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
|
|
|
*
|
2012-05-21 15:12:37 +04: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 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"
|
2012-08-15 22:52:42 +04:00
|
|
|
#include "nsIWidgetListener.h"
|
2000-02-14 12:39:21 +03:00
|
|
|
|
2009-02-25 18:25:08 +03:00
|
|
|
#include "nsTArray.h"
|
2001-02-01 00:03:40 +03:00
|
|
|
#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
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t x;
|
|
|
|
int32_t y;
|
|
|
|
int32_t cx;
|
|
|
|
int32_t cy;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool visible;
|
2000-03-11 04:16:24 +03:00
|
|
|
nsCOMPtr<nsISHistory> sessionHistory;
|
|
|
|
nsString name;
|
1999-10-27 06:45:49 +04:00
|
|
|
};
|
|
|
|
|
2001-02-01 00:03:40 +03:00
|
|
|
class nsWebBrowserListenerState
|
|
|
|
{
|
|
|
|
public:
|
2011-09-29 10:19:26 +04:00
|
|
|
bool Equals(nsIWeakReference *aListener, const nsIID& aID) {
|
2011-10-17 18:59:28 +04:00
|
|
|
if (mWeakPtr.get() == aListener && mID.Equals(aID)) return true;
|
|
|
|
return false;
|
2007-04-23 18:21:53 +04:00
|
|
|
}
|
2001-02-01 00:03:40 +03:00
|
|
|
|
|
|
|
nsWeakPtr mWeakPtr;
|
|
|
|
nsIID mID;
|
|
|
|
};
|
1999-10-27 06:45:49 +04:00
|
|
|
|
2014-01-04 01:08:50 +04:00
|
|
|
// {cda5863a-aa9c-411e-be49-ea0d525ab4b5} -
|
2005-03-06 23:53:33 +03:00
|
|
|
#define NS_WEBBROWSER_CID \
|
2014-01-04 01:08:50 +04:00
|
|
|
{0xcda5863a, 0xaa9c, 0x411e, { 0xbe, 0x49, 0xea, 0x0d, 0x52, 0x5a, 0xb4, 0xb5 }}
|
2005-03-06 23:53:33 +03:00
|
|
|
|
|
|
|
|
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,
|
2012-08-15 22:52:42 +04:00
|
|
|
public nsIWidgetListener,
|
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
|
|
|
|
2009-05-17 18:22:54 +04:00
|
|
|
// XXXbz why are these NS_IMETHOD? They're not interface methods!
|
2000-08-16 12:50:00 +04:00
|
|
|
NS_IMETHOD SetDocShell(nsIDocShell* aDocShell);
|
|
|
|
NS_IMETHOD EnsureDocShellTreeOwner();
|
2011-07-15 14:31:34 +04:00
|
|
|
NS_IMETHOD GetPrimaryContentWindow(nsIDOMWindow **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);
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHOD EnableGlobalHistory(bool aEnable);
|
2000-11-17 22:57:16 +03:00
|
|
|
|
2012-08-15 22:52:42 +04:00
|
|
|
// nsIWidgetListener
|
|
|
|
virtual void WindowRaised(nsIWidget* aWidget);
|
|
|
|
virtual void WindowLowered(nsIWidget* aWidget);
|
2013-05-23 18:49:18 +04:00
|
|
|
virtual bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion) MOZ_OVERRIDE;
|
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;
|
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;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mContentType;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mActivating;
|
|
|
|
bool mShouldEnableHistory;
|
|
|
|
bool mIsActive;
|
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;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mPersistCurrentState;
|
2012-08-06 16:02:31 +04:00
|
|
|
nsresult mPersistResult;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mPersistFlags;
|
2001-09-24 01:03:03 +04:00
|
|
|
|
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...
|
2009-02-25 18:25:08 +03:00
|
|
|
nsIWidget* mParentWidget;
|
|
|
|
nsTArray<nsWebBrowserListenerState*>* mListenerArray;
|
1999-10-22 06:35:18 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsWebBrowser_h__ */
|
2000-11-17 22:57:16 +03:00
|
|
|
|
|
|
|
|