locsrv_plat/location_settings_launch_api/inc/locsettingsuiclient.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2005-2009 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:  Client Side handle for using the Location System UI services
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_LOCSETTINGSUICLIENT_H
       
    20 #define C_LOCSETTINGSUICLIENT_H
       
    21 
       
    22 // System Includes
       
    23 #include <e32base.h>
       
    24 
       
    25 // Forward Declarations
       
    26 class RLocSettingsUiService;
       
    27 class CLocLaunchUiAO;
       
    28 class CEikonEnv;
       
    29 
       
    30 // Global Constants
       
    31 
       
    32 // UIDs for Launching the Location Based Settings UIs through the Launch
       
    33 // API. The UIDs of all the Settings UI plug-ins that plug into this framework
       
    34 // need to be consolidated here.
       
    35 
       
    36 /**
       
    37  * UID for launching Position Method Settings 
       
    38  */
       
    39 const TInt  KLocPsySettingsUID  = 0x10275062;
       
    40 
       
    41 /**
       
    42  * UID for launching SUPL Settings UI
       
    43  */
       
    44 const TInt  KLocSUPLSettingsUID = 0x10275091;
       
    45 
       
    46 /**
       
    47  * UID for launching Location Notation Prefences Settings UI
       
    48  */
       
    49 const TInt  KLocNotPrefSettingsUID = 0x1020690F;
       
    50 
       
    51 // Parameters for Individual Location Based Settings UIs. All parameter 
       
    52 // enumerations of all Settings UI plug-ins that plug into this framwork
       
    53 // need to be consolidated here
       
    54 
       
    55 /**
       
    56  * Default Value for all paramter enumerations. This should be the first 
       
    57  * enumeration value for all the parameter enumerations that we define
       
    58  */
       
    59 const TInt  KDefaultParamValue  = 0x00000000;
       
    60 
       
    61 /**
       
    62  * SUPL Settings UI parameter enumerations
       
    63  */
       
    64 enum TLocSUPLSettingsParams
       
    65     {
       
    66     ELocSUPLDefault         = KDefaultParamValue,   // Default Settings View
       
    67     ELocSUPLIAPSelection    = 0x00000001,           // IAP Selection dialog
       
    68     ELocSUPLStateSelection  = 0x00000002,           // State enable dialog 
       
    69     ELocSuplSettingsPage    = 0x00000010            // SUPL settings page
       
    70     };
       
    71     
       
    72  
       
    73 /**
       
    74  *  Client side resource class to launch Location settings UI.
       
    75  *
       
    76  *  Client side interface class used by all clients to
       
    77  *  launch Location settings UIs. For UI applications the settings UIs 
       
    78  *  can be launched as embedded application. Frameworks can launch the
       
    79  *  settings UIs in a separate UI server.
       
    80  *
       
    81  *  The client application / framework can also cancel the launched
       
    82  *  settings UI by calling the Cancel method.
       
    83  *
       
    84  *  @lib locsettingsuiclient.lib
       
    85  *  @since S60 v3.1
       
    86  */
       
    87 class CLocSettingsUiClient : public CBase
       
    88     {
       
    89 
       
    90 public:
       
    91     /**
       
    92      * Two Phase constructor 
       
    93      * 
       
    94      * @since S60 v3.1
       
    95      * @return The reference of the newly allocated CLocSettingsUiClient 
       
    96      *         object
       
    97      */
       
    98     IMPORT_C static CLocSettingsUiClient* NewL();
       
    99 
       
   100     /**
       
   101      * Two Phase constructor. Leaves the allocated object on the Clean-up
       
   102      * stack 
       
   103      * 
       
   104      * @since S60 v3.1
       
   105      * @return The reference of the newly allocated CLocSettingsUiClient 
       
   106      *         object
       
   107      */
       
   108     IMPORT_C static CLocSettingsUiClient* NewLC();
       
   109 
       
   110     /**
       
   111      * C++ Destructor
       
   112      * 
       
   113      * @since S60 v3.1
       
   114      */
       
   115     virtual ~CLocSettingsUiClient();
       
   116 
       
   117 public: // Exported functions related to the handling of Location sub-setting UI.
       
   118     /**
       
   119      * Launch a Settings UI in an ui app server. 
       
   120      * The API is used to launch a settings UI. It is expected to be used 
       
   121      * by Framework executables that do not have a UI environment.
       
   122      * There can be only one outstanding Launch request at any instant of 
       
   123      * time. This is an asynchronous function. If a session is already 
       
   124      * running then the function leaves with KErrInUse.
       
   125      *
       
   126      * @since S60 v3.1
       
   127      * @param aImplementationUid The ECOM Implementation UID of the 
       
   128      *                           settings UI ECOM plug-in that has to be 
       
   129      *                           launched.
       
   130      * @param aParams            Opaque parameters that is handed over to
       
   131      *                           the Settings UI. Flags that define 
       
   132      *                           specific configuration of the Settings UI,
       
   133      *                           that the user of the API wants to launch. 
       
   134      *                           The interpretation of these flag values is a
       
   135      *                           part of the understanding between the API 
       
   136      *                           user and the Settings UI
       
   137      * @param aStatus            Request status. On completion contains: 
       
   138      *                           KErrNone, if successful, otherwise one of
       
   139      *                           the other system-wide error codes.
       
   140      *
       
   141      */
       
   142     IMPORT_C void LaunchSettingsUiL( TUid            aImplementationUid, 
       
   143                                      TInt            aParams,
       
   144                                      TRequestStatus& aStatus );
       
   145     
       
   146     /**
       
   147      * Launch a Settings UI as an embedded application.
       
   148      * The API is used to launch a settings UI as an embeded. This is
       
   149      * expected to be used by UI applications. There can be only 
       
   150      * one outstanding Launch request at any instant of time. This is
       
   151      * an asynchronous function.
       
   152      *
       
   153      * @since S60 v3.1
       
   154      * @param aImplementationUid The ECOM Implementation UID of the 
       
   155      *                           settings UI ECOM plug-in that has to be 
       
   156      *                           launched.
       
   157      * @param aParams            Opaque parameters that is handed over to
       
   158      *                           the Settings UI. Flags that define 
       
   159      *                           specific configuration of the Settings UI,
       
   160      *                           that the user of the API wants to launch.
       
   161      *                           The interpretation of these flag values is a
       
   162      *                           part of the understanding between the API 
       
   163      *                           user and the Settings UI
       
   164      * @param aStatus            Request status. On completion contains: 
       
   165      *                           KErrNone, if successful, otherwise one of
       
   166      *                           the other system-wide error codes.
       
   167      *
       
   168      */
       
   169     IMPORT_C void LaunchSettingsUiAsEmbeddedAppL( 
       
   170                                     TUid            aImplementationUid, 
       
   171                                     TInt            aParams,
       
   172                                     TRequestStatus& aStatus );    
       
   173     /**
       
   174      * Launch a Settings UI in an ui app server. 
       
   175      * The API is used to launch a settings UI. It is expected to be used 
       
   176      * by Framework executables that do not have a UI environment.
       
   177      * There can be only one outstanding Launch request at any instant of 
       
   178      * time. This is an asynchronous function. If a session is already 
       
   179      * running then the function leaves with KErrInUse.
       
   180      *
       
   181      * @since S60 v9.2
       
   182      * @param aImplementationUid The ECOM Implementation UID of the 
       
   183      *                           settings UI ECOM plug-in that has to be 
       
   184      *                           launched.
       
   185      * @param aParamsString      Opaque parameters that is handed over to
       
   186      *                           the Settings UI. This allows the API user  
       
   187      *                           to pass buffer to the Settings UI.
       
   188      *                           The interpretation of this buffer is the
       
   189      *                           part of the understanding between the API 
       
   190      *                           user and the Settings UI
       
   191      * @param aStatus            Request status. On completion contains: 
       
   192      *                           KErrNone, if successful, otherwise one of
       
   193      *                           the other system-wide error codes.
       
   194      *
       
   195      */
       
   196     IMPORT_C void LaunchSettingsUiL( TUid            aImplementationUid, 
       
   197                                      const TDesC&            aParamsString,
       
   198                                      TRequestStatus& aStatus );
       
   199     
       
   200     /**
       
   201      * Launch a Settings UI as an embedded application.
       
   202      * The API is used to launch a settings UI as an embeded. This is
       
   203      * expected to be used by UI applications. There can be only 
       
   204      * one outstanding Launch request at any instant of time. This is
       
   205      * an asynchronous function.
       
   206      *
       
   207      * @since S60 v9.2
       
   208      * @param aImplementationUid The ECOM Implementation UID of the 
       
   209      *                           settings UI ECOM plug-in that has to be 
       
   210      *                           launched.
       
   211      * @param aParamsString      Opaque parameters that is handed over to
       
   212      *                           the Settings UI. This allows the API user  
       
   213      *                           to pass buffer to the Settings UI.
       
   214      *                           The interpretation of this buffer is the
       
   215      *                           part of the understanding between the API 
       
   216      *                           user and the Settings UI
       
   217      * @param aStatus            Request status. On completion contains: 
       
   218      *                           KErrNone, if successful, otherwise one of
       
   219      *                           the other system-wide error codes.
       
   220      *
       
   221      */
       
   222     IMPORT_C void LaunchSettingsUiAsEmbeddedAppL( 
       
   223                                     TUid            aImplementationUid, 
       
   224                                     const TDesC&            aParamsString,
       
   225                                     TRequestStatus& aStatus );    
       
   226     
       
   227     /**
       
   228      * Cancels an already launched settings UI.
       
   229      *
       
   230      * @since S60 v3.1
       
   231      * @return a Symbian OS Error Code in case a settings UI was not launched.
       
   232      * Returns KErrNone if successful. 
       
   233      */
       
   234     IMPORT_C TInt CancelLaunchedSettingsUi();
       
   235 
       
   236 public: // Exported functions pertaining to the handling of Postioning Settings
       
   237 
       
   238     /**
       
   239      * Launch Positioning Settings UI.
       
   240      * The API is used to launch Positioning Settings UI. It is expected to 
       
   241      * be used by Framework executables that do not have a UI environment.
       
   242      * There can be only one outstanding Launch request at any instant of 
       
   243      * time. This is an asynchronous function. If a session is already 
       
   244      * running then the function leaves with KErrInUse.
       
   245      *
       
   246      * @since S60 v3.2
       
   247      * @param aStatus            Request status. On completion contains: 
       
   248      *                           KErrNone, if successful, otherwise one of
       
   249      *                           the other system-wide error codes.     
       
   250      *
       
   251      */
       
   252     IMPORT_C void LaunchPosSettingsL( TRequestStatus& aStatus );
       
   253     
       
   254     /**
       
   255      * Launch Positioning Settings UI as an embedded application.
       
   256      * The API is used to launch Positioning Settings UI. his is
       
   257      * expected to be used by UI applications. There can be only 
       
   258      * one outstanding Launch request at any instant of time. This is
       
   259      * an asynchronous function. If a session is already 
       
   260      * running then the function leaves with KErrInUse.
       
   261      *
       
   262      * @since S60 v3.2
       
   263      * @param aStatus            Request status. On completion contains: 
       
   264      *                           KErrNone, if successful, otherwise one of
       
   265      *                           the other system-wide error codes.     
       
   266      *
       
   267      */    
       
   268     IMPORT_C void LaunchPosSettingsAsEmbeddedAppL(  TRequestStatus& aStatus );
       
   269  
       
   270     /**
       
   271      * Closes an already launched Positioning Settings UI.
       
   272      *
       
   273      * @since S60 v3.2
       
   274      * @return Symbian OS Error Code in case Positioning settings UI
       
   275      *         was not launched.
       
   276      * Returns KErrNone if successful. 
       
   277      */   
       
   278     IMPORT_C TInt ClosePosSettings();
       
   279     
       
   280 private:
       
   281     /**
       
   282      * C++ Default Constructor
       
   283      */
       
   284     CLocSettingsUiClient();
       
   285 
       
   286     /**
       
   287      * Second phase of Two phase construction
       
   288      */
       
   289     void ConstructL();
       
   290 
       
   291 private:
       
   292 
       
   293     /**
       
   294      * Handle to the Client side resource to the Settings UI Server
       
   295      * Owns
       
   296      */
       
   297     RLocSettingsUiService*          iLocService;
       
   298      
       
   299     /**
       
   300      * Active Object to initiate asynchronous requests
       
   301      * Owns
       
   302      */
       
   303     CLocLaunchUiAO*                 iLaunchUiAO;
       
   304      
       
   305     /**
       
   306      * Reference to the UI environment from where this client is launched.
       
   307      * It will be NULL if the Client Application is launched from frameworks
       
   308      */
       
   309     CEikonEnv*                        iCEikonEnv; 
       
   310      
       
   311     /** Unused variable for future expansion. */
       
   312     TAny* iReserved;
       
   313 
       
   314     };
       
   315 
       
   316 #endif // C_LOCSETTINGSUICLIENT_H