Back to index

lightning-sunbird  0.9+nobinonly
TestEmbed.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Chak Nanga <chak@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 // mozembed.h : main header file for the MOZEMBED application
00040 //
00041 
00042 #ifndef _TESTEMBED_H
00043 #define _TESTEMBED_H
00044 
00045 #if _MSC_VER > 1000
00046 #pragma once
00047 #endif // _MSC_VER > 1000
00048 
00049 #ifndef __AFXWIN_H__
00050        #error include 'stdafx.h' before including this file for PCH
00051 #endif
00052 
00053 #include "resource.h"       // main symbols
00054 
00056 // CTestEmbedApp:
00057 // See mozembed.cpp for the implementation of this class
00058 //
00059 
00060 class CBrowserFrame;
00061 class CProfileMgr;
00062 
00063 class CTestEmbedApp : public CWinApp,
00064                      public nsIObserver,
00065                      public nsIWindowCreator,
00066                      public nsSupportsWeakReference
00067 {
00068 public:
00069        CTestEmbedApp();
00070        
00071     NS_DECL_ISUPPORTS
00072     NS_DECL_NSIOBSERVER
00073     NS_DECL_NSIWINDOWCREATOR
00074 
00075        CBrowserFrame* CreateNewBrowserFrame(PRUint32 chromeMask = nsIWebBrowserChrome::CHROME_ALL, 
00076                                                  PRInt32 x = -1, PRInt32 y = -1, 
00077                                                  PRInt32 cx = -1, PRInt32 cy = -1,
00078                                                  PRBool bShowWindow = PR_TRUE);
00079        void RemoveFrameFromList(CBrowserFrame* pFrm, BOOL bCloseAppOnLastFrame = TRUE);
00080 
00081     void ShowDebugConsole();
00082     BOOL IsCmdLineSwitch(const char *pSwitch, BOOL bRemove = TRUE);
00083     void ParseCmdLine();
00084     nsresult OverrideComponents();
00085 
00086        // Overrides
00087        // ClassWizard generated virtual function overrides
00088        //{{AFX_VIRTUAL(CTestEmbedApp)
00089        public:
00090        virtual BOOL InitInstance();
00091        virtual int ExitInstance();
00092        virtual BOOL OnIdle(LONG lCount);
00093        //}}AFX_VIRTUAL
00094 
00095        CObList m_FrameWndLst;
00096 
00097     CString m_strHomePage;
00098     inline BOOL GetHomePage(CString& strHomePage) {
00099         strHomePage = m_strHomePage;
00100         return TRUE;
00101     }
00102 
00103     int m_iStartupPage; //0 = BlankPage, 1 = HomePage
00104     inline int GetStartupPageMode() {
00105         return m_iStartupPage;
00106     }
00107 
00108 // Implementation
00109 
00110 public:
00111        //{{AFX_MSG(CTestEmbedApp)
00112        afx_msg void OnAppAbout();
00113        afx_msg void OnNewBrowser();
00114     afx_msg void OnManageProfiles();
00115     afx_msg void OnEditPreferences();
00116               // NOTE - the ClassWizard will add and remove member functions here.
00117               //    DO NOT EDIT what you see in these blocks of generated code !
00118        //}}AFX_MSG
00119        DECLARE_MESSAGE_MAP()
00120 
00121 private:
00122        BOOL                 InitializeProfiles();
00123        BOOL                 CreateHiddenWindow();
00124     nsresult        InitializePrefs();
00125     nsresult        InitializeWindowCreator();
00126     
00127 private:
00128     CProfileMgr     *m_ProfileMgr;
00129 };
00130 
00131 
00133 
00134 //{{AFX_INSERT_LOCATION}}
00135 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00136 
00137 #endif // _TESTEMBED_H