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/. */ 6 7 /** 8 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. 12 13 **/ 14 15 #ifndef nsStackLayout_h___ 16 #define nsStackLayout_h___ 17 18 #include "mozilla/Attributes.h" 19 #include "nsBoxLayout.h" 20 #include "nsCOMPtr.h" 21 #include "nsCoord.h" 22 23 nsresult NS_NewStackLayout(nsCOMPtr<nsBoxLayout>& aNewLayout); 24 25 class nsStackLayout : public nsBoxLayout { 26 public: 27 friend nsresult NS_NewStackLayout(nsCOMPtr<nsBoxLayout>& aNewLayout); 28 static void Shutdown(); 29 30 nsStackLayout(); 31 32 NS_IMETHOD XULLayout(nsIFrame* aBox, nsBoxLayoutState& aState) override; 33 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; 42 43 private: 44 static nsBoxLayout* gInstance; 45 46 }; // class nsStackLayout 47 48 #endif 49