layout/xul/nsBoxLayout.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/xul/nsBoxLayout.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsBoxLayout_h___
    1.10 +#define nsBoxLayout_h___
    1.11 +
    1.12 +#include "nsISupports.h"
    1.13 +#include "nsCoord.h"
    1.14 +#include "nsFrameList.h"
    1.15 +
    1.16 +class nsIFrame;
    1.17 +class nsBoxLayoutState;
    1.18 +struct nsSize;
    1.19 +struct nsMargin;
    1.20 +
    1.21 +#define NS_BOX_LAYOUT_IID \
    1.22 +{ 0x09d522a7, 0x304c, 0x4137, \
    1.23 + { 0xaf, 0xc9, 0xe0, 0x80, 0x2e, 0x89, 0xb7, 0xe8 } }
    1.24 +
    1.25 +class nsIGridPart;
    1.26 +
    1.27 +class nsBoxLayout : public nsISupports {
    1.28 +
    1.29 +public:
    1.30 +
    1.31 +  nsBoxLayout() {}
    1.32 +  virtual ~nsBoxLayout() {}
    1.33 +
    1.34 +  NS_DECL_ISUPPORTS
    1.35 +
    1.36 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID)
    1.37 +
    1.38 +  NS_IMETHOD Layout(nsIFrame* aBox, nsBoxLayoutState& aState);
    1.39 +
    1.40 +  virtual nsSize GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
    1.41 +  virtual nsSize GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
    1.42 +  virtual nsSize GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
    1.43 +  virtual nscoord GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState);
    1.44 +  virtual void ChildrenInserted(nsIFrame* aBox, nsBoxLayoutState& aState,
    1.45 +                                nsIFrame* aPrevBox,
    1.46 +                                const nsFrameList::Slice& aNewChildren) {}
    1.47 +  virtual void ChildrenAppended(nsIFrame* aBox, nsBoxLayoutState& aState,
    1.48 +                                const nsFrameList::Slice& aNewChildren) {}
    1.49 +  virtual void ChildrenRemoved(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
    1.50 +  virtual void ChildrenSet(nsIFrame* aBox, nsBoxLayoutState& aState, nsIFrame* aChildList) {}
    1.51 +  virtual void IntrinsicWidthsDirty(nsIFrame* aBox, nsBoxLayoutState& aState) {}
    1.52 +
    1.53 +  virtual void AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize);
    1.54 +  virtual void AddMargin(nsIFrame* aChild, nsSize& aSize);
    1.55 +  virtual void AddMargin(nsSize& aSize, const nsMargin& aMargin);
    1.56 +
    1.57 +  virtual nsIGridPart* AsGridPart() { return nullptr; }
    1.58 +
    1.59 +  static void AddLargestSize(nsSize& aSize, const nsSize& aToAdd);
    1.60 +  static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd);
    1.61 +};
    1.62 +
    1.63 +NS_DEFINE_STATIC_IID_ACCESSOR(nsBoxLayout, NS_BOX_LAYOUT_IID)
    1.64 +
    1.65 +#endif
    1.66 +

mercurial