locationcentre/lcservice/inc/lcclientsession.h
branchRCL_3
changeset 16 4721bd00d3da
parent 14 3a25f69541ff
child 21 e15b7f06eba6
equal deleted inserted replaced
14:3a25f69541ff 16:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 2007 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 session to the Location Centre server.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef R_LCCLIENTSESSION_H
       
    20 #define R_LCCLIENTSESSION_H
       
    21 
       
    22 // SYSTEM INCLUDES
       
    23 #include <e32std.h>
       
    24 
       
    25 // USER INCLUDES
       
    26 #include "lcserverinterface.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 
       
    30 /**
       
    31  *  Client side session handle to the Location Centre server session.
       
    32  *
       
    33  *  @lib lcservice.lib
       
    34  *  @since S60 v5.0
       
    35  */
       
    36 NONSHARABLE_CLASS( RLcClientSession ) : public RSessionBase
       
    37     {
       
    38 public:
       
    39     /**
       
    40      * C++ Default Constructor
       
    41      *
       
    42      *  @lib lcservice.lib
       
    43      *  @since S60 v5.0     
       
    44      */
       
    45     RLcClientSession();      
       
    46 
       
    47     /**
       
    48      * C++ Destructor.
       
    49      *
       
    50      *  @lib lcservice.lib
       
    51      *  @since S60 v5.0     
       
    52      */
       
    53     virtual ~RLcClientSession();
       
    54 
       
    55     /**
       
    56      * Creates the Client side session handle to the Location Centre
       
    57      * server.
       
    58      *
       
    59      * This function starts the Location Centre server (if its not already
       
    60      * running) and then creates a session to it.
       
    61      *
       
    62      * @since S60 v5.0
       
    63      * @leave System wide error code if the operation fails.
       
    64      */
       
    65     TInt CreateSession();
       
    66     
       
    67     /**
       
    68      * Closes the Client side session handle to the Location Centre
       
    69      * server.
       
    70      *
       
    71      * @since S60 v5.0   
       
    72      */
       
    73     void Close();
       
    74    
       
    75     /**
       
    76      * Send an asynchronous request to the Location Centre server.
       
    77      *
       
    78      * @since S60 v5.0
       
    79      * @param aMsgType  Operation that is requested from the Location
       
    80      *                  Centre server.
       
    81      * @param aArgs     Message argument. 
       
    82      * @param aStatus   The request status object on which the completion
       
    83      *                  of the request is communicated.
       
    84      */
       
    85     void SendReceive(       TLcServerMsgType    aMsgType, 
       
    86                       const TIpcArgs&           aArgs,
       
    87                             TRequestStatus&     aStatus ) const;
       
    88     
       
    89     /**
       
    90      * Send an synchronous request to the Location Centre server.
       
    91      *
       
    92      * @since S60 v5.0
       
    93      * @param aMsgType  Operation that is requested from the Location
       
    94      *                  Centre server.
       
    95      * @param aArgs     Message argument. 
       
    96      * @return  KErrNone, If the request is completed successfully.
       
    97      *          System wide error codes in the request fails.
       
    98      */
       
    99     TInt SendReceive(       TLcServerMsgType    aMsgType, 
       
   100                       const TIpcArgs&           aArgs ) const;
       
   101  
       
   102     /**
       
   103      * Send an asynchronous request to the Location Centre server.
       
   104      *
       
   105      * @since S60 v5.0
       
   106      * @param aMsgType  Operation that is requested from the Location
       
   107      *                  Centre server.
       
   108      * @param aStatus   The request status object on which the completion
       
   109      *                  of the request is communicated.
       
   110      */
       
   111     void SendReceive(       TLcServerMsgType    aMsgType,
       
   112                             TRequestStatus&     aStatus ) const;
       
   113                              
       
   114     /**
       
   115      * Send an synchronous request to the Location Centre server.
       
   116      *
       
   117      * @since S60 v5.0
       
   118      * @param aMsgType  Operation that is requested from the Location
       
   119      *                  Centre server.
       
   120      * @return  KErrNone, If the request is completed successfully.
       
   121      *          System wide error codes in the request fails.
       
   122      */
       
   123     TInt SendReceive(       TLcServerMsgType    aMsgType ) const;
       
   124                               
       
   125 private:
       
   126     /**
       
   127      * Starts a new server instance
       
   128      *
       
   129      * @return  KErrNone, If the server is successfully launched
       
   130      *          System wide error codes incase the Start fails
       
   131      */
       
   132     TInt StartServer();
       
   133     };
       
   134 
       
   135 #endif // R_LCCLIENTSESSION_H