2000-04-02 21:19:56 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
1999-10-22 02:35:18 +00:00
|
|
|
*
|
2012-05-21 11:12:37 +00:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-10-22 02:35:18 +00:00
|
|
|
|
|
|
|
#ifndef nsWebBrowser_h__
|
|
|
|
#define nsWebBrowser_h__
|
|
|
|
|
2000-03-11 01:16:24 +00:00
|
|
|
// Local Includes
|
|
|
|
#include "nsDocShellTreeOwner.h"
|
1999-10-26 02:26:57 +00:00
|
|
|
|
2000-03-11 01:16:24 +00:00
|
|
|
// Core Includes
|
|
|
|
#include "nsCOMPtr.h"
|
1999-10-22 02:35:18 +00:00
|
|
|
|
2000-02-14 09:39:21 +00:00
|
|
|
// Interfaces needed
|
2000-03-11 01:16:24 +00:00
|
|
|
#include "nsCWebBrowser.h"
|
2000-02-14 09:39:21 +00:00
|
|
|
#include "nsIBaseWindow.h"
|
|
|
|
#include "nsIDocShell.h"
|
2000-03-11 01:16:24 +00:00
|
|
|
#include "nsIDocShellTreeItem.h"
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
2001-09-05 21:28:38 +00:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2000-02-14 09:39:21 +00:00
|
|
|
#include "nsIScrollable.h"
|
2000-03-11 01:16:24 +00:00
|
|
|
#include "nsISHistory.h"
|
2000-02-14 09:39:21 +00:00
|
|
|
#include "nsITextScroll.h"
|
|
|
|
#include "nsIWidget.h"
|
2001-01-31 21:03:40 +00:00
|
|
|
#include "nsIWebProgress.h"
|
2001-06-02 00:35:39 +00:00
|
|
|
#include "nsISecureBrowserUI.h"
|
2000-02-14 09:39:21 +00:00
|
|
|
#include "nsIWebBrowser.h"
|
2000-02-24 03:51:35 +00:00
|
|
|
#include "nsIWebNavigation.h"
|
2000-08-25 18:39:46 +00:00
|
|
|
#include "nsIWebBrowserSetup.h"
|
2000-11-30 00:43:42 +00:00
|
|
|
#include "nsIWebBrowserPersist.h"
|
2001-01-31 00:34:28 +00:00
|
|
|
#include "nsIWebBrowserFocus.h"
|
2004-05-29 17:43:59 +00:00
|
|
|
#include "nsIWebBrowserStream.h"
|
2001-04-16 20:34:33 +00:00
|
|
|
#include "nsIWindowWatcher.h"
|
2002-01-01 12:58:53 +00:00
|
|
|
#include "nsIPrintSettings.h"
|
2004-05-29 17:43:59 +00:00
|
|
|
#include "nsEmbedStream.h"
|
2012-08-15 18:52:42 +00:00
|
|
|
#include "nsIWidgetListener.h"
|
2000-02-14 09:39:21 +00:00
|
|
|
|
2009-02-25 15:25:08 +00:00
|
|
|
#include "nsTArray.h"
|
2001-01-31 21:03:40 +00:00
|
|
|
#include "nsWeakPtr.h"
|
|
|
|
|
2002-02-01 14:52:11 +00:00
|
|
|
class nsIContentViewerFile;
|
2001-02-07 04:31:36 +00:00
|
|
|
|
1999-10-27 02:45:49 +00:00
|
|
|
class nsWebBrowserInitInfo
|
|
|
|
{
|
|
|
|
public:
|
1999-11-17 09:00:05 +00:00
|
|
|
//nsIBaseWindow Stuff
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t x;
|
|
|
|
int32_t y;
|
|
|
|
int32_t cx;
|
|
|
|
int32_t cy;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool visible;
|
2000-03-11 01:16:24 +00:00
|
|
|
nsCOMPtr<nsISHistory> sessionHistory;
|
|
|
|
nsString name;
|
1999-10-27 02:45:49 +00:00
|
|
|
};
|
|
|
|
|
2001-01-31 21:03:40 +00:00
|
|
|
class nsWebBrowserListenerState
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 06:19:26 +00:00
|
|
|
bool Equals(nsIWeakReference *aListener, const nsIID& aID) {
|
2011-10-17 14:59:28 +00:00
|
|
|
if (mWeakPtr.get() == aListener && mID.Equals(aID)) return true;
|
|
|
|
return false;
|
2007-04-23 14:21:53 +00:00
|
|
|
}
|
2001-01-31 21:03:40 +00:00
|
|
|
|
|
|
|
nsWeakPtr mWeakPtr;
|
|
|
|
nsIID mID;
|
|
|
|
};
|
1999-10-27 02:45:49 +00:00
|
|
|
|
2014-01-03 21:08:50 +00:00
|
|
|
// {cda5863a-aa9c-411e-be49-ea0d525ab4b5} -
|
2005-03-06 20:53:33 +00:00
|
|
|
#define NS_WEBBROWSER_CID \
|
2014-01-03 21:08:50 +00:00
|
|
|
{0xcda5863a, 0xaa9c, 0x411e, { 0xbe, 0x49, 0xea, 0x0d, 0x52, 0x5a, 0xb4, 0xb5 }}
|
2005-03-06 20:53:33 +00:00
|
|
|
|
|
|
|
|
2014-08-05 17:33:55 +00:00
|
|
|
class nsWebBrowser MOZ_FINAL : public nsIWebBrowser,
|
|
|
|
public nsIWebNavigation,
|
|
|
|
public nsIWebBrowserSetup,
|
|
|
|
public nsIDocShellTreeItem,
|
|
|
|
public nsIBaseWindow,
|
|
|
|
public nsIScrollable,
|
|
|
|
public nsITextScroll,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIWebBrowserPersist,
|
|
|
|
public nsIWebBrowserFocus,
|
|
|
|
public nsIWebProgressListener,
|
|
|
|
public nsIWebBrowserStream,
|
2012-08-15 18:52:42 +00:00
|
|
|
public nsIWidgetListener,
|
2001-09-23 21:03:03 +00:00
|
|
|
public nsSupportsWeakReference
|
1999-10-22 02:35:18 +00:00
|
|
|
{
|
2000-03-11 01:16:24 +00:00
|
|
|
friend class nsDocShellTreeOwner;
|
1999-10-22 02:35:18 +00:00
|
|
|
public:
|
2000-08-16 08:50:00 +00:00
|
|
|
nsWebBrowser();
|
2000-03-13 07:11:21 +00:00
|
|
|
|
2000-08-16 08:50:00 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
1999-10-22 02:35:18 +00:00
|
|
|
|
2000-08-16 08:50:00 +00: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 18:39:46 +00:00
|
|
|
NS_DECL_NSIWEBBROWSERSETUP
|
2000-11-30 00:43:42 +00:00
|
|
|
NS_DECL_NSIWEBBROWSERPERSIST
|
2005-04-10 12:37:36 +00:00
|
|
|
NS_DECL_NSICANCELABLE
|
2001-01-31 00:34:28 +00:00
|
|
|
NS_DECL_NSIWEBBROWSERFOCUS
|
2004-05-29 17:43:59 +00:00
|
|
|
NS_DECL_NSIWEBBROWSERSTREAM
|
2001-09-23 21:03:03 +00:00
|
|
|
NS_DECL_NSIWEBPROGRESSLISTENER
|
2001-03-27 12:04:30 +00:00
|
|
|
|
1999-10-22 02:35:18 +00:00
|
|
|
protected:
|
2000-08-16 08:50:00 +00:00
|
|
|
virtual ~nsWebBrowser();
|
|
|
|
NS_IMETHOD InternalDestroy();
|
1999-10-22 02:35:18 +00:00
|
|
|
|
2009-05-17 14:22:54 +00:00
|
|
|
// XXXbz why are these NS_IMETHOD? They're not interface methods!
|
2000-08-16 08:50:00 +00:00
|
|
|
NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
|
|
|
|
NS_IMETHOD EnsureDocShellTreeOwner();
|
2011-07-15 10:31:34 +00:00
|
|
|
NS_IMETHOD GetPrimaryContentWindow(nsIDOMWindow **aDomWindow);
|
2001-01-31 21:03:40 +00:00
|
|
|
NS_IMETHOD BindListener(nsISupports *aListener, const nsIID& aIID);
|
|
|
|
NS_IMETHOD UnBindListener(nsISupports *aListener, const nsIID& aIID);
|
2011-09-29 06:19:26 +00:00
|
|
|
NS_IMETHOD EnableGlobalHistory(bool aEnable);
|
2000-11-17 19:57:16 +00:00
|
|
|
|
2012-08-15 18:52:42 +00:00
|
|
|
// nsIWidgetListener
|
|
|
|
virtual void WindowRaised(nsIWidget* aWidget);
|
|
|
|
virtual void WindowLowered(nsIWidget* aWidget);
|
2013-05-23 14:49:18 +00:00
|
|
|
virtual bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion) MOZ_OVERRIDE;
|
1999-10-26 02:26:57 +00:00
|
|
|
|
1999-10-22 02:35:18 +00:00
|
|
|
protected:
|
2000-03-11 01:16:24 +00:00
|
|
|
nsDocShellTreeOwner* mDocShellTreeOwner;
|
1999-11-01 19:57:15 +00:00
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
2000-03-11 01:16:24 +00:00
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mDocShellAsReq;
|
|
|
|
nsCOMPtr<nsIBaseWindow> mDocShellAsWin;
|
2000-03-14 07:05:08 +00:00
|
|
|
nsCOMPtr<nsIWebNavigation> mDocShellAsNav;
|
2000-03-11 01:16:24 +00:00
|
|
|
nsCOMPtr<nsIScrollable> mDocShellAsScrollable;
|
|
|
|
nsCOMPtr<nsITextScroll> mDocShellAsTextScroll;
|
|
|
|
nsCOMPtr<nsIWidget> mInternalWidget;
|
2001-04-16 20:34:33 +00:00
|
|
|
nsCOMPtr<nsIWindowWatcher> mWWatch;
|
1999-11-01 19:57:15 +00:00
|
|
|
nsWebBrowserInitInfo* mInitInfo;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mContentType;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mActivating;
|
|
|
|
bool mShouldEnableHistory;
|
|
|
|
bool mIsActive;
|
1999-11-01 19:57:15 +00:00
|
|
|
nativeWindow mParentNativeWindow;
|
2001-09-23 21:03:03 +00:00
|
|
|
nsIWebProgressListener *mProgressListener;
|
2001-04-27 21:11:03 +00:00
|
|
|
nsCOMPtr<nsIWebProgress> mWebProgress;
|
1999-11-18 09:17:07 +00:00
|
|
|
|
2002-01-01 12:58:53 +00:00
|
|
|
nsCOMPtr<nsIPrintSettings> mPrintSettings;
|
|
|
|
|
2001-05-07 13:49:59 +00:00
|
|
|
// cached background color
|
2001-04-13 03:52:45 +00:00
|
|
|
nscolor mBackgroundColor;
|
|
|
|
|
2001-09-23 21:03:03 +00:00
|
|
|
// persistence object
|
|
|
|
nsCOMPtr<nsIWebBrowserPersist> mPersist;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mPersistCurrentState;
|
2012-08-06 12:02:31 +00:00
|
|
|
nsresult mPersistResult;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mPersistFlags;
|
2001-09-23 21:03:03 +00:00
|
|
|
|
2004-05-29 17:43:59 +00:00
|
|
|
// stream
|
|
|
|
nsEmbedStream *mStream;
|
|
|
|
nsCOMPtr<nsISupports> mStreamGuard;
|
|
|
|
|
1999-11-18 09:17:07 +00:00
|
|
|
//Weak Reference interfaces...
|
2009-02-25 15:25:08 +00:00
|
|
|
nsIWidget* mParentWidget;
|
|
|
|
nsTArray<nsWebBrowserListenerState*>* mListenerArray;
|
1999-10-22 02:35:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsWebBrowser_h__ */
|
2000-11-17 19:57:16 +00:00
|
|
|
|
|
|
|
|