williamr@2: /* williamr@2: * Copyright (c) 2006, 2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Observer interface for hierarchical list. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef M_AKNTREELISTOBSERVER_H williamr@2: #define M_AKNTREELISTOBSERVER_H williamr@2: williamr@2: williamr@2: #include williamr@2: williamr@2: class CAknTreeList; williamr@2: williamr@2: williamr@2: /** williamr@2: * Observer interface for hierarchical list. williamr@2: * williamr@2: * Notifications of common hierarhicial list events are sent to the williamr@2: * list client through this interface. All hierarhical list clients must williamr@2: * provide an implementation for the interface and then register it with williamr@2: * @c CAknTreeList::AddObserverL() method. williamr@2: * williamr@2: * List specializations can also provide extended observer interfaces derived williamr@2: * from this interface, if this interface is not sufficient for the usage of williamr@2: * some hierarhical list specialization. williamr@2: * williamr@2: * @since S60 v3.2 williamr@2: */ williamr@2: class MAknTreeListObserver williamr@2: { williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Hierarchical list events. These events are sent to hierarchical list williamr@2: * observer with @c HandleTreeListEvent() method. williamr@2: */ williamr@2: enum TEvent williamr@2: { williamr@2: /** Node is being expanded. At this point the list client should williamr@2: update the content of expanded node, or add the content, if it williamr@2: has not been added or was removed when the node was collapsed. */ williamr@2: ENodeExpanded, williamr@2: /** Node is being collapsed. This event is sent before a node is williamr@2: collapsed. After the event, all the content of the node is deleted williamr@2: unless it has been set persistent. */ williamr@2: ENodeCollapsed, williamr@2: /** Focused item is changed. This event indicates that the focus is williamr@2: moved to another list item. The client can use this information, williamr@2: for example, for showing some additional information about the williamr@2: focused item. */ williamr@2: EItemFocused, williamr@2: /** Item is selected. This event indicates that the focused item is williamr@2: selected with some key or pointer event. The client should respond williamr@2: to selection event, for example, by opening the selected item. */ williamr@2: EItemSelected, williamr@2: /** Item was removed from the list. The specified item ID is no williamr@2: longer usable. */ williamr@2: EItemRemoved, williamr@2: /** Marking mode enabled. This event is used for notifying the client williamr@2: that markable list has entered marking mode as a result of user williamr@2: keeping shift, control, edit, or hash key pressed. During marking williamr@2: mode, the list controls the MSK key, and to ensure proper MSK williamr@2: functionality, the client should not change MSK content. */ williamr@2: EMarkingModeEnabled, williamr@2: /** Marking mode disabled. This event is sent when markable list williamr@2: exits the marking mode. After this, the list no longer controls williamr@2: the MSK key. */ williamr@2: EMarkingModeDisabled, williamr@2: /** Item has been marked. This event is sent when either a node or williamr@2: a leaf has been marked. Note that when marked item is a node, williamr@2: its content is also set marked, but separate events are not williamr@2: sent for all of the marked descendants. */ williamr@2: EItemMarked, williamr@2: /** Item has been unmarked. This event is sent when either a node or williamr@2: a leaf has been unmarked. Note that when unmarked item is a node, williamr@2: its content is also set unmarked, but separate events are not williamr@2: sent for all of the unmarked descendants. */ williamr@2: EItemUnmarked williamr@2: }; williamr@2: williamr@2: /** williamr@2: * The list client is notified of hierarchical list events with this williamr@2: * method. Hierarchical list instance, item ID of the referred list item, williamr@2: * and the event code are sent to the client. williamr@2: * williamr@2: * Note: New events may be added to the @c MAknTreeListObserver::TEvent williamr@2: * enumeration in the future, and it should be taken in account in the williamr@2: * implementations of this method, and not, for example, panic when williamr@2: * receiving some currently unspecified event. williamr@2: * williamr@2: * @param aList The hierarchical list from where the event is originated. williamr@2: * williamr@2: * @param aItem Item ID of the list item the event is referring to. williamr@2: * williamr@2: * @param aEvent The hierarchical list event. williamr@2: * williamr@2: * @return Return value currently not used, value @c KErrNone should williamr@2: * be used. williamr@2: */ williamr@2: virtual TInt HandleTreeListEvent( CAknTreeList& aList, williamr@2: TAknTreeItemID aItem, TEvent aEvent ) = 0; williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // M_AKNTREELISTOBSERVER_H