1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 : * vim:cindent:ts=2:et:sw=2:
3 : *
4 : * ***** BEGIN LICENSE BLOCK *****
5 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 : *
7 : * The contents of this file are subject to the Mozilla Public License Version
8 : * 1.1 (the "License"); you may not use this file except in compliance with
9 : * the License. You may obtain a copy of the License at
10 : * http://www.mozilla.org/MPL/
11 : *
12 : * Software distributed under the License is distributed on an "AS IS" basis,
13 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14 : * for the specific language governing rights and limitations under the
15 : * License.
16 : *
17 : * The Original Code is mozilla.org code.
18 : *
19 : * The Initial Developer of the Original Code is
20 : * Netscape Communications Corporation.
21 : * Portions created by the Initial Developer are Copyright (C) 1998
22 : * the Initial Developer. All Rights Reserved.
23 : *
24 : * Contributor(s):
25 : * Pierre Phaneuf <pp@ludusdesign.com>
26 : * Brian Ryner <bryner@brianryner.com>
27 : *
28 : * Alternatively, the contents of this file may be used under the terms of
29 : * either of the GNU General Public License Version 2 or later (the "GPL"),
30 : * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 : * in which case the provisions of the GPL or the LGPL are applicable instead
32 : * of those above. If you wish to allow use of your version of this file only
33 : * under the terms of either the GPL or the LGPL, and not to allow others to
34 : * use your version of this file under the terms of the MPL, indicate your
35 : * decision by deleting the provisions above and replace them with the notice
36 : * and other provisions required by the GPL or the LGPL. If you do not delete
37 : * the provisions above, a recipient may use your version of this file under
38 : * the terms of any one of the MPL, the GPL or the LGPL.
39 : *
40 : * ***** END LICENSE BLOCK *****
41 : *
42 : * This Original Code has been modified by IBM Corporation. Modifications made
43 : * by IBM described herein are Copyright (c) International Business Machines
44 : * Corporation, 2000. Modifications to Mozilla code or documentation identified
45 : * per MPL Section 3.3
46 : *
47 : * Date Modified by Description of modification
48 : * 04/20/2000 IBM Corp. OS/2 VisualAge build.
49 : */
50 :
51 : /* part of nsFrameManager, to work around header inclusionordering */
52 :
53 : #ifndef _nsFrameManagerBase_h_
54 : #define _nsFrameManagerBase_h_
55 :
56 : #include "pldhash.h"
57 :
58 : class nsIPresShell;
59 : class nsStyleSet;
60 : class nsIContent;
61 : class nsPlaceholderFrame;
62 : class nsIFrame;
63 : class nsStyleContext;
64 : class nsIAtom;
65 : class nsStyleChangeList;
66 : class nsILayoutHistoryState;
67 :
68 : class nsFrameManagerBase
69 : {
70 : public:
71 0 : nsFrameManagerBase()
72 : {
73 0 : memset(this, '\0', sizeof(nsFrameManagerBase));
74 0 : }
75 :
76 : bool IsDestroyingFrames() { return mIsDestroyingFrames; }
77 :
78 : /*
79 : * Gets and sets the root frame (typically the viewport). The lifetime of the
80 : * root frame is controlled by the frame manager. When the frame manager is
81 : * destroyed, it destroys the entire frame hierarchy.
82 : */
83 0 : NS_HIDDEN_(nsIFrame*) GetRootFrame() const { return mRootFrame; }
84 0 : NS_HIDDEN_(void) SetRootFrame(nsIFrame* aRootFrame)
85 : {
86 0 : NS_ASSERTION(!mRootFrame, "already have a root frame");
87 0 : mRootFrame = aRootFrame;
88 0 : }
89 :
90 : protected:
91 : class UndisplayedMap;
92 :
93 : // weak link, because the pres shell owns us
94 : nsIPresShell* mPresShell;
95 : // the pres shell owns the style set
96 : nsStyleSet* mStyleSet;
97 : nsIFrame* mRootFrame;
98 : PLDHashTable mPlaceholderMap;
99 : UndisplayedMap* mUndisplayedMap;
100 : bool mIsDestroyingFrames; // The frame manager is destroying some frame(s).
101 : };
102 :
103 : #endif
|