|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsISupports.idl" |
|
6 |
|
7 interface nsITreeColumns; |
|
8 interface nsIDOMElement; |
|
9 interface nsIAtom; |
|
10 |
|
11 [scriptable, uuid(ae835ecf-6b32-4660-9b43-8a270df56e02)] |
|
12 interface nsITreeColumn : nsISupports |
|
13 { |
|
14 readonly attribute nsIDOMElement element; |
|
15 |
|
16 readonly attribute nsITreeColumns columns; |
|
17 |
|
18 readonly attribute long x; |
|
19 readonly attribute long width; |
|
20 |
|
21 readonly attribute AString id; |
|
22 [noscript] void getIdConst([shared] out wstring idConst); |
|
23 [noscript] readonly attribute nsIAtom atom; |
|
24 |
|
25 readonly attribute long index; |
|
26 |
|
27 readonly attribute boolean primary; |
|
28 readonly attribute boolean cycler; |
|
29 readonly attribute boolean editable; |
|
30 readonly attribute boolean selectable; |
|
31 |
|
32 const short TYPE_TEXT = 1; |
|
33 const short TYPE_CHECKBOX = 2; |
|
34 const short TYPE_PROGRESSMETER = 3; |
|
35 readonly attribute short type; |
|
36 |
|
37 nsITreeColumn getNext(); |
|
38 nsITreeColumn getPrevious(); |
|
39 |
|
40 void invalidate(); |
|
41 }; |
|
42 |
|
43 interface nsITreeBoxObject; |
|
44 |
|
45 [scriptable, uuid(f8a8d6b4-6788-438d-9009-7142798767ab)] |
|
46 interface nsITreeColumns : nsISupports |
|
47 { |
|
48 /** |
|
49 * The tree widget for these columns. |
|
50 */ |
|
51 readonly attribute nsITreeBoxObject tree; |
|
52 |
|
53 /** |
|
54 * The number of columns. |
|
55 */ |
|
56 readonly attribute long count; |
|
57 |
|
58 /** |
|
59 * An alias for count (for the benefit of scripts which treat this as an |
|
60 * array). |
|
61 */ |
|
62 readonly attribute long length; |
|
63 |
|
64 /** |
|
65 * Get the first/last column. |
|
66 */ |
|
67 nsITreeColumn getFirstColumn(); |
|
68 nsITreeColumn getLastColumn(); |
|
69 |
|
70 /** |
|
71 * Attribute based column getters. |
|
72 */ |
|
73 nsITreeColumn getPrimaryColumn(); |
|
74 nsITreeColumn getSortedColumn(); |
|
75 nsITreeColumn getKeyColumn(); |
|
76 |
|
77 /** |
|
78 * Get the column for the given element. |
|
79 */ |
|
80 nsITreeColumn getColumnFor(in nsIDOMElement element); |
|
81 |
|
82 /** |
|
83 * Parametric column getters. |
|
84 */ |
|
85 nsITreeColumn getNamedColumn(in AString id); |
|
86 nsITreeColumn getColumnAt(in long index); |
|
87 |
|
88 /** |
|
89 * This method is called whenever a treecol is added or removed and |
|
90 * the column cache needs to be rebuilt. |
|
91 */ |
|
92 void invalidateColumns(); |
|
93 |
|
94 void restoreNaturalOrder(); |
|
95 }; |