Back to index

lightning-sunbird  0.9+nobinonly
GeckoFrame.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: Mozilla-sample-code 1.0
00003  *
00004  * Copyright (c) 2002 Netscape Communications Corporation and
00005  * other contributors
00006  *
00007  * Permission is hereby granted, free of charge, to any person obtaining a
00008  * copy of this Mozilla sample software and associated documentation files
00009  * (the "Software"), to deal in the Software without restriction, including
00010  * without limitation the rights to use, copy, modify, merge, publish,
00011  * distribute, sublicense, and/or sell copies of the Software, and to permit
00012  * persons to whom the Software is furnished to do so, subject to the
00013  * following conditions:
00014  *
00015  * The above copyright notice and this permission notice shall be included
00016  * in all copies or substantial portions of the Software.
00017  *
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00019  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00021  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00022  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00023  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00024  * DEALINGS IN THE SOFTWARE.
00025  *
00026  * Contributor(s):
00027  *   Adam Lock <adamlock@netscape.com>
00028  *
00029  * ***** END LICENSE BLOCK ***** */
00030 
00031 #ifndef GECKOFRAME_H
00032 #define GECKOFRAME_H
00033 
00034 #include "nsIWebBrowser.h"
00035 
00036 #include "GeckoWindow.h"
00037 #include "GeckoContainer.h"
00038 
00039 class GeckoFrame :
00040     public wxFrame,
00041     public GeckoContainerUI
00042 {
00043 protected:
00044     GeckoWindow            *mGeckoWnd;
00045     nsCOMPtr<nsIWebBrowser> mWebBrowser;
00046 public:
00047     GeckoFrame();
00048 
00049     DECLARE_EVENT_TABLE()
00050     void OnActivate(wxActivateEvent &event);
00051     void OnEditCut(wxCommandEvent &event);
00052     void OnUpdateEditCut(wxUpdateUIEvent &event);
00053     void OnEditCopy(wxCommandEvent &event);
00054     void OnUpdateEditCopy(wxUpdateUIEvent &event);
00055     void OnEditPaste(wxCommandEvent &event);
00056     void OnUpdateEditPaste(wxUpdateUIEvent &event);
00057     void OnEditSelectAll(wxCommandEvent &event);
00058 
00059     // This method searches for a "gecko" wxWindow and sets it up with the frame
00060     // as the container UI. The results are stored in the mGeckoWnd and mWebBrowser
00061     // member variables.
00062     bool SetupDefaultGeckoWindow();
00063     // This method sets up the specified window with the specified container UI
00064     // and returns the nsIWebBrowser interface to it.
00065     bool SetupGeckoWindow(GeckoWindow *aGeckoWindow, GeckoContainerUI *aUI, nsIWebBrowser **aWebBrowser) const;
00066 
00067     // GeckoContainerUI overrides
00068     void SetFocus();
00069 };
00070 
00071 #endif