locationsystemui/locationsysui/locsuplsettingsui/inc/locsuplsettings.h
author hgs
Wed, 03 Nov 2010 23:28:39 +0530
changeset 56 4e949f03ecc5
permissions -rw-r--r--
201044
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  SUPL Settings UI implementation.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef CLOCSUPLSETTINGS_H_
hgs
parents:
diff changeset
    20
#define CLOCSUPLSETTINGS_H_
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
// User Includes
hgs
parents:
diff changeset
    23
#include "locsettingsui.h"
hgs
parents:
diff changeset
    24
#include "locsuplsettingsuiengobserver.h"
hgs
parents:
diff changeset
    25
#include "locsuplsettingseventhandler.h"
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
// System Includes
hgs
parents:
diff changeset
    28
#include <ConeResLoader.h>
hgs
parents:
diff changeset
    29
#include <data_caging_path_literals.hrh>
hgs
parents:
diff changeset
    30
hgs
parents:
diff changeset
    31
hgs
parents:
diff changeset
    32
// Forward Declarations
hgs
parents:
diff changeset
    33
class CAknQueryDialog;
hgs
parents:
diff changeset
    34
class MLocSettingsUiObserver;
hgs
parents:
diff changeset
    35
class CLocSUPLSettingsView;
hgs
parents:
diff changeset
    36
class CLocSUPLServerView;
hgs
parents:
diff changeset
    37
class CLocSUPLSessionView;
hgs
parents:
diff changeset
    38
class CLocSUPLSettingsUiEngine;
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
// Global constants
hgs
parents:
diff changeset
    41
hgs
parents:
diff changeset
    42
/**
hgs
parents:
diff changeset
    43
 * SUPL Settings RSC file name
hgs
parents:
diff changeset
    44
 */
hgs
parents:
diff changeset
    45
_LIT( KSUPLUiResFileName, "locsuplsettingsui.rsc" );
hgs
parents:
diff changeset
    46
hgs
parents:
diff changeset
    47
class CLocSUPLAO : public CActive
hgs
parents:
diff changeset
    48
    {               
hgs
parents:
diff changeset
    49
    public:
hgs
parents:
diff changeset
    50
        static CLocSUPLAO* NewL(
hgs
parents:
diff changeset
    51
                MLocSettingsUiObserver&     aSettingsUiObserver,
hgs
parents:
diff changeset
    52
                CLocSUPLSettingsUiEngine&   aSettingsEngine,
hgs
parents:
diff changeset
    53
                TInt                        aLaunchParams  );
hgs
parents:
diff changeset
    54
        
hgs
parents:
diff changeset
    55
        virtual ~CLocSUPLAO();
hgs
parents:
diff changeset
    56
        
hgs
parents:
diff changeset
    57
        void CompleteRequest();
hgs
parents:
diff changeset
    58
hgs
parents:
diff changeset
    59
    private:
hgs
parents:
diff changeset
    60
        CLocSUPLAO( MLocSettingsUiObserver&     aSettingsUiObserver,
hgs
parents:
diff changeset
    61
                    CLocSUPLSettingsUiEngine&   aSettingsEngine,
hgs
parents:
diff changeset
    62
                    TInt                        aLaunchParams );
hgs
parents:
diff changeset
    63
        
hgs
parents:
diff changeset
    64
        void RunL();
hgs
parents:
diff changeset
    65
        
hgs
parents:
diff changeset
    66
        void DoCancel();
hgs
parents:
diff changeset
    67
        
hgs
parents:
diff changeset
    68
        
hgs
parents:
diff changeset
    69
        
hgs
parents:
diff changeset
    70
    private:
hgs
parents:
diff changeset
    71
        MLocSettingsUiObserver&         iSettingsUiObserver;
hgs
parents:
diff changeset
    72
        CLocSUPLSettingsUiEngine&       iSettingsEngine;
hgs
parents:
diff changeset
    73
        TInt                            iLaunchParams;  
hgs
parents:
diff changeset
    74
    };
hgs
parents:
diff changeset
    75
hgs
parents:
diff changeset
    76
/**
hgs
parents:
diff changeset
    77
 * CLocSUPLSettings
hgs
parents:
diff changeset
    78
 *
hgs
parents:
diff changeset
    79
 * ECom Plugin implementation for SUPL Settings UI. The Settings UI provides 
hgs
parents:
diff changeset
    80
 * two major functionalities i.e., Launching a Settings UI plug-in and 
hgs
parents:
diff changeset
    81
 * cancelling the existing launched UI.
hgs
parents:
diff changeset
    82
 * The Launch request depending on the parameters is expected to pop up a 
hgs
parents:
diff changeset
    83
 * query dialog to request the user whether he intends to configure SUPL
hgs
parents:
diff changeset
    84
 * settings currently. The default behaviour should be to pop up the configuration
hgs
parents:
diff changeset
    85
 * dialog for SUPL settings.
hgs
parents:
diff changeset
    86
 */
hgs
parents:
diff changeset
    87
class CLocSUPLSettings : public CLocSettingsUi,
hgs
parents:
diff changeset
    88
                         public MLocSUPLSettingsUiEngObserver,
hgs
parents:
diff changeset
    89
                         public MLocSUPLSettingsEventHandler
hgs
parents:
diff changeset
    90
    {
hgs
parents:
diff changeset
    91
    
hgs
parents:
diff changeset
    92
    public:
hgs
parents:
diff changeset
    93
        
hgs
parents:
diff changeset
    94
        /**
hgs
parents:
diff changeset
    95
         * Symbian OS two-phased constructor
hgs
parents:
diff changeset
    96
         * @return 
hgs
parents:
diff changeset
    97
         */
hgs
parents:
diff changeset
    98
        static CLocSUPLSettings* NewL( TAny* aParam );
hgs
parents:
diff changeset
    99
    
hgs
parents:
diff changeset
   100
        /**
hgs
parents:
diff changeset
   101
         * Destructor.
hgs
parents:
diff changeset
   102
         */
hgs
parents:
diff changeset
   103
        ~CLocSUPLSettings();
hgs
parents:
diff changeset
   104
hgs
parents:
diff changeset
   105
    public: // Inherited from CLocSettingsUi
hgs
parents:
diff changeset
   106
         
hgs
parents:
diff changeset
   107
    	/**
hgs
parents:
diff changeset
   108
    	 * Inherited from CLocSettingsUi
hgs
parents:
diff changeset
   109
		 * Launches the Settings UI
hgs
parents:
diff changeset
   110
		 *
hgs
parents:
diff changeset
   111
		 * @param aUiLaunchParams	Flags that define specific configuration of
hgs
parents:
diff changeset
   112
         *                          if the Settings UI, that the user of the API
hgs
parents:
diff changeset
   113
         *                          wants to launch. If more than one functionality
hgs
parents:
diff changeset
   114
         *                          is requested then the various combinations
hgs
parents:
diff changeset
   115
         *                          are to be ORed.
hgs
parents:
diff changeset
   116
		 */
hgs
parents:
diff changeset
   117
		 void LaunchL( TInt		aUiLaunchParams );
hgs
parents:
diff changeset
   118
         
hgs
parents:
diff changeset
   119
        /**
hgs
parents:
diff changeset
   120
         * Inherited from CLocSettingsUi
hgs
parents:
diff changeset
   121
         * Launches the Settings UI
hgs
parents:
diff changeset
   122
         *
hgs
parents:
diff changeset
   123
         * @param aUiLaunchParams   Flags that define specific configuration of
hgs
parents:
diff changeset
   124
         *                          if the Settings UI, that the user of the API
hgs
parents:
diff changeset
   125
         *                          wants to launch. If more than one functionality
hgs
parents:
diff changeset
   126
         *                          is requested then the various combinations
hgs
parents:
diff changeset
   127
         *                          are to be ORed.
hgs
parents:
diff changeset
   128
         */
hgs
parents:
diff changeset
   129
         void LaunchL( const TDesC&       aUiLaunchParams );
hgs
parents:
diff changeset
   130
hgs
parents:
diff changeset
   131
		/**
hgs
parents:
diff changeset
   132
		 * Inherited from CLocSettingsUi
hgs
parents:
diff changeset
   133
		 * Closes the running Settings UI prematurely.
hgs
parents:
diff changeset
   134
		 */
hgs
parents:
diff changeset
   135
		 void Close();
hgs
parents:
diff changeset
   136
hgs
parents:
diff changeset
   137
		/**
hgs
parents:
diff changeset
   138
		 * Inherited from CLocSettingsUi
hgs
parents:
diff changeset
   139
         * Method for getting caption of this plugin. This should be the 
hgs
parents:
diff changeset
   140
         * localized name of the settings view to be shown in parent view.
hgs
parents:
diff changeset
   141
         *
hgs
parents:
diff changeset
   142
         * @param aCaption pointer to Caption variable
hgs
parents:
diff changeset
   143
         */
hgs
parents:
diff changeset
   144
         void GetCaptionL( TDes& aCaption ) const;
hgs
parents:
diff changeset
   145
hgs
parents:
diff changeset
   146
		/**
hgs
parents:
diff changeset
   147
		 * Inherited from CLocSettingsUi
hgs
parents:
diff changeset
   148
         * Returns the priority of the UI module. 
hgs
parents:
diff changeset
   149
         * 
hgs
parents:
diff changeset
   150
         * @return Priority of the Settings UI
hgs
parents:
diff changeset
   151
         */
hgs
parents:
diff changeset
   152
         TInt GetPriority();
hgs
parents:
diff changeset
   153
hgs
parents:
diff changeset
   154
		/**
hgs
parents:
diff changeset
   155
		 * Inherited from CLocSettingsUi
hgs
parents:
diff changeset
   156
		 * Accessor Function for determine whether the UI presence 
hgs
parents:
diff changeset
   157
		 * should be shown to the user or should be hidden
hgs
parents:
diff changeset
   158
		 *
hgs
parents:
diff changeset
   159
		 * @return ETrue  If the presence of the UI be shown to the usr
hgs
parents:
diff changeset
   160
				   EFalse If the UI should funtion as a non visible UI
hgs
parents:
diff changeset
   161
		 */
hgs
parents:
diff changeset
   162
		 TBool	IsVisible();
hgs
parents:
diff changeset
   163
	
hgs
parents:
diff changeset
   164
	public: // Inherited from MLocSUPLSettingsUiEngObserver
hgs
parents:
diff changeset
   165
		
hgs
parents:
diff changeset
   166
		/**
hgs
parents:
diff changeset
   167
		 * Inherited from MLocSUPLSettingsUiEngObserver
hgs
parents:
diff changeset
   168
		 */
hgs
parents:
diff changeset
   169
		void HandleSettingsEventL( TSettingsEventType    aEvent );
hgs
parents:
diff changeset
   170
	
hgs
parents:
diff changeset
   171
	public: // Inherited from MLocSUPLSettingsEventHandler
hgs
parents:
diff changeset
   172
		
hgs
parents:
diff changeset
   173
		/**
hgs
parents:
diff changeset
   174
		 * Inherited from MLocSUPLSettingsEventHandler
hgs
parents:
diff changeset
   175
		 */
hgs
parents:
diff changeset
   176
		void HandleScreenSizeChange();
hgs
parents:
diff changeset
   177
		 
hgs
parents:
diff changeset
   178
		/**
hgs
parents:
diff changeset
   179
         * Inherited from MLocSUPLSettingsEventHandler
hgs
parents:
diff changeset
   180
         * Handles commands from the views
hgs
parents:
diff changeset
   181
         *
hgs
parents:
diff changeset
   182
         * @param  aCommand Command ID
hgs
parents:
diff changeset
   183
         */
hgs
parents:
diff changeset
   184
        void HandleCommandL( TInt aCommand );
hgs
parents:
diff changeset
   185
    
hgs
parents:
diff changeset
   186
	private:
hgs
parents:
diff changeset
   187
	    enum TLaunchParamType
hgs
parents:
diff changeset
   188
	        {
hgs
parents:
diff changeset
   189
	        ELaunchParamInt = 0,
hgs
parents:
diff changeset
   190
	        ELaunchParamString
hgs
parents:
diff changeset
   191
	        };
hgs
parents:
diff changeset
   192
        
hgs
parents:
diff changeset
   193
    private:
hgs
parents:
diff changeset
   194
        /**
hgs
parents:
diff changeset
   195
         * C++ default constructor.
hgs
parents:
diff changeset
   196
         */
hgs
parents:
diff changeset
   197
        CLocSUPLSettings( MLocSettingsUiObserver&		aSettingsUiObserver,
hgs
parents:
diff changeset
   198
					 	   CAknViewAppUi&				aAppUi );
hgs
parents:
diff changeset
   199
hgs
parents:
diff changeset
   200
        /**
hgs
parents:
diff changeset
   201
         * Second phase constructor.
hgs
parents:
diff changeset
   202
         */
hgs
parents:
diff changeset
   203
        void ConstructL();
hgs
parents:
diff changeset
   204
  
hgs
parents:
diff changeset
   205
        /**
hgs
parents:
diff changeset
   206
         * Launches the SUPL UI
hgs
parents:
diff changeset
   207
         */
hgs
parents:
diff changeset
   208
        void LaunchSUPLUiL();
hgs
parents:
diff changeset
   209
        
hgs
parents:
diff changeset
   210
        /**
hgs
parents:
diff changeset
   211
         * Opens the nearest localized resourcefile using aResourceLoader. 
hgs
parents:
diff changeset
   212
         * aResourceLoader should be opened only once before closing it. 
hgs
parents:
diff changeset
   213
         * Otherwise it will raise a panic. Therefore it is better to have 
hgs
parents:
diff changeset
   214
         * multiple resource loaders.
hgs
parents:
diff changeset
   215
         * 
hgs
parents:
diff changeset
   216
         * @param aResourceFileName Drive and name of resource file in format 
hgs
parents:
diff changeset
   217
         *                          <path>:<rsc_file_name>
hgs
parents:
diff changeset
   218
         * @param aResourceLoader Resource loader for the resource. The loader 
hgs
parents:
diff changeset
   219
         *                        must not be opened allready or it will raise 
hgs
parents:
diff changeset
   220
         *                        a panic. It is caller's responsibility to 
hgs
parents:
diff changeset
   221
         *                        close the resource loader after using the 
hgs
parents:
diff changeset
   222
         *                        resource.
hgs
parents:
diff changeset
   223
         */
hgs
parents:
diff changeset
   224
        void OpenLocalizedResourceFileL( const TDesC& 				aResourceFileName, 
hgs
parents:
diff changeset
   225
        								       RConeResourceLoader& aResourceLoader );
hgs
parents:
diff changeset
   226
          								       
hgs
parents:
diff changeset
   227
    private:
hgs
parents:
diff changeset
   228
	    /**
hgs
parents:
diff changeset
   229
	     * Resource Loader handle for handling SUPL Settings UI specific resources
hgs
parents:
diff changeset
   230
	     */
hgs
parents:
diff changeset
   231
    	RConeResourceLoader 			iResourceLoader;
hgs
parents:
diff changeset
   232
              								       
hgs
parents:
diff changeset
   233
    	/** 
hgs
parents:
diff changeset
   234
    	 * Reference to the SUPL Settings View
hgs
parents:
diff changeset
   235
    	 * Owns
hgs
parents:
diff changeset
   236
    	 */
hgs
parents:
diff changeset
   237
    	CLocSUPLSettingsView*			iSettingsView;
hgs
parents:
diff changeset
   238
    	
hgs
parents:
diff changeset
   239
    	/**
hgs
parents:
diff changeset
   240
    	 * View Id for SUPL Settings UI View
hgs
parents:
diff changeset
   241
    	 */
hgs
parents:
diff changeset
   242
    	TUid							iSettingsViewId;              								       
hgs
parents:
diff changeset
   243
hgs
parents:
diff changeset
   244
    	/** 
hgs
parents:
diff changeset
   245
    	 * Reference to the SUPL Server View
hgs
parents:
diff changeset
   246
    	 * Owns
hgs
parents:
diff changeset
   247
    	 */
hgs
parents:
diff changeset
   248
    	CLocSUPLServerView*				iServerView;
hgs
parents:
diff changeset
   249
    	
hgs
parents:
diff changeset
   250
    	/**
hgs
parents:
diff changeset
   251
    	 * View Id for SUPL Server UI View
hgs
parents:
diff changeset
   252
    	 */
hgs
parents:
diff changeset
   253
    	TUid							iServerViewId;              								       
hgs
parents:
diff changeset
   254
hgs
parents:
diff changeset
   255
        /**
hgs
parents:
diff changeset
   256
         * Settings UI Engine
hgs
parents:
diff changeset
   257
         * Owns
hgs
parents:
diff changeset
   258
         */
hgs
parents:
diff changeset
   259
         CLocSUPLSettingsUiEngine*      iSettingsEngine;
hgs
parents:
diff changeset
   260
         
hgs
parents:
diff changeset
   261
         /** 
hgs
parents:
diff changeset
   262
    	 * Reference to the SUPL Session View
hgs
parents:
diff changeset
   263
    	 * Owns
hgs
parents:
diff changeset
   264
    	 */
hgs
parents:
diff changeset
   265
         CLocSUPLSessionView*           iSessionView;
hgs
parents:
diff changeset
   266
         
hgs
parents:
diff changeset
   267
    	/**
hgs
parents:
diff changeset
   268
    	 * View Id for SUPL Session UI View
hgs
parents:
diff changeset
   269
    	 */
hgs
parents:
diff changeset
   270
    	TUid							iSessionViewId;   
hgs
parents:
diff changeset
   271
         								       
hgs
parents:
diff changeset
   272
        /**
hgs
parents:
diff changeset
   273
         * Denotes whether a Launch request is outstanding. 
hgs
parents:
diff changeset
   274
         * Necessary to handle the closing of the configuration dialog ( if it
hgs
parents:
diff changeset
   275
         * exists ) gracefully. If the dialog is currenlty being shown to
hgs
parents:
diff changeset
   276
         * the user and we get a Cancel request, then we shouldnot complete
hgs
parents:
diff changeset
   277
         * the request with KErrAbort. This is done to ensure that we complete
hgs
parents:
diff changeset
   278
         * the request only if a Launch call is outstanding
hgs
parents:
diff changeset
   279
         */
hgs
parents:
diff changeset
   280
         TBool                          iLaunchOutStanding;
hgs
parents:
diff changeset
   281
        
hgs
parents:
diff changeset
   282
        /**
hgs
parents:
diff changeset
   283
         * Launch Paramters
hgs
parents:
diff changeset
   284
         */
hgs
parents:
diff changeset
   285
         TInt                           iLaunchParams;    
hgs
parents:
diff changeset
   286
         
hgs
parents:
diff changeset
   287
        /**
hgs
parents:
diff changeset
   288
         * Launch Param Type
hgs
parents:
diff changeset
   289
         */
hgs
parents:
diff changeset
   290
         TLaunchParamType               iLaunchParamType;
hgs
parents:
diff changeset
   291
         
hgs
parents:
diff changeset
   292
         CLocSUPLAO*                    iLaunchAO;
hgs
parents:
diff changeset
   293
    };
hgs
parents:
diff changeset
   294
hgs
parents:
diff changeset
   295
#endif // CLOCSUPLSETTINGS_H_
hgs
parents:
diff changeset
   296