emailuis/uicomponents/inc/fstreeobserver.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 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 "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  An observer interface for the tree data model.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_FSTREEOBSERVER_H
       
    20 #define M_FSTREEOBSERVER_H
       
    21 
       
    22 
       
    23 /**
       
    24  * MFsTreeObserver defines an interface which is used to observe tree events.
       
    25  * 
       
    26  * Observer of the tree is notified of changes in the tree structure
       
    27  * through this interface with appropriate events.
       
    28  * 
       
    29  * @code
       
    30  *
       
    31  * @endcode
       
    32  *
       
    33  * @lib 
       
    34  */
       
    35 NONSHARABLE_CLASS( MFsTreeObserver )
       
    36     {
       
    37 public:
       
    38 
       
    39     enum TFsTreeEvent
       
    40         {
       
    41         /** 
       
    42          * Item was added to the tree. 
       
    43          * The visible items list should be updated if needed.
       
    44          */
       
    45         EFsTreeItemAdded,
       
    46         
       
    47         /** 
       
    48          * Node was added to the tree. 
       
    49          * The visible items list should be updated if needed.
       
    50          */
       
    51         EFsTreeNodeAdded,
       
    52         
       
    53         /**
       
    54          * Item was removed from the tree.
       
    55          * The visible items list should be updated if needed.
       
    56          */
       
    57         EFsTreeItemRemoved,
       
    58         
       
    59         /**
       
    60          * Node was removed from the tree.
       
    61          * The visible items list should be updated if needed.
       
    62          */
       
    63         EFsTreeNodeRemoved,
       
    64         
       
    65         /**
       
    66          * All items will be removed from the tree.
       
    67          * The visible items list should be updated..
       
    68          */
       
    69         EFsTreeRemovedAll,
       
    70         
       
    71         /**
       
    72          * Item's/Node's data has changed.
       
    73          * The visible items list should be updated if needed.
       
    74          */
       
    75         EFsTreeItemDataChanged,
       
    76         
       
    77         /**
       
    78          * Item data's visualizer has changed.
       
    79          * The visible items list should be updated if needed.
       
    80          */
       
    81         EFsTreeItemVisualizerChanged
       
    82         };
       
    83     
       
    84 public:
       
    85     
       
    86     /**
       
    87      * Observer of the tree is notified of changes in the tree structure
       
    88      * through this function.
       
    89      * 
       
    90      * @param aEvent Event which happend in the tree structure.
       
    91      * @param aId Id of the node/item associated with the event.
       
    92      */
       
    93     struct TFsTreeEventParams
       
    94         {
       
    95         TFsTreeEventParams(TFsTreeItemId aItemId, TFsTreeItemId aTargetNodeId, TInt aIndex ) :
       
    96         iItemId(aItemId), iTargetNodeId(aTargetNodeId), iIndex(aIndex) {};
       
    97         
       
    98         TFsTreeItemId iItemId;
       
    99         TFsTreeItemId iTargetNodeId; 
       
   100         TInt iIndex;
       
   101         };
       
   102     
       
   103     virtual void TreeEventL( const TFsTreeEvent aEvent, 
       
   104             const TFsTreeEventParams& aParams ) = 0;
       
   105     
       
   106     };
       
   107     
       
   108      
       
   109 #endif // M_FSTREEOBSERVER_H