1998-04-14 00:24:54 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
#ifndef nsIPresShell_h___
|
|
|
|
#define nsIPresShell_h___
|
|
|
|
|
|
|
|
#include "nslayout.h"
|
1998-06-03 19:41:39 +04:00
|
|
|
#include "nsISupports.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsCoord.h"
|
|
|
|
class nsIContent;
|
|
|
|
class nsIDocument;
|
1998-06-03 19:41:39 +04:00
|
|
|
class nsIDocumentObserver;
|
1998-04-14 00:24:54 +04:00
|
|
|
class nsIFrame;
|
|
|
|
class nsIPresContext;
|
|
|
|
class nsIStyleSet;
|
|
|
|
class nsIViewManager;
|
1998-06-09 08:51:44 +04:00
|
|
|
class nsIReflowCommand;
|
1998-06-25 08:24:45 +04:00
|
|
|
class nsIDeviceContext;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
#define NS_IPRESSHELL_IID \
|
|
|
|
{ 0x76e79c60, 0x944e, 0x11d1, \
|
|
|
|
{0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Presentation shell interface. Presentation shells are the
|
|
|
|
* controlling point for managing the presentation of a document. The
|
|
|
|
* presentation shell holds a live reference to the document, the
|
|
|
|
* presentation context, the style manager, the style set and the root
|
|
|
|
* frame. <p>
|
|
|
|
*
|
|
|
|
* When this object is Release'd, it will release the document, the
|
|
|
|
* presentation context, the style manager, the style set and the root
|
|
|
|
* frame.
|
|
|
|
*/
|
1998-06-03 19:41:39 +04:00
|
|
|
class nsIPresShell : public nsISupports {
|
1998-04-14 00:24:54 +04:00
|
|
|
public:
|
1998-06-03 19:41:39 +04:00
|
|
|
NS_IMETHOD Init(nsIDocument* aDocument,
|
|
|
|
nsIPresContext* aPresContext,
|
|
|
|
nsIViewManager* aViewManager,
|
|
|
|
nsIStyleSet* aStyleSet) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
virtual nsIDocument* GetDocument() = 0;
|
|
|
|
|
|
|
|
virtual nsIPresContext* GetPresContext() = 0;
|
|
|
|
|
|
|
|
virtual nsIViewManager * GetViewManager() = 0;
|
|
|
|
|
|
|
|
virtual nsIStyleSet* GetStyleSet() = 0;
|
|
|
|
|
1998-05-09 07:21:34 +04:00
|
|
|
NS_IMETHOD EnterReflowLock() = 0;
|
|
|
|
|
|
|
|
NS_IMETHOD ExitReflowLock() = 0;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
// Make shell be a document observer
|
|
|
|
virtual void BeginObservingDocument() = 0;
|
|
|
|
|
|
|
|
// Make shell stop being a document observer
|
|
|
|
virtual void EndObservingDocument() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reflow the frame model into a new width and height. The
|
|
|
|
* coordinates for aWidth and aHeight must be in standard nscoord's.
|
|
|
|
*/
|
|
|
|
virtual void ResizeReflow(nscoord aWidth, nscoord aHeight) = 0;
|
|
|
|
|
|
|
|
virtual nsIFrame* GetRootFrame() = 0;
|
|
|
|
|
|
|
|
virtual nsIFrame* FindFrameWithContent(nsIContent* aContent) = 0;
|
|
|
|
|
1998-06-09 08:51:44 +04:00
|
|
|
virtual void AppendReflowCommand(nsIReflowCommand* aReflowCommand) = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
virtual void ProcessReflowCommands() = 0;
|
|
|
|
|
|
|
|
// XXX events
|
|
|
|
// XXX selection
|
1998-07-13 23:49:20 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* See if reflow verification is enabled. To enable reflow verification add
|
|
|
|
* "verifyreflow:1" to your NSPR_LOG_MODULES environment variable
|
|
|
|
* (any non-zero debug level will work). Or, call SetVerifyReflowEnable
|
|
|
|
* with PR_TRUE.
|
|
|
|
*/
|
|
|
|
static NS_LAYOUT PRBool GetVerifyReflowEnable();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the verify-reflow enable flag.
|
|
|
|
*/
|
|
|
|
static NS_LAYOUT void SetVerifyReflowEnable(PRBool aEnabled);
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new empty presentation shell. Upon success, call Init
|
|
|
|
* before attempting to use the shell.
|
|
|
|
*/
|
|
|
|
extern NS_LAYOUT nsresult
|
|
|
|
NS_NewPresShell(nsIPresShell** aInstancePtrResult);
|
|
|
|
|
|
|
|
#endif /* nsIPresShell_h___ */
|