Link against: aknhlist.lib
#include <aknsinglestyletreelist.h>
Inherits CAknTreeList.
Single style hierarchical list is a hierarchical list specialisation for a list type with simple list items, which contain only a folder or file icon, single line of text and some optional icons. This class provides only the specialisation specific APIs for the list usage. The common hierarchical list APIs are located in its base class.
Here is an example of how an instance of window-owning single style hierarchical list can be constructed:
// Construct the list, set its size, and make it visible. CAknSingleStyleTreeList* list = CAknSingleStyleTreeList::NewL(); list->SetRect( rect ); list->MakeVisible( ETrue );
Adding items to the constructed list:
// Add a node to the top-most level of the tree. _LIT( KNodeText, "Node" ); TUint32 flags = CAknSingleStyleTreeList::EPersistent; TAknTreeItemID node = list->AddNodeL( KAknTreeIIDRoot, KNodeText, flags, EFalse ); // Add a leaf to the previously added node. _LIT( KLeafText, "Leaf" ); TAknTreeItemID leaf = list->AddLeafL( node, KLeafText, flags, EFalse );
Changing icons for the list items:
// Add icon to the list and set it to existing list item. TInt iconId = list->AddIconL( KAknsIIDQgnPropBtCarkit, AknIconUtils::AvkonIconFileName(), EMbmAvkonQgn_prop_bt_carkit, EMbmAvkonQgn_prop_bt_carkit_mask, EAspectRatioPreserved ); list->SetIcon( leaf, CAknSingleStyleTreeList::ELeaf, iconId, ETrue );
Public Types | |
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 style hierarchical list. More... | |
enum | TOrdering { EAscendingAlphabeticalOrdering, EDescendingAlphabeticalOrdering } |
Single style hierarchical list ordering types. More... | |
enum | TSingleStyleItemFlags { EPersistent = 0x01, EMarked = 0x02, EExpanded = 0x04, ENonEmpty = 0x08 } |
Flags usable with single style tree items. More... | |
Public Member Functions | |
virtual | ~CAknSingleStyleTreeList () |
Destructor. | |
IMPORT_C TAknTreeItemID | AddLeafL (TAknTreeItemID aParent, const TDesC &aText, TUint32 aFlags, TBool aDrawNow) |
Adds new leaf (file) to single style hierarchical list. | |
IMPORT_C TAknTreeItemID | AddNodeL (TAknTreeItemID aParent, const TDesC &aText, TUint32 aFlags, TBool aDrawNow) |
Adds new node (folder) to single style hierarchical list. | |
IMPORT_C void | SortL (TOrdering aOrdering, TBool aDrawNow) |
Sorts the hierarchical list according to the given ordering. | |
IMPORT_C void | SetTextL (TAknTreeItemID aItem, const TDesC &aText, TBool aDrawNow) |
Changes the text of the specified item. | |
IMPORT_C const TDesC & | Text (TAknTreeItemID aItem) const |
Returns the text field of the specified item. | |
IMPORT_C void | SetIcon (TAknTreeItemID aItem, TIconType aType, TInt aIconId, TBool aDrawNow) |
Sets an icon for a list item. | |
IMPORT_C TInt | Icon (TAknTreeItemID aItem, TIconType aType) const |
Returns the icon ID set for the specified icon of a list item. | |
void | SetFlags (TUint32 aFlags) |
From CAknTreeList. | |
Static Public Member Functions | |
static IMPORT_C CAknSingleStyleTreeList * | NewL () |
Two phased constructor. | |
static IMPORT_C CAknSingleStyleTreeList * | NewL (const CCoeControl &aContainer) |
Two phased constructor. | |
static IMPORT_C CAknSingleStyleTreeList * | NewLC () |
Otherwise identical to NewL() , but leaves the newly created object in the cleanup stack. | |
static IMPORT_C CAknSingleStyleTreeList * | NewLC (const CCoeControl &aContainer) |
Otherwise identical to NewL( const CCoeControl& ) , but leaves the newly created object in the cleanup stack. |
|
|
Single style hierarchical list ordering types. |
|
Flags usable with single style tree items. |
|
Destructor. |
|
Adds new leaf (file) to single style hierarchical list.
New leaf with the specified content is created and added to the specified parent node. Constant
|
|
Adds new node (folder) to single style hierarchical list.
New node with the specified content is created and added to the specified parent node. Constant
|
|
Returns the icon ID set for the specified icon of a list item.
|
|
Two phased constructor. Creates a new single style hierarchical list instance as non-window-owning component control to the compound control given as parameter.
|
|
Two phased constructor. Creates a new single style hierarchical list instance as window-owning control.
|
|
Otherwise identical to Two phased constructor. Creates a new single style hierarchical 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 list instance as window-owning control.
|
|
From CAknTreeList. Sets the flags for the single style hierarchical 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
|
|
Changes the text of the specified item. Note that the change of text might also affect the item's position in the list, when the items are ordered based on their text fields.
|
|
Sorts the hierarchical list according to the given ordering.
|
|
Returns the text field of the specified item.
|