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/. */
9 A frame that can have multiple children. Only one child may be displayed at one time. So the
10 can be flipped though like a deck of cards.
14 #ifndef nsStackLayout_h___
15 #define nsStackLayout_h___
17 #include "mozilla/Attributes.h"
18 #include "nsBoxLayout.h"
24 nsresult
NS_NewStackLayout(nsIPresShell
* aPresShell
, nsCOMPtr
<nsBoxLayout
>& aNewLayout
);
26 class nsStackLayout
: public nsBoxLayout
30 friend nsresult
NS_NewStackLayout(nsIPresShell
* aPresShell
, nsCOMPtr
<nsBoxLayout
>& aNewLayout
);
31 static void Shutdown();
35 NS_IMETHOD
Layout(nsIFrame
* aBox
, nsBoxLayoutState
& aState
) MOZ_OVERRIDE
;
37 virtual nsSize
GetPrefSize(nsIFrame
* aBox
, nsBoxLayoutState
& aBoxLayoutState
) MOZ_OVERRIDE
;
38 virtual nsSize
GetMinSize(nsIFrame
* aBox
, nsBoxLayoutState
& aBoxLayoutState
) MOZ_OVERRIDE
;
39 virtual nsSize
GetMaxSize(nsIFrame
* aBox
, nsBoxLayoutState
& aBoxLayoutState
) MOZ_OVERRIDE
;
40 virtual nscoord
GetAscent(nsIFrame
* aBox
, nsBoxLayoutState
& aBoxLayoutState
) MOZ_OVERRIDE
;
42 // get the child offsets for aChild and set them in aMargin. Returns a
43 // bitfield mask of the SPECIFIED_LEFT, SPECIFIED_RIGHT, SPECIFIED_TOP and
44 // SPECIFIED_BOTTOM offsets indicating which sides have been specified by
46 static uint8_t GetOffset(nsBoxLayoutState
& aState
, nsIFrame
* aChild
, nsMargin
& aMargin
);
49 static nsBoxLayout
* gInstance
;
51 }; // class nsStackLayout