1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Chak Nanga <chak@netscape.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 // This interface acts as a glue between the required/optional
40 // Gecko embedding interfaces and the actual platform specific
41 // way of doing things - such as updating a statusbar etc.
43 // For ex, in the mfcembed sample the required interfaces such as
44 // IWebBrowserChrome etc. are implemented in a XP way in the
45 // BrowserImp*.cpp files. However, when they get called to update the
46 // statusbar etc. they call on this interface to get the actual job
47 // done. During the BrowserFrame creation some object must implement
48 // this interface and pass the pointer to it via the Init() member of
49 // the CBrowserImpl class
51 #ifndef _IBROWSERFRAMEGLUE_H
52 #define _IBROWSERFRAMEGLUE_H
54 struct IBrowserFrameGlue
{
55 // Progress Related Methods
56 virtual void UpdateStatusBarText(const PRUnichar
*aMessage
) = 0;
57 virtual void UpdateProgress(PRInt32 aCurrent
, PRInt32 aMax
) = 0;
58 virtual void UpdateBusyState(PRBool aBusy
) = 0;
59 virtual void UpdateCurrentURI(nsIURI
*aLocation
) = 0;
61 // BrowserFrame Related Methods
62 virtual PRBool
CreateNewBrowserFrame(PRUint32 chromeMask
,
64 PRInt32 cx
, PRInt32 cy
,
65 nsIWebBrowser
** aWebBrowser
) = 0;
66 virtual void DestroyBrowserFrame() = 0;
67 virtual void GetBrowserFrameTitle(PRUnichar
**aTitle
) = 0;
68 virtual void SetBrowserFrameTitle(const PRUnichar
*aTitle
) = 0;
69 virtual void GetBrowserFramePosition(PRInt32
*aX
, PRInt32
*aY
) = 0;
70 virtual void SetBrowserFramePosition(PRInt32 aX
, PRInt32 aY
) = 0;
71 virtual void GetBrowserFrameSize(PRInt32
*aCX
, PRInt32
*aCY
) = 0;
72 virtual void SetBrowserFrameSize(PRInt32 aCX
, PRInt32 aCY
) = 0;
73 virtual void GetBrowserFramePositionAndSize(PRInt32
*aX
, PRInt32
*aY
, PRInt32
*aCX
, PRInt32
*aCY
) = 0;
74 virtual void SetBrowserFramePositionAndSize(PRInt32 aX
, PRInt32 aY
, PRInt32 aCX
, PRInt32 aCY
, PRBool fRepaint
) = 0;
75 virtual void ShowBrowserFrame(PRBool aShow
) = 0;
76 virtual void SetFocus() = 0;
77 virtual void FocusAvailable(PRBool
*aFocusAvail
) = 0;
78 virtual void GetBrowserFrameVisibility(PRBool
*aVisible
) = 0;
80 // ContextMenu Related Methods
81 virtual void ShowContextMenu(PRUint32 aContextFlags
, nsIDOMNode
*aNode
) = 0;
84 virtual void ShowTooltip(PRInt32 aXCoords
, PRInt32 aYCoords
, const PRUnichar
*aTipText
) = 0;
85 virtual void HideTooltip() = 0;
87 virtual HWND
GetBrowserFrameNativeWnd() = 0;
90 #define NS_DECL_BROWSERFRAMEGLUE \
92 virtual void UpdateStatusBarText(const PRUnichar *aMessage); \
93 virtual void UpdateProgress(PRInt32 aCurrent, PRInt32 aMax); \
94 virtual void UpdateBusyState(PRBool aBusy); \
95 virtual void UpdateCurrentURI(nsIURI *aLocation); \
96 virtual PRBool CreateNewBrowserFrame(PRUint32 chromeMask, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, nsIWebBrowser** aWebBrowser); \
97 virtual void DestroyBrowserFrame(); \
98 virtual void GetBrowserFrameTitle(PRUnichar **aTitle); \
99 virtual void SetBrowserFrameTitle(const PRUnichar *aTitle); \
100 virtual void GetBrowserFramePosition(PRInt32 *aX, PRInt32 *aY); \
101 virtual void SetBrowserFramePosition(PRInt32 aX, PRInt32 aY); \
102 virtual void GetBrowserFrameSize(PRInt32 *aCX, PRInt32 *aCY); \
103 virtual void SetBrowserFrameSize(PRInt32 aCX, PRInt32 aCY); \
104 virtual void GetBrowserFramePositionAndSize(PRInt32 *aX, PRInt32 *aY, PRInt32 *aCX, PRInt32 *aCY); \
105 virtual void SetBrowserFramePositionAndSize(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, PRBool fRepaint); \
106 virtual void ShowBrowserFrame(PRBool aShow); \
107 virtual void SetFocus(); \
108 virtual void FocusAvailable(PRBool *aFocusAvail); \
109 virtual void GetBrowserFrameVisibility(PRBool *aVisible); \
110 virtual void ShowContextMenu(PRUint32 aContextFlags, nsIDOMNode *aNode); \
111 virtual void ShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText); \
112 virtual void HideTooltip(); \
113 virtual HWND GetBrowserFrameNativeWnd();
114 typedef IBrowserFrameGlue
*PBROWSERFRAMEGLUE
;
116 #endif //_IBROWSERFRAMEGLUE_H