contentstorage/srvinc/casrv.h
changeset 60 f62f87b200ec
child 103 b99b84bcd2d1
equal deleted inserted replaced
4:1a2a00e78665 60:f62f87b200ec
       
     1 /*
       
     2  * Copyright (c) 2008 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:  ?Description
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef CASRV_H
       
    19 #define CASRV_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 // FORWARD DECLARATION
       
    25 class CCaSrvEngUtils;
       
    26 class CCaSrvManager;
       
    27 class CCaStorageProxy;
       
    28 
       
    29 // GLOBAL FUNCTIONS
       
    30 /**
       
    31  * Run the Menu Server (entry function).
       
    32  * @return Error code.
       
    33  */
       
    34 IMPORT_C TInt RunCaServer();
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  * Menu Server.
       
    40  */
       
    41 NONSHARABLE_CLASS( CCaSrv ): public CServer2
       
    42     {
       
    43 public:
       
    44     
       
    45     /**
       
    46      * Destructor.
       
    47      */
       
    48     virtual ~CCaSrv();
       
    49 
       
    50     /**
       
    51      * Two-phased constructor. Leaves on failure.
       
    52      * @return The constructed server.
       
    53      */
       
    54     static CCaSrv* NewL();
       
    55 
       
    56 public:
       
    57     
       
    58     /**
       
    59      * Storage proxy getter.
       
    60      * @return storage proxy.
       
    61      */
       
    62     CCaStorageProxy* GetStorageProxy();
       
    63 
       
    64     /*
       
    65      * Increases session count.
       
    66      */
       
    67     void IncreaseSessionCount();
       
    68 
       
    69     /*
       
    70      * Decreases session count. If session count reaches 0 server is stoped.
       
    71      */
       
    72     void DecreaseSessionCount();
       
    73 
       
    74 private:
       
    75     // Constructors and destructor
       
    76 
       
    77     /**
       
    78      * Constructor.
       
    79      */
       
    80     CCaSrv();
       
    81 
       
    82     /**
       
    83      * Second-phase constructor.
       
    84      */
       
    85     void ConstructL();
       
    86 
       
    87 private:
       
    88     // From CServer2
       
    89 
       
    90     /**
       
    91      * Create new session.
       
    92      * @param aVersion Version.
       
    93      * @param aMessage Message (unused).
       
    94      * @return New session.
       
    95      */
       
    96     CSession2* NewSessionL( const TVersion& aVersion,
       
    97             const RMessage2& aMessage ) const;
       
    98 
       
    99 private:
       
   100     // Data
       
   101     
       
   102     /**
       
   103      * Data storage proxy. Own.
       
   104      */
       
   105     CCaStorageProxy* iStorageProxy;
       
   106 
       
   107     /*
       
   108      * Session count. Own.
       
   109      */
       
   110     TInt iSessionCount;
       
   111 
       
   112     /*
       
   113      * Utils. Own.
       
   114      */
       
   115     CCaSrvEngUtils* iSrvEngUtils;
       
   116 
       
   117     /*
       
   118      * Srv plugin manager. Own.
       
   119      */
       
   120     CCaSrvManager* iSrvManager;
       
   121 
       
   122     };
       
   123 
       
   124 #endif // CASRV_H
       
   125 // End of File