hwrmhaptics/hapticsclient/inc/hwrmhapticssession.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Definition of haptics client side session.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef R_HWRMHAPTICSSESSION_H
       
    20 #define R_HWRMHAPTICSSESSION_H
       
    21 
       
    22 class RSessionBase;
       
    23 
       
    24 /**
       
    25  * The client-side handle to a session with the Haptics Server.
       
    26  */
       
    27 class RHWRMHapticsSession : public RSessionBase
       
    28     {
       
    29 public:
       
    30 
       
    31     /**
       
    32      * Connects to server
       
    33      *
       
    34      * @return KErrNone if connect succesfully, otherwise system wide error
       
    35      */
       
    36     TInt Connect();
       
    37 
       
    38     /**
       
    39      * Connects to server asynchronously.
       
    40      *
       
    41      * @param aStatus Status for async call.
       
    42      */
       
    43     void Connect( TRequestStatus& aStatus );
       
    44 
       
    45     /**
       
    46      * Send server a command. This method is just a wrapper for 
       
    47      * SendReceive.
       
    48      *
       
    49      * @param aCommand Command identifier.
       
    50      * @param aArgs Command arguments.
       
    51      * @return KErrNone if sent succesfully, otherwise system wide error
       
    52      */
       
    53     TInt ExecuteOperation( TInt aCommand, const TIpcArgs& aArgs ) const;
       
    54 
       
    55     /**
       
    56      * Send server a command. This method is just a wrapper for 
       
    57      * SendReceive.
       
    58      *
       
    59      * @param aCommand Command identifier.
       
    60      * @return KErrNone if sent succesfully, otherwise system wide error
       
    61      */
       
    62     TInt ExecuteOperation( TInt aCommand ) const;
       
    63 
       
    64     /**
       
    65      * Send server a command. This method is just a public wrapper for 
       
    66      * asynchronous version of SendReceive.
       
    67      *
       
    68      * @param aCommand Command identifier.
       
    69      * @param aArgs Command arguments.
       
    70      * @param aStatus Status object for async call
       
    71      * @return KErrNone if sent succesfully, otherwise system wide error
       
    72      */
       
    73     void ExecuteAsyncOperation( TInt aCommand, const TIpcArgs& aArgs,
       
    74                                 TRequestStatus& aStatus ) const;
       
    75 
       
    76 private:
       
    77 
       
    78     /**
       
    79      * Returns server location,
       
    80      *
       
    81      * @return The location of the server exe.
       
    82      */
       
    83     TFullName ServerLocation() const;
       
    84 
       
    85     /**
       
    86      * Returns the version of the server.
       
    87      * 
       
    88      * @return The version of the server.
       
    89      */
       
    90     TVersion ServerVersion() const;
       
    91          
       
    92     /**
       
    93      * Starts server.
       
    94      * 
       
    95      * @return KErrNone if started succesfully, otherwise system wide error
       
    96      */
       
    97     TInt StartServer() const;
       
    98 
       
    99     /**
       
   100      * Makes connection to server.
       
   101      * 
       
   102      * @return KErrNone if connected succesfully, otherwise system wide error
       
   103      */
       
   104     TInt MakeConnection();
       
   105     };
       
   106 
       
   107 #endif // R_HWRMHAPTICSSESSION_H   
       
   108             
       
   109 // End of File