Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #ifndef nsBoxLayout_h___
7 : #define nsBoxLayout_h___
8 :
9 : #include "nsISupports.h"
10 : #include "nsCoord.h"
11 : #include "nsFrameList.h"
12 :
13 : class nsIFrame;
14 : class nsBoxLayoutState;
15 : struct nsSize;
16 : struct nsMargin;
17 :
18 : #define NS_BOX_LAYOUT_IID \
19 : { 0x09d522a7, 0x304c, 0x4137, \
20 : { 0xaf, 0xc9, 0xe0, 0x80, 0x2e, 0x89, 0xb7, 0xe8 } }
21 :
22 : class nsIGridPart;
23 :
24 : class nsBoxLayout : public nsISupports {
25 :
26 : protected:
27 0 : virtual ~nsBoxLayout() {}
28 :
29 : public:
30 :
31 3 : nsBoxLayout() {}
32 :
33 : NS_DECL_ISUPPORTS
34 :
35 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID)
36 :
37 : NS_IMETHOD XULLayout(nsIFrame* aBox, nsBoxLayoutState& aState);
38 :
39 : virtual nsSize GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
40 : virtual nsSize GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
41 : virtual nsSize GetXULMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
42 : virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
43 22 : virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
44 : nsIFrame* aPrevBox,
45 22 : const nsFrameList::Slice& aNewChildren) {}
46 0 : virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
47 0 : const nsFrameList::Slice& aNewChildren) {}
48 13 : virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
49 224 : virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
50 1222 : virtual void IntrinsicISizesDirty(nsIFrame* aBox, nsBoxLayoutState& aState) {}
51 :
52 : virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize);
53 : virtual void AddMargin(nsIFrame* aChild, nsSize& aSize);
54 : virtual void AddMargin(nsSize& aSize, const nsMargin& aMargin);
55 :
56 0 : virtual nsIGridPart* AsGridPart() { return nullptr; }
57 :
58 : static void AddLargestSize(nsSize& aSize, const nsSize& aToAdd);
59 : static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd);
60 : };
61 :
62 : NS_DEFINE_STATIC_IID_ACCESSOR(nsBoxLayout, NS_BOX_LAYOUT_IID)
63 :
64 : #endif
65 :
|