uifw/EikStd/coctlinc/aknmarkingmode.h
branchRCL_3
changeset 23 3d340a0166ff
child 64 85902f042028
equal deleted inserted replaced
18:0aa5fbdfbc30 23:3d340a0166ff
       
     1 /*
       
     2 * Copyright (c) 2009 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: Marking mode handler.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_AKNMARKINGMODE_H
       
    19 #define C_AKNMARKINGMODE_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 class CAknNavigationDecorator;
       
    24 class CAknItemActionMenu;
       
    25 class MAknCollection;
       
    26 class MAknMarkingCollection;
       
    27 
       
    28 typedef RPointerArray<MAknCollection> CollectionArray;
       
    29 
       
    30 /**
       
    31  * Marking mode handler.
       
    32  *
       
    33  * @lib eikcoctl
       
    34  * @since S60 v5.2
       
    35  */
       
    36 NONSHARABLE_CLASS( CAknMarkingMode ) : public CBase
       
    37     {
       
    38 
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Two-phased constructor.
       
    43      */
       
    44     static CAknMarkingMode* NewL(
       
    45             CAknItemActionMenu& aItemActionMenu,
       
    46             CollectionArray& aArray );
       
    47 
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     virtual ~CAknMarkingMode();
       
    52 
       
    53     /**
       
    54      * Sets visible collection multiple marking state.
       
    55      *
       
    56      * @internal
       
    57      * @param aActive ETrue if multiple marking should be active.
       
    58      */
       
    59     void SetCollectionMultipleMarkingState( TBool aActive );
       
    60     
       
    61     /**
       
    62      * Ends marking mode if collection allows it
       
    63      */
       
    64     void TryExitMarkingMode();
       
    65 
       
    66     /**
       
    67      * Returns ETrue if multiple marking state is active.
       
    68      *
       
    69      * @internal
       
    70      * @return ETrue if multiple marking is active.
       
    71      */
       
    72     TBool MultipleMarkingActive() const;
       
    73 
       
    74     /**
       
    75      * Returns ETrue if there are marked items in visible list that is
       
    76      * in multiple marking state.
       
    77      *
       
    78      * @internal
       
    79      * @return ETrue if items are currently marked.
       
    80      */
       
    81     TBool MarkedItems() const;
       
    82     
       
    83     /**
       
    84      * Returns ETrue if the collection has no items
       
    85      * 
       
    86      * @internal
       
    87      * @return ETrue if there are no items
       
    88      */
       
    89     TBool CollectionEmpty() const;
       
    90             
       
    91     /**
       
    92      * Marks all items in the collection.
       
    93      */
       
    94     void MarkAllL();
       
    95     
       
    96     /**
       
    97      * Unmarks all items in the collection.
       
    98      */
       
    99     void UnmarkAll();
       
   100     
       
   101     /**
       
   102      * Marks the currently selected item in the collection.
       
   103      */
       
   104     void MarkCurrentItemL();
       
   105     
       
   106     /**
       
   107      * Returns ETrue if current item can be marked
       
   108      * 
       
   109      * @internal
       
   110      * @return ETrue if current item can be marked
       
   111      */
       
   112     TBool CurrentItemMarkable();
       
   113 
       
   114 private:
       
   115 
       
   116     /**
       
   117      * C++ constructor.
       
   118      */
       
   119     CAknMarkingMode(
       
   120             CAknItemActionMenu& aItemActionMenu,
       
   121             CollectionArray& aArray );
       
   122 
       
   123     /**
       
   124      * Returns marking collection received from aCollection.
       
   125      * 
       
   126      * @param aCollection Collection.
       
   127      * @return Marking collection object.
       
   128      */
       
   129     static MAknMarkingCollection* MarkingCollection(
       
   130             MAknCollection& aCollection );
       
   131 
       
   132     /**
       
   133      * Returns marking collection.
       
   134      * 
       
   135      * @return Marking collection object.
       
   136      */
       
   137     MAknMarkingCollection* MarkingCollection();
       
   138     
       
   139     /**
       
   140      * Returns the activated marking collection i.e the one with marking mode
       
   141      * turned on.
       
   142      * 
       
   143      * @return Active marking collection.
       
   144      */
       
   145     MAknMarkingCollection* ActiveMarkingCollection();
       
   146 
       
   147     /**
       
   148      * Updates navi pane when entering and exiting marking mode
       
   149      * 
       
   150      * @param  aEnable @c ETrue to set marking mode related text
       
   151      *                 @c EFalse to remove marking mode related text
       
   152      */
       
   153     void UpdateMarkingModeNaviPaneL( TBool aEnable );
       
   154     
       
   155 private: // data
       
   156 
       
   157     /**
       
   158      * Collection array owned by CAknItemActionMenu.
       
   159      * Not own.
       
   160      */
       
   161     CollectionArray& iCollections;
       
   162 
       
   163     /**
       
   164      * Item action menu that owns this marking mode handler.
       
   165      * Not own.
       
   166      */
       
   167     CAknItemActionMenu& iItemActionMenu;
       
   168     
       
   169     /**
       
   170      * Marking mode navi pane decorator
       
   171      */
       
   172     CAknNavigationDecorator* iMarkingDecorator;     
       
   173     };
       
   174 
       
   175 #endif // C_AKNMARKINGMODE_H