supl/locationomasuplprotocolhandler/protocolhandlerver1/inc/epos_comasuplsettingslauncher.h
changeset 50 4c28d569e1fe
parent 43 24e118dfbea1
child 52 4d26d2f138a3
equal deleted inserted replaced
43:24e118dfbea1 50:4c28d569e1fe
     1 /*
       
     2 * Copyright (c) 2002-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:   Active object wrapper for launching Settings UI
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_COMASUPLSETTINGSLAUNCHER_H
       
    21 #define C_COMASUPLSETTINGSLAUNCHER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32std.h>
       
    25 //#include <agentdialog.h>    // for RGenConAgentDialogServer
       
    26 
       
    27 const TUid KNotifier1Uid = { 0x10009C00 };
       
    28 const TUid KNotifier2Uid = { 0x10009C01 };
       
    29 const TUid KNotifier3Uid = { 0x10009C02 };
       
    30 // FORWARD DECLARATIONS
       
    31 class MOMASuplUISettingsObserver;
       
    32 class CLocSettingsUiClient;
       
    33 class COMASuplTrace;
       
    34 /**
       
    35 * Active object wrapper for launching Supl Settings UI.
       
    36 * User of this class needs to implement relevant MOMASuplUISettingsObserver interface
       
    37 * methods to receive notifications.
       
    38 */
       
    39 class COMASuplSettingsLauncher : public CActive
       
    40     {
       
    41     public:
       
    42 
       
    43 		enum TSuplDialogType
       
    44 			{
       
    45 				ESUPLYesNoDialog  = 0,
       
    46 				ESUPLIAPDialog,
       
    47 				ESUPLUsageDialog,
       
    48 				ESUPLTimeoutDialog		
       
    49 			};	
       
    50         /**
       
    51         * This is a two-phase constructor method that is used to
       
    52         * create a new instance for launching settings UI
       
    53         *
       
    54         * @param aCallback Reference to a callback instance.
       
    55         * @return          A pointer to a new instance of the COMASuplSettingsLauncher class.
       
    56         */
       
    57         static COMASuplSettingsLauncher* NewL(MOMASuplUISettingsObserver& aCallback);
       
    58 
       
    59         /**
       
    60         * This is a two-phase constructor method that is used to create a new
       
    61         * instance for launching settings UI
       
    62         * Leaves the constructed instance to cleanup stack.
       
    63         *
       
    64         * @param aCallback Reference to a callback instance.
       
    65         * @return          A pointer to a new instance of the COMASuplSettingsLauncher class.
       
    66         */
       
    67         static COMASuplSettingsLauncher* NewLC(MOMASuplUISettingsObserver& aCallback);
       
    68         /**
       
    69         * When this method is called, the COMASuplSettingsLauncher launches the
       
    70         * settings UI
       
    71         *
       
    72         * @throws error code depending on whether launch was successful or failed
       
    73         */
       
    74         TInt LaunchSettings();
       
    75 
       
    76         /**
       
    77         * When this method is called, the COMASuplSettingsLauncher cancels the 
       
    78         * launch if it has not been already launched
       
    79         */
       
    80         void CancelLaunch();
       
    81 
       
    82         /**
       
    83         * When this method is called, the COMASuplSettingsLauncher launches the
       
    84         * settings UI
       
    85         *
       
    86         * @throws error code depending on whether launch was successful or failed
       
    87         */
       
    88         TInt LaunchSuplUsageSettingsUI(TBool aRoaming);
       
    89         /* Launches the Dialog saying one or more location requests were cancelled
       
    90         */
       
    91         
       
    92         TInt LaunchSessionTimeOutDialog();
       
    93 
       
    94         /**
       
    95         * Destructor.
       
    96         */
       
    97         virtual ~COMASuplSettingsLauncher();
       
    98         
       
    99         TInt GetIAPName(TDes& aIAPName,TUint32& aIAPId);	
       
   100 
       
   101     protected:
       
   102 
       
   103         /**
       
   104         * Implements CActive
       
   105         * @param none
       
   106         * @return none
       
   107         */    
       
   108         void RunL();
       
   109     
       
   110         /**
       
   111         * Implements CActive
       
   112         * @param aError the error returned
       
   113         * @return error
       
   114         */
       
   115         TInt RunError(TInt aError);
       
   116 
       
   117         /**
       
   118         * Implements CActive
       
   119         * @param none
       
   120         * @return none
       
   121         */    
       
   122         void DoCancel();
       
   123 
       
   124     private:
       
   125 
       
   126         /**
       
   127         * Default Constructor
       
   128         * @param aCallback Reference to a callback instance.
       
   129         * @return None
       
   130         */
       
   131         COMASuplSettingsLauncher(MOMASuplUISettingsObserver& aCallback);
       
   132         
       
   133         void ConstructL();                                         
       
   134    private:
       
   135    
       
   136    		TInt LaunchIAPDialog();       
       
   137    		
       
   138    		void ConvertIAPIdtoNameL( const TUint aIAPId,TDes& aIAPName );                            
       
   139     private:
       
   140         // not owned by this class
       
   141         MOMASuplUISettingsObserver& iCallback; 
       
   142         // Settings Launcher
       
   143         CLocSettingsUiClient* iSettingsLauncher;
       
   144 
       
   145 		//Trace Utility
       
   146 		COMASuplTrace* iTrace;
       
   147 
       
   148 		TSuplDialogType  iDialogType;
       
   149 
       
   150         RNotifier iNotifier;
       
   151 	    TBuf8<256>	buffer1;
       
   152 	    TBuf8<256>  buffer2;
       
   153         TBool iRoaming;
       
   154         
       
   155 		/**
       
   156 		* IAP Selector Handle
       
   157 		*/
       
   158 	 //   RGenConAgentDialogServer    	iIapSelector;
       
   159 	    
       
   160 		/**
       
   161 		* Selected IAP ID
       
   162 		*/
       
   163         TUint32                     	iSelectedIap;
       
   164 
       
   165 
       
   166     };
       
   167 
       
   168 
       
   169 /**
       
   170 * This class provides a callback interface for handling the
       
   171 * completion of settings.  The Client derives a
       
   172 * class from this interface and implements the SettingsUICompleted-methods
       
   173 * that interest it.
       
   174 */
       
   175 class MOMASuplUISettingsObserver
       
   176     {
       
   177 
       
   178     public:
       
   179 
       
   180     /** 
       
   181     * This callback method is used to notify the client about
       
   182     * completion of settingsUi Launch
       
   183     * @param aError error encountered while launching change
       
   184     * @return None
       
   185     */
       
   186     virtual void SettingsUICompletedL(TInt aError) = 0;
       
   187    
       
   188     /** 
       
   189     * This callback method is used to notify the client about
       
   190     * completion of settingsUi Launch for SUPL state
       
   191     * @param aError error encountered while launching change
       
   192     * @return None
       
   193     */
       
   194    
       
   195     virtual void SettingsUsageUICompletedL(TInt aError) = 0;
       
   196    
       
   197     /** 
       
   198     * This callback method is used to notify the client about
       
   199     * completion of Timeout UI
       
   200     * @param aError error encountered while launching change
       
   201     * @return None
       
   202     */
       
   203    
       
   204     virtual void SettingsTimeOutUICompletedL(TInt aError) = 0;
       
   205    
       
   206     };
       
   207 
       
   208 #endif      // C_COMASUPLSETTINGSLAUNCHER_H
       
   209 
       
   210 // End of File