2000-04-03 01:19:56 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
1999-10-22 06:35:18 +04:00
|
|
|
*
|
2004-04-19 02:01:16 +04:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
1999-10-22 06:35:18 +04:00
|
|
|
* The Original Code is the Mozilla browser.
|
2004-04-19 02:01:16 +04:00
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications, Inc.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1999
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
1999-10-22 06:35:18 +04:00
|
|
|
* Contributor(s):
|
|
|
|
* Travis Bogard <travis@netscape.com>
|
2004-04-19 02:01:16 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-10-22 06:35:18 +04:00
|
|
|
|
|
|
|
#ifndef nsWebBrowser_h__
|
|
|
|
#define nsWebBrowser_h__
|
|
|
|
|
2000-03-11 04:16:24 +03:00
|
|
|
// Local Includes
|
|
|
|
#include "nsDocShellTreeOwner.h"
|
1999-10-26 06:26:57 +04:00
|
|
|
|
2000-03-11 04:16:24 +03:00
|
|
|
// Core Includes
|
|
|
|
#include "nsCOMPtr.h"
|
1999-10-22 06:35:18 +04:00
|
|
|
|
2000-02-14 12:39:21 +03:00
|
|
|
// Interfaces needed
|
2000-03-11 04:16:24 +03:00
|
|
|
#include "nsCWebBrowser.h"
|
2000-02-14 12:39:21 +03:00
|
|
|
#include "nsIBaseWindow.h"
|
|
|
|
#include "nsIDocShell.h"
|
2000-03-11 04:16:24 +03:00
|
|
|
#include "nsIDocShellTreeItem.h"
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
2001-09-06 01:28:38 +04:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2000-02-14 12:39:21 +03:00
|
|
|
#include "nsIScrollable.h"
|
2000-03-11 04:16:24 +03:00
|
|
|
#include "nsISHistory.h"
|
2000-02-14 12:39:21 +03:00
|
|
|
#include "nsITextScroll.h"
|
|
|
|
#include "nsIWidget.h"
|
2001-02-01 00:03:40 +03:00
|
|
|
#include "nsIWebProgress.h"
|
2001-06-02 04:35:39 +04:00
|
|
|
#include "nsISecureBrowserUI.h"
|
2000-02-14 12:39:21 +03:00
|
|
|
#include "nsIWebBrowser.h"
|
2000-02-24 06:51:35 +03:00
|
|
|
#include "nsIWebNavigation.h"
|
2000-08-25 22:39:46 +04:00
|
|
|
#include "nsIWebBrowserSetup.h"
|
2000-11-30 03:43:42 +03:00
|
|
|
#include "nsIWebBrowserPersist.h"
|
2001-01-31 03:34:28 +03:00
|
|
|
#include "nsIWebBrowserFocus.h"
|
2004-05-29 21:43:59 +04:00
|
|
|
#include "nsIWebBrowserStream.h"
|
2001-04-17 00:34:33 +04:00
|
|
|
#include "nsIWindowWatcher.h"
|
2002-01-01 15:58:53 +03:00
|
|
|
#include "nsIPrintSettings.h"
|
2004-05-29 21:43:59 +04:00
|
|
|
#include "nsEmbedStream.h"
|
2000-02-14 12:39:21 +03:00
|
|
|
|
2001-02-01 00:03:40 +03:00
|
|
|
#include "nsVoidArray.h"
|
|
|
|
#include "nsWeakPtr.h"
|
|
|
|
|
2002-02-01 17:52:11 +03:00
|
|
|
class nsIContentViewerFile;
|
2001-02-07 07:31:36 +03:00
|
|
|
|
1999-10-27 06:45:49 +04:00
|
|
|
class nsWebBrowserInitInfo
|
|
|
|
{
|
|
|
|
public:
|
1999-11-17 12:00:05 +03:00
|
|
|
//nsIBaseWindow Stuff
|
2000-03-11 04:16:24 +03:00
|
|
|
PRInt32 x;
|
|
|
|
PRInt32 y;
|
|
|
|
PRInt32 cx;
|
|
|
|
PRInt32 cy;
|
|
|
|
PRBool visible;
|
|
|
|
nsCOMPtr<nsISHistory> sessionHistory;
|
|
|
|
nsString name;
|
1999-10-27 06:45:49 +04:00
|
|
|
};
|
|
|
|
|
2001-02-01 00:03:40 +03:00
|
|
|
class nsWebBrowserListenerState
|
|
|
|
{
|
|
|
|
public:
|
2001-02-14 06:12:33 +03:00
|
|
|
PRBool Equals(nsIWeakReference *aListener, const nsIID& aID) {
|
|
|
|
if (mWeakPtr.get() == aListener && mID.Equals(aID)) return PR_TRUE;
|
2001-02-01 00:03:40 +03:00
|
|
|
return PR_FALSE;
|
|
|
|
};
|
|
|
|
|
|
|
|
nsWeakPtr mWeakPtr;
|
|
|
|
nsIID mID;
|
|
|
|
};
|
1999-10-27 06:45:49 +04:00
|
|
|
|
2005-03-06 23:53:33 +03:00
|
|
|
// {F1EAC761-87E9-11d3-AF80-00A024FFC08C} -
|
|
|
|
#define NS_WEBBROWSER_CID \
|
|
|
|
{0xf1eac761, 0x87e9, 0x11d3, { 0xaf, 0x80, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
|
|
|
|
|
|
|
|
|
2000-03-11 04:16:24 +03:00
|
|
|
class nsWebBrowser : public nsIWebBrowser,
|
|
|
|
public nsIWebNavigation,
|
2000-08-25 22:39:46 +04:00
|
|
|
public nsIWebBrowserSetup,
|
2000-08-16 12:50:00 +04:00
|
|
|
public nsIDocShellTreeItem,
|
2000-03-11 04:16:24 +03:00
|
|
|
public nsIBaseWindow,
|
|
|
|
public nsIScrollable,
|
|
|
|
public nsITextScroll,
|
2000-11-30 03:43:42 +03:00
|
|
|
public nsIInterfaceRequestor,
|
2001-01-31 03:34:28 +03:00
|
|
|
public nsIWebBrowserPersist,
|
2001-02-07 07:31:36 +03:00
|
|
|
public nsIWebBrowserFocus,
|
2001-09-24 01:03:03 +04:00
|
|
|
public nsIWebProgressListener,
|
2004-05-29 21:43:59 +04:00
|
|
|
public nsIWebBrowserStream,
|
2001-09-24 01:03:03 +04:00
|
|
|
public nsSupportsWeakReference
|
1999-10-22 06:35:18 +04:00
|
|
|
{
|
2000-03-11 04:16:24 +03:00
|
|
|
friend class nsDocShellTreeOwner;
|
1999-10-22 06:35:18 +04:00
|
|
|
public:
|
2000-08-16 12:50:00 +04:00
|
|
|
nsWebBrowser();
|
2000-03-13 10:11:21 +03:00
|
|
|
|
2000-08-16 12:50:00 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
1999-10-22 06:35:18 +04:00
|
|
|
|
2000-08-16 12:50:00 +04:00
|
|
|
NS_DECL_NSIBASEWINDOW
|
|
|
|
NS_DECL_NSIDOCSHELLTREEITEM
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
NS_DECL_NSISCROLLABLE
|
|
|
|
NS_DECL_NSITEXTSCROLL
|
|
|
|
NS_DECL_NSIWEBBROWSER
|
|
|
|
NS_DECL_NSIWEBNAVIGATION
|
2000-08-25 22:39:46 +04:00
|
|
|
NS_DECL_NSIWEBBROWSERSETUP
|
2000-11-30 03:43:42 +03:00
|
|
|
NS_DECL_NSIWEBBROWSERPERSIST
|
2005-04-10 16:37:36 +04:00
|
|
|
NS_DECL_NSICANCELABLE
|
2001-01-31 03:34:28 +03:00
|
|
|
NS_DECL_NSIWEBBROWSERFOCUS
|
2004-05-29 21:43:59 +04:00
|
|
|
NS_DECL_NSIWEBBROWSERSTREAM
|
2001-09-24 01:03:03 +04:00
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
2001-03-27 16:04:30 +04:00
|
|
|
|
1999-10-22 06:35:18 +04:00
|
|
|
protected:
|
2000-08-16 12:50:00 +04:00
|
|
|
virtual ~nsWebBrowser();
|
|
|
|
NS_IMETHOD InternalDestroy();
|
1999-10-22 06:35:18 +04:00
|
|
|
|
2000-08-16 12:50:00 +04:00
|
|
|
NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
|
|
|
|
NS_IMETHOD EnsureDocShellTreeOwner();
|
2000-11-17 22:57:16 +03:00
|
|
|
NS_IMETHOD GetPrimaryContentWindow(nsIDOMWindowInternal **aDomWindow);
|
2001-02-01 00:03:40 +03:00
|
|
|
NS_IMETHOD BindListener(nsISupports *aListener, const nsIID& aIID);
|
|
|
|
NS_IMETHOD UnBindListener(nsISupports *aListener, const nsIID& aIID);
|
2001-05-19 22:31:20 +04:00
|
|
|
NS_IMETHOD EnableGlobalHistory(PRBool aEnable);
|
2000-11-17 22:57:16 +03:00
|
|
|
|
|
|
|
static nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent);
|
1999-10-26 06:26:57 +04:00
|
|
|
|
1999-10-22 06:35:18 +04:00
|
|
|
protected:
|
2000-03-11 04:16:24 +03:00
|
|
|
nsDocShellTreeOwner* mDocShellTreeOwner;
|
1999-11-01 22:57:15 +03:00
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
2000-03-11 04:16:24 +03:00
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mDocShellAsReq;
|
|
|
|
nsCOMPtr<nsIBaseWindow> mDocShellAsWin;
|
|
|
|
nsCOMPtr<nsIDocShellTreeItem> mDocShellAsItem;
|
2000-03-14 10:05:08 +03:00
|
|
|
nsCOMPtr<nsIWebNavigation> mDocShellAsNav;
|
2000-03-11 04:16:24 +03:00
|
|
|
nsCOMPtr<nsIScrollable> mDocShellAsScrollable;
|
|
|
|
nsCOMPtr<nsITextScroll> mDocShellAsTextScroll;
|
|
|
|
nsCOMPtr<nsIWidget> mInternalWidget;
|
2001-04-17 00:34:33 +04:00
|
|
|
nsCOMPtr<nsIWindowWatcher> mWWatch;
|
1999-11-01 22:57:15 +03:00
|
|
|
nsWebBrowserInitInfo* mInitInfo;
|
2000-07-05 01:53:27 +04:00
|
|
|
PRUint32 mContentType;
|
2002-02-08 04:01:21 +03:00
|
|
|
PRBool mActivating;
|
1999-11-01 22:57:15 +03:00
|
|
|
nativeWindow mParentNativeWindow;
|
2001-09-24 01:03:03 +04:00
|
|
|
nsIWebProgressListener *mProgressListener;
|
2001-04-28 01:11:03 +04:00
|
|
|
nsCOMPtr<nsIWebProgress> mWebProgress;
|
1999-11-18 12:17:07 +03:00
|
|
|
|
2002-01-01 15:58:53 +03:00
|
|
|
nsCOMPtr<nsIPrintSettings> mPrintSettings;
|
|
|
|
|
2001-05-07 17:49:59 +04:00
|
|
|
// cached background color
|
2001-04-13 07:52:45 +04:00
|
|
|
nscolor mBackgroundColor;
|
|
|
|
|
2001-09-24 01:03:03 +04:00
|
|
|
// persistence object
|
|
|
|
nsCOMPtr<nsIWebBrowserPersist> mPersist;
|
|
|
|
PRUint32 mPersistCurrentState;
|
|
|
|
PRUint32 mPersistResult;
|
|
|
|
PRUint32 mPersistFlags;
|
|
|
|
|
2004-05-29 21:43:59 +04:00
|
|
|
// stream
|
|
|
|
nsEmbedStream *mStream;
|
|
|
|
nsCOMPtr<nsISupports> mStreamGuard;
|
|
|
|
|
1999-11-18 12:17:07 +03:00
|
|
|
//Weak Reference interfaces...
|
2000-03-11 04:16:24 +03:00
|
|
|
nsIWidget* mParentWidget;
|
2001-02-01 00:03:40 +03:00
|
|
|
nsVoidArray * mListenerArray;
|
2003-06-16 18:59:23 +04:00
|
|
|
|
|
|
|
#if (defined(XP_MAC) || defined(XP_MACOSX)) && !defined(MOZ_WIDGET_COCOA)
|
|
|
|
NS_IMETHOD EnsureTopLevelWidget(nativeWindow aWindow);
|
|
|
|
|
|
|
|
nsIWidget* mTopLevelWidget;
|
|
|
|
#endif
|
|
|
|
|
1999-10-22 06:35:18 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsWebBrowser_h__ */
|
2000-11-17 22:57:16 +03:00
|
|
|
|
|
|
|
|