accessoryservices/accessoryserver/inc/Server/AccSrvMainSession.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's side session class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CACCSRVMAINSESSION_H
       
    20 #define CACCSRVMAINSESSION_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "AccServer.h"
       
    24 #include "AccSrvSubMode.h"
       
    25 #include "AccSrvsubSettings.h"
       
    26 #include "AccSrvSubSingleConnection.h"
       
    27 #include "AccSrvSubConnection.h"
       
    28 #include "AccSrvSubControl.h"
       
    29 #include "AccSrvSubBTControl.h"
       
    30 #include "AccSrvSubAudioControl.h"
       
    31 #include "AccSrvSubAsyComms.h"
       
    32 #include "AsyProxyAPI.h"
       
    33 #include <e32base.h>
       
    34 
       
    35 // CONSTANTS
       
    36 
       
    37 // MACROS
       
    38 
       
    39 // DATA TYPES
       
    40 
       
    41 // FUNCTION PROTOTYPES
       
    42 
       
    43 // FORWARD DECLARATIONS
       
    44 
       
    45 // CLASS DECLARATION
       
    46 /**
       
    47 *  Server's side session class
       
    48 *
       
    49 *  AccServer.exe
       
    50 *  @since S60 3.1
       
    51 */
       
    52 NONSHARABLE_CLASS(  CAccSrvMainSession ) : public CSession2
       
    53     {
       
    54 
       
    55     public: // Constructors and destructor
       
    56 
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         * @since S60 3.1
       
    60         * @param aClient A client's thread
       
    61         * @param aServer Reference to server
       
    62         * @param aProxy Pointer to an ASYProxy's API
       
    63         * @param aConnectionController Pointer to an connection controller object
       
    64         * @param aServerModel Pointer to an server model
       
    65         * @return Pointer to a new session
       
    66         */
       
    67         static CAccSrvMainSession* NewL(
       
    68                           RThread& aClient,
       
    69                           CAccServer& aServer,
       
    70                           CASYProxyAPI* aProxy,
       
    71                           CAccSrvConnectionController* aConnectionController,
       
    72                           CAccSrvServerModel* aServerModel );
       
    73 
       
    74         /**
       
    75         * Two-phased constructor.
       
    76         * @since S60 3.1
       
    77         * @param aClient A client's thread
       
    78         * @param aServer Reference to server
       
    79         * @param aProxy Pointer to an ASYProxy's API
       
    80         * @param aConnectionController Pointer to an connection controller object
       
    81         * @param aServerModel Pointer to an server model
       
    82         * @return Pointer to a new session
       
    83         */
       
    84         static CAccSrvMainSession* NewLC(
       
    85                           RThread& aClient,
       
    86                           CAccServer& aServer,
       
    87                           CASYProxyAPI* aProxy,
       
    88                           CAccSrvConnectionController* aConnectionController,
       
    89                           CAccSrvServerModel* aServerModel );
       
    90 
       
    91         /**
       
    92         * Destructor.
       
    93         */
       
    94         ~CAccSrvMainSession();
       
    95 
       
    96     public: // New functions
       
    97 
       
    98     public: // Functions from base classes
       
    99 
       
   100         /**
       
   101         * Override of CSession2::ServiceL().
       
   102         * @since S60 3.1
       
   103         * @param aMessage Message from client
       
   104         * @return void
       
   105         */
       
   106         void ServiceL( const RMessage2& aMessage );
       
   107 
       
   108     protected:  // New functions
       
   109 
       
   110     protected:  // Functions from base classes
       
   111 
       
   112     private:
       
   113 
       
   114         /**
       
   115         * C++ default constructor.
       
   116         */
       
   117         CAccSrvMainSession( CAccSrvConnectionController* aConnectionController,
       
   118                             CAccSrvServerModel* aServerModel );
       
   119 
       
   120         /**
       
   121         * By default Symbian 2nd phase constructor is private.
       
   122         */
       
   123         void ConstructL( CAccServer* aServer, CASYProxyAPI* aProxy );
       
   124 
       
   125         void NewSubSessionL( const RMessage2& aMessage );
       
   126         void CloseSubSessionL( const RMessage2& aMessage );
       
   127         void DispatchMessageL( const RMessage2& aMessage );
       
   128         void WriteL( const RMessage2& aMessage, TInt aFunction, TInt aErr );
       
   129 
       
   130     public:     // Data
       
   131 
       
   132     protected:  // Data
       
   133 
       
   134     private:    // Data
       
   135 
       
   136         // Pointer to a server
       
   137         CAccServer* iAccServer;  // Not owned
       
   138 
       
   139         // Pointer to an object index
       
   140         CObjectIx* iObjectIx;    // Owned
       
   141 
       
   142         // Pointer to an object container
       
   143         CObjectCon* iObjectCon;  // Owned
       
   144 
       
   145         // Pointer to an ASYProxy's API
       
   146         CASYProxyAPI* iProxy;    // Not owned
       
   147 
       
   148         CAccSrvConnectionController* iConnectionController; // Not owned
       
   149         CAccSrvServerModel*          iServerModel;          // Not Owned
       
   150 
       
   151     public:     // Friend classes
       
   152 
       
   153     protected:  // Friend classes
       
   154 
       
   155     private:    // Friend classes
       
   156 
       
   157     };
       
   158 
       
   159 #endif // CACCSRVMAINSESSION_H
       
   160 
       
   161 // End of File