|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
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 #ifndef nsPopupSetFrame_h__ |
|
8 #define nsPopupSetFrame_h__ |
|
9 |
|
10 #include "mozilla/Attributes.h" |
|
11 #include "nsIAtom.h" |
|
12 #include "nsBoxFrame.h" |
|
13 |
|
14 nsIFrame* NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); |
|
15 |
|
16 class nsPopupSetFrame : public nsBoxFrame |
|
17 { |
|
18 public: |
|
19 NS_DECL_FRAMEARENA_HELPERS |
|
20 |
|
21 nsPopupSetFrame(nsIPresShell* aShell, nsStyleContext* aContext): |
|
22 nsBoxFrame(aShell, aContext) {} |
|
23 |
|
24 ~nsPopupSetFrame() {} |
|
25 |
|
26 virtual void Init(nsIContent* aContent, |
|
27 nsIFrame* aParent, |
|
28 nsIFrame* aPrevInFlow) MOZ_OVERRIDE; |
|
29 virtual nsresult AppendFrames(ChildListID aListID, |
|
30 nsFrameList& aFrameList) MOZ_OVERRIDE; |
|
31 virtual nsresult RemoveFrame(ChildListID aListID, |
|
32 nsIFrame* aOldFrame) MOZ_OVERRIDE; |
|
33 virtual nsresult InsertFrames(ChildListID aListID, |
|
34 nsIFrame* aPrevFrame, |
|
35 nsFrameList& aFrameList) MOZ_OVERRIDE; |
|
36 virtual nsresult SetInitialChildList(ChildListID aListID, |
|
37 nsFrameList& aChildList) MOZ_OVERRIDE; |
|
38 |
|
39 virtual const nsFrameList& GetChildList(ChildListID aList) const MOZ_OVERRIDE; |
|
40 virtual void GetChildLists(nsTArray<ChildList>* aLists) const MOZ_OVERRIDE; |
|
41 |
|
42 NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE; |
|
43 |
|
44 // Used to destroy our popup frames. |
|
45 virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; |
|
46 |
|
47 virtual nsIAtom* GetType() const MOZ_OVERRIDE; |
|
48 |
|
49 #ifdef DEBUG_FRAME_DUMP |
|
50 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE |
|
51 { |
|
52 return MakeFrameName(NS_LITERAL_STRING("PopupSet"), aResult); |
|
53 } |
|
54 #endif |
|
55 |
|
56 protected: |
|
57 void AddPopupFrameList(nsFrameList& aPopupFrameList); |
|
58 void RemovePopupFrame(nsIFrame* aPopup); |
|
59 |
|
60 nsFrameList mPopupList; |
|
61 }; |
|
62 |
|
63 #endif |