mpx/collectionframework/collectionserver/inc/mpxcollectionserver.h
changeset 0 a2952bb97e68
equal deleted inserted replaced
-1:000000000000 0:a2952bb97e68
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Collection server
       
    15 *
       
    16 */
       
    17 
       
    18  
       
    19 #ifndef CMPXCOLLECTIONSERVER_H
       
    20 #define CMPXCOLLECTIONSERVER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "mpxcollectionserverdefs.h"
       
    24 
       
    25 class MMPXCollectionCallback;
       
    26 class CMPXCollectionEngine;
       
    27 
       
    28 /**
       
    29 * Music collection server
       
    30 */
       
    31 NONSHARABLE_CLASS(CMPXCollectionServer) : public CPolicyServer
       
    32     {
       
    33 public:
       
    34 
       
    35     /**
       
    36     *  Two-phased constructor. Leaves on failure.
       
    37     *
       
    38     *  @return The constructed object
       
    39     */
       
    40     static CMPXCollectionServer* NewL();
       
    41 
       
    42     /**
       
    43     *  Destructor
       
    44     */
       
    45     ~CMPXCollectionServer();
       
    46     
       
    47     /**
       
    48     *  Decrements number of sessions this server holds, and if now zero, shuts
       
    49     *  down the server.
       
    50     *
       
    51     */
       
    52     void RemoveClient();
       
    53 
       
    54 private: // From base class
       
    55     /** From CServer2 from which CPolicyServer derives
       
    56      *  Create a new session
       
    57      *
       
    58      *  @param aVersion version of the server
       
    59      *  @param aMessage message object
       
    60      */
       
    61      CSession2* NewSessionL(const TVersion& aVersion,
       
    62                             const RMessage2& aMessage) const;
       
    63 
       
    64 private:
       
    65 
       
    66     /**
       
    67     *  C++ constructor
       
    68     *
       
    69     *  @param aPriority  priority of server
       
    70     *  @param aPolicy security policy
       
    71     */
       
    72     CMPXCollectionServer(TInt aPriority, const TPolicy &aPolicy);
       
    73 
       
    74     /**
       
    75     *  2nd phase constructor
       
    76     */
       
    77     void ConstructL();
       
    78 private:
       
    79  
       
    80     CMPXCollectionEngine* iEngine;  // Single collection engine
       
    81     TInt iClients;
       
    82     };
       
    83     
       
    84 #endif // CMPXCOLLECTIONSERVER_H
       
    85