landmarksui/uicontrols/inc/CLmkLmItemListMemento.h
branchRCL_3
changeset 18 870918037e16
parent 0 522cd55cc3d7
equal deleted inserted replaced
17:1fc85118c3ae 18:870918037e16
       
     1 /*
       
     2 * Copyright (c) 2004 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:    LandmarksUi Content File -    Store and restore views last state.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKLMITEMLISTMEMENTO_H
       
    26 #define CLMKLMITEMLISTMEMENTO_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "MLmkListMemento.h"
       
    30 #include <e32base.h>
       
    31 #include <EPos_Landmarks.h>
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CAknFilteredTextListBoxModel;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 * CLmkLmItemListMemento class
       
    40 */
       
    41 class CLmkLmItemListMemento : public CBase, public MLmkListMemento
       
    42     {
       
    43     public: // Constructors and destructor
       
    44 
       
    45         /**
       
    46         *
       
    47         */
       
    48         static CLmkLmItemListMemento* NewL();
       
    49 
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         ~CLmkLmItemListMemento();
       
    54 
       
    55     public: // New functions
       
    56 
       
    57 		TBool IsModelAvailable();
       
    58 		void  UpdateModelAvailability(TBool aModelAvailable);
       
    59        /**
       
    60         * Returns memorized item id for specific purposes.
       
    61         * Mainly used for setting up category contents view.
       
    62         * @return item id, KPosLmNullItemId if not applicable
       
    63         */
       
    64         IMPORT_C TPosLmItemId MemorizedItemId() const;
       
    65 
       
    66     public: // From MLmkListMemento
       
    67 
       
    68         void Store( const CEikListBox& aListBox,
       
    69                     const CLmkListProviderBase& aProvider,
       
    70                     TBool aFiltered );
       
    71 
       
    72         void Restore( const CEikListBox& aListBox,
       
    73                       const CLmkListProviderBase& aProvider,
       
    74                       TBool aFiltered );
       
    75 
       
    76     protected: // Constructors and destructor
       
    77 
       
    78         /**
       
    79         * C++ constructor.
       
    80         */
       
    81         CLmkLmItemListMemento();
       
    82 
       
    83         /**
       
    84         * By default Symbian 2nd phase constructor is private.
       
    85         */
       
    86         void ConstructL( );
       
    87 
       
    88     private: // New functions
       
    89 
       
    90         void StoreFiltered( const CEikListBox& aListBox,
       
    91                             const CLmkListProviderBase& aProvider,
       
    92                             const CAknFilteredTextListBoxModel& aModel );
       
    93 
       
    94         void RestoreFiltered( const CEikListBox& aListBox,
       
    95                               const CLmkListProviderBase& aProvider,
       
    96                               const CAknFilteredTextListBoxModel& aModel );
       
    97 
       
    98         void StoreNonFiltered( const CEikListBox& aListBox,
       
    99                                const CLmkListProviderBase& aProvider );
       
   100 
       
   101         void RestoreNonFiltered( const CEikListBox& aListBox,
       
   102                                  const CLmkListProviderBase& aProvider );
       
   103 
       
   104     private: // data
       
   105 
       
   106         TInt iMemorizedCurrentItemIndex;
       
   107 
       
   108         TPosLmItemId iMemorizedCurrentItemId;
       
   109 
       
   110         TInt iMemorizedTopItemIndex;
       
   111         TBool iModelAvailable;
       
   112     };
       
   113 
       
   114 #endif      // CLMKLMITEMLISTMEMENTO_H
       
   115 
       
   116 // End of File