|
1 /* |
|
2 * Copyright (c) 2002 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 * imps group property class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "ImpsGroupProps.h" |
|
22 #include "ImpsGroupPropsInt.h" |
|
23 |
|
24 |
|
25 // ================= MEMBER FUNCTIONS ======================= |
|
26 |
|
27 // --------------------------------------------------------- |
|
28 // CImpsGroupProp::CImpsGroupProp |
|
29 // --------------------------------------------------------- |
|
30 // |
|
31 CImpsGroupProp::CImpsGroupProp() |
|
32 { |
|
33 } |
|
34 |
|
35 // --------------------------------------------------------- |
|
36 // CImpsGroupProp::~CImpsGroupProp |
|
37 // --------------------------------------------------------- |
|
38 // |
|
39 CImpsGroupProp::~CImpsGroupProp() |
|
40 { |
|
41 delete iKey; |
|
42 delete iValue; |
|
43 iLink.Deque(); |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------- |
|
47 // CImpsGroupProp::NewL |
|
48 // --------------------------------------------------------- |
|
49 // |
|
50 CImpsGroupProp* CImpsGroupProp::NewL( |
|
51 const TDesC& aKey, |
|
52 const TDesC& aValue ) |
|
53 { |
|
54 CImpsGroupProp* self = new (ELeave) CImpsGroupProp; |
|
55 CleanupStack::PushL( self ); |
|
56 self->ConstructL( aKey, aValue ); |
|
57 CleanupStack::Pop(); |
|
58 return self; |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------- |
|
62 // CImpsGroupProp::Key |
|
63 // --------------------------------------------------------- |
|
64 // |
|
65 TPtrC CImpsGroupProp::Key() const |
|
66 { |
|
67 /*LDRA_NOANALYSIS*/ |
|
68 return iKey ? TPtrC( *iKey ) : TPtrC(); |
|
69 /*LDRA_ANALYSIS*/ |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------- |
|
73 // CImpsGroupProp::Value |
|
74 // --------------------------------------------------------- |
|
75 // |
|
76 TPtrC CImpsGroupProp::Value() const |
|
77 { |
|
78 /*LDRA_NOANALYSIS*/ |
|
79 return iValue ? TPtrC( *iValue ) : TPtrC(); |
|
80 /*LDRA_ANALYSIS*/ |
|
81 } |
|
82 |
|
83 // --------------------------------------------------------- |
|
84 // CImpsGroupProp::ConstructL |
|
85 // --------------------------------------------------------- |
|
86 // |
|
87 void CImpsGroupProp::ConstructL( |
|
88 const TDesC& aKey, |
|
89 const TDesC& aValue ) |
|
90 { |
|
91 HBufC* newAttrib = aKey.AllocL(); |
|
92 iKey = newAttrib; |
|
93 newAttrib = aValue.AllocL(); |
|
94 iValue = newAttrib; |
|
95 } |
|
96 |
|
97 // --------------------------------------------------------- |
|
98 // C++ default constructor can NOT contain any code, that |
|
99 // might leave. |
|
100 // --------------------------------------------------------- |
|
101 // |
|
102 CImpsGroupProps::CImpsGroupProps() |
|
103 : iReset( ETrue ), |
|
104 iPropertyList(_FOFF( CImpsGroupProp, iLink )), |
|
105 iIter( iPropertyList ), |
|
106 iPrivateMessages( EImpsPropUndef ) |
|
107 { |
|
108 } |
|
109 |
|
110 // --------------------------------------------------------- |
|
111 // CImpsGroupProps::~CImpsGroupProps() |
|
112 // --------------------------------------------------------- |
|
113 // |
|
114 CImpsGroupProps::~CImpsGroupProps() |
|
115 { |
|
116 // Delete all properties |
|
117 TDblQueIter<CImpsGroupProp> rIter( iPropertyList ); |
|
118 |
|
119 rIter.SetToFirst(); |
|
120 |
|
121 while ( rIter ) |
|
122 { |
|
123 CImpsGroupProp* pr = rIter; |
|
124 rIter++; |
|
125 delete pr; |
|
126 } |
|
127 } |
|
128 |
|
129 // --------------------------------------------------------- |
|
130 // CImpsGroupProps::ConstructL |
|
131 // --------------------------------------------------------- |
|
132 // |
|
133 void CImpsGroupProps::ConstructL() |
|
134 { |
|
135 } |
|
136 |
|
137 // --------------------------------------------------------- |
|
138 // CImpsGroupProps::Count |
|
139 // --------------------------------------------------------- |
|
140 // |
|
141 EXPORT_C TInt CImpsGroupProps::Count() |
|
142 { |
|
143 // Count all properties |
|
144 TInt counter = 0; |
|
145 TDblQueIter<CImpsGroupProp> rIter( iPropertyList ); |
|
146 rIter.SetToFirst(); |
|
147 while ( rIter ) |
|
148 { |
|
149 rIter++; |
|
150 counter++; |
|
151 } |
|
152 return counter; |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------- |
|
156 // CImpsGroupProps::AddL |
|
157 // --------------------------------------------------------- |
|
158 // |
|
159 EXPORT_C void CImpsGroupProps::AddL( const CImpsGroupProp& aProperty ) |
|
160 { |
|
161 iReset = EFalse; |
|
162 CImpsGroupProp* pr = CImpsGroupProp::NewL( |
|
163 aProperty.iKey->Des(), |
|
164 aProperty.iValue->Des() ); |
|
165 iPropertyList.AddLast( *pr ); |
|
166 } |
|
167 |
|
168 // --------------------------------------------------------- |
|
169 // CImpsGroupProps::FirstL |
|
170 // --------------------------------------------------------- |
|
171 // |
|
172 EXPORT_C const CImpsGroupProp& CImpsGroupProps::FirstL() |
|
173 { |
|
174 iReset = EFalse; |
|
175 iIter.SetToFirst(); |
|
176 CImpsGroupProp* pr = iIter; |
|
177 if ( !pr ) |
|
178 { |
|
179 User::Leave( KErrEof ); |
|
180 } |
|
181 return *pr; |
|
182 } |
|
183 |
|
184 // --------------------------------------------------------- |
|
185 // CImpsGroupProps::NextL |
|
186 // --------------------------------------------------------- |
|
187 // |
|
188 EXPORT_C const CImpsGroupProp& CImpsGroupProps::NextL() |
|
189 { |
|
190 if ( iReset ) |
|
191 { |
|
192 User::Leave( KErrEof ); |
|
193 } |
|
194 iIter++; |
|
195 CImpsGroupProp* pr = iIter; |
|
196 if ( !pr ) |
|
197 { |
|
198 User::Leave( KErrEof ); |
|
199 } |
|
200 return *pr; |
|
201 } |
|
202 |
|
203 // --------------------------------------------------------- |
|
204 // CImpsGroupProps::Reset |
|
205 // --------------------------------------------------------- |
|
206 // |
|
207 void CImpsGroupProps::Reset() |
|
208 { |
|
209 iReset = ETrue; |
|
210 // Delete all properties |
|
211 TDblQueIter<CImpsGroupProp> rIter( iPropertyList ); |
|
212 |
|
213 rIter.SetToFirst(); |
|
214 |
|
215 while ( rIter ) |
|
216 { |
|
217 CImpsGroupProp* pr = rIter; |
|
218 rIter++; |
|
219 delete pr; |
|
220 } |
|
221 |
|
222 iPrivateMessages = EImpsPropUndef; |
|
223 } |
|
224 |
|
225 // --------------------------------------------------------- |
|
226 // CImpsGroupProps::IsPrivateAllowed |
|
227 // --------------------------------------------------------- |
|
228 // |
|
229 TImpsPropertyBool CImpsGroupProps::IsPrivateAllowed() const |
|
230 { |
|
231 return iPrivateMessages; |
|
232 } |
|
233 |
|
234 // --------------------------------------------------------- |
|
235 // CImpsGroupProps::IsPrivateAllowed |
|
236 // --------------------------------------------------------- |
|
237 // |
|
238 void CImpsGroupProps::SetPrivateAllowed( TImpsPropertyBool aValue ) |
|
239 { |
|
240 iPrivateMessages = aValue; |
|
241 } |
|
242 |
|
243 |
|
244 /************ PRIVATE PROPS ********************************/ |
|
245 |
|
246 // --------------------------------------------------------- |
|
247 // CImpsCommonGroupProps::CImpsCommonGroupProps |
|
248 // --------------------------------------------------------- |
|
249 // |
|
250 CImpsCommonGroupProps::CImpsCommonGroupProps() |
|
251 : CImpsGroupProps(), |
|
252 iAccessOpen( EImpsPropUndef), |
|
253 iTypePublic( EImpsPropUndef ), |
|
254 iSearchable( EImpsPropUndef ), |
|
255 iNbrActive(0), |
|
256 iMaxUsers(0), |
|
257 iName(NULL), |
|
258 iTopic(NULL), |
|
259 iWelcome(NULL), |
|
260 iAutoDelete( EImpsPropUndef ) |
|
261 { |
|
262 |
|
263 } |
|
264 |
|
265 // --------------------------------------------------------- |
|
266 // CImpsCommonGroupProps::NewL |
|
267 // --------------------------------------------------------- |
|
268 // |
|
269 EXPORT_C CImpsCommonGroupProps* CImpsCommonGroupProps::NewL() |
|
270 { |
|
271 CImpsCommonGroupProps* self = new (ELeave) CImpsCommonGroupProps; |
|
272 CleanupStack::PushL( self ); |
|
273 self->ConstructL(); |
|
274 CleanupStack::Pop(); |
|
275 return self; |
|
276 } |
|
277 |
|
278 // --------------------------------------------------------- |
|
279 // CImpsCommonGroupProps::~CImpsCommonGroupProps |
|
280 // --------------------------------------------------------- |
|
281 // |
|
282 CImpsCommonGroupProps::~CImpsCommonGroupProps() |
|
283 { |
|
284 Reset(); |
|
285 } |
|
286 |
|
287 // --------------------------------------------------------- |
|
288 // CImpsCommonGroupProps::Reset |
|
289 // --------------------------------------------------------- |
|
290 // |
|
291 EXPORT_C void CImpsCommonGroupProps::Reset() |
|
292 { |
|
293 iAccessOpen = EImpsPropUndef; |
|
294 // iTypePublic = EImpsPropUndef; |
|
295 iSearchable = EImpsPropUndef; |
|
296 // iNbrActive = EImpsPropUndef; |
|
297 iMaxUsers = EImpsPropUndef; |
|
298 delete iName; |
|
299 iName = NULL; |
|
300 delete iTopic; |
|
301 iTopic = NULL; |
|
302 delete iWelcome; |
|
303 iWelcome = NULL; |
|
304 CImpsGroupProps::Reset(); |
|
305 } |
|
306 |
|
307 |
|
308 // --------------------------------------------------------- |
|
309 // CImpsCommonGroupProps::Type |
|
310 // --------------------------------------------------------- |
|
311 // |
|
312 EXPORT_C TImpsPropertyType CImpsCommonGroupProps::Type() const |
|
313 { |
|
314 return EImpsPropCommon; |
|
315 } |
|
316 |
|
317 // --------------------------------------------------------- |
|
318 // CImpsCommonGroupProps::IsPrivateAllowed |
|
319 // --------------------------------------------------------- |
|
320 // |
|
321 EXPORT_C TImpsPropertyBool CImpsCommonGroupProps::IsPrivateAllowed() const |
|
322 { |
|
323 return CImpsGroupProps::IsPrivateAllowed(); |
|
324 } |
|
325 |
|
326 // --------------------------------------------------------- |
|
327 // CImpsCommonGroupProps::SetPrivateAllowed |
|
328 // --------------------------------------------------------- |
|
329 // |
|
330 EXPORT_C void CImpsCommonGroupProps::SetPrivateAllowed( |
|
331 TImpsPropertyBool aValue ) |
|
332 { |
|
333 CImpsGroupProps::SetPrivateAllowed( aValue ); |
|
334 } |
|
335 |
|
336 // --------------------------------------------------------- |
|
337 // CImpsCommonGroupProps::IsOpen |
|
338 // --------------------------------------------------------- |
|
339 // |
|
340 EXPORT_C TImpsPropertyBool CImpsCommonGroupProps::IsOpen() const |
|
341 { |
|
342 return iAccessOpen; |
|
343 } |
|
344 |
|
345 // --------------------------------------------------------- |
|
346 // CImpsCommonGroupProps::SetOpen |
|
347 // --------------------------------------------------------- |
|
348 // |
|
349 EXPORT_C void CImpsCommonGroupProps::SetOpen( |
|
350 TImpsPropertyBool aValue ) |
|
351 { |
|
352 iAccessOpen = aValue; |
|
353 } |
|
354 |
|
355 |
|
356 // --------------------------------------------------------- |
|
357 // CImpsCommonGroupProps::IsPublic |
|
358 // --------------------------------------------------------- |
|
359 // |
|
360 EXPORT_C TImpsPropertyBool CImpsCommonGroupProps::IsPublic() const |
|
361 { |
|
362 return iTypePublic; |
|
363 } |
|
364 |
|
365 |
|
366 // --------------------------------------------------------- |
|
367 // CImpsCommonGroupProps::IsSearchable |
|
368 // --------------------------------------------------------- |
|
369 // |
|
370 EXPORT_C TImpsPropertyBool CImpsCommonGroupProps::IsSearchable() const |
|
371 { |
|
372 return iSearchable; |
|
373 } |
|
374 |
|
375 // --------------------------------------------------------- |
|
376 // CImpsCommonGroupProps::SetSearchable |
|
377 // --------------------------------------------------------- |
|
378 // |
|
379 EXPORT_C void CImpsCommonGroupProps::SetSearchable( |
|
380 TImpsPropertyBool aValue ) |
|
381 { |
|
382 iSearchable = aValue; |
|
383 } |
|
384 |
|
385 |
|
386 // --------------------------------------------------------- |
|
387 // CImpsCommonGroupProps::NbrOfUsers |
|
388 // --------------------------------------------------------- |
|
389 // |
|
390 EXPORT_C TInt CImpsCommonGroupProps::NbrOfUsers() const |
|
391 { |
|
392 return iNbrActive; |
|
393 } |
|
394 |
|
395 // --------------------------------------------------------- |
|
396 // CImpsCommonGroupProps::MaxNbrOfUsers |
|
397 // --------------------------------------------------------- |
|
398 // |
|
399 EXPORT_C TInt CImpsCommonGroupProps::MaxNbrOfUsers() const |
|
400 { |
|
401 return iMaxUsers; |
|
402 } |
|
403 |
|
404 // --------------------------------------------------------- |
|
405 // CImpsCommonGroupProps::SetMaxNbrOfUsers |
|
406 // --------------------------------------------------------- |
|
407 // |
|
408 EXPORT_C void CImpsCommonGroupProps::SetMaxNbrOfUsers( |
|
409 TInt aValue ) |
|
410 { |
|
411 iMaxUsers = aValue; |
|
412 } |
|
413 |
|
414 |
|
415 // --------------------------------------------------------- |
|
416 // CImpsCommonGroupProps::GroupName |
|
417 // --------------------------------------------------------- |
|
418 // |
|
419 EXPORT_C TPtrC CImpsCommonGroupProps::GroupName() const |
|
420 { |
|
421 /*LDRA_NOANALYSIS*/ |
|
422 return iName ? TPtrC( *iName ) : TPtrC(); |
|
423 /*LDRA_ANALYSIS*/ |
|
424 } |
|
425 |
|
426 // --------------------------------------------------------- |
|
427 // CImpsCommonGroupProps::SetGroupNameL |
|
428 // --------------------------------------------------------- |
|
429 // |
|
430 EXPORT_C void CImpsCommonGroupProps::SetGroupNameL( |
|
431 const TDesC& aName ) |
|
432 { |
|
433 HBufC* newAttrib = aName.AllocL(); |
|
434 delete iName; |
|
435 iName = newAttrib; |
|
436 } |
|
437 |
|
438 // --------------------------------------------------------- |
|
439 // CImpsCommonGroupProps::Topic |
|
440 // --------------------------------------------------------- |
|
441 // |
|
442 EXPORT_C TPtrC CImpsCommonGroupProps::Topic() const |
|
443 { |
|
444 /*LDRA_NOANALYSIS*/ |
|
445 return iTopic ? TPtrC( *iTopic ) : TPtrC(); |
|
446 /*LDRA_ANALYSIS*/ |
|
447 } |
|
448 |
|
449 // --------------------------------------------------------- |
|
450 // CImpsCommonGroupProps::SetTopicL |
|
451 // --------------------------------------------------------- |
|
452 // |
|
453 EXPORT_C void CImpsCommonGroupProps::SetTopicL( |
|
454 const TDesC& aTopic ) |
|
455 { |
|
456 HBufC* newAttrib = aTopic.AllocL(); |
|
457 delete iTopic; |
|
458 iTopic = newAttrib; |
|
459 } |
|
460 |
|
461 // --------------------------------------------------------- |
|
462 // CImpsCommonGroupProps::Welcome |
|
463 // --------------------------------------------------------- |
|
464 // |
|
465 EXPORT_C TPtrC CImpsCommonGroupProps::Welcome() const |
|
466 { |
|
467 /*LDRA_NOANALYSIS*/ |
|
468 return iWelcome ? TPtrC( *iWelcome ) : TPtrC(); |
|
469 /*LDRA_ANALYSIS*/ |
|
470 } |
|
471 |
|
472 // --------------------------------------------------------- |
|
473 // CImpsCommonGroupProps::SetWelcomeL |
|
474 // --------------------------------------------------------- |
|
475 // |
|
476 EXPORT_C void CImpsCommonGroupProps::SetWelcomeL( |
|
477 const TDesC& aText ) |
|
478 { |
|
479 HBufC* newAttrib = aText.AllocL(); |
|
480 delete iWelcome; |
|
481 iWelcome = newAttrib; |
|
482 } |
|
483 // --------------------------------------------------------- |
|
484 // CImpsCommonGroupProps::AutoDelete |
|
485 // --------------------------------------------------------- |
|
486 // |
|
487 EXPORT_C TImpsPropertyBool CImpsCommonGroupProps::AutoDelete() const |
|
488 { |
|
489 return iAutoDelete; |
|
490 } |
|
491 // --------------------------------------------------------- |
|
492 // CImpsCommonGroupProps::SetAutoDelete |
|
493 // --------------------------------------------------------- |
|
494 // |
|
495 EXPORT_C void CImpsCommonGroupProps::SetAutoDelete( TImpsPropertyBool aValue ) |
|
496 { |
|
497 iAutoDelete = aValue; |
|
498 } |
|
499 |
|
500 // --------------------------------------------------------- |
|
501 // CImpsCommonGroupPropsInt::Reset |
|
502 // --------------------------------------------------------- |
|
503 // |
|
504 EXPORT_C void CImpsCommonGroupPropsInt::Reset() |
|
505 { |
|
506 CImpsCommonGroupProps::Reset(); |
|
507 iTypePublic = EImpsPropUndef; // type public/private |
|
508 iNbrActive = EImpsPropUndef; // nbr of active users |
|
509 } |
|
510 |
|
511 // --------------------------------------------------------- |
|
512 // CImpsCommonGroupPropsInt::HasData |
|
513 // --------------------------------------------------------- |
|
514 // |
|
515 TBool CImpsCommonGroupPropsInt::HasData() const |
|
516 { |
|
517 if ( ( iAccessOpen != EImpsPropUndef ) || |
|
518 ( iTypePublic != EImpsPropUndef ) || |
|
519 ( iSearchable != EImpsPropUndef ) || |
|
520 ( iNbrActive >= 0 ) || |
|
521 ( iMaxUsers >= 0 ) || |
|
522 ( iName ) || |
|
523 ( iTopic ) || |
|
524 ( iWelcome ) || |
|
525 ( iPrivateMessages != EImpsPropUndef ) ) // from base class |
|
526 { |
|
527 return ETrue; |
|
528 } |
|
529 return EFalse; |
|
530 } |
|
531 |
|
532 |
|
533 /************ PRIVATE PROPS ********************************/ |
|
534 |
|
535 // --------------------------------------------------------- |
|
536 // CImpsPrivateGroupProps::CImpsPrivateGroupProps |
|
537 // --------------------------------------------------------- |
|
538 // |
|
539 CImpsPrivateGroupProps::CImpsPrivateGroupProps() |
|
540 : CImpsGroupProps(), |
|
541 iMember( EImpsPropUndef ), |
|
542 iPrivilege( EImpsUserUndef ) |
|
543 { |
|
544 |
|
545 } |
|
546 |
|
547 // --------------------------------------------------------- |
|
548 // CImpsPrivateGroupProps::NewL |
|
549 // --------------------------------------------------------- |
|
550 // |
|
551 EXPORT_C CImpsPrivateGroupProps* CImpsPrivateGroupProps::NewL() |
|
552 { |
|
553 CImpsPrivateGroupProps* self = new (ELeave) CImpsPrivateGroupProps; |
|
554 |
|
555 CleanupStack::PushL( self ); |
|
556 self->ConstructL(); |
|
557 CleanupStack::Pop(); |
|
558 |
|
559 return self; |
|
560 } |
|
561 |
|
562 // --------------------------------------------------------- |
|
563 // CImpsPrivateGroupProps::~CImpsPrivateGroupProps |
|
564 // --------------------------------------------------------- |
|
565 // |
|
566 CImpsPrivateGroupProps::~CImpsPrivateGroupProps() |
|
567 { |
|
568 |
|
569 } |
|
570 |
|
571 // Symbian OS default constructor can leave. |
|
572 void CImpsPrivateGroupProps::ConstructL() |
|
573 { |
|
574 Reset( ); |
|
575 } |
|
576 |
|
577 // --------------------------------------------------------- |
|
578 // CImpsPrivateGroupProps::Reset |
|
579 // --------------------------------------------------------- |
|
580 // |
|
581 EXPORT_C void CImpsPrivateGroupProps::Reset() |
|
582 { |
|
583 iMember = EImpsPropUndef; |
|
584 iPrivilege = EImpsUserUndef; |
|
585 CImpsGroupProps::Reset(); |
|
586 } |
|
587 |
|
588 // --------------------------------------------------------- |
|
589 // CImpsPrivateGroupProps::Type |
|
590 // --------------------------------------------------------- |
|
591 // |
|
592 EXPORT_C TImpsPropertyType CImpsPrivateGroupProps::Type() const |
|
593 { |
|
594 return EImpsPropPrivate; |
|
595 } |
|
596 |
|
597 // --------------------------------------------------------- |
|
598 // CImpsPrivateGroupProps::IsPrivateAllowed |
|
599 // --------------------------------------------------------- |
|
600 // |
|
601 EXPORT_C TImpsPropertyBool CImpsPrivateGroupProps::IsPrivateAllowed() const |
|
602 { |
|
603 return CImpsGroupProps::IsPrivateAllowed(); |
|
604 } |
|
605 |
|
606 // --------------------------------------------------------- |
|
607 // CImpsPrivateGroupProps::SetPrivateAllowed |
|
608 // --------------------------------------------------------- |
|
609 // |
|
610 EXPORT_C void CImpsPrivateGroupProps::SetPrivateAllowed( TImpsPropertyBool aValue ) |
|
611 { |
|
612 CImpsGroupProps::SetPrivateAllowed( aValue ); |
|
613 } |
|
614 |
|
615 // --------------------------------------------------------- |
|
616 // CImpsPrivateGroupProps::IsMember |
|
617 // --------------------------------------------------------- |
|
618 // |
|
619 EXPORT_C TImpsPropertyBool CImpsPrivateGroupProps::IsMember() const |
|
620 { |
|
621 return iMember; |
|
622 } |
|
623 |
|
624 // --------------------------------------------------------- |
|
625 // CImpsPrivateGroupPropsInt::HasData |
|
626 // --------------------------------------------------------- |
|
627 // |
|
628 TBool CImpsPrivateGroupPropsInt::HasData() const |
|
629 { |
|
630 if ( ( iMember != EImpsPropUndef ) || |
|
631 ( iPrivilege != EImpsUserUndef ) || |
|
632 ( iPrivateMessages != EImpsPropUndef ) ) // from base class |
|
633 { |
|
634 return ETrue; |
|
635 } |
|
636 return EFalse; |
|
637 } |
|
638 |
|
639 // --------------------------------------------------------- |
|
640 // CImpsPrivateGroupProps::Privileges |
|
641 // --------------------------------------------------------- |
|
642 // |
|
643 EXPORT_C TImpsGroupUsers CImpsPrivateGroupProps::Privileges() const |
|
644 { |
|
645 return iPrivilege; |
|
646 } |
|
647 |
|
648 |
|
649 // EPOC default constructor can leave. |
|
650 void CImpsCommonGroupProps::ConstructL() |
|
651 { |
|
652 Reset( ); |
|
653 } |
|
654 |
|
655 // --------------------------------------------------------- |
|
656 // CImpsCommonGroupPropsInt::CImpsCommonGroupPropsInt |
|
657 // --------------------------------------------------------- |
|
658 // |
|
659 CImpsCommonGroupPropsInt::CImpsCommonGroupPropsInt() |
|
660 : CImpsCommonGroupProps() |
|
661 { |
|
662 |
|
663 } |
|
664 |
|
665 |
|
666 // --------------------------------------------------------- |
|
667 // CImpsCommonGroupPropsInt::NewL |
|
668 // --------------------------------------------------------- |
|
669 // |
|
670 EXPORT_C CImpsCommonGroupPropsInt* CImpsCommonGroupPropsInt::NewL() |
|
671 { |
|
672 CImpsCommonGroupPropsInt* self = new ( ELeave ) CImpsCommonGroupPropsInt; |
|
673 CleanupStack::PushL( self ); |
|
674 self->ConstructL(); |
|
675 CleanupStack::Pop(); |
|
676 return self; |
|
677 } |
|
678 |
|
679 // --------------------------------------------------------- |
|
680 // CImpsCommonGroupPropsInt::~CImpsCommonGroupPropsInt |
|
681 // --------------------------------------------------------- |
|
682 // |
|
683 CImpsCommonGroupPropsInt::~CImpsCommonGroupPropsInt() |
|
684 { |
|
685 Reset(); |
|
686 } |
|
687 |
|
688 // Symbian OS default constructor can leave. |
|
689 void CImpsCommonGroupPropsInt::ConstructL() |
|
690 { |
|
691 Reset( ); |
|
692 } |
|
693 |
|
694 // --------------------------------------------------------- |
|
695 // CImpsCommonGroupPropsInt::SetPublic |
|
696 // --------------------------------------------------------- |
|
697 // |
|
698 EXPORT_C void CImpsCommonGroupPropsInt::SetPublic( |
|
699 TImpsPropertyBool aType ) |
|
700 { |
|
701 iTypePublic = aType; |
|
702 } |
|
703 |
|
704 // --------------------------------------------------------- |
|
705 // CImpsCommonGroupPropsInt::SetNbrOfUsers |
|
706 // --------------------------------------------------------- |
|
707 // |
|
708 EXPORT_C void CImpsCommonGroupPropsInt::SetNbrOfUsers( |
|
709 TInt aNbr ) |
|
710 { |
|
711 iNbrActive = aNbr; |
|
712 } |
|
713 |
|
714 // --------------------------------------------------------- |
|
715 // CImpsCommonGroupPropsInt::Size |
|
716 // --------------------------------------------------------- |
|
717 // |
|
718 TInt CImpsCommonGroupPropsInt::Size() const |
|
719 { |
|
720 TInt sizeEntry = Align4( KImpsPackedCommonProps ); |
|
721 sizeEntry += Align4( KImpsPackedProps ); |
|
722 |
|
723 TInt sizeStrings = 0; |
|
724 sizeStrings += GroupName().Size(); |
|
725 sizeStrings += Topic().Size(); |
|
726 sizeStrings += Welcome().Size(); |
|
727 |
|
728 TInt size = sizeEntry + sizeStrings + ( KImpsPackedCommonPropsNbr * sizeof(TInt32) ); |
|
729 |
|
730 // no arrays |
|
731 |
|
732 return size; |
|
733 } |
|
734 |
|
735 // --------------------------------------------------------- |
|
736 // CImpsPrivateGroupPropsInt::CImpsPrivateGroupPropsInt |
|
737 // --------------------------------------------------------- |
|
738 // |
|
739 CImpsPrivateGroupPropsInt::CImpsPrivateGroupPropsInt() |
|
740 : CImpsPrivateGroupProps() |
|
741 { |
|
742 |
|
743 } |
|
744 |
|
745 // --------------------------------------------------------- |
|
746 // CImpsPrivateGroupPropsInt::NewL |
|
747 // --------------------------------------------------------- |
|
748 // |
|
749 EXPORT_C CImpsPrivateGroupPropsInt* CImpsPrivateGroupPropsInt::NewL() |
|
750 { |
|
751 CImpsPrivateGroupPropsInt* self = new (ELeave) CImpsPrivateGroupPropsInt; |
|
752 CleanupStack::PushL( self ); |
|
753 self->ConstructL(); |
|
754 CleanupStack::Pop(); |
|
755 return self; |
|
756 } |
|
757 |
|
758 // --------------------------------------------------------- |
|
759 // CImpsPrivateGroupPropsInt::~CImpsPrivateGroupPropsInt |
|
760 // --------------------------------------------------------- |
|
761 // |
|
762 CImpsPrivateGroupPropsInt::~CImpsPrivateGroupPropsInt() |
|
763 { |
|
764 Reset(); |
|
765 } |
|
766 |
|
767 // Symbian OS default constructor can leave. |
|
768 void CImpsPrivateGroupPropsInt::ConstructL() |
|
769 { |
|
770 Reset( ); |
|
771 } |
|
772 |
|
773 // --------------------------------------------------------- |
|
774 // CImpsPrivateGroupPropsInt::Reset |
|
775 // --------------------------------------------------------- |
|
776 // |
|
777 EXPORT_C void CImpsPrivateGroupPropsInt::Reset() |
|
778 { |
|
779 CImpsPrivateGroupProps::Reset(); |
|
780 iMember = EImpsPropUndef; // Am i member |
|
781 iPrivilege = EImpsUserUndef; // privilege level |
|
782 } |
|
783 |
|
784 // --------------------------------------------------------- |
|
785 // CImpsPrivateGroupPropsInt::SetMember |
|
786 // --------------------------------------------------------- |
|
787 // |
|
788 EXPORT_C void CImpsPrivateGroupPropsInt::SetMember( |
|
789 TImpsPropertyBool aValue ) |
|
790 { |
|
791 iMember = aValue; |
|
792 } |
|
793 |
|
794 // --------------------------------------------------------- |
|
795 // CImpsPrivateGroupPropsInt::SetPrivileges |
|
796 // --------------------------------------------------------- |
|
797 // |
|
798 EXPORT_C void CImpsPrivateGroupPropsInt::SetPrivileges( |
|
799 TImpsGroupUsers aValue ) |
|
800 { |
|
801 iPrivilege = aValue; |
|
802 } |
|
803 |
|
804 // --------------------------------------------------------- |
|
805 // CImpsPrivateGroupPropsInt::Size |
|
806 // --------------------------------------------------------- |
|
807 // |
|
808 TInt CImpsPrivateGroupPropsInt::Size() const |
|
809 { |
|
810 TInt sizeEntry = Align4( KImpsPackedPrivateProps ); |
|
811 sizeEntry += Align4( KImpsPackedProps ); |
|
812 |
|
813 // Notice: update this always when class definition changes |
|
814 TInt sizeStrings = 0; |
|
815 |
|
816 TInt size = sizeEntry + sizeStrings; |
|
817 |
|
818 // no arrays |
|
819 |
|
820 return size; |
|
821 } |
|
822 |
|
823 |
|
824 // ================= OTHER EXPORTED FUNCTIONS ============== |
|
825 |
|
826 |
|
827 // End of File |
|
828 |