mediator/inc/Client/MediatorEventProviderBody.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2005 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:  An implementation class for raising Mediator Service events.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MEDIATOREVENTPROVIDERBODY_H
       
    19 #define MEDIATOREVENTPROVIDERBODY_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "MediatorServerClient.h"
       
    25 #include "MediatorServiceDefs.h"
       
    26 
       
    27 using namespace MediatorService;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  A class used for raising Mediator Service events.
       
    33 *
       
    34 *  @lib MediatorClient.lib
       
    35 *  @since S60 3.1
       
    36 */
       
    37 NONSHARABLE_CLASS(CMediatorEventProviderBody) : public CBase
       
    38 	{
       
    39     public:  // Constructors and destructor
       
    40         
       
    41         /**
       
    42         * Two-phased constructor.
       
    43         *
       
    44         * @return a new CMediatorEventProviderBody instance
       
    45         */
       
    46         static CMediatorEventProviderBody* NewL();
       
    47         
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CMediatorEventProviderBody();
       
    52 
       
    53     public: // Event registration
       
    54         
       
    55         /**
       
    56         * Registers a list of events within specified category. 
       
    57         * This command needs SwEvent -capability.
       
    58         * 
       
    59         * @since S60 3.1   
       
    60         * @param aDomain    The identifier of the domain     
       
    61         * @param aCategory  The identifier of the category.
       
    62         * @param aEvents    List of events to be registered.
       
    63         * @return TInt      an error value.
       
    64         */
       
    65         TInt RegisterEvent( TUid aDomain, 
       
    66                             TUid aCategory, 
       
    67                             const REventList& aEvents );
       
    68 
       
    69         /**
       
    70         * Register a single event. After registering an event it may be raised.
       
    71         * This command needs SwEvent -capability.
       
    72         * 
       
    73         * @since S60 3.1
       
    74         * @param aDomain    The identifier of the domain         
       
    75         * @param aCategory  The identifier of the category.
       
    76         * @param aEventId   The identifier of the event.
       
    77         * @param aVersion   The version of the event.
       
    78         * @param aCaps      Capabilities required for consuming the event.
       
    79         * @return TInt      an error value.
       
    80         */
       
    81         TInt RegisterEvent( TUid aDomain,
       
    82                             TUid aCategory, 
       
    83                             TInt aEventId, 
       
    84                             TVersion aVersion,
       
    85                             TCapabilitySet aCaps );
       
    86 
       
    87         /**
       
    88         * Unregister an event category.
       
    89         * 
       
    90         * @since S60 3.1 
       
    91         * @param aDomain    The identifier of the domain         
       
    92         * @param aCategory  The identifier of the category.
       
    93         * @param aEvents    List of events to be unregistered.
       
    94         * @return TInt      an error value.
       
    95         */
       
    96         TInt UnregisterEvent( TUid aDomain,
       
    97                               TUid aCategory,
       
    98                               const REventList& aEvents );
       
    99 
       
   100         /**
       
   101         * Unregister an event.
       
   102         * 
       
   103         * @since S60 3.1        
       
   104         * @param aCategory  The identifier of the category.
       
   105         * @param aEventId   The identifier of the event.
       
   106         * @return TInt      an error value.
       
   107         */
       
   108         TInt UnregisterEvent( TUid aDomain, 
       
   109                               TUid aCategory, 
       
   110                               TInt aEventId );
       
   111     
       
   112     public: // Event raising
       
   113 
       
   114         /**
       
   115         * Raise an event.
       
   116         * This command needs SwEvent -capability.
       
   117         * 
       
   118         * @since S60 3.1        
       
   119         * @param aCategory  The identifier of the category.
       
   120         * @param aEventId   The identifier of the event.
       
   121         * @param aVersion   The version of the event.
       
   122         * @param aData      The parameters of the event.
       
   123         * @return TInt      an error value.
       
   124         */
       
   125         TInt RaiseEvent( TUid aDomain,
       
   126                          TUid aCategory, 
       
   127                          TInt aEventId,
       
   128                          TVersion aVersion, 
       
   129                          const TDesC8& aData );
       
   130     
       
   131     private:
       
   132     
       
   133         /**
       
   134         * C++ default constructor.
       
   135         */
       
   136         CMediatorEventProviderBody();
       
   137 
       
   138         /**
       
   139         * By default Symbian 2nd phase constructor is private.
       
   140         */
       
   141         void ConstructL();
       
   142     
       
   143     private: // Data
       
   144 
       
   145         // A session class to mediator server
       
   146         RMediatorServer     iMediatorServer;
       
   147          
       
   148 	};
       
   149 
       
   150 #endif      // MEDIATOREVENTPROVIDERBODY_H 
       
   151             
       
   152 // End of File