1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 A frame that can have multiple children. Only one child may be displayed at
11 one time. So the can be flipped though like a deck of cards.
15 #ifndef nsStackLayout_h___
16 #define nsStackLayout_h___
18 #include "mozilla/Attributes.h"
19 #include "nsBoxLayout.h"
23 nsresult
NS_NewStackLayout(nsCOMPtr
<nsBoxLayout
>& aNewLayout
);
25 class nsStackLayout
: public nsBoxLayout
{
27 friend nsresult
NS_NewStackLayout(nsCOMPtr
<nsBoxLayout
>& aNewLayout
);
28 static void Shutdown();
32 NS_IMETHOD
XULLayout(nsIFrame
* aBox
, nsBoxLayoutState
& aState
) override
;
34 virtual nsSize
GetXULPrefSize(nsIFrame
* aBox
,
35 nsBoxLayoutState
& aBoxLayoutState
) override
;
36 virtual nsSize
GetXULMinSize(nsIFrame
* aBox
,
37 nsBoxLayoutState
& aBoxLayoutState
) override
;
38 virtual nsSize
GetXULMaxSize(nsIFrame
* aBox
,
39 nsBoxLayoutState
& aBoxLayoutState
) override
;
40 virtual nscoord
GetAscent(nsIFrame
* aBox
,
41 nsBoxLayoutState
& aBoxLayoutState
) override
;
43 // get the child offsets for aChild and set them in aMargin. Returns a
44 // bitfield mask of the SPECIFIED_LEFT, SPECIFIED_RIGHT, SPECIFIED_TOP and
45 // SPECIFIED_BOTTOM offsets indicating which sides have been specified by
47 static uint8_t GetOffset(nsIFrame
* aChild
, nsMargin
& aMargin
);
50 static nsBoxLayout
* gInstance
;
52 }; // class nsStackLayout