Link against: aknhlist.lib
#include <aknsinglecolumnstyletreelist.h>
Inherits CAknTreeList.
Single style hierarchical column list is hierarchical list type that can contain three types of items: Core data rows, simple data rows, and subtitle rows.
Core data row is a list item that consists of two text columns in portrait mode, and in addition to those, it can have an optional third text column in landscape mode. Core data row can contain one icon in front of text columns, and up to two optional indicator icons at the other end of the row.
Simple data row is a list item that consists of single text column, and can have one leaf icon in front of the text, and one optional icon at the other end.
Subtitle row is otherwise similar to simple data row, but as core data row and simple data row are tree leaves that cannot contain other list items as children, the subtitle row is a tree node that can be used in forming the hierarchy for the list. As a node, subtitle row has expand and collapse functionality, and it can group other tree items, including other subtitle rows. However, since hierarchical column list does not support indention of tree items or drawing of tree structure lines, the hierarchy should be limited to two levels for clarity.
The CAknSingleColumnStyleTreeList
class contains only methods for constructing the list, constructing and adding the list type specific items to the list,
and setting and getting item type specific properties. Other methods for list usage can be found from its parent class.
// Construct the list, set its size, and make it visible. CAknSingleColumnStyleTreeList* list = CAknSingleColumnStyleTreeList::NewL(); list->SetRect( rect ); list->MakeVisible( ETrue );
Adding items to the constructed list:
TUint32 flags = CAknSingleColumnStyleTreeList::EPersistent; TBool drawNow = EFalse; // Add simple data row to the top-most level of the tree. _LIT( KSimpleDataRowText, "Simple data row" ); TAknTreeItemID simpleItem = list->AddSimpleDataRowL( KAknTreeIIDRoot, KSimpleDataRowText, flags, drawNow ); // Add subtitle row to the to the top-most level of the tree. _LIT( KSubtitleRowText, "Subtitle row" ); TAknTreeItemID subtitle = list->AddSubtitleRowL( KAknTreeIIDRoot, KSubtitleRowText, flags, drawNow ); // Add core data row to the previously added subtitle row. _LIT( KCoreDataRowText, "Core data row" ); TAknTreeItemID coreItem = list->AddCoreDataRowL( subtitle, KCoreDataRowText, KNulDesC, flags, drawNow );
Public Types |
|
enum | TItemType { ENone = 0, ETreeRoot = 1, ESimpleDataRow = 2, ECoreDataRow = 3, ESubtitleRow = 4 } |
Item types used in single style hierarchical column list. More... |
|
enum | TItemFlags { EPersistent = 0x01, EMarked = 0x02, EExpanded = 0x04, ENonEmpty = 0x08, EEmphasis = 0x10, EMarkingDisabled = 0x20 } |
Flags usable with single column style tree items. More... |
|
enum | TIconType { ELeaf = 0, EHighlightedLeaf = 1, EExpandedNode = 2, EHighlightedExpandedNode = 3, ECollapsedNode = 4, EHighlightedCollapsedNode = 5, EOptionalIcon1 = 6, EHighlightedOptionalIcon1 = 7, EOptionalIcon2 = 8, EHighlightedOptionalIcon2 = 9 } |
Icon types usable with single column style hierarchical list. More... |
|
Public Member Functions |
|
virtual | ~CAknSingleColumnStyleTreeList () |
Destructor. |
|
IMPORT_C TAknTreeItemID | AddSimpleDataRowL (TAknTreeItemID aParent, const TDesC &aText, TUint32 aFlags, TBool aDrawNow) |
Adds new simple data row to single style hierarchical column list. |
|
IMPORT_C TAknTreeItemID | AddCoreDataRowL (TAknTreeItemID aParent, const TDesC &aFirstColumn, const TDesC &aSecondColumn, TUint32 aFlags, TBool aDrawNow) |
Adds new core data row to single style hierarchical column list. |
|
IMPORT_C TAknTreeItemID | AddCoreDataRowL (TAknTreeItemID aParent, const TDesC &aFirstColumnd, const TDesC &aSecondColumn, const TDesC &aThirdColumn, TUint32 aFlags, TBool aDrawNow) |
Adds new core data row to single style hierarchical column list. |
|
IMPORT_C TAknTreeItemID | AddSubtitleRowL (TAknTreeItemID aParent, const TDesC &aText, TUint32 aFlags, TBool aDrawNow) |
Adds new subtitle row to single style hierarchical column list. |
|
IMPORT_C const TDesC & | Text (TAknTreeItemID aItem) const |
Returns the text field of the specified list item. |
|
IMPORT_C const TDesC & | Text (TAknTreeItemID aItem, TInt aColumnIndex) const |
Returns the specified text column of specified list item. |
|
IMPORT_C void | SetTextL (TAknTreeItemID aItem, const TDesC &aText, TBool aDrawNow) |
Sets the text for specified hierarchical column list item. |
|
IMPORT_C void | SetTextL (TAknTreeItemID aItem, const TDesC &aText, TInt aColumnIndex, TBool aDrawNow) |
Sets the text for specified column of specified hierarchical column list item. |
|
IMPORT_C TBool | IsEmphasised (TAknTreeItemID aItem) const |
Checks whether the specified core data row is emphasised. |
|
IMPORT_C void | SetEmphasis (TAknTreeItemID aItem, TBool aEmphasis, TBool aDrawNow) |
Sets the emphasis for specified core data row. |
|
IMPORT_C TBool | IsThirdColumnEnabled (TAknTreeItemID aItem) const |
Checks whether the third text column is enabled for specified core data row. |
|
IMPORT_C void | EnableThirdColumn (TAknTreeItemID aItem, TBool aEnable, TBool aDrawNow) |
Enables or disables third text column usage in landscape mode for specified core data row. |
|
IMPORT_C TInt | Icon (TAknTreeItemID aItem, TIconType aType) const |
Returns the icon ID set for the specified icon of a list item. |
|
IMPORT_C void | SetIcon (TAknTreeItemID aItem, TIconType aType, TInt aIconId, TBool aDrawNow) |
Sets an icon for a list item. |
|
IMPORT_C TItemType | ItemType (TAknTreeItemID aItem) const |
Checks the type of the specified list item. |
|
void | SetFlags (TUint32 aFlags) |
From CAknTreeList. |
|
void | HandleResourceChange (TInt aType) |
From CAknTreeList. |
|
Static Public Member Functions |
|
static IMPORT_C CAknSingleColumnStyleTreeList * | NewL () |
Two phased constructor. |
|
static IMPORT_C CAknSingleColumnStyleTreeList * | NewL (const CCoeControl &aContainer) |
Two phased constructor. |
|
static IMPORT_C CAknSingleColumnStyleTreeList * | NewLC () |
Otherwise identical to NewL() , but leaves the newly created object in the cleanup stack. |
|
static IMPORT_C CAknSingleColumnStyleTreeList * | NewLC (const CCoeControl &aContainer) |
Otherwise identical to NewL( const CCoeControl& ) , but leaves the newly created object in the cleanup stack. |
|
|
Flags usable with single column style tree items. These flags can be given, when adding new items to the list. |
|
Item types used in single style hierarchical column list.
The type of each item can be get with |
|
Destructor. |
|
Adds new core data row to single style hierarchical column list.
New core data row containing the specified three text columns is constructed and added to the specified parent node. Constant
|
|
Adds new core data row to single style hierarchical column list.
New core data row containing specified two text columns is constructed and added to the specified parent node. Constant
|
|
Adds new simple data row to single style hierarchical column list.
New simple data row with the specified content is constructed and added to the specified parent node. Constant
|
|
Adds new subtitle row to single style hierarchical column list.
New row with the given content is constructed and added to the specified parent node. Constant
|
|
Enables or disables third text column usage in landscape mode for specified core data row.
|
|
From CAknTreeList. Handles resource changes.
Reimplemented from CAknTreeList. |
|
Returns the icon ID set for the specified icon of a list item.
|
|
Checks whether the specified core data row is emphasised. When core data row is emphasized, it uses different text layout for emphasising the row.
|
|
Checks whether the third text column is enabled for specified core data row. If third text column is enabled, it is shown for the item in landscape mode, when list has enough space for the third column.
|
|
Checks the type of the specified list item.
|
|
Two phased constructor. Creates a new single style hierarchical column list instance as non-window-owning component control to the compound control given as parameter.
|
|
Two phased constructor. Creates a new single style hierarchical column list instance as window-owning control.
|
|
Otherwise identical to Two phased constructor. Creates a new single style hierarchical column list instance as non-window-owning component control to the compound control given as parameter.
|
|
Otherwise identical to Two phased constructor. Creates a new single style hierarchical column list instance as window-owning control.
|
|
Sets the emphasis for specified core data row.
|
|
From CAknTreeList. Sets the flags for the single style hierarchical column list.
Reimplemented from CAknTreeList. |
|
Sets an icon for a list item.
Every list item may have several icons, so the correct icon has to be specified with the icon type. Note that the type has
to be applicable to the specified list item. Pre-defined icon IDs can be found within
|
|
Sets the text for specified column of specified hierarchical column list item. Non-zero value for column list can only be used with core data row, as the other row types contain only one text column.
|
|
Sets the text for specified hierarchical column list item.
|
|
Returns the specified text column of specified list item. If the text for specified column is not set, or the specified column does not exist, empty descriptor is returned.
|
|
Returns the text field of the specified list item.
|