diff -r 0efa10d348c0 -r a5a39a295112 contentcontrolsrv/ccsrv/inc/ccsrv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/ccsrv/inc/ccsrv.h Wed Sep 01 12:22:09 2010 +0100 @@ -0,0 +1,174 @@ +/* +* 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: +* +*/ + +#ifndef CCSRV_H +#define CCSRV_H + +// System includes +#include + +// Forward declarations +class CCcSrvSession; +class CCcSrvMsg; + +/** + * Content control server + * + * + * @code + * + * @endcode + * + * @lib ccsrv.exe + * @since S60 v5.0 + */ +class CCcSrv : public CPolicyServer + { +public: // Constructor and destructor + + /** + * NewLC + * @since S60 3.1 + */ + static CServer2* NewLC(); + + +private: // Constructors and destructor + + /** + * Constructor + */ + CCcSrv(); + + /** + * Destructor + */ + ~CCcSrv(); + + /** + * Second phase constructor + */ + void ConstructL(); + +public: // New functions + /** + * Add session + * @param aSession Added session + */ + void AddSessionL( + CCcSrvSession* aSession ); + + /** + * Drop session + * @param aSession Dropped session + */ + void DropSession( + CCcSrvSession* aSession ); + + /** + * Registers provider session + * @param aProvider Registered provider + * @param aId Provider session id + */ + void RegisterProviderL( + TUint32 aProvider, + CCcSrvSession* aSession ); + + /** + * Registers observer session + * @param aProvider Registered provider + * @param aId Provider session id + */ + void RegisterObserverL( + TUint32 aProvider, + CCcSrvSession* aSession ); + + /** + * Resolves registered provider address + * @param aProvider Registered provider + * @param aAddress Resolved address + */ + void ResolveProviderAddressL( + TUint32 aProvider, + TUint32& aAddress ); + + /** + * Calculates next available transaction id + * @return next available transaction id + */ + TUint32 GetTrId(); + + /** + * Sends message to defined session + * @param aMsgBuf Message buffer + */ + void SendMsgL( + CCcSrvMsg& aMessage ); + +private: + + /** + * NewSessionL + * @since S60 3.1 + */ + CSession2* NewSessionL( + const TVersion& aVersion, + const RMessage2& aMessage ) const; + + +private: // Data + /** + * Session list + */ + RPointerArray iSessions; + + /** + * Last session id + */ + TUint32 iLastSessionId; + + /** + * Last used transaction id + */ + TUint32 iLastTrId; + + /** + * Provider list + */ + struct TCcProvider + { + TUint32 iId; + CCcSrvSession* iSession; + }; + RArray iProviders; + + /** + * Observer list + */ + struct TCcObserver + { + TUint32 iProviderId; + TUint32 iObserver; + }; + RArray iObservers; + + }; + + +#endif // CCSRV_H + +// End of file