accessoryservices/accessoryserver/inc/Server/AccSrvSubConnection.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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:  Server-side sub-session of Accessory Connection
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CACCSRVSUBCONNECTION_H
       
    21 #define CACCSRVSUBCONNECTION_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "AccSrvSubConnectionBase.h"
       
    25 #include <e32base.h>
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // MACROS
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // FUNCTION PROTOTYPES
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CAccSrvMainSession;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  Accessory Connection server-side sub-session implementation.
       
    42 *
       
    43 *  AccServer.lib
       
    44 *  @since S60 3.1
       
    45 */
       
    46 NONSHARABLE_CLASS( CAccSrvSubConnection ) : public CAccSrvSubConnectionBase
       
    47     {
       
    48     public: // Constructors and destructor
       
    49 
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         * @since S60 3.1
       
    53         * @param aSession              Handle to the ASY Proxy.
       
    54         * @param aConnectionController Handle to the Connection Controller.
       
    55         * @param aServerModel          Handle to the Server Model.
       
    56         * @return Pointer to a new subsession
       
    57         */
       
    58         static CAccSrvSubConnection* NewL( CASYProxyAPI* aSession,
       
    59                                            CAccSrvConnectionController* aConnectionController,
       
    60                                            CAccSrvServerModel* aServerModel );
       
    61 
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         ~CAccSrvSubConnection();
       
    66 
       
    67     public: // New functions
       
    68 
       
    69     public: // Functions from base classes
       
    70 
       
    71         /**
       
    72         * From CAccSrvSubBase.
       
    73         * Handles received messages from client. Sub classes of this base class
       
    74         * may or may not implement this, however, if message is not handled
       
    75         * in sub class, it should call this base class to handle it.
       
    76         * @since S60 3.1
       
    77         * @param aMessage Client request.
       
    78         * @return void
       
    79         */
       
    80         virtual void DispatchMessageL( const RMessage2& aMessage );
       
    81 
       
    82         /**
       
    83         * From MQueueObserver.
       
    84         * Called when Queue passes message completion handling to registered observers.
       
    85         *
       
    86         * @since S60 3.1
       
    87         * @param aMsgID     Message in question.
       
    88         * @param aErrorCode Error Code of the operation.
       
    89         * @param aUniqueID  Unique ID of the Generic ID in question.
       
    90         * @return ETrue if the message was consumpted by a observer.
       
    91         *               Call-back order must be renewed after consumption
       
    92         *               if further call-backs are needed.
       
    93         */
       
    94         virtual TBool CompleteMessageL( TMsgID aMsgID,
       
    95                                         TInt aErrorCode,
       
    96                                         TInt aUniqueID );
       
    97 
       
    98     protected: // New functions
       
    99 
       
   100         /**
       
   101         * C++ default constructor.
       
   102         */
       
   103         CAccSrvSubConnection( CASYProxyAPI* aSession,
       
   104                               CAccSrvConnectionController* aConnectionController,
       
   105                               CAccSrvServerModel* aServerModel );
       
   106 
       
   107         /**
       
   108         * Symbian 2nd phase constructor.
       
   109         */
       
   110         void ConstructL();
       
   111 
       
   112     private:  // New functions
       
   113 
       
   114         /**
       
   115         * Handles GetAccessoryConnectionStatus() client request.
       
   116         * If leave occurs, the client request is completed with that error code.
       
   117         *
       
   118         * @since S60 3.1
       
   119         * @param aMessage Client request.
       
   120         * @return void
       
   121         */
       
   122         void GetAccessoryConnectionStatusL( const RMessage2& aMessage );
       
   123 
       
   124         /**
       
   125         * Handles GetAccessoryConnectionStatus() asynchronous client request.
       
   126         * If leave occurs, the client request is completed with that error code.
       
   127         *
       
   128         * @since S60 3.1
       
   129         * @param aMessage Client request.
       
   130         * @return void
       
   131         */
       
   132         void GetAccessoryConnectionStatusAsyncL( const RMessage2& aMessage );
       
   133 
       
   134         /**
       
   135         * Handles NotifyAccessoryConnectionStatusChanged() client request.
       
   136         * If leave occurs, the client request is completed with that error code.
       
   137         *
       
   138         * @since S60 3.1
       
   139         * @param aMessage Client request.
       
   140         * @return void
       
   141         */
       
   142         void NotifyAccessoryConnectionStatusChanged( const RMessage2& aMessage );
       
   143 
       
   144         /**
       
   145         * Handles CancelNotifyAccessoryConnectionStatusChanged() client request.
       
   146         * If leave occurs, the client request is completed with that error code.
       
   147         *
       
   148         * @since S60 3.1
       
   149         * @param aMessage Client request.
       
   150         * @return void
       
   151         */
       
   152         void CancelNotifyAccessoryConnectionStatusChanged( const RMessage2& aMessage );
       
   153 
       
   154         /**
       
   155         * Handles CancelGetAccessoryConnectionStatus() client request.
       
   156         * If leave occurs, the client request is completed with that error code.
       
   157         *
       
   158         * @since S60 3.1
       
   159         * @param aMessage Client request.
       
   160         * @return void
       
   161         */
       
   162         void CancelGetAccessoryConnectionStatus( const RMessage2& aMessage );
       
   163 
       
   164 
       
   165     public:     // Data
       
   166 
       
   167     protected:  // Data
       
   168 
       
   169     private:    // Data
       
   170 
       
   171         //Stored GetAccessoryConnectionStatus() client request for later completion.
       
   172         RMessage2 iGetAccessoryConnectionStatus;
       
   173 
       
   174         //Stored NotifyAccessoryConnectionStatusChanged() client request for later completion.
       
   175         RMessage2 iNotifyAccessoryConnectionStatusChanged;
       
   176 
       
   177     public:     // Friend classes
       
   178 
       
   179     protected:  // Friend classes
       
   180 
       
   181     private:    // Friend classes
       
   182 
       
   183     };
       
   184 
       
   185 #endif // CACCSRVSUBCONNECTION_H
       
   186 
       
   187 // End of File