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