class CCL::AbstractItemModel
Overview
Base class for model implementation. More…
#include <iitemmodel.h> class AbstractItemModel: public CCL::IItemModel { public: // methods void CCL_API viewAttached (IItemView* itemView); virtual void CCL_API viewDetached (IItemView* itemView); virtual int CCL_API countFlatItems (); virtual tbool CCL_API getRootItem (ItemIndex& index); virtual tbool CCL_API isItemFolder (ItemIndexRef index); virtual tbool CCL_API canExpandItem (ItemIndexRef index); virtual tbool CCL_API canAutoExpandItem (ItemIndexRef index); virtual tbool CCL_API getSubItems (IUnknownList& items, ItemIndexRef index); virtual IItemSelection*CCL_API getSelection (); virtual tbool CCL_API getItemTitle (String& title, ItemIndexRef index); virtual tbool CCL_API getUniqueItemName ( MutableCString& name, ItemIndexRef index ); virtual IImage*CCL_API getItemIcon (ItemIndexRef index); virtual IImage*CCL_API getItemThumbnail (ItemIndexRef index); virtual tbool CCL_API getItemTooltip ( String& tooltip, ItemIndexRef index, int column ); virtual tbool CCL_API canSelectItem (ItemIndexRef index); virtual tbool CCL_API getItemAccessibilityInfo ( AccessibilityInfo& info, ItemIndexRef index, int column ) const; virtual tbool CCL_API onItemFocused (ItemIndexRef index); virtual tbool CCL_API openItem ( ItemIndexRef index, int column, const EditInfo& info ); virtual tbool CCL_API canRemoveItem (ItemIndexRef index); virtual tbool CCL_API removeItem (ItemIndexRef index); virtual tbool CCL_API canInsertData ( ItemIndexRef index, int column, const IUnknownList& data, IDragSession* session, IView* targetView = nullptr ); virtual tbool CCL_API insertData ( ItemIndexRef index, int column, const IUnknownList& data, IDragSession* session ); virtual tbool CCL_API editCell ( ItemIndexRef index, int column, const EditInfo& info ); virtual tbool CCL_API drawCell ( ItemIndexRef index, int column, const DrawInfo& info ); virtual tbool CCL_API drawItem (ItemIndexRef index, const DrawInfo& info); virtual tbool CCL_API drawIconOverlay (ItemIndexRef index, const DrawInfo& info); virtual StringID CCL_API getItemBackground (ItemIndexRef index); virtual tbool CCL_API measureCellContent ( Rect& size, ItemIndexRef index, int column, const StyleInfo& info ); virtual tbool CCL_API createColumnHeaders (IColumnHeaderList& list); virtual tbool CCL_API getSortColumnID (MutableCString& columnID, tbool& upwards); virtual IUnknown*CCL_API createDragSessionData (ItemIndexRef index); virtual tbool CCL_API appendItemMenu ( IContextMenu& menu, ItemIndexRef item, const IItemSelection& selection ); virtual tbool CCL_API interpretCommand ( const CommandMsg& msg, ItemIndexRef item, const IItemSelection& selection ); virtual ITouchHandler*CCL_API createTouchHandler ( ItemIndexRef index, int column, const EditInfo& info ); };
Inherited Members
public: // structs struct AccessibilityInfo; struct DrawInfo; struct EditInfo; struct StyleInfo; // methods virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0; virtual unsigned int CCL_API retain () = 0; virtual unsigned int CCL_API release () = 0; virtual void CCL_API viewDetached (IItemView* itemView) = 0; virtual int CCL_API countFlatItems () = 0; virtual tbool CCL_API getRootItem (ItemIndex& index) = 0; virtual tbool CCL_API isItemFolder (ItemIndexRef index) = 0; virtual tbool CCL_API canExpandItem (ItemIndexRef index) = 0; virtual tbool CCL_API canAutoExpandItem (ItemIndexRef index) = 0; virtual tbool CCL_API getSubItems (IUnknownList& items, ItemIndexRef index) = 0; virtual IItemSelection*CCL_API getSelection () = 0; virtual tbool CCL_API getItemTitle (String& title, ItemIndexRef index) = 0; virtual tbool CCL_API getUniqueItemName ( MutableCString& name, ItemIndexRef index ) = 0; virtual IImage*CCL_API getItemIcon (ItemIndexRef index) = 0; virtual IImage*CCL_API getItemThumbnail (ItemIndexRef index) = 0; virtual tbool CCL_API getItemTooltip ( String& tooltip, ItemIndexRef index, int column ) = 0; virtual tbool CCL_API canSelectItem (ItemIndexRef index) = 0; virtual tbool CCL_API getItemAccessibilityInfo ( AccessibilityInfo& info, ItemIndexRef index, int column ) const = 0; virtual tbool CCL_API onItemFocused (ItemIndexRef index) = 0; virtual tbool CCL_API openItem ( ItemIndexRef index, int column, const EditInfo& info ) = 0; virtual tbool CCL_API canRemoveItem (ItemIndexRef index) = 0; virtual tbool CCL_API removeItem (ItemIndexRef index) = 0; virtual tbool CCL_API canInsertData ( ItemIndexRef index, int column, const IUnknownList& data, IDragSession* session, IView* targetView = nullptr ) = 0; virtual tbool CCL_API insertData ( ItemIndexRef index, int column, const IUnknownList& data, IDragSession* session ) = 0; virtual tbool CCL_API editCell ( ItemIndexRef index, int column, const EditInfo& info ) = 0; virtual tbool CCL_API drawCell ( ItemIndexRef index, int column, const DrawInfo& info ) = 0; virtual tbool CCL_API drawIconOverlay (ItemIndexRef index, const DrawInfo& info) = 0; virtual StringID CCL_API getItemBackground (ItemIndexRef index) = 0; virtual tbool CCL_API measureCellContent ( Rect& size, ItemIndexRef index, int column, const StyleInfo& info ) = 0; virtual tbool CCL_API drawItem (ItemIndexRef index, const DrawInfo& info) = 0; virtual tbool CCL_API createColumnHeaders (IColumnHeaderList& list) = 0; virtual tbool CCL_API getSortColumnID (MutableCString& columnID, tbool& upwards) = 0; virtual IUnknown*CCL_API createDragSessionData (ItemIndexRef index) = 0; virtual tbool CCL_API appendItemMenu ( IContextMenu& menu, ItemIndexRef item, const IItemSelection& selection ) = 0; virtual tbool CCL_API interpretCommand ( const CommandMsg& msg, ItemIndexRef item, const IItemSelection& selection ) = 0; virtual ITouchHandler*CCL_API createTouchHandler ( ItemIndexRef index, int column, const EditInfo& info ) = 0;
Detailed Documentation
Base class for model implementation.
Methods
virtual void CCL_API viewDetached (IItemView* itemView)
View ends to use the model.
virtual int CCL_API countFlatItems ()
Get item count of (flat) list.
virtual tbool CCL_API getRootItem (ItemIndex& index)
Get tree root item.
virtual tbool CCL_API isItemFolder (ItemIndexRef index)
Check if item is a folder.
virtual tbool CCL_API canExpandItem (ItemIndexRef index)
Check if item can be expanded.
virtual tbool CCL_API canAutoExpandItem (ItemIndexRef index)
Check if item can be expanded automatically on click (if tree view has style kTreeViewAutoExpand).
virtual tbool CCL_API getSubItems (IUnknownList& items, ItemIndexRef index)
Get children of given item.
virtual IItemSelection*CCL_API getSelection ()
Get special item selection implementation provided by model.
Return null to use default selection of view.
virtual tbool CCL_API getItemTitle (String& title, ItemIndexRef index)
Get title of specified item.
virtual tbool CCL_API getUniqueItemName ( MutableCString& name, ItemIndexRef index )
Get a unique name (unique among siblings) of specified item.
Must not contain a ‘/’. Used for storing expand states of items.
virtual IImage*CCL_API getItemIcon (ItemIndexRef index)
Get icon of specified item.
virtual IImage*CCL_API getItemThumbnail (ItemIndexRef index)
Get thumbnail of specified item.
virtual tbool CCL_API getItemTooltip ( String& tooltip, ItemIndexRef index, int column )
Get tooltip of specified item.
virtual tbool CCL_API canSelectItem (ItemIndexRef index)
Check if item can be selected.
virtual tbool CCL_API getItemAccessibilityInfo ( AccessibilityInfo& info, ItemIndexRef index, int column ) const
Get accessibility info.
virtual tbool CCL_API onItemFocused (ItemIndexRef index)
Item was focused.
virtual tbool CCL_API openItem ( ItemIndexRef index, int column, const EditInfo& info )
Item was double-clicked, or [Enter] key was pressed.
virtual tbool CCL_API canRemoveItem (ItemIndexRef index)
Check if item can be removed.
virtual tbool CCL_API removeItem (ItemIndexRef index)
Item should be removed (e.g.
delete key pressed or dropped outside during drag session).
virtual tbool CCL_API canInsertData ( ItemIndexRef index, int column, const IUnknownList& data, IDragSession* session, IView* targetView = nullptr )
Check if data can be inserted (during drag session).
virtual tbool CCL_API insertData ( ItemIndexRef index, int column, const IUnknownList& data, IDragSession* session )
Insert data (during drag session).
virtual tbool CCL_API editCell ( ItemIndexRef index, int column, const EditInfo& info )
Edit cell.
virtual tbool CCL_API drawCell ( ItemIndexRef index, int column, const DrawInfo& info )
Draw cell in list or tree view.
virtual tbool CCL_API drawItem (ItemIndexRef index, const DrawInfo& info)
Draw custom item, i.e.
framework draws nothing (requires kListViewDrawCustomItem style).
virtual tbool CCL_API drawIconOverlay (ItemIndexRef index, const DrawInfo& info)
Draw overlay on top of item icon (optional).
virtual StringID CCL_API getItemBackground (ItemIndexRef index)
Get an optional background color id for an item.
It is looked up in the visual style of the ItemView.
virtual tbool CCL_API measureCellContent ( Rect& size, ItemIndexRef index, int column, const StyleInfo& info )
Get size of cell content.
virtual tbool CCL_API createColumnHeaders (IColumnHeaderList& list)
Create column headers.
virtual tbool CCL_API getSortColumnID (MutableCString& columnID, tbool& upwards)
Get identifier of current sort column.
virtual IUnknown*CCL_API createDragSessionData (ItemIndexRef index)
Create object for dragging item data.
virtual tbool CCL_API appendItemMenu ( IContextMenu& menu, ItemIndexRef item, const IItemSelection& selection )
Append context menu for selected items.
virtual tbool CCL_API interpretCommand ( const CommandMsg& msg, ItemIndexRef item, const IItemSelection& selection )
Interpret commands for selected items.
virtual ITouchHandler*CCL_API createTouchHandler ( ItemIndexRef index, int column, const EditInfo& info )
Create touch handler.