diff -r 1a2a00e78665 -r 7feec50967db contentstorage/srvinc/casrv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentstorage/srvinc/casrv.h Tue Mar 23 23:17:02 2010 +0200 @@ -0,0 +1,131 @@ +/* + * 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 + +// FORWARD DECLARATION +class CTimeout; +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 + + /** + * Exit timer. Own. + */ + CTimeout* iExitTimer; + + /** + * 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