Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsBoxLayout_h___ |
michael@0 | 7 | #define nsBoxLayout_h___ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsISupports.h" |
michael@0 | 10 | #include "nsCoord.h" |
michael@0 | 11 | #include "nsFrameList.h" |
michael@0 | 12 | |
michael@0 | 13 | class nsIFrame; |
michael@0 | 14 | class nsBoxLayoutState; |
michael@0 | 15 | struct nsSize; |
michael@0 | 16 | struct nsMargin; |
michael@0 | 17 | |
michael@0 | 18 | #define NS_BOX_LAYOUT_IID \ |
michael@0 | 19 | { 0x09d522a7, 0x304c, 0x4137, \ |
michael@0 | 20 | { 0xaf, 0xc9, 0xe0, 0x80, 0x2e, 0x89, 0xb7, 0xe8 } } |
michael@0 | 21 | |
michael@0 | 22 | class nsIGridPart; |
michael@0 | 23 | |
michael@0 | 24 | class nsBoxLayout : public nsISupports { |
michael@0 | 25 | |
michael@0 | 26 | public: |
michael@0 | 27 | |
michael@0 | 28 | nsBoxLayout() {} |
michael@0 | 29 | virtual ~nsBoxLayout() {} |
michael@0 | 30 | |
michael@0 | 31 | NS_DECL_ISUPPORTS |
michael@0 | 32 | |
michael@0 | 33 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID) |
michael@0 | 34 | |
michael@0 | 35 | NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState); |
michael@0 | 36 | |
michael@0 | 37 | virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); |
michael@0 | 38 | virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); |
michael@0 | 39 | virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); |
michael@0 | 40 | virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); |
michael@0 | 41 | virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState, |
michael@0 | 42 | nsIFrame* aPrevBox, |
michael@0 | 43 | const nsFrameList::Slice& aNewChildren) {} |
michael@0 | 44 | virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState, |
michael@0 | 45 | const nsFrameList::Slice& aNewChildren) {} |
michael@0 | 46 | virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {} |
michael@0 | 47 | virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {} |
michael@0 | 48 | virtual void IntrinsicWidthsDirty(nsIFrame* aBox, nsBoxLayoutState& aState) {} |
michael@0 | 49 | |
michael@0 | 50 | virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize); |
michael@0 | 51 | virtual void AddMargin(nsIFrame* aChild, nsSize& aSize); |
michael@0 | 52 | virtual void AddMargin(nsSize& aSize, const nsMargin& aMargin); |
michael@0 | 53 | |
michael@0 | 54 | virtual nsIGridPart* AsGridPart() { return nullptr; } |
michael@0 | 55 | |
michael@0 | 56 | static void AddLargestSize(nsSize& aSize, const nsSize& aToAdd); |
michael@0 | 57 | static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd); |
michael@0 | 58 | }; |
michael@0 | 59 | |
michael@0 | 60 | NS_DEFINE_STATIC_IID_ACCESSOR(nsBoxLayout, NS_BOX_LAYOUT_IID) |
michael@0 | 61 | |
michael@0 | 62 | #endif |
michael@0 | 63 |