contentcontrolsrv/ccsrv/inc/ccsrv.h
branchRCL_3
changeset 114 a5a39a295112
equal deleted inserted replaced
113:0efa10d348c0 114:a5a39a295112
       
     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 aMsgBuf Message buffer
       
   118      */
       
   119     void SendMsgL(
       
   120         CCcSrvMsg& aMessage );
       
   121 
       
   122 private:
       
   123 
       
   124     /**
       
   125      * NewSessionL
       
   126      * @since S60 3.1
       
   127      */
       
   128     CSession2* NewSessionL(
       
   129         const TVersion& aVersion, 
       
   130         const RMessage2& aMessage ) const;
       
   131     
       
   132     
       
   133 private: // Data
       
   134     /**
       
   135      * Session list
       
   136      */
       
   137     RPointerArray<CCcSrvSession> iSessions;
       
   138 
       
   139     /**
       
   140      * Last session id
       
   141      */
       
   142     TUint32 iLastSessionId;
       
   143 
       
   144     /**
       
   145      * Last used transaction id
       
   146      */
       
   147     TUint32 iLastTrId;
       
   148 
       
   149     /**
       
   150      * Provider list
       
   151      */
       
   152     struct TCcProvider
       
   153         {
       
   154         TUint32 iId;
       
   155         CCcSrvSession* iSession;
       
   156         };
       
   157     RArray<TCcProvider> iProviders;
       
   158     
       
   159     /**
       
   160      * Observer list
       
   161      */
       
   162     struct TCcObserver
       
   163         {
       
   164         TUint32 iProviderId;
       
   165         TUint32 iObserver;
       
   166         };
       
   167     RArray<TCcObserver> iObservers;
       
   168     
       
   169     };
       
   170 
       
   171 
       
   172 #endif // CCSRV_H
       
   173 
       
   174 // End of file