Bug 1591736 - Fix AddonManagerWebAPI::IsAPIEnabled in out-of-process iframes r=mixedpuppy
[gecko.git] / layout / xul / nsStackLayout.h
blob46eabed79ff8cbd9de067a0c39759b04f7e8193c
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/. */
7 /**
9 Eric D Vaughan
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.
13 **/
15 #ifndef nsStackLayout_h___
16 #define nsStackLayout_h___
18 #include "mozilla/Attributes.h"
19 #include "nsBoxLayout.h"
20 #include "nsCOMPtr.h"
21 #include "nsCoord.h"
23 nsresult NS_NewStackLayout(nsCOMPtr<nsBoxLayout>& aNewLayout);
25 class nsStackLayout : public nsBoxLayout {
26 public:
27 friend nsresult NS_NewStackLayout(nsCOMPtr<nsBoxLayout>& aNewLayout);
28 static void Shutdown();
30 nsStackLayout();
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
46 // attributes.
47 static uint8_t GetOffset(nsIFrame* aChild, nsMargin& aMargin);
49 private:
50 static nsBoxLayout* gInstance;
52 }; // class nsStackLayout
54 #endif