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