comparison dwt/internal/cocoa/NSOutlineView.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSOutlineView;
15
16 import dwt.internal.cocoa.CGFloat;
17 import dwt.internal.cocoa.NSInteger;
18 import dwt.internal.cocoa.NSRect;
19 import dwt.internal.cocoa.NSTableColumn;
20 import dwt.internal.cocoa.NSTableView;
21 import dwt.internal.cocoa.OS;
22 import objc = dwt.internal.objc.runtime;
23
24 public class NSOutlineView : NSTableView
25 {
26
27 public this ()
28 {
29 super();
30 }
31
32 public this (objc.id id)
33 {
34 super(id);
35 }
36
37 public bool autoresizesOutlineColumn ()
38 {
39 return OS.objc_msgSend(this.id, OS.sel_autoresizesOutlineColumn) !is null;
40 }
41
42 public bool autosaveExpandedItems ()
43 {
44 return OS.objc_msgSend(this.id, OS.sel_autosaveExpandedItems) !is null;
45 }
46
47 public void collapseItem_ (id item)
48 {
49 OS.objc_msgSend(this.id, OS.sel_collapseItem_1, item !is null ? item.id : null);
50 }
51
52 public void collapseItem_collapseChildren_ (id item, bool collapseChildren)
53 {
54 OS.objc_msgSend(this.id, OS.sel_collapseItem_1collapseChildren_1, item !is null ? item.id : null, collapseChildren);
55 }
56
57 public void expandItem_ (id item)
58 {
59 OS.objc_msgSend(this.id, OS.sel_expandItem_1, item !is null ? item.id : null);
60 }
61
62 public void expandItem_expandChildren_ (id item, bool expandChildren)
63 {
64 OS.objc_msgSend(this.id, OS.sel_expandItem_1expandChildren_1, item !is null ? item.id : null, expandChildren);
65 }
66
67 public NSRect frameOfOutlineCellAtRow (NSInteger row)
68 {
69 NSRect result;
70 OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfOutlineCellAtRow_1, row);
71 return result;
72 }
73
74 public bool indentationMarkerFollowsCell ()
75 {
76 return OS.objc_msgSend(this.id, OS.sel_indentationMarkerFollowsCell) !is null;
77 }
78
79 public CGFloat indentationPerLevel ()
80 {
81 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_indentationPerLevel);
82 }
83
84 public bool isExpandable (id item)
85 {
86 return OS.objc_msgSend(this.id, OS.sel_isExpandable_1, item !is null ? item.id : null) !is null;
87 }
88
89 public bool isItemExpanded (id item)
90 {
91 return OS.objc_msgSend(this.id, OS.sel_isItemExpanded_1, item !is null ? item.id : null) !is null;
92 }
93
94 public id itemAtRow (NSInteger row)
95 {
96 objc.id result = OS.objc_msgSend(this.id, OS.sel_itemAtRow_1, row);
97 return result !is null ? new id(result) : null;
98 }
99
100 public NSInteger levelForItem (id item)
101 {
102 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_levelForItem_1, item !is null ? item.id : null);
103 }
104
105 public NSInteger levelForRow (NSInteger row)
106 {
107 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_levelForRow_1, row);
108 }
109
110 public NSTableColumn outlineTableColumn ()
111 {
112 objc.id result = OS.objc_msgSend(this.id, OS.sel_outlineTableColumn);
113 return result !is null ? new NSTableColumn(result) : null;
114 }
115
116 public id parentForItem (id item)
117 {
118 objc.id result = OS.objc_msgSend(this.id, OS.sel_parentForItem_1, item !is null ? item.id : null);
119 return result !is null ? new id(result) : null;
120 }
121
122 public void reloadItem_ (id item)
123 {
124 OS.objc_msgSend(this.id, OS.sel_reloadItem_1, item !is null ? item.id : null);
125 }
126
127 public void reloadItem_reloadChildren_ (id item, bool reloadChildren)
128 {
129 OS.objc_msgSend(this.id, OS.sel_reloadItem_1reloadChildren_1, item !is null ? item.id : null, reloadChildren);
130 }
131
132 public NSInteger rowForItem (id item)
133 {
134 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_rowForItem_1, item !is null ? item.id : null);
135 }
136
137 public void setAutoresizesOutlineColumn (bool resize)
138 {
139 OS.objc_msgSend(this.id, OS.sel_setAutoresizesOutlineColumn_1, resize);
140 }
141
142 public void setAutosaveExpandedItems (bool save)
143 {
144 OS.objc_msgSend(this.id, OS.sel_setAutosaveExpandedItems_1, save);
145 }
146
147 public void setDropItem (id item, NSInteger index)
148 {
149 OS.objc_msgSend(this.id, OS.sel_setDropItem_1dropChildIndex_1, item !is null ? item.id : null, index);
150 }
151
152 public void setIndentationMarkerFollowsCell (bool drawInCell)
153 {
154 OS.objc_msgSend(this.id, OS.sel_setIndentationMarkerFollowsCell_1, drawInCell);
155 }
156
157 public void setIndentationPerLevel (CGFloat indentationPerLevel)
158 {
159 OS.objc_msgSend(this.id, OS.sel_setIndentationPerLevel_1, indentationPerLevel);
160 }
161
162 public void setOutlineTableColumn (NSTableColumn outlineTableColumn)
163 {
164 OS.objc_msgSend(this.id, OS.sel_setOutlineTableColumn_1, outlineTableColumn !is null ? outlineTableColumn.id : null);
165 }
166
167 public bool shouldCollapseAutoExpandedItemsForDeposited (bool deposited)
168 {
169 return OS.objc_msgSend(this.id, OS.sel_shouldCollapseAutoExpandedItemsForDeposited_1, deposited) !is null;
170 }
171
172 }