]>
Commit | Line | Data |
---|---|---|
5c6eb3a8 | 1 | ///////////////////////////////////////////////////////////////////////////// |
e86edab0 RR |
2 | // Name: wx/osx/carbon/dataview.h |
3 | // Purpose: wxDataViewCtrl native implementation header for carbon | |
5829b303 | 4 | // Author: |
e86edab0 RR |
5 | // Id: $Id: dataview.h 57374 2009-01-27 |
6 | // Copyright: (c) 2009 | |
5c6eb3a8 SC |
7 | // Licence: wxWindows licence |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
e86edab0 RR |
10 | #ifndef _WX_DATAVIEWCTRL_CARBON_H_ |
11 | #define _WX_DATAVIEWCTRL_CARBON_H_ | |
5c6eb3a8 | 12 | |
e86edab0 | 13 | #include "wx/defs.h" |
5c6eb3a8 | 14 | |
e86edab0 | 15 | #if wxUSE_GUI |
5c6eb3a8 | 16 | |
e86edab0 RR |
17 | #include "wx/osx/core/dataview.h" |
18 | #include "wx/osx/private.h" | |
19 | ||
20 | // ============================================================================ | |
21 | // wxDataViewColumnNativeData | |
22 | // ============================================================================ | |
23 | class wxDataViewColumnNativeData | |
5c6eb3a8 SC |
24 | { |
25 | public: | |
26 | // | |
27 | // constructors / destructor | |
28 | // | |
e86edab0 RR |
29 | wxDataViewColumnNativeData(void) |
30 | { | |
31 | } | |
32 | wxDataViewColumnNativeData(DataBrowserPropertyID initPropertyID) | |
33 | :m_PropertyID(initPropertyID) | |
34 | { | |
35 | } | |
5c6eb3a8 SC |
36 | |
37 | // | |
e86edab0 | 38 | // data access methods |
5c6eb3a8 | 39 | // |
e86edab0 | 40 | DataBrowserPropertyID GetPropertyID(void) const |
5c6eb3a8 | 41 | { |
e86edab0 | 42 | return this->m_PropertyID; |
5c6eb3a8 | 43 | } |
e86edab0 RR |
44 | |
45 | void SetPropertyID(DataBrowserPropertyID newPropertyID) | |
5c6eb3a8 | 46 | { |
e86edab0 | 47 | this->m_PropertyID = newPropertyID; |
5c6eb3a8 SC |
48 | } |
49 | ||
e86edab0 RR |
50 | protected: |
51 | private: | |
52 | // | |
53 | // variables | |
54 | // | |
55 | DataBrowserPropertyID m_PropertyID; // each column is identified by its unique property ID (NOT by the column's index) | |
56 | }; | |
57 | ||
58 | // ============================================================================ | |
59 | // wxDataViewRendererNativeData | |
60 | // ============================================================================ | |
61 | class wxDataViewRendererNativeData | |
62 | { | |
63 | public: | |
64 | // | |
65 | // constructors / destructor | |
66 | // | |
67 | wxDataViewRendererNativeData(void) | |
5c6eb3a8 SC |
68 | { |
69 | } | |
e86edab0 RR |
70 | wxDataViewRendererNativeData(DataBrowserPropertyType initPropertyType, DataBrowserItemDataRef initItemDataRef=NULL) |
71 | :m_ItemDataRef(initItemDataRef), m_PropertyType(initPropertyType) | |
5c6eb3a8 | 72 | { |
5c6eb3a8 SC |
73 | } |
74 | ||
75 | // | |
e86edab0 | 76 | // data access methods |
5c6eb3a8 | 77 | // |
e86edab0 | 78 | DataBrowserItemDataRef GetItemDataRef(void) const |
5c6eb3a8 | 79 | { |
e86edab0 | 80 | return this->m_ItemDataRef; |
5c6eb3a8 | 81 | } |
e86edab0 | 82 | DataBrowserPropertyType GetPropertyType(void) const |
5c6eb3a8 | 83 | { |
e86edab0 | 84 | return this->m_PropertyType; |
5c6eb3a8 SC |
85 | } |
86 | ||
e86edab0 | 87 | void SetItemDataRef(DataBrowserItemDataRef newItemDataRef) |
5c6eb3a8 | 88 | { |
e86edab0 RR |
89 | this->m_ItemDataRef = newItemDataRef; |
90 | } | |
91 | void SetPropertyType(DataBrowserPropertyType newPropertyType) | |
92 | { | |
93 | this->m_PropertyType = newPropertyType; | |
5c6eb3a8 SC |
94 | } |
95 | ||
e86edab0 | 96 | protected: |
5c6eb3a8 SC |
97 | private: |
98 | // | |
99 | // variables | |
100 | // | |
e86edab0 | 101 | DataBrowserItemDataRef m_ItemDataRef; |
5c6eb3a8 | 102 | |
e86edab0 RR |
103 | DataBrowserPropertyType m_PropertyType; |
104 | }; | |
5c6eb3a8 | 105 | |
e86edab0 RR |
106 | // ============================================================================ |
107 | // wxMacDataBrowserTableViewControl | |
108 | // ============================================================================ | |
5c6eb3a8 | 109 | // |
e86edab0 RR |
110 | // This is a wrapper class for the Mac OS X data browser environment. |
111 | // It covers all data brower functionality for the native browser's list | |
112 | // and column style. | |
5c6eb3a8 | 113 | // |
5c6eb3a8 | 114 | |
e86edab0 RR |
115 | // data browser's property IDs have a reserved ID range from 0 - 1023 |
116 | // therefore, the first usable property ID is 'kMinPropertyID' | |
117 | DataBrowserPropertyID const kMinPropertyID = 1024; | |
118 | ||
119 | // array of data browser item IDs | |
120 | WX_DEFINE_ARRAY_SIZE_T(size_t,wxArrayDataBrowserItemID); | |
5c6eb3a8 | 121 | |
e86edab0 | 122 | class wxMacDataBrowserTableViewControl : public wxMacControl |
5c6eb3a8 SC |
123 | { |
124 | public: | |
125 | // | |
126 | // constructors / destructor | |
127 | // | |
e86edab0 RR |
128 | wxMacDataBrowserTableViewControl(wxWindow* peer, const wxPoint& pos, const wxSize& size, long style); |
129 | wxMacDataBrowserTableViewControl(void) | |
130 | { | |
131 | } | |
5c6eb3a8 SC |
132 | |
133 | // | |
e86edab0 | 134 | // callback handling |
5829b303 | 135 | // |
e86edab0 RR |
136 | OSStatus SetCallbacks (DataBrowserCallbacks const* callbacks); |
137 | OSStatus SetCustomCallbacks(DataBrowserCustomCallbacks const* customCallbacks); | |
5829b303 | 138 | |
5c6eb3a8 | 139 | // |
e86edab0 | 140 | // DnD handling |
5c6eb3a8 | 141 | // |
e86edab0 | 142 | OSStatus EnableAutomaticDragTracking(bool enable=true); |
5c6eb3a8 SC |
143 | |
144 | // | |
e86edab0 | 145 | // header handling |
5c6eb3a8 | 146 | // |
e86edab0 | 147 | OSStatus GetHeaderDesc(DataBrowserPropertyID property, DataBrowserListViewHeaderDesc* desc) const; |
5c6eb3a8 | 148 | |
e86edab0 | 149 | OSStatus SetHeaderDesc(DataBrowserPropertyID property, DataBrowserListViewHeaderDesc* desc); |
5c6eb3a8 | 150 | |
5c6eb3a8 | 151 | // |
e86edab0 | 152 | // layout handling |
5c6eb3a8 | 153 | // |
e86edab0 | 154 | OSStatus AutoSizeColumns(); |
5c6eb3a8 | 155 | |
e86edab0 | 156 | OSStatus EnableCellSizeModification(bool enableHeight=true, bool enableWidth=true); // enables or disables the column width and row height modification (default: false) |
5c6eb3a8 | 157 | |
e86edab0 RR |
158 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 |
159 | OSStatus GetAttributes (OptionBits* attributes); | |
160 | #endif | |
161 | OSStatus GetColumnWidth (DataBrowserPropertyID column, UInt16 *width ) const; // returns the column width in pixels | |
162 | OSStatus GetDefaultColumnWidth(UInt16 *width ) const; // returns the default column width in pixels | |
163 | OSStatus GetDefaultRowHeight (UInt16 * height ) const; | |
164 | OSStatus GetHeaderButtonHeight(UInt16 *height ); | |
165 | OSStatus GetPartBounds (DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserPropertyPart part, Rect* bounds); | |
166 | OSStatus GetRowHeight (DataBrowserItemID item , UInt16 *height) const; | |
167 | OSStatus GetScrollPosition (UInt32* top, UInt32 *left) const; | |
5c6eb3a8 | 168 | |
e86edab0 RR |
169 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 |
170 | OSStatus SetAttributes (OptionBits attributes); | |
171 | #endif | |
172 | OSStatus SetColumnWidth(DataBrowserPropertyID column, UInt16 width); // sets the column width in pixels | |
173 | OSStatus SetDefaultColumnWidth( UInt16 width ); | |
174 | OSStatus SetDefaultRowHeight( UInt16 height ); | |
175 | OSStatus SetHasScrollBars( bool horiz, bool vert ); | |
176 | OSStatus SetHeaderButtonHeight( UInt16 height ); | |
177 | OSStatus SetHiliteStyle(DataBrowserTableViewHiliteStyle hiliteStyle); | |
178 | OSStatus SetIndent(float Indent); | |
179 | OSStatus SetItemRowHeight( DataBrowserItemID item , UInt16 height); | |
180 | OSStatus SetScrollPosition( UInt32 top , UInt32 left ); | |
5c6eb3a8 | 181 | |
5c6eb3a8 | 182 | // |
e86edab0 | 183 | // column handling |
5c6eb3a8 | 184 | // |
e86edab0 RR |
185 | OSStatus GetColumnCount (UInt32* numColumns) const; |
186 | OSStatus GetColumnIndex (DataBrowserPropertyID propertyID, DataBrowserTableViewColumnIndex* index) const; // returns for the passed property the corresponding column index | |
187 | OSStatus GetFreePropertyID(DataBrowserPropertyID* propertyID) const; // this method returns a property id that is valid and currently not used; if it cannot be found 'errDataBrowerPropertyNotSupported' is returned | |
188 | OSStatus GetPropertyFlags (DataBrowserPropertyID propertyID, DataBrowserPropertyFlags *flags ) const; | |
189 | OSStatus GetPropertyID (DataBrowserItemDataRef itemData, DataBrowserPropertyID* propertyID) const; // returns for the passed item data reference the corresponding property ID | |
190 | OSStatus GetPropertyID (DataBrowserTableViewColumnIndex index, DataBrowserPropertyID* propertyID) const; // returns for the passed column index the corresponding property ID | |
191 | ||
192 | OSStatus IsUsedPropertyID(DataBrowserPropertyID propertyID) const; // checks if passed property id is used by the control; no error is returned if the id exists | |
5c6eb3a8 | 193 | |
e86edab0 RR |
194 | OSStatus RemoveColumnByProperty(DataBrowserTableViewColumnID propertyID); |
195 | OSStatus RemoveColumnByIndex (DataBrowserTableViewColumnIndex index); | |
196 | ||
197 | OSStatus SetColumnIndex (DataBrowserPropertyID propertyID, DataBrowserTableViewColumnIndex index); | |
198 | OSStatus SetDisclosureColumn(DataBrowserPropertyID propertyID, Boolean expandableRows=false); | |
199 | OSStatus SetPropertyFlags (DataBrowserPropertyID propertyID, DataBrowserPropertyFlags flags); | |
5c6eb3a8 SC |
200 | |
201 | // | |
e86edab0 | 202 | // item handling |
5c6eb3a8 | 203 | // |
e86edab0 RR |
204 | OSStatus AddItem(DataBrowserItemID container, DataBrowserItemID const* itemID) // adds a single item |
205 | { | |
206 | return this->AddItems(container,1,itemID,kDataBrowserItemNoProperty); | |
207 | } | |
208 | OSStatus AddItems(DataBrowserItemID container, UInt32 numItems, DataBrowserItemID const* items, DataBrowserPropertyID preSortProperty); // adds items to the data browser | |
5c6eb3a8 | 209 | |
e86edab0 RR |
210 | OSStatus GetFreeItemID(DataBrowserItemID* id) const; // this method returns an item id that is valid and currently not used; if it cannot be found 'errDataBrowserItemNotAdded' is returned |
211 | OSStatus GetItemCount (ItemCount* numItems) const | |
212 | { | |
213 | return this->GetItemCount(kDataBrowserNoItem,true,kDataBrowserItemAnyState,numItems); | |
214 | } | |
215 | OSStatus GetItemCount (DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, ItemCount* numItems) const; | |
216 | OSStatus GetItemID (DataBrowserTableViewRowIndex row, DataBrowserItemID* item) const; | |
217 | OSStatus GetItems (DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, Handle items) const; | |
218 | OSStatus GetItemRow (DataBrowserItemID item, DataBrowserTableViewRowIndex* row) const; | |
219 | OSStatus GetItemState (DataBrowserItemID item, DataBrowserItemState* state) const; | |
5c6eb3a8 | 220 | |
e86edab0 | 221 | OSStatus IsUsedItemID(DataBrowserItemID itemID) const; // checks if the passed id is in use |
5c6eb3a8 | 222 | |
e86edab0 | 223 | OSStatus RevealItem(DataBrowserItemID item, DataBrowserPropertyID propertyID, DataBrowserRevealOptions options) const; |
5c6eb3a8 | 224 | |
e86edab0 RR |
225 | OSStatus RemoveItem(DataBrowserItemID container, DataBrowserItemID const* itemID) // removes a single item |
226 | { | |
227 | return this->RemoveItems(container,1,itemID,kDataBrowserItemNoProperty); | |
228 | } | |
229 | OSStatus RemoveItems(void) // removes all items | |
230 | { | |
231 | return this->RemoveItems(kDataBrowserNoItem,0,NULL,kDataBrowserItemNoProperty); | |
232 | } | |
233 | OSStatus RemoveItems(DataBrowserItemID container, UInt32 numItems, DataBrowserItemID const* items, DataBrowserPropertyID preSortProperty); | |
5c6eb3a8 | 234 | |
e86edab0 RR |
235 | OSStatus UpdateItem(DataBrowserItemID container, DataBrowserItemID const* item) // updates all columns of the passed item |
236 | { | |
237 | return this->UpdateItems(container,1,item,kDataBrowserItemNoProperty,kDataBrowserItemNoProperty); | |
238 | } | |
239 | OSStatus UpdateItems(void) // updates all items | |
240 | { | |
241 | return this->UpdateItems(kDataBrowserNoItem,0,NULL,kDataBrowserItemNoProperty,kDataBrowserItemNoProperty); | |
242 | } | |
243 | OSStatus UpdateItems(DataBrowserItemID container, UInt32 numItems, DataBrowserItemID const* items, DataBrowserPropertyID preSortProperty, DataBrowserPropertyID propertyID) const; | |
5c6eb3a8 | 244 | |
5c6eb3a8 | 245 | // |
e86edab0 | 246 | // item selection |
5c6eb3a8 | 247 | // |
e86edab0 RR |
248 | size_t GetSelectedItemIDs(wxArrayDataBrowserItemID& itemIDs) const; // returns the number of selected item and the item IDs in the array |
249 | OSStatus GetSelectionAnchor(DataBrowserItemID *first, DataBrowserItemID *last) const; | |
250 | OSStatus GetSelectionFlags (DataBrowserSelectionFlags* flags) const; | |
5c6eb3a8 | 251 | |
e86edab0 RR |
252 | bool IsItemSelected(DataBrowserItemID item) const; |
253 | ||
254 | OSStatus SetSelectionFlags(DataBrowserSelectionFlags flags); | |
255 | OSStatus SetSelectedItems (UInt32 numItems, DataBrowserItemID const* itemIDs, DataBrowserSetOption operation); | |
5c6eb3a8 SC |
256 | |
257 | // | |
e86edab0 | 258 | // item sorting |
5c6eb3a8 | 259 | // |
e86edab0 RR |
260 | OSStatus GetSortOrder (DataBrowserSortOrder* order) const; |
261 | OSStatus GetSortProperty(DataBrowserPropertyID* propertyID) const; | |
5c6eb3a8 | 262 | |
e86edab0 | 263 | OSStatus Resort(DataBrowserItemID container=kDataBrowserNoItem, Boolean sortChildren=true); |
5c6eb3a8 | 264 | |
e86edab0 RR |
265 | OSStatus SetSortOrder (DataBrowserSortOrder order); |
266 | OSStatus SetSortProperty(DataBrowserPropertyID propertyID); | |
5829b303 | 267 | |
5c6eb3a8 | 268 | // |
e86edab0 | 269 | // container handling |
5c6eb3a8 | 270 | // |
e86edab0 RR |
271 | OSStatus CloseContainer(DataBrowserItemID containerID); |
272 | ||
273 | OSStatus OpenContainer(DataBrowserItemID containerID); | |
5829b303 | 274 | |
e86edab0 | 275 | protected : |
5c6eb3a8 | 276 | // |
e86edab0 | 277 | // standard callback functions |
5c6eb3a8 | 278 | // |
e86edab0 RR |
279 | static pascal Boolean DataBrowserCompareProc (ControlRef browser, DataBrowserItemID itemOneID, DataBrowserItemID itemTwoID, DataBrowserPropertyID sortProperty); |
280 | static pascal void DataBrowserGetContextualMenuProc(ControlRef browser, MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* selection); | |
281 | static pascal OSStatus DataBrowserGetSetItemDataProc (ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean getValue); | |
282 | static pascal void DataBrowserItemNotificationProc (ControlRef browser, DataBrowserItemID itemID, DataBrowserItemNotification message, DataBrowserItemDataRef itemData); | |
5c6eb3a8 | 283 | |
e86edab0 RR |
284 | virtual Boolean DataBrowserCompareProc (DataBrowserItemID itemOneID, DataBrowserItemID itemTwoID, DataBrowserPropertyID sortProperty) = 0; |
285 | virtual void DataBrowserGetContextualMenuProc(MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* selection) = 0; | |
286 | virtual OSStatus DataBrowserGetSetItemDataProc (DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean getValue) = 0; | |
287 | virtual void DataBrowserItemNotificationProc (DataBrowserItemID itemID, DataBrowserItemNotification message, DataBrowserItemDataRef itemData) = 0; | |
5c6eb3a8 SC |
288 | |
289 | // | |
e86edab0 | 290 | // callback functions for customized types |
5c6eb3a8 | 291 | // |
e86edab0 RR |
292 | static pascal void DataBrowserDrawItemProc(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice); |
293 | static pascal Boolean DataBrowserEditItemProc(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, CFStringRef theString, Rect* maxEditTextRect, Boolean* shrinkToFit); | |
294 | static pascal Boolean DataBrowserHitTestProc (ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Rect const* mouseRect); | |
295 | static pascal DataBrowserTrackingResult DataBrowserTrackingProc(ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Point startPt, EventModifiers modifiers); | |
5c6eb3a8 | 296 | |
e86edab0 RR |
297 | virtual void DataBrowserDrawItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice) = 0; |
298 | virtual Boolean DataBrowserEditItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, CFStringRef theString, Rect* maxEditTextRect, Boolean* shrinkToFit) = 0; | |
299 | virtual Boolean DataBrowserHitTestProc (DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Rect const* mouseRect) = 0; | |
300 | virtual DataBrowserTrackingResult DataBrowserTrackingProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Point startPt, EventModifiers modifiers) = 0; | |
5c6eb3a8 | 301 | |
e86edab0 RR |
302 | // |
303 | // callback functions for drag & drop | |
304 | /// | |
305 | static pascal Boolean DataBrowserAcceptDragProc (ControlRef browser, DragReference dragRef, DataBrowserItemID itemID); | |
306 | static pascal Boolean DataBrowserAddDragItemProc(ControlRef browser, DragReference dragRef, DataBrowserItemID itemID, ItemReference* itemRef); | |
307 | static pascal Boolean DataBrowserReceiveDragProc(ControlRef browser, DragReference dragRef, DataBrowserItemID itemID); | |
5c6eb3a8 | 308 | |
e86edab0 RR |
309 | virtual Boolean DataBrowserAcceptDragProc (DragReference dragRef, DataBrowserItemID itemID) = 0; |
310 | virtual Boolean DataBrowserAddDragItemProc(DragReference dragRef, DataBrowserItemID itemID, ItemReference* itemRef) = 0; | |
311 | virtual Boolean DataBrowserReceiveDragProc(DragReference dragRef, DataBrowserItemID itemID) = 0; | |
5c6eb3a8 | 312 | |
e86edab0 | 313 | private: |
5c6eb3a8 | 314 | // |
e86edab0 | 315 | // wxWidget internal stuff |
5c6eb3a8 | 316 | // |
e86edab0 RR |
317 | DECLARE_ABSTRACT_CLASS(wxMacDataBrowserTableViewControl) |
318 | }; | |
5c6eb3a8 | 319 | |
e86edab0 RR |
320 | // ============================================================================ |
321 | // wxMacDataBrowserListViewControl | |
322 | // ============================================================================ | |
5c6eb3a8 | 323 | // |
e86edab0 RR |
324 | // This class is a wrapper for the native browser's list view style. It expands |
325 | // the inherited functionality of the table view control class. | |
326 | // The term list view is in this case Mac OS X specific and is not related | |
327 | // to any wxWidget naming conventions. | |
5c6eb3a8 | 328 | // |
e86edab0 | 329 | class wxMacDataBrowserListViewControl : public wxMacDataBrowserTableViewControl |
5c6eb3a8 SC |
330 | { |
331 | public: | |
5c6eb3a8 | 332 | // |
e86edab0 | 333 | // constructors / destructor |
5c6eb3a8 | 334 | // |
e86edab0 RR |
335 | wxMacDataBrowserListViewControl(wxWindow* peer, wxPoint const& pos, wxSize const& size, long style) : wxMacDataBrowserTableViewControl(peer,pos,size,style) |
336 | { | |
337 | } | |
5c6eb3a8 SC |
338 | |
339 | // | |
e86edab0 | 340 | // column handling |
5c6eb3a8 | 341 | // |
e86edab0 | 342 | OSStatus AddColumn(DataBrowserListViewColumnDesc *columnDesc, DataBrowserTableViewColumnIndex position); |
5c6eb3a8 SC |
343 | |
344 | protected: | |
345 | private: | |
5c6eb3a8 SC |
346 | }; |
347 | ||
5c6eb3a8 | 348 | |
e86edab0 RR |
349 | // ============================================================================ |
350 | // wxMacDataViewDataBrowserListViewControl | |
351 | // ============================================================================ | |
352 | // | |
353 | // This is the internal interface class between wxDataViewCtrl (wxWidget) and | |
354 | // the native data browser (Mac OS X carbon). | |
355 | // | |
356 | class wxMacDataViewDataBrowserListViewControl : public wxMacDataBrowserListViewControl, public wxDataViewWidgetImpl | |
5c6eb3a8 SC |
357 | { |
358 | public: | |
5c6eb3a8 | 359 | // |
e86edab0 | 360 | // constructors / destructor |
5c6eb3a8 | 361 | // |
e86edab0 RR |
362 | wxMacDataViewDataBrowserListViewControl(wxWindow* peer, wxPoint const& pos, wxSize const& size, long style); |
363 | ||
364 | // | |
365 | // column related methods (inherited from wxDataViewWidgetImpl) | |
366 | // | |
367 | virtual bool ClearColumns (void); | |
368 | virtual bool DeleteColumn (wxDataViewColumn* columnPtr); | |
369 | virtual void DoSetExpanderColumn(wxDataViewColumn const* columnPtr); | |
370 | virtual wxDataViewColumn* GetColumn (unsigned int pos) const; | |
371 | virtual int GetColumnPosition (wxDataViewColumn const* columnPtr) const; | |
372 | virtual bool InsertColumn (unsigned int pos, wxDataViewColumn* columnPtr); | |
373 | ||
374 | // | |
375 | // item related methods (inherited from wxDataViewWidgetImpl) | |
376 | // | |
377 | virtual bool Add (wxDataViewItem const& parent, wxDataViewItem const& item); | |
378 | virtual bool Add (wxDataViewItem const& parent, wxDataViewItemArray const& items); | |
379 | virtual void Collapse (wxDataViewItem const& item); | |
380 | virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr); | |
381 | virtual void Expand (wxDataViewItem const& item); | |
382 | virtual unsigned int GetCount (void) const; | |
383 | virtual wxRect GetRectangle (wxDataViewItem const& item, wxDataViewColumn const* columnPtr); | |
384 | virtual bool IsExpanded (wxDataViewItem const& item) const; | |
385 | virtual bool Reload (void); | |
386 | virtual bool Remove (wxDataViewItem const& parent, wxDataViewItem const& item); | |
387 | virtual bool Remove (wxDataViewItem const& parent, wxDataViewItemArray const& item); | |
388 | virtual bool Update (wxDataViewColumn const* columnPtr); | |
389 | virtual bool Update (wxDataViewItem const& parent, wxDataViewItem const& item); | |
390 | virtual bool Update (wxDataViewItem const& parent, wxDataViewItemArray const& items); | |
391 | ||
392 | // | |
393 | // model related methods | |
394 | // | |
395 | virtual bool AssociateModel(wxDataViewModel* model); | |
5c6eb3a8 | 396 | |
e86edab0 RR |
397 | // |
398 | // selection related methods (inherited from wxDataViewWidgetImpl) | |
399 | // | |
400 | virtual int GetSelections(wxDataViewItemArray& sel) const; | |
401 | virtual bool IsSelected (wxDataViewItem const& item) const; | |
402 | virtual void Select (wxDataViewItem const& item); | |
403 | virtual void SelectAll (void); | |
404 | virtual void Unselect (wxDataViewItem const& item); | |
405 | virtual void UnselectAll (void); | |
406 | ||
407 | // | |
408 | // sorting related methods | |
409 | // | |
410 | virtual wxDataViewColumn* GetSortingColumn (void) const; | |
411 | virtual void Resort (void); | |
412 | ||
413 | // | |
414 | // other methods (inherited from wxDataViewWidgetImpl) | |
415 | // | |
416 | virtual void DoSetIndent (int indent); | |
417 | virtual void HitTest (wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const; | |
418 | virtual void SetRowHeight(wxDataViewItem const& item, unsigned int height); | |
419 | virtual void OnSize (void); | |
420 | ||
421 | // | |
422 | // other methods | |
423 | // | |
424 | wxDataViewCtrl* GetDataViewCtrl(void) const | |
5c6eb3a8 | 425 | { |
e86edab0 | 426 | return dynamic_cast<wxDataViewCtrl*>(this->GetWXPeer()); |
5c6eb3a8 SC |
427 | } |
428 | ||
5c6eb3a8 | 429 | protected: |
5c6eb3a8 | 430 | // |
e86edab0 RR |
431 | // standard callback functions (inherited from wxMacDataBrowserTableViewControl) |
432 | // | |
433 | virtual Boolean DataBrowserCompareProc (DataBrowserItemID itemOneID, DataBrowserItemID itemTwoID, DataBrowserPropertyID sortProperty); | |
434 | virtual void DataBrowserItemNotificationProc (DataBrowserItemID itemID, DataBrowserItemNotification message, DataBrowserItemDataRef itemData); | |
435 | virtual void DataBrowserGetContextualMenuProc(MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* selection); | |
436 | virtual OSStatus DataBrowserGetSetItemDataProc (DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemDataRef itemData, Boolean getValue); | |
5c6eb3a8 | 437 | |
e86edab0 RR |
438 | // |
439 | // callback functions for customized types (inherited from wxMacDataBrowserTableViewControl) | |
440 | // | |
441 | virtual void DataBrowserDrawItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice); | |
442 | virtual Boolean DataBrowserEditItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, CFStringRef theString, Rect* maxEditTextRect, Boolean* shrinkToFit); | |
443 | virtual Boolean DataBrowserHitTestProc (DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Rect const* mouseRect); | |
444 | virtual DataBrowserTrackingResult DataBrowserTrackingProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, Rect const* theRect, Point startPt, EventModifiers modifiers); | |
5c6eb3a8 | 445 | |
e86edab0 RR |
446 | // |
447 | // callback functions for drag & drop (inherited from wxMacDataBrowserTableViewControl) | |
448 | // | |
449 | virtual Boolean DataBrowserAcceptDragProc (DragReference dragRef, DataBrowserItemID itemID); | |
450 | virtual Boolean DataBrowserAddDragItemProc(DragReference dragRef, DataBrowserItemID itemID, ItemReference* itemRef); | |
451 | virtual Boolean DataBrowserReceiveDragProc(DragReference dragRef, DataBrowserItemID itemID); | |
5829b303 | 452 | |
e86edab0 RR |
453 | // |
454 | // drag & drop helper methods | |
455 | // | |
456 | wxDataFormat GetDnDDataFormat(wxDataObjectComposite* dataObjects); | |
457 | wxDataObjectComposite* GetDnDDataObjects(DragReference dragRef, ItemReference itemRef) const; // create the data objects from the native dragged object | |
5c6eb3a8 | 458 | |
e86edab0 RR |
459 | // |
460 | // other methods | |
461 | // | |
462 | wxDataViewColumn* GetColumnPtr(DataBrowserPropertyID propertyID) const; // returns for the passed property the corresponding pointer to a column; NULL is returned if not found | |
5c6eb3a8 | 463 | |
e86edab0 | 464 | private: |
5c6eb3a8 SC |
465 | }; |
466 | ||
e86edab0 | 467 | typedef wxMacDataViewDataBrowserListViewControl* wxMacDataViewDataBrowserListViewControlPointer; |
5c6eb3a8 | 468 | |
e86edab0 | 469 | #endif // WX_GUI |
5c6eb3a8 | 470 | #endif // _WX_MACCARBONDATAVIEWCTRL_H_ |