landmarksui/uicontrols/inc/CLmkAppLmItemSelectorImpl.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     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 -
       
    15 *				Base class for application's (view-based) selectors
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKAPPLMITEMSELECTORIMPL_H
       
    26 #define CLMKAPPLMITEMSELECTORIMPL_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "CLmkAppSelectorImplBase.h"
       
    30 #include "MLmkAOOperationObserver.h"
       
    31 #include "MLmkLocationObserver.h"
       
    32 #include "lmkwaitdlglauncher.h"
       
    33 #include <CLmkEditorDlg.h>
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CLmkLmItemListProvider;
       
    37 class CLmkDbUtils;
       
    38 class CLmkLocationService;
       
    39 class TPosition;
       
    40 class CPosLandmark;
       
    41 class CLmkSender;
       
    42 class CLmkLocSettingsLauncher;
       
    43 
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 *  Base class for application's (view-based) selectors that list items
       
    49 *  having TPosLmItemId, i.e. using provider of type CLmkLmItemListProvider.
       
    50 */
       
    51 class CLmkAppLmItemSelectorImpl
       
    52 : public CLmkAppSelectorImplBase,
       
    53   public MLmkAOOperationObserver,
       
    54   public MLmkLocationObserver,
       
    55   public MLmkWaitDialogLauncherObserver
       
    56     {
       
    57     public:  // Constructors and destructor
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         ~CLmkAppLmItemSelectorImpl();
       
    62 
       
    63     public: // New functions
       
    64         /**
       
    65         * Method for changing an icon of a listbox item. Calls templated
       
    66         * method which should handle subclass-specific details.
       
    67         */
       
    68         void ChangeIconCmdL();
       
    69         // Added for Bug Fix
       
    70         void DiskSpaceBelowCriticalLevelL(
       
    71 									    TInt aBytesToWrite, TChar aDrive);
       
    72 
       
    73 		TInt CalculateLandmarkDisksize(
       
    74     									const CPosLandmark& aLandmark);
       
    75 
       
    76     public: // From CLmkAppSelectorImplBase
       
    77         MLmkListMemento* MementoL();
       
    78 		/**
       
    79 		* Method to handle change in screen size.
       
    80 		* When the icon selection popup is shown screen size changes have to
       
    81 		* be propagated to the popup.
       
    82 		*/
       
    83 		void HandleScreenSizeChange();
       
    84 
       
    85 		TInt CurrentCategoryId();
       
    86 
       
    87     public: //from MLmkMapAndNavigationObserver
       
    88         void HandleLmCreated(TPosLmItemId aNewLmkItemId);
       
    89 
       
    90     public://from MLmkWaitDialogLauncherObserver
       
    91     	void HandleDialogDismissed( TInt aButtonId );
       
    92 
       
    93     protected: // From MEikCommandObserver
       
    94         void ProcessCommandL( TInt aCommandId );
       
    95 
       
    96     protected: // From MLmkLocationObserver
       
    97         void NotifyL( const TInt aStatus );
       
    98         void NotifyErrorL( TInt aErrorCode );
       
    99 
       
   100     protected: // New functions
       
   101         /**
       
   102         * Returns provider reference as CLmkLmItemListProvider type.
       
   103         * @return provider reference
       
   104         */
       
   105         CLmkLmItemListProvider& LmItemListProvider();
       
   106 
       
   107         /**
       
   108         * Currently selected item's id
       
   109         * @return TPosLmItemId
       
   110         */
       
   111         TPosLmItemId SelectedIdL();
       
   112 
       
   113         /**
       
   114         * Currently marked item ids
       
   115         * @return TPosLmItemId array reference
       
   116         */
       
   117         RArray<TPosLmItemId>& MarkedItemIdsL();
       
   118 
       
   119         /**
       
   120         * Template method called by ChangeIconCmdL.
       
   121         * @param aId
       
   122         * @param aIconIndex
       
   123         */
       
   124         virtual void ChangeIconL( TPosLmItemId aId, TInt aIconIndex, TInt aMaskIndex) = 0;
       
   125 
       
   126         /**
       
   127         * Template method called by ChangeIconCmdL.
       
   128         * @param aIdArray
       
   129         * @param aIconIndex
       
   130         */
       
   131         virtual void ChangeIconsL( RArray<TPosLmItemId>& aIdArray,
       
   132                                    TInt aIconIndex, TInt aMaskIndex) = 0;
       
   133 
       
   134 		IMPORT_C void LaunchPosSettingsL();
       
   135         /**
       
   136         * Initial landmark
       
   137         * @param aLandmark
       
   138         */
       
   139         virtual void InitialLandmarkL( CPosLandmark* /*aLandmark*/ ){}
       
   140 
       
   141         /**
       
   142         * Method to change the mark index or indexes after adding
       
   143         * new Landmark.
       
   144         * @param None
       
   145         */
       
   146         void UpdateMarkIndexAfterAdditionL( TInt aIndexToBeSelected );
       
   147         //resolves id, to be focussed after deletion.
       
   148         void StoreIdTobeFocussedAfterDeletion( RArray<TPosLmItemId>& markedItemIds );
       
   149         //sets item to focus after deletion
       
   150         void SetFocusToItemAfterDeletionOfMarkedItems();
       
   151 
       
   152     protected: // Constructors and destructor
       
   153         /**
       
   154         * C++ default constructor.
       
   155         */
       
   156         CLmkAppLmItemSelectorImpl( CPosLandmarkDatabase& aDb,
       
   157                                    CLmkSender& aSender,
       
   158                                    TBool aFindBox );
       
   159 
       
   160         /**
       
   161         * By default Symbian 2nd phase constructor is private.
       
   162         */
       
   163         void BaseConstructL();
       
   164 
       
   165     private: //new functions
       
   166         /**
       
   167         * Make new landmark
       
   168         */
       
   169         void NewLandmarkCmdL();
       
   170 
       
   171         /**
       
   172         * Executes landmark editor with correct parameters for
       
   173         * new landmark creation.
       
   174         * @param aLandmark empty or initialized landmark for editing
       
   175         */
       
   176         void ExecuteNewLandmarkEditorL( CPosLandmark& aLandmark );
       
   177         /**
       
   178         * Request current location
       
   179         */
       
   180         void RequestCurrenLocationL();
       
   181 
       
   182         /**
       
   183         * Create new landmark from current location
       
   184         * @param aPosition
       
   185         */
       
   186         void CreateLmkFromCurrentLocationL( const TPosition& aPosition );
       
   187 
       
   188         static TInt MessageQueryCallBack( TAny* aPtr );
       
   189 
       
   190     protected: // Data
       
   191         ///Ref:
       
   192         CLmkSender& iSender;
       
   193 
       
   194         ///Own:
       
   195         CLmkDbUtils* iDbUtils;
       
   196 
       
   197         ///Own:
       
   198         CLmkLocationService* iLocationService;
       
   199 
       
   200         RArray<TPosLmItemId> iMarkedItemIds;
       
   201 
       
   202         // If a new Item is added then the highlight will have to be
       
   203         // adjusted to point to the currently added Item.
       
   204         // For new Landmarks This flag will be set in this class
       
   205         // For new Categories this flag will be set in the derived class
       
   206         // And the flag is used in the respective derived classes.
       
   207         TBool iNewListBoxItemAdded;
       
   208 
       
   209         // Own: Pointer to Location Settings Launcher
       
   210         CLmkLocSettingsLauncher* iLauncher;
       
   211 
       
   212 	    //this holds the landmark view dialog
       
   213 	    CLmkEditorImpl* iDlg;
       
   214 
       
   215         /**
       
   216          * Wait dialog launcher
       
   217          * Owns
       
   218          */
       
   219         CLmkWaitDialogLauncher* iWaitDialogLauncher;
       
   220         //item to focus after deletion
       
   221         TPosLmItemId iFocusItemIdAfterDeletion;
       
   222     };
       
   223 
       
   224 #endif      // CLMKAPPLMITEMSELECTORIMPL_H
       
   225 
       
   226 // End of File