nsPopupSetFrame.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifndef nsPopupSetFrame_h__
  7. #define nsPopupSetFrame_h__
  8. #include "mozilla/Attributes.h"
  9. #include "nsIAtom.h"
  10. #include "nsBoxFrame.h"
  11. nsIFrame* NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
  12. class nsPopupSetFrame : public nsBoxFrame
  13. {
  14. public:
  15. NS_DECL_FRAMEARENA_HELPERS
  16. explicit nsPopupSetFrame(nsStyleContext* aContext):
  17. nsBoxFrame(aContext) {}
  18. ~nsPopupSetFrame() {}
  19. virtual void Init(nsIContent* aContent,
  20. nsContainerFrame* aParent,
  21. nsIFrame* aPrevInFlow) override;
  22. virtual void SetInitialChildList(ChildListID aListID,
  23. nsFrameList& aChildList) override;
  24. virtual void AppendFrames(ChildListID aListID,
  25. nsFrameList& aFrameList) override;
  26. virtual void RemoveFrame(ChildListID aListID,
  27. nsIFrame* aOldFrame) override;
  28. virtual void InsertFrames(ChildListID aListID,
  29. nsIFrame* aPrevFrame,
  30. nsFrameList& aFrameList) override;
  31. virtual const nsFrameList& GetChildList(ChildListID aList) const override;
  32. virtual void GetChildLists(nsTArray<ChildList>* aLists) const override;
  33. NS_IMETHOD DoXULLayout(nsBoxLayoutState& aBoxLayoutState) override;
  34. // Used to destroy our popup frames.
  35. virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
  36. virtual nsIAtom* GetType() const override;
  37. #ifdef DEBUG_FRAME_DUMP
  38. virtual nsresult GetFrameName(nsAString& aResult) const override
  39. {
  40. return MakeFrameName(NS_LITERAL_STRING("PopupSet"), aResult);
  41. }
  42. #endif
  43. protected:
  44. void AddPopupFrameList(nsFrameList& aPopupFrameList);
  45. void RemovePopupFrame(nsIFrame* aPopup);
  46. nsFrameList mPopupList;
  47. };
  48. #endif