nsTreeColFrame.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/. */
  5. #include "mozilla/Attributes.h"
  6. #include "nsBoxFrame.h"
  7. class nsITreeBoxObject;
  8. nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
  9. nsStyleContext* aContext);
  10. class nsTreeColFrame : public nsBoxFrame
  11. {
  12. public:
  13. NS_DECL_FRAMEARENA_HELPERS
  14. explicit nsTreeColFrame(nsStyleContext* aContext):
  15. nsBoxFrame(aContext) {}
  16. virtual void Init(nsIContent* aContent,
  17. nsContainerFrame* aParent,
  18. nsIFrame* aPrevInFlow) override;
  19. virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
  20. virtual void BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
  21. const nsDisplayListSet& aLists) override;
  22. virtual nsresult AttributeChanged(int32_t aNameSpaceID,
  23. nsIAtom* aAttribute,
  24. int32_t aModType) override;
  25. virtual void SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
  26. bool aRemoveOverflowArea = false) override;
  27. friend nsIFrame* NS_NewTreeColFrame(nsIPresShell* aPresShell,
  28. nsStyleContext* aContext);
  29. protected:
  30. virtual ~nsTreeColFrame();
  31. /**
  32. * @return the tree box object of the tree this column belongs to, or nullptr.
  33. */
  34. nsITreeBoxObject* GetTreeBoxObject();
  35. /**
  36. * Helper method that gets the nsITreeColumns object this column belongs to
  37. * and calls InvalidateColumns() on it.
  38. */
  39. void InvalidateColumns(bool aCanWalkFrameTree = true);
  40. };