layout/xul/nsDeckFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/xul/nsDeckFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,74 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/**
    1.10 +
    1.11 +  Eric D Vaughan
    1.12 +  A frame that can have multiple children. Only one child may be displayed at one time. So the
    1.13 +  can be flipped though like a deck of cards.
    1.14 + 
    1.15 +**/
    1.16 +
    1.17 +#ifndef nsDeckFrame_h___
    1.18 +#define nsDeckFrame_h___
    1.19 +
    1.20 +#include "mozilla/Attributes.h"
    1.21 +#include "nsBoxFrame.h"
    1.22 +
    1.23 +class nsDeckFrame : public nsBoxFrame
    1.24 +{
    1.25 +public:
    1.26 +  NS_DECL_QUERYFRAME_TARGET(nsDeckFrame)
    1.27 +  NS_DECL_QUERYFRAME
    1.28 +  NS_DECL_FRAMEARENA_HELPERS
    1.29 +
    1.30 +  friend nsIFrame* NS_NewDeckFrame(nsIPresShell* aPresShell,
    1.31 +                                   nsStyleContext* aContext);
    1.32 +
    1.33 +  virtual nsresult AttributeChanged(int32_t         aNameSpaceID,
    1.34 +                                    nsIAtom*        aAttribute,
    1.35 +                                    int32_t         aModType) MOZ_OVERRIDE;
    1.36 +
    1.37 +  NS_IMETHOD DoLayout(nsBoxLayoutState& aState) MOZ_OVERRIDE;
    1.38 +
    1.39 +  virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
    1.40 +                                const nsRect&           aDirtyRect,
    1.41 +                                const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    1.42 +
    1.43 +  virtual void BuildDisplayListForChildren(nsDisplayListBuilder*   aBuilder,
    1.44 +                                           const nsRect&           aDirtyRect,
    1.45 +                                           const nsDisplayListSet& aLists) MOZ_OVERRIDE;
    1.46 +                                         
    1.47 +  virtual void Init(nsIContent*      aContent,
    1.48 +                    nsIFrame*        aParent,
    1.49 +                    nsIFrame*        aPrevInFlow) MOZ_OVERRIDE;
    1.50 +
    1.51 +  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
    1.52 +
    1.53 +#ifdef DEBUG_FRAME_DUMP
    1.54 +  virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE
    1.55 +  {
    1.56 +      return MakeFrameName(NS_LITERAL_STRING("Deck"), aResult);
    1.57 +  }
    1.58 +#endif
    1.59 +
    1.60 +  nsDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
    1.61 +
    1.62 +  nsIFrame* GetSelectedBox();
    1.63 +
    1.64 +protected:
    1.65 +
    1.66 +  void IndexChanged();
    1.67 +  int32_t GetSelectedIndex();
    1.68 +  void HideBox(nsIFrame* aBox);
    1.69 +
    1.70 +private:
    1.71 +
    1.72 +  int32_t mIndex;
    1.73 +
    1.74 +}; // class nsDeckFrame
    1.75 +
    1.76 +#endif
    1.77 +

mercurial