basiclocationinfodisplay/blid/ui/inc/CBlidBaseView.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2005 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:  Declares main view for blid application.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CBLIDBASEVIEW_H
       
    20 #define CBLIDBASEVIEW_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknview.h>
       
    24 #include <featmgr.h>
       
    25 #include <bldvariant.hrh>
       
    26 
       
    27 #ifdef RD_SCALABLE_UI_V2
       
    28 #include <eikclb.h>
       
    29 #endif // RD_SCALABLE_UI_V2
       
    30 
       
    31 #include "MKeyProcessor.h"
       
    32 #include "MBlidEngObserver.h"
       
    33 #include "CLmkLandmarkSelectorDlg.h"
       
    34 #include "blidcommonconsts.h"
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CEikonEnv;
       
    38 class CBlidBaseContainer;
       
    39 class CEikMenuPane;
       
    40 class MBlidRouter;
       
    41 class MBlidLocation;
       
    42 class CBlidEng;
       
    43 class CBlidCurrentPositionDlg;
       
    44 class CBlidDocument;
       
    45 class CAlfImageLoaderUtil;
       
    46 
       
    47 // CLASS DECLARATION
       
    48 /**
       
    49 *  Base view class.
       
    50 * 
       
    51 */
       
    52 class CBlidBaseView : public CAknView, public MKeyProcessor, 
       
    53                                        public MBlidEngObserver
       
    54                                        #ifdef RD_SCALABLE_UI_V2                                       
       
    55                                        ,public MEikListBoxObserver
       
    56                                        #endif // RD_SCALABLE_UI_V2
       
    57     {
       
    58     public: // Constructors and destructor
       
    59         /**
       
    60          * C++ constructor
       
    61          * @param aKeyProcessor A pointer to MKeyProcessor
       
    62          */
       
    63         CBlidBaseView( MKeyProcessor& aKeyProcessor );
       
    64 
       
    65         /**
       
    66          * By default Symbian 2nd phase constructor is private.
       
    67          * @param aResId Resource id
       
    68          */
       
    69         void BaseConstructL( TInt aResId );
       
    70 
       
    71         /**
       
    72          * Destructor.
       
    73          */
       
    74         ~CBlidBaseView();
       
    75 
       
    76     public: // From MKeyProcessor
       
    77         TBool ProcessKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    78         MAknTabObserver* TabObserver();
       
    79 
       
    80     public: // From MEikMenuObserver
       
    81         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    82 
       
    83     public: //From MBlidEngObserver
       
    84         void NotifyL( const TBool aOnlineMode );
       
    85         void NotifyErrorL( TInt aErrorCode );
       
    86         void Update(CBlidBaseContainer* aContainer);
       
    87         CEikButtonGroupContainer* CBAPtr() const;
       
    88         
       
    89     protected: // New methods  
       
    90         /**
       
    91          * Handle help requests
       
    92          *
       
    93          * @param aMenuPane A pointer to CEikMenuPane
       
    94          */
       
    95         void HandleHelpFeatureL( CEikMenuPane* aMenuPane ) const;
       
    96 
       
    97         /**
       
    98         * Insert waypoint to MBlidRouter's array
       
    99         * @return ETrue if waypoint inserted,
       
   100         *         EFalse if waypoint not inserted
       
   101         */
       
   102         TBool InsertWaypointL();
       
   103 
       
   104         /**
       
   105         * Select waypoint from the list
       
   106         *
       
   107         * @return index of list
       
   108         */
       
   109         TInt SelectWaypointL();
       
   110 
       
   111         /**
       
   112          * Check if waypoint name exist
       
   113          * @param aName 
       
   114          * @return TBool 
       
   115          */
       
   116         TBool CheckIfExistL( const TDes& aName, TInt& aErrorCode, TInt& aRemovedIndex );
       
   117         
       
   118         /**
       
   119          * Launches the Landmark Dialog
       
   120          * 
       
   121          */
       
   122         TInt LaunchLandmarksDialogL();
       
   123         
       
   124         /**
       
   125          * Launches confirmation dialog
       
   126          * 
       
   127          */
       
   128         TInt NotifyUserErrorL(TInt resourceId);
       
   129         
       
   130         void SaveCurrentPositionAsLandmarkL();
       
   131         
       
   132         TInt LaunchManualWaypointDialogL();
       
   133         
       
   134         /**
       
   135          * Make visible Middle Soft Key Label/Icon.
       
   136          * 
       
   137          */
       
   138         void SetMSKVisible(); 
       
   139         
       
   140         #ifdef RD_SCALABLE_UI_V2        
       
   141         /**
       
   142         * From MEikListBoxObserver.
       
   143         * Handles listbox events.
       
   144         * @param aListBox Listbox where the event occurred.
       
   145         * @param aEventType Event type.
       
   146         */
       
   147         void HandleListBoxEventL( CEikListBox* aListBox, 
       
   148             TListBoxEvent aEventType );
       
   149 
       
   150         /**
       
   151         * Called by HandleListBoxEventL to handles list box selections.
       
   152         * This is Pure virtual function so every derived view class
       
   153         * need defination for this function
       
   154         */
       
   155         virtual void HandleListBoxSelectionL() = 0;                                   
       
   156         #endif // RD_SCALABLE_UI_V2        
       
   157         
       
   158         void ShowCurrentPositionInfoL();
       
   159     
       
   160     public: //New Method
       
   161         /**
       
   162          * Changes the MSK visibility option depending upon some condition.
       
   163          * 
       
   164          */
       
   165         void SetMSKNotVisible();
       
   166         
       
   167         /**
       
   168          * Update Middle Soft Key label/Icon depending upon GPS data Availability
       
   169          * 
       
   170          */
       
   171         void UpdateMskStateL();
       
   172         
       
   173         void SaveCurrentPositionL();
       
   174         
       
   175         CBlidDocument* BlidDocument();
       
   176         
       
   177         void ActivateSatelliteViewL( );
       
   178         
       
   179         TBool IsSatViewActive( );
       
   180         
       
   181         TBool IsForeGroundApp( );
       
   182         
       
   183         void ExitMainApplicationL( TInt aButtonId );
       
   184         
       
   185         void LaunchTripContextMenuL();
       
   186         
       
   187         void LaunchNavigationContextMenuL();
       
   188         
       
   189         void LaunchSatelliteInfoDlgL();
       
   190         
       
   191         /**
       
   192          * Sets the Middle Soft Key label after reding from the resource ID.
       
   193          * @param aResourceId
       
   194          * @param aCommandId
       
   195          */        
       
   196         void SetMiddleSoftKeyLabelL(const TInt aResourceId, const TInt aCommandId );
       
   197         
       
   198         void RemoveMiddleSoftKeyLabel( const TInt aCommandId );
       
   199         
       
   200         void ActivateNavigationViewL( );
       
   201         
       
   202         void ChangeViewSoftKeyL( );
       
   203         
       
   204         TRect ApplicationRect() const;
       
   205         
       
   206         CAlfImageLoaderUtil* ImageLoaderUtils( ) const;
       
   207         
       
   208         TFileName ImagePathName( ) const;
       
   209 
       
   210         
       
   211     #ifdef RD_SCALABLE_UI_V2        
       
   212     public:
       
   213        /**
       
   214         * Depends upon the Lm feature availability
       
   215         * return ETrue or EFalse
       
   216         * @return Tbool
       
   217         */
       
   218         TBool IsLmFeatureAvailable();
       
   219         
       
   220        /**
       
   221         * Depends upon the Lm availability in DB
       
   222         * return ETrue or EFalse
       
   223         * @return Tbool
       
   224         */
       
   225         TBool IsLmAvailableL();
       
   226         
       
   227        /**
       
   228         * Depends upon saved Waypoint availability
       
   229         * return ETrue or EFalse
       
   230         * @return Tbool
       
   231         */
       
   232         TBool IsWpAvailable();
       
   233         
       
   234     #endif // RD_SCALABLE_UI_V2    
       
   235     
       
   236 	public://new function added for HTK        
       
   237 		void ActivateCorrectViewL( TInt aIndex );
       
   238 		
       
   239         TBool IsSettingsViewActive();        		
       
   240         
       
   241         CCoeEnv* CoeEnv();        		
       
   242     
       
   243 
       
   244     protected: // Data
       
   245         /// Not owned: reference to key processor
       
   246         MKeyProcessor& iKeyProcessor;
       
   247 
       
   248         // Not owned: A pointer to location model
       
   249         MBlidLocation* iLocation;
       
   250 
       
   251         // Not owned: A pointer to router model
       
   252         MBlidRouter* iRouter;
       
   253 
       
   254         // Not owned: A pointer to blid's engine
       
   255         CBlidEng* iEngine;
       
   256         
       
   257         /// Own: Landmark Dialog
       
   258         CLmkLandmarkSelectorDlg* iLandmarkInfo;
       
   259         
       
   260         ///Own: count for 30 sec PSY unavailaility
       
   261         static TInt iPSYTimeoutCount;
       
   262         
       
   263         ///Own: Manual waypoint default name
       
   264         TBuf<KBlidWaypointNameMaxLen> iManualWaypointName;
       
   265         
       
   266         static TBool iOnline;
       
   267         
       
   268         TInt iGPSTimeoutCount;
       
   269         
       
   270         //Own: Boolean value holds whether the MSK is visible or not.
       
   271         TBool iMSKVisible;
       
   272         
       
   273         TBool	iIsSettingsViewActive;                 
       
   274         
       
   275 	private:
       
   276 		CBlidCurrentPositionDlg* iPopupDialog;
       
   277 		
       
   278         TFileName iConFileName;
       
   279         
       
   280         CAlfImageLoaderUtil* iImageLoaderUtil;  
       
   281 		
       
   282     };
       
   283 
       
   284 #endif //CBLIDBASEVIEW_H
       
   285 
       
   286 // End of File