contentstorage/srvinc/casrv.h
changeset 60 f62f87b200ec
child 103 b99b84bcd2d1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvinc/casrv.h	Fri Mar 19 09:35:23 2010 +0200
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  ?Description
+ *
+ */
+
+#ifndef CASRV_H
+#define CASRV_H
+
+//  INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATION
+class CCaSrvEngUtils;
+class CCaSrvManager;
+class CCaStorageProxy;
+
+// GLOBAL FUNCTIONS
+/**
+ * Run the Menu Server (entry function).
+ * @return Error code.
+ */
+IMPORT_C TInt RunCaServer();
+
+// CLASS DECLARATION
+
+/**
+ * Menu Server.
+ */
+NONSHARABLE_CLASS( CCaSrv ): public CServer2
+    {
+public:
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CCaSrv();
+
+    /**
+     * Two-phased constructor. Leaves on failure.
+     * @return The constructed server.
+     */
+    static CCaSrv* NewL();
+
+public:
+    
+    /**
+     * Storage proxy getter.
+     * @return storage proxy.
+     */
+    CCaStorageProxy* GetStorageProxy();
+
+    /*
+     * Increases session count.
+     */
+    void IncreaseSessionCount();
+
+    /*
+     * Decreases session count. If session count reaches 0 server is stoped.
+     */
+    void DecreaseSessionCount();
+
+private:
+    // Constructors and destructor
+
+    /**
+     * Constructor.
+     */
+    CCaSrv();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+private:
+    // From CServer2
+
+    /**
+     * Create new session.
+     * @param aVersion Version.
+     * @param aMessage Message (unused).
+     * @return New session.
+     */
+    CSession2* NewSessionL( const TVersion& aVersion,
+            const RMessage2& aMessage ) const;
+
+private:
+    // Data
+    
+    /**
+     * Data storage proxy. Own.
+     */
+    CCaStorageProxy* iStorageProxy;
+
+    /*
+     * Session count. Own.
+     */
+    TInt iSessionCount;
+
+    /*
+     * Utils. Own.
+     */
+    CCaSrvEngUtils* iSrvEngUtils;
+
+    /*
+     * Srv plugin manager. Own.
+     */
+    CCaSrvManager* iSrvManager;
+
+    };
+
+#endif // CASRV_H
+// End of File