hti/HtiCommPlugins/HtiIPCommPlugin/inc/HtiIPCommServer.h
branchRCL_3
changeset 59 8ad140f3dd41
parent 0 a03f92240627
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 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:  CHtiIPCommServer declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __HTIIPCOMMSERVER_H__
       
    20 #define __HTIIPCOMMSERVER_H__
       
    21 
       
    22 //  INCLUDES
       
    23 
       
    24 #include <e32def.h>
       
    25 #include <e32base.h>
       
    26 
       
    27 #include "HtiConnectionManager.h"
       
    28 #include "HtiIPCommServerSession.h"
       
    29 
       
    30 //  CONSTANTS
       
    31 
       
    32 // Reasons for IPCommServer panic
       
    33 enum TIPCommServerPanic
       
    34     {
       
    35     EBadDescriptor = 1,
       
    36     EUnknownCompletion,
       
    37     EUnknownState
       
    38     };
       
    39 
       
    40 //  FUNCTION PROTOTYPES
       
    41 
       
    42 // Function to panic the server
       
    43 //GLREF_C void PanicServer(TIPCommServerPanic aPanic);
       
    44 
       
    45 
       
    46 //  FORWARD DECLARATIONS
       
    47 class CHtiConnectionManager;
       
    48 
       
    49 // CLASS DECLARATION
       
    50 
       
    51 
       
    52 class CHtiIPCommServer : public CServer2
       
    53 {
       
    54 public:
       
    55     static CHtiIPCommServer* NewLC();
       
    56 
       
    57     /**
       
    58      * Used to inform the server that session has been created
       
    59      */
       
    60     void SessionOpened();
       
    61 
       
    62     /**
       
    63      * Used to inform the server that session has been closed
       
    64      */
       
    65     void SessionClosed();
       
    66 
       
    67     void CloseServer();
       
    68 
       
    69 private:
       
    70     CHtiIPCommServer();
       
    71 
       
    72     ~CHtiIPCommServer();
       
    73 
       
    74     void ConstructL();
       
    75 
       
    76    /**
       
    77     * Creates a new client session
       
    78     * @param aVersion Version of the server
       
    79     * @return Pointer to the clinet session
       
    80     */
       
    81     CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage) const;
       
    82 
       
    83 public:
       
    84     CHtiConnectionManager* iConnectionManager;
       
    85 
       
    86     // Used to prevent stopping active scheduler twice
       
    87     TBool iRunning;
       
    88 
       
    89 private:
       
    90     TInt  iNrOfSessions;
       
    91 };
       
    92 
       
    93 #endif // __HTIIPCOMMSERVER_H__
       
    94 
       
    95 // End of file