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