Back to index

lightning-sunbird  0.9+nobinonly
IBrowserFrameGlue.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 // This interface acts as a glue between the required/optional 
00040 // Gecko embedding interfaces and the actual platform specific
00041 // way of doing things - such as updating a statusbar etc.
00042 //
00043 // For ex, in the mfcembed sample the required interfaces such as 
00044 // IWebBrowserChrome etc. are implemented in a XP way in the
00045 // BrowserImp*.cpp files. However, when they get called to update the
00046 // statusbar etc. they call on this interface to get the actual job
00047 // done. During the BrowserFrame creation some object must implement
00048 // this interface and pass the pointer to it via the Init() member of
00049 // the CBrowserImpl class
00050 
00051 #ifndef _IBROWSERFRAMEGLUE_H
00052 #define _IBROWSERFRAMEGLUE_H
00053 
00054 struct IBrowserFrameGlue {
00055        // Progress Related Methods
00056        virtual void UpdateStatusBarText(const PRUnichar *aMessage) = 0;
00057        virtual void UpdateProgress(PRInt32 aCurrent, PRInt32 aMax) = 0;
00058        virtual void UpdateBusyState(PRBool aBusy) = 0;
00059        virtual void UpdateCurrentURI(nsIURI *aLocation) = 0;
00060 
00061        // BrowserFrame Related Methods
00062        virtual PRBool CreateNewBrowserFrame(PRUint32 chromeMask, 
00063                                                  PRInt32 x, PRInt32 y, 
00064                                                  PRInt32 cx, PRInt32 cy,
00065                                                  nsIWebBrowser ** aWebBrowser) = 0;
00066        virtual void DestroyBrowserFrame() = 0;
00067        virtual void GetBrowserFrameTitle(PRUnichar **aTitle) = 0;
00068        virtual void SetBrowserFrameTitle(const PRUnichar *aTitle) = 0;
00069        virtual void GetBrowserFramePosition(PRInt32 *aX, PRInt32 *aY) = 0;
00070        virtual void SetBrowserFramePosition(PRInt32 aX, PRInt32 aY) = 0;
00071        virtual void GetBrowserFrameSize(PRInt32 *aCX, PRInt32 *aCY) = 0;
00072        virtual void SetBrowserFrameSize(PRInt32 aCX, PRInt32 aCY) = 0;
00073        virtual void GetBrowserFramePositionAndSize(PRInt32 *aX, PRInt32 *aY, PRInt32 *aCX, PRInt32 *aCY) = 0;
00074        virtual void SetBrowserFramePositionAndSize(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, PRBool fRepaint) = 0;
00075        virtual void ShowBrowserFrame(PRBool aShow) = 0;
00076        virtual void SetFocus() = 0;
00077        virtual void FocusAvailable(PRBool *aFocusAvail) = 0;
00078        virtual void GetBrowserFrameVisibility(PRBool *aVisible) = 0;
00079 
00080        // ContextMenu Related Methods
00081        virtual void ShowContextMenu(PRUint32 aContextFlags, nsIDOMNode *aNode) = 0;
00082 
00083     // Tooltip methods
00084     virtual void ShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText) = 0;
00085     virtual void HideTooltip() = 0;
00086 
00087        virtual HWND GetBrowserFrameNativeWnd() = 0;
00088 };
00089 
00090 #define       NS_DECL_BROWSERFRAMEGLUE    \
00091        public:       \
00092               virtual void UpdateStatusBarText(const PRUnichar *aMessage);   \
00093               virtual void UpdateProgress(PRInt32 aCurrent, PRInt32 aMax);   \
00094               virtual void UpdateBusyState(PRBool aBusy);                                         \
00095               virtual void UpdateCurrentURI(nsIURI *aLocation);                            \
00096               virtual PRBool CreateNewBrowserFrame(PRUint32 chromeMask, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, nsIWebBrowser** aWebBrowser);       \
00097               virtual void DestroyBrowserFrame();                                                 \
00098               virtual void GetBrowserFrameTitle(PRUnichar **aTitle);  \
00099               virtual void SetBrowserFrameTitle(const PRUnichar *aTitle);    \
00100               virtual void GetBrowserFramePosition(PRInt32 *aX, PRInt32 *aY);       \
00101               virtual void SetBrowserFramePosition(PRInt32 aX, PRInt32 aY);  \
00102               virtual void GetBrowserFrameSize(PRInt32 *aCX, PRInt32 *aCY);  \
00103               virtual void SetBrowserFrameSize(PRInt32 aCX, PRInt32 aCY);           \
00104               virtual void GetBrowserFramePositionAndSize(PRInt32 *aX, PRInt32 *aY, PRInt32 *aCX, PRInt32 *aCY);       \
00105               virtual void SetBrowserFramePositionAndSize(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, PRBool fRepaint); \
00106               virtual void ShowBrowserFrame(PRBool aShow);                                 \
00107               virtual void SetFocus();                                                                   \
00108               virtual void FocusAvailable(PRBool *aFocusAvail);                            \
00109               virtual void GetBrowserFrameVisibility(PRBool *aVisible);             \
00110               virtual void ShowContextMenu(PRUint32 aContextFlags, nsIDOMNode *aNode); \
00111         virtual void ShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText); \
00112         virtual void HideTooltip(); \
00113               virtual HWND GetBrowserFrameNativeWnd();         
00114 typedef IBrowserFrameGlue *PBROWSERFRAMEGLUE;
00115 
00116 #endif //_IBROWSERFRAMEGLUE_H