|
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: CMediatorQueItem implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "mediatorqueitem.h" |
|
21 |
|
22 // ----------------------------------------------------------------------------- |
|
23 // CMediatorQueItem::NofiticationType |
|
24 // ----------------------------------------------------------------------------- |
|
25 TMediatorNotificationType CMediatorQueItem::NofiticationType() const |
|
26 { |
|
27 return iNotificationType; |
|
28 } |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CMediatorQueItem::Domain |
|
32 // ----------------------------------------------------------------------------- |
|
33 const TUid& CMediatorQueItem::Domain() const |
|
34 { |
|
35 return iDomain; |
|
36 } |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // CMediatorQueItem::Category |
|
40 // ----------------------------------------------------------------------------- |
|
41 const TUid& CMediatorQueItem::Category() const |
|
42 { |
|
43 return iCategory; |
|
44 } |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CMediatorQueItem::CMediatorQueItem |
|
48 // ----------------------------------------------------------------------------- |
|
49 CMediatorQueItem::CMediatorQueItem( TMediatorNotificationType aNotificationType, |
|
50 const TUid& aDomain, |
|
51 const TUid& aCategory ) : |
|
52 iNotificationType( aNotificationType ), |
|
53 iDomain( aDomain ), |
|
54 iCategory( aCategory ) |
|
55 { |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CMediatorQueItem::~CMediatorQueItem |
|
60 // ----------------------------------------------------------------------------- |
|
61 CMediatorQueItem::~CMediatorQueItem() |
|
62 { |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CEventListQueItem::NewL |
|
67 // ----------------------------------------------------------------------------- |
|
68 CEventListQueItem* CEventListQueItem::NewL( TMediatorNotificationType aNotificationType, |
|
69 const TUid& aDomain, |
|
70 const TUid& aCategory, |
|
71 const REventList& aEventList ) |
|
72 { |
|
73 CEventListQueItem* self = new (ELeave) CEventListQueItem( aNotificationType, |
|
74 aDomain, |
|
75 aCategory ); |
|
76 CleanupStack::PushL( self ); |
|
77 self->ConstructL( aEventList ); |
|
78 CleanupStack::Pop( self ); |
|
79 return self; |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CEventListQueItem::CEventListQueItem |
|
84 // ----------------------------------------------------------------------------- |
|
85 CEventListQueItem::~CEventListQueItem() |
|
86 { |
|
87 iEventList.Reset(); |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CEventListQueItem::CEventListQueItem |
|
92 // ----------------------------------------------------------------------------- |
|
93 CEventListQueItem::CEventListQueItem( TMediatorNotificationType aNotificationType, |
|
94 const TUid& aDomain, |
|
95 const TUid& aCategory ) : |
|
96 CMediatorQueItem( aNotificationType, |
|
97 aDomain, |
|
98 aCategory ) |
|
99 { |
|
100 } |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CEventListQueItem::ConstructL |
|
104 // ----------------------------------------------------------------------------- |
|
105 void CEventListQueItem::ConstructL( const REventList& aEventList ) |
|
106 { |
|
107 TInt eventCount( aEventList.Count() ); |
|
108 iEventList.ReserveL( eventCount ); |
|
109 |
|
110 for ( TInt i = 0; i < eventCount; i++ ) |
|
111 { |
|
112 iEventList.AppendL( aEventList[i] ); |
|
113 } |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // CEventListQueItem::Events |
|
118 // ----------------------------------------------------------------------------- |
|
119 const REventList* CEventListQueItem::Events() const |
|
120 { |
|
121 return &iEventList; |
|
122 } |
|
123 |
|
124 // ----------------------------------------------------------------------------- |
|
125 // CEventListQueItem::Commands |
|
126 // ----------------------------------------------------------------------------- |
|
127 const RCommandList* CEventListQueItem::Commands() const |
|
128 { |
|
129 return NULL; |
|
130 } |
|
131 |
|
132 |
|
133 // ----------------------------------------------------------------------------- |
|
134 // CCommandListQueItem::NewL |
|
135 // ----------------------------------------------------------------------------- |
|
136 CCommandListQueItem* CCommandListQueItem::NewL( TMediatorNotificationType aNotificationType, |
|
137 const TUid& aDomain, |
|
138 const TUid& aCategory, |
|
139 const RCommandList& aCommandList ) |
|
140 { |
|
141 CCommandListQueItem* self = new (ELeave) CCommandListQueItem( aNotificationType, |
|
142 aDomain, |
|
143 aCategory ); |
|
144 CleanupStack::PushL( self ); |
|
145 self->ConstructL( aCommandList ); |
|
146 CleanupStack::Pop( self ); |
|
147 return self; |
|
148 } |
|
149 |
|
150 // ----------------------------------------------------------------------------- |
|
151 // CCommandListQueItem::~CCommandListQueItem |
|
152 // ----------------------------------------------------------------------------- |
|
153 CCommandListQueItem::~CCommandListQueItem() |
|
154 { |
|
155 iCommandList.Reset(); |
|
156 } |
|
157 |
|
158 // ----------------------------------------------------------------------------- |
|
159 // CCommandListQueItem::CCommandListQueItem |
|
160 // ----------------------------------------------------------------------------- |
|
161 CCommandListQueItem::CCommandListQueItem( TMediatorNotificationType aNotificationType, |
|
162 const TUid& aDomain, |
|
163 const TUid& aCategory ) : |
|
164 CMediatorQueItem( aNotificationType, |
|
165 aDomain, |
|
166 aCategory ) |
|
167 { |
|
168 } |
|
169 |
|
170 // ----------------------------------------------------------------------------- |
|
171 // CCommandListQueItem::ConstructL |
|
172 // ----------------------------------------------------------------------------- |
|
173 void CCommandListQueItem::ConstructL( const RCommandList& aCommandList ) |
|
174 { |
|
175 TInt commandCount( aCommandList.Count() ); |
|
176 iCommandList.ReserveL( commandCount ); |
|
177 |
|
178 for ( TInt i = 0; i < commandCount; i++ ) |
|
179 { |
|
180 iCommandList.AppendL( aCommandList[i] ); |
|
181 } |
|
182 } |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // CCommandListQueItem::Events |
|
186 // ----------------------------------------------------------------------------- |
|
187 const REventList* CCommandListQueItem::Events() const |
|
188 { |
|
189 return NULL; |
|
190 } |
|
191 |
|
192 // ----------------------------------------------------------------------------- |
|
193 // CCommandListQueItem::Commands |
|
194 // ----------------------------------------------------------------------------- |
|
195 const RCommandList* CCommandListQueItem::Commands() const |
|
196 { |
|
197 return &iCommandList; |
|
198 } |
|
199 |
|
200 // ----------------------------------------------------------------------------- |
|
201 // CCategoryQueItem::NewL |
|
202 // ----------------------------------------------------------------------------- |
|
203 CCategoryQueItem* CCategoryQueItem::NewL( const TUid& aDomain, const TUid& aCategory ) |
|
204 { |
|
205 CCategoryQueItem* self = new (ELeave) CCategoryQueItem( aDomain, aCategory ); |
|
206 CleanupStack::PushL( self ); |
|
207 self->ConstructL(); |
|
208 CleanupStack::Pop( self ); |
|
209 return self; |
|
210 } |
|
211 |
|
212 // ----------------------------------------------------------------------------- |
|
213 // CCategoryQueItem::~CCategoryQueItem |
|
214 // ----------------------------------------------------------------------------- |
|
215 CCategoryQueItem::~CCategoryQueItem() |
|
216 { |
|
217 } |
|
218 |
|
219 // ----------------------------------------------------------------------------- |
|
220 // CCategoryQueItem::Events |
|
221 // ----------------------------------------------------------------------------- |
|
222 const REventList* CCategoryQueItem::Events() const |
|
223 { |
|
224 return NULL; |
|
225 } |
|
226 |
|
227 // ----------------------------------------------------------------------------- |
|
228 // CCategoryQueItem::Commands |
|
229 // ----------------------------------------------------------------------------- |
|
230 const RCommandList* CCategoryQueItem::Commands() const |
|
231 { |
|
232 return NULL; |
|
233 } |
|
234 |
|
235 // ----------------------------------------------------------------------------- |
|
236 // CCategoryQueItem::CCategoryBuffer |
|
237 // ----------------------------------------------------------------------------- |
|
238 CCategoryQueItem::CCategoryQueItem( const TUid& aDomain, |
|
239 const TUid& aCategory ) : |
|
240 CMediatorQueItem( EMediatorCategoryUnregistered, |
|
241 aDomain, |
|
242 aCategory ) |
|
243 { |
|
244 } |
|
245 |
|
246 // ----------------------------------------------------------------------------- |
|
247 // CCategoryQueItem::ConstructL |
|
248 // ----------------------------------------------------------------------------- |
|
249 void CCategoryQueItem::ConstructL() |
|
250 { |
|
251 } |
|
252 |
|
253 // End of File |