landmarksui/uicontrols/inc/CLmkAppLmSelectorImpl.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2002-2006 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 -
       
    15 *				Application's (view-based) landmark selector impl class
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKAPPLMSELECTORIMPL_H
       
    26 #define CLMKAPPLMSELECTORIMPL_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "CLmkAppLmItemSelectorImpl.h"
       
    30 #include "TLmkDeletionHelper.h"
       
    31 #include <CLmkEditorDlg.h>
       
    32 #include "CLmkAppSelectorImplBase.h"
       
    33 #include "mlmkdbsearchutilsobserver.h"
       
    34 #include "clmkcallcmd.h"
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CPosLmCategoryCriteria;
       
    38 class MLmkListMemento;
       
    39 class CLmkDbSearchUtils;
       
    40 class CLmkGoToURLCmd;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45 *  Application's (view-based) landmark selector impl class.
       
    46 *
       
    47 */
       
    48 class CLmkAppLmSelectorImpl : public CLmkAppLmItemSelectorImpl, public MLmkDbSearchUtilsObserver
       
    49     {
       
    50     public:  // Constructors and destructor
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         * @param aDb database reference
       
    54         * @param aSender landmark sender reference
       
    55         * @param aFindBox tells whether selector contains find box or not
       
    56         * @return newly instantiated object
       
    57         */
       
    58         IMPORT_C static CLmkAppLmSelectorImpl* NewL(
       
    59                                     CPosLandmarkDatabase& aDb,
       
    60                                     CLmkSender& aSender,
       
    61                                     TBool aFindBox );
       
    62 
       
    63         /**
       
    64         * Two-phased constructor.
       
    65         * Creates lm selector based on memento of category view's
       
    66         * current selection.
       
    67         * @param aDb database reference
       
    68         * @param aCategoryMemento category view state
       
    69         * @param aSender landmark sender reference
       
    70         * @param aFindBox tells whether selector contains find box or not
       
    71         * @return newly instantiated object
       
    72         */
       
    73         IMPORT_C static CLmkAppLmSelectorImpl* NewL(
       
    74                                     CPosLandmarkDatabase& aDb,
       
    75                                     const MLmkListMemento& aCategoryMemento,
       
    76                                     CLmkSender& aSender,
       
    77                                     TBool aFindBox );
       
    78 
       
    79         /**
       
    80         * Destructor.
       
    81         */
       
    82         ~CLmkAppLmSelectorImpl();
       
    83         /**
       
    84         * @return ETrue if opened category is 'Uncategorized' else EFalse.
       
    85         */
       
    86         IMPORT_C TBool IsCriteriaUnCategorizedCat();
       
    87 
       
    88     public: // New functions
       
    89         /**
       
    90         * Return category name, used when viewing category contents.
       
    91         * If selector was not created with valid category memento parameter
       
    92         * this method leaves with KErrNotSupported.
       
    93         * @return category name
       
    94         */
       
    95         IMPORT_C TPtrC CategoryNameL();
       
    96 
       
    97     public: // From CLmkSelectorImpl
       
    98         void SetupListProviderL();
       
    99         const CLmkListProviderBase& ListProvider() const;
       
   100     public: // From MLmkDbSearchUtilsObserver
       
   101     	void HandleCategorySearchNotifyL(RArray<TPosLmItemId> aArray);
       
   102     	void HandleLmkSearchNotifyL();
       
   103 
       
   104     public: //from MLmkMapAndNavigationObserver
       
   105         void HandleLmCreated(TPosLmItemId aNewLmkItemId);
       
   106 
       
   107     public: //from MLmkAOOperationObserver
       
   108         void HandleOperationL( TOperationTypes aType,
       
   109                               TReal32 aProgress,
       
   110                               TInt aStatus );
       
   111 
       
   112     public: // From MEikCommandObserver
       
   113         void ProcessCommandL( TInt aCommandId );
       
   114 
       
   115     protected: // From CLmkAppLmItemSelectorImpl
       
   116         void ChangeIconL( TPosLmItemId aId, TInt aIconIndex, TInt aMaskIndex);
       
   117         void ChangeIconsL( RArray<TPosLmItemId>& aIdArray, TInt aIconIndex, TInt aMaskIndex);
       
   118         void InitialLandmarkL( CPosLandmark* aLandmark );
       
   119         TBool HandleEventListReadyL();
       
   120 
       
   121     public:  // From CLmkAppLmItemSelectorImpl
       
   122         /**
       
   123         * Following 3 methods are Wrapper methods for caller's menu and interest
       
   124         * resources to AIW menu service handler
       
   125         */
       
   126         void AttachToAIWMenuL( TInt aMenuResourceId,
       
   127         					   TInt aInterestResourceId);
       
   128 
       
   129         void InitializeMenuPaneL( CEikMenuPane& aMenuPane,
       
   130                                   TInt aMenuResourceId);
       
   131 
       
   132         void ExecuteAIWCallCmdL( TInt aCommandId );
       
   133         void AttachInterestL ( TInt aInterestResourceId );
       
   134         //from CLmkAppSelectorImplBase
       
   135         TInt ServiceCmdByMenuCmd( TInt aMenuCmd );
       
   136 
       
   137         /**
       
   138         * Checks if atleast one landmark with this field exist in database
       
   139         */
       
   140 
       
   141         TBool IsLmWithThisFieldExistL( TLmkAppCmdId  aFieldId);
       
   142 
       
   143         virtual TInt GetSelectedLandmarksL(RPointerArray<CPosLandmark> &aArray);
       
   144 
       
   145 		virtual TBool IsLandmarkDataEmptyL(CPosLandmark* aLandmark);
       
   146 
       
   147 		/**
       
   148         * Removes opened category from the selected landmarks.
       
   149         */
       
   150 		IMPORT_C void RemoveLandmarksFromCategoryL();
       
   151 
       
   152 		/**
       
   153         * From CLmkListProviderBase
       
   154         * Asynchronous starting of Landmarks Search to prepare the list.
       
   155         */
       
   156 		IMPORT_C void StartSearchingLandmarksL(const TDesC& aSearchPattern,
       
   157     								  TBool aSearchOnlyInPreviousMatches);
       
   158 
       
   159     protected: // Constructors and destructor
       
   160         /**
       
   161         * C++ default constructor.
       
   162         * @param aDb database reference
       
   163         * @param aFindBox
       
   164         * @return newly object
       
   165         */
       
   166         CLmkAppLmSelectorImpl( CPosLandmarkDatabase& aDb,
       
   167                                CLmkSender& aSender,
       
   168                                TBool aFindBox );
       
   169 
       
   170         /**
       
   171         * By default Symbian 2nd phase constructor is private.
       
   172         */
       
   173         void ConstructL();
       
   174 
       
   175         /**
       
   176         * By default Symbian 2nd phase constructor is private.
       
   177         * @param aCategoryMemento
       
   178         */
       
   179         void ConstructL( const MLmkListMemento& aCategoryMemento );
       
   180 
       
   181     private: // New functions
       
   182         /**
       
   183         * Edit landmark
       
   184         */
       
   185         void EditLandmarkCmdL(TLmkEditorMode aEditMode);
       
   186 
       
   187         /**
       
   188         * Delete landmark(s)
       
   189         */
       
   190         void DeleteLandmarksCmdL();
       
   191 
       
   192         /**
       
   193         * Add landmark(s) to category(s)
       
   194         */
       
   195         void AddToCatCmdL();
       
   196 
       
   197         /**
       
   198         * Gets the position field value for a selected Landmark
       
   199         */
       
   200         TInt GetPositionFieldForSelectedLmL(
       
   201 	                        TPositionFieldId  aFieldId,
       
   202 	                        HBufC& aFieldValue);
       
   203 		/**
       
   204 		* Closes wait note
       
   205 		*/
       
   206 		void CloseWaitNoteL();
       
   207 
       
   208 
       
   209     protected: // Data
       
   210         /// helps updating the list after deletion
       
   211         TLmkDeletionHelper iDeletionHelper;
       
   212 
       
   213         ///Own:
       
   214         CPosLmCategoryCriteria* iCriteria;
       
   215 
       
   216         ///Own:
       
   217         HBufC* iCategoryName;
       
   218 
       
   219         ///Own: pointer to db serach utils
       
   220         CLmkDbSearchUtils* iDbSearchUtils;
       
   221 
       
   222         /// Own: Wait dialog displayed while searching landmarks
       
   223         CAknWaitDialog* iWaitNote;
       
   224     private:     
       
   225     	// own
       
   226         CLmkCallCmd *iLmkCallCmd;	          
       
   227         // own
       
   228         TInt iMarkedCatCountAdded;        
       
   229         // own
       
   230         CLmkGoToURLCmd* iLmkGoToURLCmd;        
       
   231         // own
       
   232         CLmkAOOperation* iOperation;
       
   233         // own
       
   234         TInt  iCatRemoveFlag;				
       
   235 		// to check dlg open or not                
       
   236         TBool iIsDlgOpen; 
       
   237     };
       
   238 
       
   239 #endif      // CLMKAPPLMSELECTORIMPL_H
       
   240 
       
   241 // End of File