locationsystemui/locationsysui/locsettingsuiservice/locsettingsuiclient/inc/locsettingsuiservice.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 resource handle to the UI Server
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef R_LOCSETTINGSUISERVICE_H
       
    20 #define R_LOCSETTINGSUISERVICE_H
       
    21 
       
    22 // System Includes
       
    23 #include <e32base.h>
       
    24 #include <AknServerApp.h>
       
    25 
       
    26 // User Includes
       
    27 #include "loclaunchuiobserver.h"
       
    28 
       
    29 // Forward Declaration
       
    30 class CLocLaunchUiAO;
       
    31 
       
    32 /**
       
    33  *  Client Side handle to the Settings UI server
       
    34  *
       
    35  *  @lib locsettingsuiclient.lib
       
    36  *  @since S60 v3.1
       
    37  */
       
    38 NONSHARABLE_CLASS( RLocSettingsUiService ): public RAknAppServiceBase,
       
    39                                             public MLocLaunchUiObserver,
       
    40                                             public MAknServerAppExitObserver
       
    41     {
       
    42 public:
       
    43     /**
       
    44      * C++ Default Constructor
       
    45      */
       
    46     RLocSettingsUiService();
       
    47     
       
    48     /**
       
    49      * C++ Destructor
       
    50      * 
       
    51      * @since S60 v3.1
       
    52      */
       
    53     virtual ~RLocSettingsUiService();
       
    54 
       
    55     /**
       
    56      * Launch a Settings UI in an ui app server. 
       
    57      * The API is used to launch a settings UI. There can be only one 
       
    58      * outstanding Launch request at any instant of time. This is an 
       
    59      * asynchronous function. If a session is already running then the
       
    60      * function leaves with KErrInUse.
       
    61      *
       
    62      * @since S60 v3.1
       
    63      * @param aImplementationUid The ECOM Implementation UID of the 
       
    64      *                           settings UI ECOM plug-in that has to be 
       
    65      *                           launched.
       
    66      * @param aParams            Opaque parameters that is handed over to
       
    67      *                           the Settings UI.
       
    68      * @param aStatus            Request status. On completion contains: 
       
    69      *                           KErrNone, if successful, otherwise one of
       
    70      *                           the other system-wide error codes.
       
    71      *
       
    72      */
       
    73     void LaunchSettingsUiL( TUid            aImplementationUid, 
       
    74                             TInt            aParams,
       
    75                             TRequestStatus& aStatus );
       
    76 
       
    77     /**
       
    78      * Launch a Settings UI as an embedded application.
       
    79      * The API is used to launch a settings UI as an embedded application.
       
    80      *
       
    81      * @since S60 v3.1
       
    82      * @param aImplementationUid The ECOM Implementation UID of the 
       
    83      *                           settings UI ECOM plug-in that has to be 
       
    84      *                           launched.
       
    85      * @param aParams            Opaque parameters that is handed over to
       
    86      *                           the Settings UI. 
       
    87      * @param aStatus            Request status. On completion contains: 
       
    88      *                           KErrNone, if successful, otherwise one of
       
    89      *                           the other system-wide error codes.
       
    90      *
       
    91      */
       
    92     void LaunchSettingsUiAsEmbeddedAppL( 
       
    93                                 TUid            aImplementationUid, 
       
    94                                 TInt            aParams,
       
    95                                 TRequestStatus& aStatus );    
       
    96 
       
    97     /**
       
    98      * Launch a Settings UI in an ui app server. 
       
    99      * The API is used to launch a settings UI. There can be only one 
       
   100      * outstanding Launch request at any instant of time. This is an 
       
   101      * asynchronous function. If a session is already running then the
       
   102      * function leaves with KErrInUse.
       
   103      *
       
   104      * @since S60 v9.2
       
   105      * @param aImplementationUid The ECOM Implementation UID of the 
       
   106      *                           settings UI ECOM plug-in that has to be 
       
   107      *                           launched.
       
   108      * @param aStringParams      Opaque parameters that is handed over to
       
   109      *                           the Settings UI.
       
   110      * @param aStatus            Request status. On completion contains: 
       
   111      *                           KErrNone, if successful, otherwise one of
       
   112      *                           the other system-wide error codes.
       
   113      *
       
   114      */
       
   115     void LaunchSettingsUiL( TUid            aImplementationUid, 
       
   116                             const TDesC&            aStringParams,
       
   117                             TRequestStatus& aStatus );
       
   118 
       
   119     /**
       
   120      * Launch a Settings UI as an embedded application.
       
   121      * The API is used to launch a settings UI as an embedded application.
       
   122      *
       
   123      * @since S60 v9.2
       
   124      * @param aImplementationUid The ECOM Implementation UID of the 
       
   125      *                           settings UI ECOM plug-in that has to be 
       
   126      *                           launched.
       
   127      * @param aStringParams      Opaque parameters that is handed over to
       
   128      *                           the Settings UI.
       
   129      * @param aStatus            Request status. On completion contains: 
       
   130      *                           KErrNone, if successful, otherwise one of
       
   131      *                           the other system-wide error codes.
       
   132      *
       
   133      */
       
   134     void LaunchSettingsUiAsEmbeddedAppL( 
       
   135                                 TUid            aImplementationUid, 
       
   136                                 const TDesC&            aStringParams,
       
   137                                 TRequestStatus& aStatus );    
       
   138     
       
   139     /**
       
   140      * Cancels an already launched settings UI.
       
   141      *
       
   142      * @since S60 v3.1
       
   143      * @return a Symbian OS Error Code in case a settings UI was not launched.
       
   144      * Returns KErrNone if successful. 
       
   145      */
       
   146     TInt CancelLaunchedSettingsUi();
       
   147     
       
   148     /**
       
   149      * Launch Positioning Settings UI in an ui app server.
       
   150      * The API is used to launch Positioning Settings UI. There can be only 
       
   151      * one outstanding Launch request at any instant of time. This is an 
       
   152      * asynchronous function. If a session is already running then the 
       
   153      * function leaves with KErrInUse.
       
   154      *
       
   155      * @since S60 v3.2
       
   156      * @param aStatus            Request status. On completion contains: 
       
   157      *                           KErrNone, if successful, otherwise one of
       
   158      *                           the other system-wide error codes.     
       
   159      *
       
   160      */
       
   161     void LaunchPosSettingsL( TRequestStatus& aStatus );
       
   162     
       
   163     /**
       
   164      * Launch Positioning Settings UI as an embedded application.
       
   165      * There can be only one outstanding Launch request at any instant of
       
   166      * time. This is an asynchronous function. If a session is already 
       
   167      * running then the function leaves with KErrInUse.
       
   168      *
       
   169      * @since S60 v3.2
       
   170      * @param aStatus            Request status. On completion contains: 
       
   171      *                           KErrNone, if successful, otherwise one of
       
   172      *                           the other system-wide error codes.     
       
   173      *
       
   174      */    
       
   175     void LaunchPosSettingsAsEmbeddedAppL(  TRequestStatus& aStatus );
       
   176  
       
   177     /**
       
   178      * Closes an already launched Positioning Settings UI.
       
   179      *
       
   180      * @since S60 v3.2
       
   181      * @return Symbian OS Error Code in case Positioning settings UI
       
   182      *         was not launched.
       
   183      * Returns KErrNone if successful. 
       
   184      */   
       
   185     TInt ClosePosSettings();
       
   186         
       
   187     /**
       
   188      * Sets the Launch Active object which is used to initiate Asynchronous 
       
   189      * calls to the UI server
       
   190      */
       
   191     void SetLaunchAO( CLocLaunchUiAO*&      aLaunchAO );
       
   192     
       
   193 public: // From MLocLaunchUiObserver
       
   194 
       
   195     void LaunchUiComplete( TInt    aError );
       
   196     
       
   197 public: // From RAknAppServiceBase
       
   198     TUid ServiceUid() const;
       
   199  
       
   200 public:
       
   201 
       
   202     /**
       
   203      * From base class MAknServerAppExitObserver
       
   204      * Handles the Server Exit Event.
       
   205      * @param aReason the command Id or error code which caused the server 
       
   206      * to close.
       
   207      */
       
   208     virtual void HandleServerAppExit(TInt aReason);
       
   209     
       
   210 private:
       
   211     /**
       
   212      * Connects to a non embedded server instance. The function tries to 
       
   213      * create a new server instance if the server is not already running
       
   214      */ 
       
   215     void    ConnectServerL();
       
   216     
       
   217     /**
       
   218      * Starts a new server instance
       
   219      *
       
   220      * @return  KErrNone, If the server is successfully launched
       
   221      *          System wide error codes incase the Start fails
       
   222      */
       
   223     TInt    StartServer();
       
   224        
       
   225 private:
       
   226     /**
       
   227      * Enumeration type defining the type of launch request outstanding
       
   228      */
       
   229      enum   TLaunchRequestType
       
   230         {
       
   231         ELaunchNone,
       
   232         ELaunchNormal,
       
   233         ELaunchEmbedded
       
   234         };
       
   235         
       
   236 private:
       
   237 
       
   238     /**
       
   239      * Active object used to provide asynshronous Send Receive Api calls
       
   240      * Owns
       
   241      */
       
   242     CLocLaunchUiAO*         iLaunchAO;
       
   243     
       
   244     /**
       
   245      * Reference to the Status variable of the object on which the Launch
       
   246      * request was issued
       
   247      */
       
   248      TRequestStatus*        iRequestStatus;
       
   249     
       
   250     /**
       
   251      * Current Launch status of the Serive provider
       
   252      */
       
   253      TLaunchRequestType     iLaunchType;
       
   254      
       
   255     /**
       
   256      * Monitor the life of the server application.
       
   257      * Wait for Server Exit Event.
       
   258      * Owns
       
   259      */
       
   260      CApaServerAppExitMonitor* iSrvMonitor;
       
   261     };
       
   262 
       
   263 #endif // R_LOCSETTINGSUISERVICE_H