2000-01-22 03:15:41 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla browser.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications, Inc. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Travis Bogard <travis@netscape.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsXULWindow_h__
|
|
|
|
#define nsXULWindow_h__
|
|
|
|
|
2000-01-25 21:59:31 +00:00
|
|
|
// Local Includes
|
|
|
|
#include "nsChromeTreeOwner.h"
|
|
|
|
#include "nsContentTreeOwner.h"
|
|
|
|
|
|
|
|
// Helper classes
|
2000-01-22 03:15:41 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2000-01-25 21:59:31 +00:00
|
|
|
#include "nsVoidArray.h"
|
|
|
|
#include "nsString.h"
|
2000-02-25 03:11:21 +00:00
|
|
|
#include "nsWeakReference.h"
|
2000-01-25 21:59:31 +00:00
|
|
|
|
|
|
|
// Interfaces needed
|
2000-01-22 03:15:41 +00:00
|
|
|
#include "nsIBaseWindow.h"
|
|
|
|
#include "nsIDocShell.h"
|
2000-01-25 21:59:31 +00:00
|
|
|
#include "nsIDocShellTreeItem.h"
|
2000-03-24 03:46:15 +00:00
|
|
|
#include "nsIDOMWindow.h"
|
2000-02-08 13:40:10 +00:00
|
|
|
#include "nsIEventQueueService.h"
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
|
|
|
#include "nsIWidget.h"
|
|
|
|
#include "nsIXULWindow.h"
|
2000-01-25 21:59:31 +00:00
|
|
|
|
|
|
|
// nsXULWindow
|
2000-01-22 03:15:41 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
class nsXULWindow : public nsIXULWindow, public nsIBaseWindow,
|
2000-02-25 03:11:21 +00:00
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsSupportsWeakReference
|
2000-01-22 03:15:41 +00:00
|
|
|
{
|
|
|
|
friend class nsChromeTreeOwner;
|
|
|
|
friend class nsContentTreeOwner;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
2000-01-22 03:15:41 +00:00
|
|
|
NS_DECL_NSIXULWINDOW
|
|
|
|
NS_DECL_NSIBASEWINDOW
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsXULWindow();
|
2000-01-27 05:59:42 +00:00
|
|
|
virtual ~nsXULWindow();
|
2000-01-22 03:15:41 +00:00
|
|
|
|
|
|
|
NS_IMETHOD EnsureChromeTreeOwner();
|
|
|
|
NS_IMETHOD EnsureContentTreeOwner();
|
2000-01-30 07:29:38 +00:00
|
|
|
NS_IMETHOD EnsurePrimaryContentTreeOwner();
|
2000-02-10 07:47:24 +00:00
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
void OnChromeLoaded();
|
2000-02-10 07:47:24 +00:00
|
|
|
NS_IMETHOD LoadPositionAndSizeFromXUL(PRBool aPosition, PRBool aSize);
|
|
|
|
NS_IMETHOD LoadTitleFromXUL();
|
2000-03-09 02:00:20 +00:00
|
|
|
NS_IMETHOD PersistPositionAndSize(PRBool aPosition, PRBool aSize, PRBool aSizeMode);
|
2000-02-08 13:40:10 +00:00
|
|
|
|
2000-03-24 03:46:15 +00:00
|
|
|
NS_IMETHOD GetWindowDOMWindow(nsIDOMWindow** aDOMWindow);
|
2000-03-16 05:45:26 +00:00
|
|
|
NS_IMETHOD GetWindowDOMElement(nsIDOMElement** aDOMElement);
|
|
|
|
NS_IMETHOD GetDOMElementById(char* aID, nsIDOMElement** aDOMElement);
|
2000-01-27 05:59:42 +00:00
|
|
|
NS_IMETHOD ContentShellAdded(nsIDocShellTreeItem* aContentShell,
|
2000-02-05 03:26:35 +00:00
|
|
|
PRBool aPrimary, const PRUnichar* aID);
|
|
|
|
NS_IMETHOD SizeShellTo(nsIDocShellTreeItem* aShellItem, PRInt32 aCX,
|
|
|
|
PRInt32 aCY);
|
2000-02-08 13:40:10 +00:00
|
|
|
NS_IMETHOD ExitModalLoop();
|
|
|
|
NS_IMETHOD GetNewWindow(PRInt32 aChromeFlags,
|
|
|
|
nsIDocShellTreeItem** aDocShellTreeItem);
|
|
|
|
NS_IMETHOD CreateNewChromeWindow(PRInt32 aChromeFlags,
|
|
|
|
nsIDocShellTreeItem** aDocShellTreeItem);
|
|
|
|
NS_IMETHOD CreateNewContentWindow(PRInt32 aChromeFlags,
|
|
|
|
nsIDocShellTreeItem** aDocShellTreeItem);
|
2000-02-14 06:14:21 +00:00
|
|
|
NS_IMETHOD NotifyObservers(const PRUnichar* aTopic, const PRUnichar* aData);
|
2000-01-22 03:15:41 +00:00
|
|
|
|
|
|
|
protected:
|
2000-02-25 03:11:21 +00:00
|
|
|
void EnableParent(PRBool aEnable);
|
2000-04-01 22:13:46 +00:00
|
|
|
PRBool ConstrainToZLevel(PRBool aImmediate, nsWindowZ *aPlacement,
|
|
|
|
nsIWidget *aReqBelow, nsIWidget **aActualBelow);
|
2000-02-25 03:11:21 +00:00
|
|
|
|
2000-01-22 03:15:41 +00:00
|
|
|
nsChromeTreeOwner* mChromeTreeOwner;
|
|
|
|
nsContentTreeOwner* mContentTreeOwner;
|
2000-01-30 07:29:38 +00:00
|
|
|
nsContentTreeOwner* mPrimaryContentTreeOwner;
|
2000-01-22 03:15:41 +00:00
|
|
|
nsCOMPtr<nsIWidget> mWindow;
|
|
|
|
nsCOMPtr<nsIDocShell> mDocShell;
|
2000-03-24 03:46:15 +00:00
|
|
|
nsCOMPtr<nsIDOMWindow> mDOMWindow;
|
2000-02-25 03:11:21 +00:00
|
|
|
nsCOMPtr<nsIWeakReference> mParentWindow;
|
2000-01-25 21:59:31 +00:00
|
|
|
nsVoidArray mContentShells;
|
2000-02-08 13:40:10 +00:00
|
|
|
PRBool mContinueModalLoop;
|
|
|
|
PRBool mDebuting; // being made visible right now
|
|
|
|
PRBool mChromeLoaded; // True when chrome has loaded
|
2000-02-08 21:29:00 +00:00
|
|
|
PRBool mShowAfterLoad;
|
|
|
|
PRBool mIntrinsicallySized;
|
2000-04-13 20:07:28 +00:00
|
|
|
PRBool mCenterAfterLoad;
|
2000-04-01 22:13:46 +00:00
|
|
|
unsigned long mZlevel;
|
2000-01-25 21:59:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// nsContentShellInfo
|
|
|
|
|
|
|
|
class nsContentShellInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsContentShellInfo(const nsString& aID, PRBool aPrimary, nsIDocShellTreeItem* aContentShell);
|
|
|
|
~nsContentShellInfo();
|
|
|
|
|
|
|
|
public:
|
|
|
|
nsAutoString id; // The identifier of the content shell
|
|
|
|
PRBool primary; // Signals the fact that the shell is primary
|
|
|
|
nsCOMPtr<nsIDocShellTreeItem> child; // content shell
|
2000-01-22 03:15:41 +00:00
|
|
|
};
|
|
|
|
|
2000-02-08 13:40:10 +00:00
|
|
|
// nsEventQueueStack
|
|
|
|
// a little utility object to push an event queue and pop it when it
|
|
|
|
// goes out of scope. should probably be in a file of utility functions.
|
|
|
|
class nsEventQueueStack
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsEventQueueStack();
|
|
|
|
~nsEventQueueStack();
|
|
|
|
|
|
|
|
nsresult Success();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCOMPtr<nsIEventQueueService> mService;
|
2000-06-05 21:53:25 +00:00
|
|
|
nsCOMPtr<nsIEventQueue> mQueue;
|
2000-02-08 13:40:10 +00:00
|
|
|
};
|
|
|
|
|
2000-01-22 03:15:41 +00:00
|
|
|
#endif /* nsXULWindow_h__ */
|