mediator/src/Client/MediatorEventProvider.cpp
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 interface for raising Mediator Service events.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    <e32base.h>
       
    21 #include    "MediatorEventProvider.h"
       
    22 #include    "MediatorEventProviderBody.h"
       
    23 #include    "Debug.h"
       
    24 
       
    25 
       
    26 // ============================ MEMBER FUNCTIONS ===============================
       
    27 
       
    28 CMediatorEventProvider::CMediatorEventProvider()
       
    29     {
       
    30     }
       
    31 
       
    32 void CMediatorEventProvider::ConstructL()
       
    33     {
       
    34     iBody = CMediatorEventProviderBody::NewL();
       
    35     }
       
    36 
       
    37 EXPORT_C CMediatorEventProvider* CMediatorEventProvider::NewL()
       
    38     {
       
    39     CMediatorEventProvider* self = new( ELeave ) CMediatorEventProvider;
       
    40     
       
    41     CleanupStack::PushL( self );
       
    42     self->ConstructL();
       
    43     CleanupStack::Pop( self );
       
    44 
       
    45     return self;
       
    46     }
       
    47     
       
    48 CMediatorEventProvider::~CMediatorEventProvider()
       
    49     {
       
    50     delete iBody;
       
    51     }
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // CMediatorEventProvider::RegisterEventL
       
    55 // Registers complete event list using Mediator Server API
       
    56 // (other items were commented in a header).
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 EXPORT_C TInt CMediatorEventProvider::RegisterEvent( TUid aDomain,
       
    60                                                      TUid aCategory, 
       
    61                                                      const REventList& aEvents )
       
    62     {
       
    63     return iBody->RegisterEvent( aDomain, aCategory, aEvents );                                   
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CMediatorEventProvider::RegisterEventL
       
    68 // Registers a single event. 
       
    69 // (other items were commented in a header).
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 EXPORT_C TInt CMediatorEventProvider::RegisterEvent( TUid aDomain,
       
    73                                                      TUid aCategory,
       
    74                                                      TInt aEventId, 
       
    75                                                      TVersion aVersion,
       
    76                                                      TCapabilitySet aCaps )
       
    77     {
       
    78     return iBody->RegisterEvent( aDomain, aCategory, aEventId, aVersion, aCaps ); 
       
    79     }   
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CMediatorEventProvider::UnregisterEvent
       
    83 // Unregisters a list of events.
       
    84 // (other items were commented in a header).
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 EXPORT_C TInt CMediatorEventProvider::UnregisterEvent( TUid aDomain,
       
    88                                                        TUid aCategory,
       
    89                                                        const REventList& aEvents )
       
    90     {
       
    91     return iBody->UnregisterEvent( aDomain, aCategory, aEvents );                               
       
    92     }
       
    93        
       
    94 // -----------------------------------------------------------------------------
       
    95 // CMediatorEventProvider::UnregisterEvent
       
    96 // Unregisters a single event.
       
    97 // (other items were commented in a header).
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 EXPORT_C TInt CMediatorEventProvider::UnregisterEvent( TUid aDomain,
       
   101                                                        TUid aCategory, 
       
   102                                                        TInt aEventId )
       
   103     {
       
   104     return iBody->UnregisterEvent( aDomain, aCategory, aEventId );
       
   105     }
       
   106        
       
   107 // -----------------------------------------------------------------------------
       
   108 // CMediatorEventProvider::RaiseEvent
       
   109 // Raises event with parameter data.
       
   110 // (other items were commented in a header).
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 EXPORT_C TInt CMediatorEventProvider::RaiseEvent( TUid aDomain,
       
   114                                                   TUid aCategory, 
       
   115                                                   TInt aEventId,
       
   116                                                   TVersion aVersion,
       
   117                                                   const TDesC8& aData )
       
   118     {
       
   119     return iBody->RaiseEvent( aDomain, aCategory, aEventId, aVersion, aData );
       
   120     }
       
   121 
       
   122 
       
   123 //  End of File