bluetoothengine/btaudioman/inc/BTAccServer.h
changeset 0 f63038272f30
child 6 6a29d5ad0713
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2005 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: 
       
    15 *                 Server class is responsible for creating sessions and then handle
       
    16 *                messages from the session class.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef BTACC_SERVER_H
       
    22 #define BTACC_SERVER_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32svr.h> 
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // FORWARD DECLARATION
       
    30 class CBasrvAccMan;
       
    31 class TAccInfo;
       
    32 class CBTAccSession;
       
    33 
       
    34 /**
       
    35 *  CBTAccServer server core class
       
    36 */
       
    37 NONSHARABLE_CLASS(CBTAccServer) : public CPolicyServer
       
    38     {
       
    39 public:  // Constructors and destructor
       
    40     /**
       
    41     * Two-phased constructor.
       
    42     */
       
    43     static CBTAccServer* NewLC();
       
    44 
       
    45     /**
       
    46     * Destructor.
       
    47     */
       
    48     ~CBTAccServer();
       
    49     
       
    50     void StartShutdownTimerIfNoSessions();
       
    51     
       
    52     void ClientOpened(CBTAccSession& aSession);
       
    53         
       
    54     void ClientClosed(CBTAccSession& aSession);
       
    55         
       
    56 private: // Functions from base classes
       
    57     /**
       
    58     * Creates a new session to client
       
    59     * @param aVersion the version
       
    60     * @param aMessage not used
       
    61     * return the new created session
       
    62     */
       
    63     CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
       
    64            
       
    65     /**
       
    66     * Constructor
       
    67     * @param aPriority This AO's priority
       
    68     */
       
    69     CBTAccServer(TInt aPriority);
       
    70 
       
    71     /**
       
    72     * Two-Phase constructor
       
    73     */
       
    74     void ConstructL();
       
    75 
       
    76     void CancelShutdownTimer();
       
    77             
       
    78     static TInt TimerFired(TAny* aThis);
       
    79 
       
    80 private:    // Data
       
    81     CBasrvAccMan* iAccMan;
       
    82 
       
    83     CPeriodic* iTimer;
       
    84     
       
    85     RPointerArray<CBTAccSession> iSessions;        
       
    86     };
       
    87 
       
    88 #endif      // BTACC_SERVER_H
       
    89 
       
    90 // End of File