michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsBoxLayout_h___ michael@0: #define nsBoxLayout_h___ michael@0: michael@0: #include "nsISupports.h" michael@0: #include "nsCoord.h" michael@0: #include "nsFrameList.h" michael@0: michael@0: class nsIFrame; michael@0: class nsBoxLayoutState; michael@0: struct nsSize; michael@0: struct nsMargin; michael@0: michael@0: #define NS_BOX_LAYOUT_IID \ michael@0: { 0x09d522a7, 0x304c, 0x4137, \ michael@0: { 0xaf, 0xc9, 0xe0, 0x80, 0x2e, 0x89, 0xb7, 0xe8 } } michael@0: michael@0: class nsIGridPart; michael@0: michael@0: class nsBoxLayout : public nsISupports { michael@0: michael@0: public: michael@0: michael@0: nsBoxLayout() {} michael@0: virtual ~nsBoxLayout() {} michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID) michael@0: michael@0: NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState); michael@0: michael@0: virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); michael@0: virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); michael@0: virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); michael@0: virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState); michael@0: virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState, michael@0: nsIFrame* aPrevBox, michael@0: const nsFrameList::Slice& aNewChildren) {} michael@0: virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState, michael@0: const nsFrameList::Slice& aNewChildren) {} michael@0: virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {} michael@0: virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {} michael@0: virtual void IntrinsicWidthsDirty(nsIFrame* aBox, nsBoxLayoutState& aState) {} michael@0: michael@0: virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize); michael@0: virtual void AddMargin(nsIFrame* aChild, nsSize& aSize); michael@0: virtual void AddMargin(nsSize& aSize, const nsMargin& aMargin); michael@0: michael@0: virtual nsIGridPart* AsGridPart() { return nullptr; } michael@0: michael@0: static void AddLargestSize(nsSize& aSize, const nsSize& aToAdd); michael@0: static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd); michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsBoxLayout, NS_BOX_LAYOUT_IID) michael@0: michael@0: #endif michael@0: