2 * Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Observer interface for hierarchical list.
19 #ifndef M_AKNTREELISTOBSERVER_H
20 #define M_AKNTREELISTOBSERVER_H
23 #include <akntreelistconstants.h>
29 * Observer interface for hierarchical list.
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.
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.
42 class MAknTreeListObserver
48 * Hierarchical list events. These events are sent to hierarchical list
49 * observer with @c HandleTreeListEvent() method.
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. */
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. */
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
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. */
70 /** Item was removed from the list. The specified item ID is no
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. */
79 /** Marking mode disabled. This event is sent when markable list
80 exits the marking mode. After this, the list no longer controls
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. */
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. */
93 /** Panning is started. @ aItem in @c HandleTreeListEvent()
94 * is @ KAknTreeIIDNone in this case.
97 /** Panning is stopeed. @ aItem in @c HandleTreeListEvent()
98 * is @ KAknTreeIIDNone in this case.
100 EEventPanningStopped,
101 /** Flick is started. @ aItem in @c HandleTreeListEvent()
102 * is @ KAknTreeIIDNone in this case.
105 /** Flick is stopped. @ aItem in @c HandleTreeListEvent()
106 * is @ KAknTreeIIDNone in this case.
109 /** Empty list clicked. This event is sent when completely empty list
112 /** Empty area clicked. This event is sent when empty area of a non-
113 empty list is clicked. */
118 * The list client is notified of hierarchical list events with this
119 * method. Hierarchical list instance, item ID of the referred list item,
120 * and the event code are sent to the client.
122 * Note: New events may be added to the @c MAknTreeListObserver::TEvent
123 * enumeration in the future, and it should be taken in account in the
124 * implementations of this method, and not, for example, panic when
125 * receiving some currently unspecified event.
127 * @param aList The hierarchical list from where the event is originated.
129 * @param aItem Item ID of the list item the event is referring to.
131 * @param aEvent The hierarchical list event.
133 * @return Return value currently not used, value @c KErrNone should
136 virtual TInt HandleTreeListEvent( CAknTreeList& aList,
137 TAknTreeItemID aItem, TEvent aEvent ) = 0;
142 #endif // M_AKNTREELISTOBSERVER_H