layout/xul/nsStackLayout.h

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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/. */
     6 /**
     8   Eric D Vaughan
     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.
    12 **/
    14 #ifndef nsStackLayout_h___
    15 #define nsStackLayout_h___
    17 #include "mozilla/Attributes.h"
    18 #include "nsBoxLayout.h"
    19 #include "nsCOMPtr.h"
    20 #include "nsCoord.h"
    22 class nsIPresShell;
    24 nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
    26 class nsStackLayout : public nsBoxLayout
    27 {
    28 public:
    30   friend nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
    31   static void Shutdown();
    33   nsStackLayout();
    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
    45   // attributes.
    46   static uint8_t GetOffset(nsBoxLayoutState& aState, nsIFrame* aChild, nsMargin& aMargin);
    48 private:
    49   static nsBoxLayout* gInstance;
    51 }; // class nsStackLayout
    55 #endif

mercurial