Bug 1675375 Part 7: Update expectations in helper_hittest_clippath.html. r=botond
[gecko.git] / layout / xul / nsDeckFrame.h
blob8eba9f62389b48dd4ceea189cffc9b9527c9afb3
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 nsDeckFrame_h___
16 #define nsDeckFrame_h___
18 #include "mozilla/Attributes.h"
19 #include "nsBoxFrame.h"
21 namespace mozilla {
22 class PresShell;
23 } // namespace mozilla
25 class nsDeckFrame final : public nsBoxFrame {
26 public:
27 NS_DECL_QUERYFRAME
28 NS_DECL_FRAMEARENA_HELPERS(nsDeckFrame)
30 friend nsIFrame* NS_NewDeckFrame(mozilla::PresShell* aPresShell,
31 ComputedStyle* aStyle);
33 virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
34 int32_t aModType) override;
36 NS_IMETHOD DoXULLayout(nsBoxLayoutState& aState) override;
38 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
39 const nsDisplayListSet& aLists) override;
41 virtual void RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) override;
43 virtual void BuildDisplayListForChildren(
44 nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) override;
46 virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
47 nsIFrame* aPrevInFlow) override;
49 #ifdef DEBUG_FRAME_DUMP
50 virtual nsresult GetFrameName(nsAString& aResult) const override {
51 return MakeFrameName(u"Deck"_ns, aResult);
53 #endif
55 explicit nsDeckFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
57 nsIFrame* GetSelectedBox();
59 protected:
60 void IndexChanged();
61 int32_t GetSelectedIndex();
62 void HideBox(nsIFrame* aBox);
63 void ShowBox(nsIFrame* aBox);
65 private:
66 int32_t mIndex;
68 void Animate(nsIFrame*, bool);
70 }; // class nsDeckFrame
72 #endif