|
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 receiving command/event notifications and info. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <e32base.h> |
|
21 #include "MediatorNotifications.h" |
|
22 #include "MediatorNotificationsBody.h" |
|
23 #include "Debug.h" |
|
24 |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 CMediatorNotifications::CMediatorNotifications() |
|
29 |
|
30 { |
|
31 } |
|
32 |
|
33 void CMediatorNotifications::ConstructL() |
|
34 { |
|
35 LOG(_L("[Mediator Server]\t CMediatorNotifications::ConstructL\n")); |
|
36 iBody = CMediatorNotificationsBody::NewL(); |
|
37 } |
|
38 |
|
39 EXPORT_C CMediatorNotifications* CMediatorNotifications::NewL() |
|
40 { |
|
41 CMediatorNotifications* self = new( ELeave ) CMediatorNotifications; |
|
42 |
|
43 CleanupStack::PushL( self ); |
|
44 self->ConstructL(); |
|
45 CleanupStack::Pop( self ); |
|
46 |
|
47 return self; |
|
48 } |
|
49 |
|
50 CMediatorNotifications::~CMediatorNotifications() |
|
51 { |
|
52 if ( iBody ) |
|
53 { |
|
54 iBody->Cancel(); |
|
55 } |
|
56 delete iBody; |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CMediatorNotifications::RegisterNotificationObserver |
|
61 // |
|
62 // (other items were commented in a header). |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 EXPORT_C TInt CMediatorNotifications::RegisterNotificationObserver( |
|
66 MMediatorNotifications* aObserver ) |
|
67 { |
|
68 return iBody->RegisterNotificationObserver( aObserver ); |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CMediatorNotifications::UnregisterNotificationObserver |
|
73 // |
|
74 // (other items were commented in a header). |
|
75 // ----------------------------------------------------------------------------- |
|
76 // |
|
77 EXPORT_C TInt CMediatorNotifications::UnregisterNotificationObserver() |
|
78 { |
|
79 return iBody->UnregisterNotificationObserver(); |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CMediatorNotifications::GetDomains |
|
84 // Gets a list of registered domains |
|
85 // (other items were commented in a header). |
|
86 // ----------------------------------------------------------------------------- |
|
87 // |
|
88 EXPORT_C TInt CMediatorNotifications::GetDomains( RDomainList& aDomains ) |
|
89 { |
|
90 return iBody->GetDomains( aDomains ); |
|
91 } |
|
92 |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CMediatorNotifications::GetCategories |
|
96 // Gets a list of registered domains |
|
97 // (other items were commented in a header). |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 EXPORT_C TInt CMediatorNotifications::GetCategories( TUid aDomain, |
|
101 RCategoryList& aCategories ) |
|
102 { |
|
103 return iBody->GetCategories( aDomain, aCategories ); |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CMediatorNotifications::GetEvents |
|
108 // Gets a list of registered events withing the domain/category |
|
109 // (other items were commented in a header). |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 EXPORT_C TInt CMediatorNotifications::GetEvents( TUid aDomain, |
|
113 TUid aCategory, |
|
114 REventList& aEvents ) |
|
115 { |
|
116 return iBody->GetEvents( aDomain, aCategory, aEvents ); |
|
117 } |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // CMediatorNotifications::GetCommands |
|
121 // Gets a list of registered commands withing the domain/category |
|
122 // (other items were commented in a header). |
|
123 // ----------------------------------------------------------------------------- |
|
124 // |
|
125 EXPORT_C TInt CMediatorNotifications::GetCommands( TUid aDomain, |
|
126 TUid aCategory, |
|
127 RCommandList& aCommands ) |
|
128 { |
|
129 return iBody->GetCommands( aDomain, aCategory, aCommands ); |
|
130 } |
|
131 |
|
132 // End of File |