epoc32/include/mw/akntreelistobserver.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Observer interface for hierarchical list.
    15 *
    16 */
    17 
    18 
    19 #ifndef M_AKNTREELISTOBSERVER_H
    20 #define M_AKNTREELISTOBSERVER_H
    21 
    22 
    23 #include <akntreelistconstants.h>
    24 
    25 class CAknTreeList;
    26 
    27 
    28 /**
    29  *  Observer interface for hierarchical list.
    30  *
    31  *  Notifications of common hierarhicial list events are sent to the 
    32  *  list client through this interface. All hierarhical list clients must
    33  *  provide an implementation for the interface and then register it with
    34  *  @c CAknTreeList::AddObserverL() method.
    35  *
    36  *  List specializations can also provide extended observer interfaces derived
    37  *  from this interface, if this interface is not sufficient for the usage of
    38  *  some hierarhical list specialization.
    39  *
    40  *  @since S60 v3.2
    41  */
    42 class MAknTreeListObserver
    43     {
    44 
    45 public:
    46 
    47     /**
    48      * Hierarchical list events. These events are sent to hierarchical list
    49      * observer with @c HandleTreeListEvent() method.
    50      */
    51     enum TEvent
    52         {
    53         /** Node is being expanded. At this point the list client should
    54             update the content of expanded node, or add the content, if it
    55             has not been added or was removed when the node was collapsed. */
    56         ENodeExpanded,
    57         /** Node is being collapsed. This event is sent before a node is
    58             collapsed. After the event, all the content of the node is deleted
    59             unless it has been set persistent. */
    60         ENodeCollapsed,
    61         /** Focused item is changed. This event indicates that the focus is
    62             moved to another list item. The client can use this information,
    63             for example, for showing some additional information about the
    64             focused item. */
    65         EItemFocused,
    66         /** Item is selected. This event indicates that the focused item is
    67             selected with some key or pointer event. The client should respond
    68             to selection event, for example, by opening the selected item. */
    69         EItemSelected,
    70         /** Item was removed from the list. The specified item ID is no
    71             longer usable. */
    72         EItemRemoved,
    73         /** Marking mode enabled. This event is used for notifying the client
    74             that markable list has entered marking mode as a result of user
    75             keeping shift, control, edit, or hash key pressed. During marking
    76             mode, the list controls the MSK key, and to ensure proper MSK
    77             functionality, the client should not change MSK content. */
    78         EMarkingModeEnabled,
    79         /** Marking mode disabled. This event is sent when markable list
    80             exits the marking mode. After this, the list no longer controls
    81             the MSK key. */
    82         EMarkingModeDisabled,
    83         /** Item has been marked. This event is sent when either a node or
    84             a leaf has been marked. Note that when marked item is a node,
    85             its content is also set marked, but separate events are not
    86             sent for all of the marked descendants. */
    87         EItemMarked,
    88         /** Item has been unmarked. This event is sent when either a node or
    89             a leaf has been unmarked. Note that when unmarked item is a node,
    90             its content is also set unmarked, but separate events are not
    91             sent for all of the unmarked descendants. */
    92         EItemUnmarked
    93         };
    94 
    95     /**
    96      * The list client is notified of hierarchical list events with this
    97      * method. Hierarchical list instance, item ID of the referred list item,
    98      * and the event code are sent to the client.
    99      *
   100      * Note: New events may be added to the @c MAknTreeListObserver::TEvent
   101      * enumeration in the future, and it should be taken in account in the
   102      * implementations of this method, and not, for example, panic when
   103      * receiving some currently unspecified event.
   104      *
   105      * @param aList The hierarchical list from where the event is originated.
   106      *
   107      * @param aItem Item ID of the list item the event is referring to.
   108      *
   109      * @param aEvent The hierarchical list event.
   110      *
   111      * @return Return value currently not used, value @c KErrNone should
   112      *      be used.
   113      */
   114     virtual TInt HandleTreeListEvent( CAknTreeList& aList,
   115         TAknTreeItemID aItem, TEvent aEvent ) = 0;
   116 
   117     };
   118 
   119 
   120 #endif // M_AKNTREELISTOBSERVER_H