CAknSingleStyleTreeList Class Reference

Link against: aknhlist.lib


#include <
aknsinglestyletreelist.h>

Inherits CAknTreeList.


Detailed Description

Single style hierarchical list.

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 );
See also:
CAknTreeList
Dll aknhlist.lib
Since:
S60 v3.2

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 CAknSingleStyleTreeListNewL ()
 Two phased constructor.
static IMPORT_C CAknSingleStyleTreeListNewL (const CCoeControl &aContainer)
 Two phased constructor.
static IMPORT_C CAknSingleStyleTreeListNewLC ()
 Otherwise identical to NewL(), but leaves the newly created object in the cleanup stack.
static IMPORT_C CAknSingleStyleTreeListNewLC (const CCoeControl &aContainer)
 Otherwise identical to NewL( const CCoeControl& ), but leaves the newly created object in the cleanup stack.

Member Enumeration Documentation

enum CAknSingleStyleTreeList::TIconType
 

Icon types usable with single style hierarchical list.

Normal icons are used when the list item is not focused, and highlighted icons are used when list item is focused. Normal icons are used also when list item is focused, if corresponding highlighted icon is not specified for the list item.

Enumerator:
ELeaf  Leaf icon.

Only usable with tree leaves.

EHighlightedLeaf  Highlighted leaf icon.

Only usable with tree leaves.

EExpandedNode  Expanded node icon.

Only usable with tree nodes.

EHighlightedExpandedNode  Highlighted expanded node icon.

Only usable with tree nodes.

ECollapsedNode  Collapsed node icon.

Only usable with tree nodes.

EHighlightedCollapsedNode  Highlighted collapsed node icon.

Only usable with tree nodes.

EOptionalIcon1  First optional icon.
EHighlightedOptionalIcon1  First highlighted optional icon.
EOptionalIcon2  Second optional icon.
EHighlightedOptionalIcon2  Second highlighted optional icon.
enum CAknSingleStyleTreeList::TOrdering
 

Single style hierarchical list ordering types.

Enumerator:
EAscendingAlphabeticalOrdering  Ascending alphabetical ordering based on item text fields.
EDescendingAlphabeticalOrdering  Descending alphabetical ordering based on item text fields.
enum CAknSingleStyleTreeList::TSingleStyleItemFlags
 

Flags usable with single style tree items.

Enumerator:
EPersistent  Item is persistent.
EMarked  Item is marked.
EExpanded  Item is expanded.

Applicable to nodes only.

ENonEmpty  Item appears non-empty.

Applicable to nodes only.


Constructor & Destructor Documentation

virtual CAknSingleStyleTreeList::~CAknSingleStyleTreeList  )  [virtual]
 

Destructor.


Member Function Documentation

IMPORT_C TAknTreeItemID CAknSingleStyleTreeList::AddLeafL TAknTreeItemID  aParent,
const TDesC &  aText,
TUint32  aFlags,
TBool  aDrawNow
 

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 KAknTreeIIDRoot can be used, if the new item is to be added to the top-most level of the hierarchical list.

Parameters:
aParent The item ID of the parent node.
aText Text for the added item.
aFlags Flags for the added item.
aDrawNow ETrue, if the list is to be redrawn after the item has been added to the list, otherwise EFalse.
Returns:
The item ID for the added leaf.
Leave:
KErrNoMemory Not enough memory.
Panic:
EAknHListPanicInvalidItemID Item with specified ID is not found.
Panic:
EAknHListPanicInvalidItemType Specified parent item is not a node.
IMPORT_C TAknTreeItemID CAknSingleStyleTreeList::AddNodeL TAknTreeItemID  aParent,
const TDesC &  aText,
TUint32  aFlags,
TBool  aDrawNow
 

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 KAknTreeIIDRoot can be used, if the new item is to be added to the top-most level of the hierarchical list.

Parameters:
aParent The item ID of the parent node.
aText Text for the added node.
aFlags Flags for the added node.
aDrawNow ETrue to redraw the list after the node has been added, otherwise EFalse.
Returns:
The Item ID for the added node.
Leave:
KErrNoMemory Not enough memory.
Panic:
EAknHListPanicInvalidItemID Item with specified ID is not found.
Panic:
EAknHListPanicInvalidItemType Specified parent item is not a node.
IMPORT_C TInt CAknSingleStyleTreeList::Icon TAknTreeItemID  aItem,
TIconType  aType
const
 

Returns the icon ID set for the specified icon of a list item.

Parameters:
aItem Item ID of a list item.
aType Type defining the specific icon within list item.
Returns:
Icon ID. The value AknTreeListIconID::KDefault is returned, if no icon has been set. Value KErrNotFound is returned, if the item does not contain icon of specified type.
Panic:
EAknHListPanicInvalidItemID Item with specified ID is not found.
static IMPORT_C CAknSingleStyleTreeList* CAknSingleStyleTreeList::NewL const CCoeControl &  aContainer  )  [static]
 

Two phased constructor.

Creates a new single style hierarchical list instance as non-window-owning component control to the compound control given as parameter.

Parameters:
aContainer The compound control used as container for the list.
Returns:
Newly constructed object.
Leave:
KErrNoMemory Not enough memory.
static IMPORT_C CAknSingleStyleTreeList* CAknSingleStyleTreeList::NewL  )  [static]
 

Two phased constructor.

Creates a new single style hierarchical list instance as window-owning control.

Returns:
Newly constructed object.
Leave:
KErrNoMemory Not enough memory.
static IMPORT_C CAknSingleStyleTreeList* CAknSingleStyleTreeList::NewLC const CCoeControl &  aContainer  )  [static]
 

Otherwise identical to NewL( const CCoeControl& ), but leaves the newly created object in the cleanup stack.

Two phased constructor.

Creates a new single style hierarchical list instance as non-window-owning component control to the compound control given as parameter.

Parameters:
aContainer The compound control used as container for the list.
Returns:
Newly constructed object.
Leave:
KErrNoMemory Not enough memory.
Postcondition:
Newly constructed object is left in cleanup stack.
static IMPORT_C CAknSingleStyleTreeList* CAknSingleStyleTreeList::NewLC  )  [static]
 

Otherwise identical to NewL(), but leaves the newly created object in the cleanup stack.

Two phased constructor.

Creates a new single style hierarchical list instance as window-owning control.

Returns:
Newly constructed object.
Leave:
KErrNoMemory Not enough memory.
Postcondition:
Newly constructed object is left in cleanup stack.
void CAknSingleStyleTreeList::SetFlags TUint32  aFlags  )  [virtual]
 

From CAknTreeList.

Sets the flags for the single style hierarchical list.

Parameters:
aFlags Flags.

Reimplemented from CAknTreeList.

IMPORT_C void CAknSingleStyleTreeList::SetIcon TAknTreeItemID  aItem,
TIconType  aType,
TInt  aIconId,
TBool  aDrawNow
 

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 AknTreeListIconID namespace. Constant AknTreeListIconID::KDefault can be used to indicate that default icon is to be used, and constant AknTreeListIconID::KNone to indicate that no icon is to be used.

Parameters:
aItem Item ID of the modified list item.
aType The type of the icon to be added.
aIconId Icon ID. Icon ID is the integer value returned by the AddIconL() method when the icon was added to the list.
aDrawNow ETrue to redraw the list after the icon has been changed, othewise EFalse.
Panic:
EAknHListPanicInvalidItemID Item with specified ID is not found.
Panic:
EAknHListPanicInvalidItemType Specified icon is not applicable with the item type.
IMPORT_C void CAknSingleStyleTreeList::SetTextL TAknTreeItemID  aItem,
const TDesC &  aText,
TBool  aDrawNow
 

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.

Parameters:
aItem Item ID of modified item.
aText New text for the item.
aDrawNow ETrue if the list is to be redrawn after the text has been changed.
Leave:
KErrNoMemory Not enough memory for adding text.
Panic:
EAknHListPanicInvalidItemID Item with specified ID is not found.
Panic:
EAknHListPanicInvalidItemType Specified item has invalid type.
IMPORT_C void CAknSingleStyleTreeList::SortL TOrdering  aOrdering,
TBool  aDrawNow
 

Sorts the hierarchical list according to the given ordering.

Parameters:
aOrdering Type of ordering.
aDrawNow ETrue to redraw the list after it has been sorted according the new ordering, otherwise EFalse.
Leave:
KErrNoMemory Not enough memory.
IMPORT_C const TDesC& CAknSingleStyleTreeList::Text TAknTreeItemID  aItem  )  const
 

Returns the text field of the specified item.

Parameters:
aItem Item ID.
Returns:
Text of the specified item.
Panic:
EAknHListPanicInvalidItemID Item with specified ID is not found.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2007
Back to top