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