gecko-dev/xpfe/browser/src/nsBrowserInstance.h

130 строки
3.7 KiB
C
Исходник Обычный вид История

1999-08-31 18:05:08 +04:00
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape 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/NPL/
1999-08-31 18:05:08 +04:00
*
* 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-08-31 18:05:08 +04:00
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
1999-08-31 18:05:08 +04:00
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
1999-08-31 18:05:08 +04:00
*/
#ifndef nsBrowserInstance_h___
#define nsBrowserInstance_h___
// Helper Classes
#include "nsCOMPtr.h"
#include "nsWeakReference.h"
// Interfaces Needed
1999-08-31 18:05:08 +04:00
#include "nsIBrowserInstance.h"
#include "nsIURIContentListener.h"
#include "nsIDocumentLoaderObserver.h"
1999-08-31 18:05:08 +04:00
1999-09-02 00:41:30 +04:00
#include "nsIAppShellComponentImpl.h"
1999-08-31 18:05:08 +04:00
#include "nscore.h"
#include "nsString.h"
#include "nsISupports.h"
#include "nsIStreamObserver.h"
#include "nsIObserver.h"
#include "nsICmdLineHandler.h"
#include "nsIXULBrowserWindow.h"
#include "nsIWebProgressListener.h"
#include "nsIWebShell.h"
2000-05-03 09:33:07 +04:00
#include "nsIUrlbarHistory.h"
#include "nsISHistory.h"
class nsIDocShell;
1999-08-31 18:05:08 +04:00
class nsIScriptContext;
class nsIDOMWindow;
class nsIDOMNode;
class nsIURI;
class nsIWebShellWindow;
class nsIFindComponent;
2000-05-03 09:33:07 +04:00
1999-08-31 18:05:08 +04:00
#define SHISTORY_POPUP_LIST 10
//#define SH_IN_FRAMES
1999-08-31 18:05:08 +04:00
////////////////////////////////////////////////////////////////////////////////
// nsBrowserInstance:
////////////////////////////////////////////////////////////////////////////////
class nsBrowserInstance : public nsIBrowserInstance,
public nsIDocumentLoaderObserver,
public nsIURIContentListener,
public nsIWebProgressListener,
public nsSupportsWeakReference
{
1999-08-31 18:05:08 +04:00
public:
nsBrowserInstance();
virtual ~nsBrowserInstance();
NS_DECL_ISUPPORTS
NS_DECL_NSIBROWSERINSTANCE
NS_DEFINE_STATIC_CID_ACCESSOR( NS_BROWSERINSTANCE_CID )
// nsIDocumentLoaderObserver
NS_DECL_NSIDOCUMENTLOADEROBSERVER
1999-08-31 18:05:08 +04:00
// URI Content listener
NS_DECL_NSIURICONTENTLISTENER
NS_DECL_NSIWEBPROGRESSLISTENER
public:
nsIDocShell* GetContentAreaDocShell();
nsIDOMWindow* GetContentWindow();
nsIDocumentLoader* GetContentAreaDocLoader();
void ReinitializeContentVariables();
1999-08-31 18:05:08 +04:00
protected:
nsresult InitializeSearch(nsIFindComponent*);
1999-08-31 18:05:08 +04:00
NS_IMETHOD CreateMenuItem(nsIDOMNode * , PRInt32,const PRUnichar * );
NS_IMETHOD EnsureXULBrowserWindow();
NS_IMETHOD ClearHistoryMenus(nsIDOMNode * );
1999-08-31 18:05:08 +04:00
PRBool mIsClosed;
1999-08-31 18:05:08 +04:00
nsCOMPtr<nsIXULBrowserWindow> mXULBrowserWindow;
#ifdef SH_IN_FRAMES
nsCOMPtr<nsISHistory> mSessionHistory;
#endif
1999-08-31 18:05:08 +04:00
nsIScriptContext *mContentScriptContext; // weak reference
nsWeakPtr mContentWindowWeak;
nsWeakPtr mContentAreaDocShellWeak;
nsWeakPtr mContentAreaDocLoaderWeak;
1999-08-31 18:05:08 +04:00
nsIWebShellWindow *mWebShellWin; // weak reference
nsIDocShell * mDocShell; // weak reference
nsIDOMWindow* mDOMWindow; // weak reference
2000-05-03 09:33:07 +04:00
nsCOMPtr<nsIUrlbarHistory> mUrlbarHistory; //We own this
1999-08-31 18:05:08 +04:00
nsCOMPtr<nsISupports> mSearchContext; // at last, something we really own
1999-09-02 00:41:30 +04:00
nsInstanceCounter mInstanceCounter;
1999-08-31 18:05:08 +04:00
#ifdef DEBUG_warren
PRIntervalTime mLoadStartTime;
#endif
};
#endif // nsBrowserInstance_h___