contentcontrolsrv/ccsrv/inc/ccsrv.h
changeset 0 79c6a41cd166
child 11 bd874ee5e5e2
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CCSRV_H
       
    19 #define CCSRV_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 
       
    24 // Forward declarations
       
    25 class CCcSrvSession;
       
    26 class CCcSrvMsg;
       
    27 
       
    28 /**
       
    29  *  Content control server
       
    30  *
       
    31  *
       
    32  *  @code
       
    33  *
       
    34  *  @endcode
       
    35  *
       
    36  *  @lib ccsrv.exe
       
    37  *  @since S60 v5.0
       
    38  */
       
    39 class CCcSrv : public CPolicyServer
       
    40     {
       
    41 public: // Constructor and destructor
       
    42 
       
    43     /**
       
    44      * NewLC
       
    45      * @since S60 3.1
       
    46      */
       
    47     static CServer2* NewLC();
       
    48 
       
    49 
       
    50 private: // Constructors and destructor
       
    51 
       
    52     /**
       
    53      * Constructor
       
    54      */
       
    55     CCcSrv();
       
    56 
       
    57     /**
       
    58      * Destructor
       
    59      */
       
    60     ~CCcSrv();
       
    61 
       
    62     /** 
       
    63      * Second phase constructor 
       
    64      */
       
    65     void ConstructL();
       
    66 
       
    67 public: // New functions
       
    68     /**
       
    69      * Add session
       
    70      * @param aSession Added session
       
    71      */
       
    72     void AddSessionL(
       
    73         CCcSrvSession* aSession );
       
    74 
       
    75     /**
       
    76      * Drop session
       
    77      * @param aSession Dropped session
       
    78      */
       
    79     void DropSession(
       
    80         CCcSrvSession* aSession );
       
    81 
       
    82     /**
       
    83      * Registers provider session
       
    84      * @param aProvider Registered provider
       
    85      * @param aId Provider session id
       
    86      */
       
    87     void RegisterProviderL(
       
    88         TUint32 aProvider,
       
    89         CCcSrvSession* aSession );
       
    90 
       
    91     /**
       
    92      * Registers observer session
       
    93      * @param aProvider Registered provider
       
    94      * @param aId Provider session id
       
    95      */
       
    96     void RegisterObserverL(
       
    97         TUint32 aProvider,
       
    98         CCcSrvSession* aSession );
       
    99 
       
   100     /**
       
   101      * Resolves registered provider address
       
   102      * @param aProvider Registered provider
       
   103      * @param aAddress Resolved address
       
   104      */
       
   105     void ResolveProviderAddressL(
       
   106         TUint32 aProvider,
       
   107         TUint32& aAddress );
       
   108 
       
   109     /**
       
   110      * Calculates next available transaction id
       
   111      * @return next available transaction id
       
   112      */
       
   113     TUint32 GetTrId();
       
   114 
       
   115     /**
       
   116      * Sends message to defined session
       
   117      * @param aSender Sender session
       
   118      * @param aReceiver Receiver session
       
   119      * @param aMsgBuf Message buffer
       
   120      */
       
   121     void SendMsgL(
       
   122         TUint32 aSender,
       
   123         TUint32 aReceiver,
       
   124         CCcSrvMsg& aMessage );
       
   125 
       
   126 private:
       
   127 
       
   128     /**
       
   129      * NewSessionL
       
   130      * @since S60 3.1
       
   131      */
       
   132     CSession2* NewSessionL(
       
   133         const TVersion& aVersion, 
       
   134         const RMessage2& aMessage ) const;
       
   135     
       
   136     
       
   137 private: // Data
       
   138     /**
       
   139      * Session list
       
   140      */
       
   141     RPointerArray<CCcSrvSession> iSessions;
       
   142 
       
   143     /**
       
   144      * Last session id
       
   145      */
       
   146     TUint32 iLastSessionId;
       
   147 
       
   148     /**
       
   149      * Last used transaction id
       
   150      */
       
   151     TUint32 iLastTrId;
       
   152 
       
   153     /**
       
   154      * Provider list
       
   155      */
       
   156     struct TCcProvider
       
   157         {
       
   158         TUint32 iId;
       
   159         CCcSrvSession* iSession;
       
   160         };
       
   161     RArray<TCcProvider> iProviders;
       
   162     
       
   163     };
       
   164 
       
   165 
       
   166 #endif // CCSRV_H
       
   167 
       
   168 // End of file