|
1 /* |
|
2 * Copyright (c) 2003-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: Implementation of contact data container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CCAGroup.h" |
|
22 #include "CCAStorage.h" |
|
23 #include "TCAStoragePanics.h" |
|
24 #include "TStorageManagerGlobals.h" |
|
25 #include "MCAStoredGroupsObserver.h" |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <e32std.h> |
|
29 #include <e32def.h> |
|
30 #include <s32strm.h> |
|
31 |
|
32 #include "ChatDebugPrint.h" |
|
33 |
|
34 // CLASS FORWARD declarations |
|
35 |
|
36 // CONSTANTS |
|
37 const TInt KCAGroupArrayGranularity = 5; // estimated |
|
38 |
|
39 //LOCAL FUNCTIONS |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // ExternalizeBufferToStreamL |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 void ExternalizeBufferToStreamL( const HBufC* aBuffer, RWriteStream& aStream ) |
|
46 { |
|
47 if ( aBuffer ) |
|
48 { |
|
49 if ( aBuffer->Length() != 0 ) |
|
50 { |
|
51 aStream.WriteInt32L( aBuffer->Length() ); |
|
52 aStream.WriteL( *aBuffer ); |
|
53 return; |
|
54 } |
|
55 } |
|
56 // no buffer or buffer length is zero, writing length information as 0 |
|
57 aStream.WriteInt32L( 0 ); |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // InternalizeBufferFromStreamL |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 HBufC* InternalizeBufferFromStreamL( RReadStream& aStream ) |
|
65 { |
|
66 HBufC* buffer = NULL; |
|
67 |
|
68 TInt length( aStream.ReadInt32L() ); |
|
69 if ( length != 0 ) |
|
70 { |
|
71 buffer = HBufC::NewLC( length ); |
|
72 TPtr ptr( buffer->Des() ); |
|
73 aStream.ReadL( ptr, length ); |
|
74 CleanupStack::Pop( buffer ); //buffer |
|
75 } |
|
76 else |
|
77 { |
|
78 // creating empty buffer with 1 byte length |
|
79 buffer = HBufC::NewL( 1 ); |
|
80 } |
|
81 |
|
82 return buffer; |
|
83 } |
|
84 |
|
85 // ============================ MEMBER FUNCTIONS =============================== |
|
86 |
|
87 // ----------------------------------------------------------------------------- |
|
88 // CCAGroup::CCAGroup |
|
89 // C++ default constructor can NOT contain any code, that |
|
90 // might leave. |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 CCAGroup::CCAGroup( CCAStorage* aStorage, |
|
94 MCAStoredGroupsObserver* aObserver ) : |
|
95 iStorage( aStorage ), |
|
96 iIsJoined( EFalse ), |
|
97 iIsOwnGroup( EFalse ), |
|
98 iIsVisible( ETrue ), |
|
99 iIsAdmin( EFalse ), |
|
100 iObserver( aObserver ) |
|
101 { |
|
102 iStorageType = TStorageManagerGlobals::EUnknownStorageType; |
|
103 } |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // CCAGroup::ConstructL |
|
107 // Symbian 2nd phase constructor can leave. |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 void CCAGroup::ConstructL() |
|
111 { |
|
112 iMembers = new ( ELeave ) CDesCArraySeg( KCAGroupArrayGranularity ); |
|
113 iParticipants = new ( ELeave ) CDesCArraySeg( KCAGroupArrayGranularity ); |
|
114 |
|
115 // must have something inside, so might as well make it empty and length 1 |
|
116 iServerName = HBufC::NewL( 1 ); |
|
117 iGroupId = HBufC::NewL( 1 ); |
|
118 iGroupName = HBufC::NewL( 1 ); |
|
119 } |
|
120 |
|
121 // ----------------------------------------------------------------------------- |
|
122 // CCAGroup::NewL |
|
123 // Two-phased constructor. |
|
124 // ----------------------------------------------------------------------------- |
|
125 // |
|
126 EXPORT_C CCAGroup* CCAGroup::NewL( CCAStorage* aStorage, |
|
127 MCAStoredGroupsObserver* aObserver ) |
|
128 { |
|
129 CCAGroup* self = new( ELeave ) CCAGroup( aStorage, aObserver ); |
|
130 |
|
131 CleanupStack::PushL( self ); |
|
132 self->ConstructL(); |
|
133 CleanupStack::Pop( self ); |
|
134 |
|
135 return self; |
|
136 } |
|
137 |
|
138 // Destructor |
|
139 EXPORT_C CCAGroup::~CCAGroup() |
|
140 { |
|
141 if ( iMembers ) |
|
142 { |
|
143 iMembers->Reset(); |
|
144 delete iMembers; |
|
145 } |
|
146 |
|
147 if ( iParticipants ) |
|
148 { |
|
149 iParticipants->Reset(); |
|
150 delete iParticipants; |
|
151 } |
|
152 |
|
153 delete iGroupId; |
|
154 delete iGroupName; |
|
155 delete iServerName; |
|
156 } |
|
157 |
|
158 // ----------------------------------------------------------------------------- |
|
159 // CCAGroup::IsJoined |
|
160 // From MCAStoredGroup |
|
161 // ----------------------------------------------------------------------------- |
|
162 // |
|
163 EXPORT_C TBool CCAGroup::IsJoined() const |
|
164 { |
|
165 return iIsJoined; |
|
166 } |
|
167 |
|
168 // ----------------------------------------------------------------------------- |
|
169 // CCAGroup::SetJoined |
|
170 // From MCAExtendedStoredGroup |
|
171 // ----------------------------------------------------------------------------- |
|
172 // |
|
173 EXPORT_C void CCAGroup::SetJoined( TBool aJoinStatus ) |
|
174 { |
|
175 iIsJoined = aJoinStatus; |
|
176 |
|
177 iIsChanged |= 1; |
|
178 } |
|
179 |
|
180 // ----------------------------------------------------------------------------- |
|
181 // CCAGroup::MembersL |
|
182 // From MCAStoredGroup |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 EXPORT_C void CCAGroup::GetMembersL( CDesCArray& aMemberList ) const |
|
186 { |
|
187 aMemberList.Reset(); |
|
188 const TInt count( iMembers->Count() ); |
|
189 for ( TInt i = 0; i < count; i++ ) |
|
190 { |
|
191 HBufC* buf = iMembers->MdcaPoint( i ).AllocL(); |
|
192 CleanupStack::PushL( buf ); |
|
193 aMemberList.AppendL( *buf ); // copy is made.. |
|
194 CleanupStack::PopAndDestroy( buf ); // buf |
|
195 } |
|
196 } |
|
197 |
|
198 // ----------------------------------------------------------------------------- |
|
199 // CCAGroup::AddMembersLocallyL |
|
200 // From MCAExtendedStoredGroup |
|
201 // ----------------------------------------------------------------------------- |
|
202 // |
|
203 EXPORT_C void CCAGroup::AddMembersLocallyL( const MDesCArray& aMemberList ) |
|
204 { |
|
205 const TInt count( aMemberList.MdcaCount() ); |
|
206 for ( TInt i = 0; i < count; i++ ) |
|
207 { |
|
208 HBufC* buf = aMemberList.MdcaPoint( i ).AllocL(); |
|
209 CleanupStack::PushL( buf ); |
|
210 iMembers->AppendL( *buf ); // makes a copy.. |
|
211 CleanupStack::PopAndDestroy( buf ); // buf |
|
212 iIsChanged |= 1; |
|
213 } |
|
214 } |
|
215 |
|
216 // ----------------------------------------------------------------------------- |
|
217 // CCAGroup::MembersLocallyL |
|
218 // From MCAExtendedStoredGroup |
|
219 // ----------------------------------------------------------------------------- |
|
220 // |
|
221 EXPORT_C void CCAGroup::RemoveMembersLocally( const MDesCArray& aMemberList ) |
|
222 { |
|
223 const TInt count( aMemberList.MdcaCount() ); |
|
224 |
|
225 for ( TInt i = 0; i < count; i++ ) |
|
226 { |
|
227 TInt pos( 0 ); |
|
228 if ( iMembers->Find( aMemberList.MdcaPoint( i ), |
|
229 pos, ECmpCollated ) == 0 ) |
|
230 { |
|
231 // found it |
|
232 iMembers->Delete( pos ); |
|
233 iIsChanged |= 1; |
|
234 iMembers->Compress(); |
|
235 } |
|
236 } |
|
237 } |
|
238 |
|
239 // ----------------------------------------------------------------------------- |
|
240 // CCAGroup::ResetMembersLocally |
|
241 // From MCAExtendedStoredGroup |
|
242 // ----------------------------------------------------------------------------- |
|
243 // |
|
244 EXPORT_C void CCAGroup::ResetMembersLocally() |
|
245 { |
|
246 iMembers->Reset(); |
|
247 iIsChanged |= 1; |
|
248 } |
|
249 |
|
250 // ----------------------------------------------------------------------------- |
|
251 // CCAGroup::ParticipantsL |
|
252 // From MCAStoredGroup |
|
253 // ----------------------------------------------------------------------------- |
|
254 // |
|
255 EXPORT_C void CCAGroup::GetParticipantsL( CDesCArray& aParticipantList ) const |
|
256 { |
|
257 aParticipantList.Reset(); |
|
258 const TInt count( iParticipants->Count() ); |
|
259 for ( TInt i = 0; i < count; i++ ) |
|
260 { |
|
261 HBufC* buf = iParticipants->MdcaPoint( i ).AllocL(); |
|
262 CleanupStack::PushL( buf ); |
|
263 aParticipantList.AppendL( *buf ); // copy is made.. |
|
264 CleanupStack::PopAndDestroy( buf ); // buf |
|
265 } |
|
266 } |
|
267 |
|
268 // ----------------------------------------------------------------------------- |
|
269 // CCAGroup::AddParticipantL |
|
270 // From MCAExtendedStoredGroup |
|
271 // ----------------------------------------------------------------------------- |
|
272 // |
|
273 EXPORT_C void CCAGroup::AddParticipantL( const MDesCArray& aParticipantList ) |
|
274 { |
|
275 const TInt count( aParticipantList.MdcaCount() ); |
|
276 for ( TInt i = 0; i < count; i++ ) |
|
277 { |
|
278 TPtrC screenName( aParticipantList.MdcaPoint( i ) ); |
|
279 TInt pos( 0 ); |
|
280 if ( iParticipants->Find( screenName, pos, ECmpCollated ) != 0 ) |
|
281 { |
|
282 // if the participant wasn't already in group, add it |
|
283 HBufC* buf = screenName.AllocLC(); |
|
284 iParticipants->AppendL( *buf ); // makes a copy.. |
|
285 CleanupStack::PopAndDestroy( buf ); // buf |
|
286 iIsChanged |= 1; |
|
287 } |
|
288 } |
|
289 } |
|
290 |
|
291 // ----------------------------------------------------------------------------- |
|
292 // CCAGroup::RemoveParticipantL |
|
293 // From MCAExtendedStoredGroup |
|
294 // ----------------------------------------------------------------------------- |
|
295 // |
|
296 EXPORT_C void CCAGroup::RemoveParticipantL( const MDesCArray& aParticipantList ) |
|
297 { |
|
298 const TInt count( aParticipantList.MdcaCount() ); |
|
299 |
|
300 for ( TInt i = 0; i < count; i++ ) |
|
301 { |
|
302 TInt pos( 0 ); |
|
303 if ( iParticipants->Find( aParticipantList.MdcaPoint( i ), |
|
304 pos, ECmpCollated ) == 0 ) |
|
305 { |
|
306 // found it |
|
307 iParticipants->Delete( pos ); |
|
308 iIsChanged |= 1; |
|
309 iParticipants->Compress(); |
|
310 } |
|
311 } |
|
312 } |
|
313 |
|
314 // ----------------------------------------------------------------------------- |
|
315 // CCAGroup::ResetParticipantsL |
|
316 // From MCAExtendedStoredGroup |
|
317 // ----------------------------------------------------------------------------- |
|
318 // |
|
319 EXPORT_C void CCAGroup::ResetParticipantsL() |
|
320 { |
|
321 iParticipants->Reset(); |
|
322 iIsChanged |= 1; |
|
323 } |
|
324 |
|
325 // ----------------------------------------------------------------------------- |
|
326 // CCAGroup::StorageType |
|
327 // From MCAStoredGroup |
|
328 // ----------------------------------------------------------------------------- |
|
329 // |
|
330 EXPORT_C TStorageManagerGlobals::TCAStorageType CCAGroup::StorageType() const |
|
331 { |
|
332 return iStorageType; |
|
333 } |
|
334 |
|
335 // ----------------------------------------------------------------------------- |
|
336 // CCAGroup::SetStorageType |
|
337 // From MCAExtendedStoredGroup |
|
338 // ----------------------------------------------------------------------------- |
|
339 // |
|
340 EXPORT_C void CCAGroup::SetStorageType( |
|
341 TStorageManagerGlobals::TCAStorageType aType ) |
|
342 { |
|
343 iStorageType = aType; |
|
344 iIsChanged |= 1; |
|
345 } |
|
346 |
|
347 // ----------------------------------------------------------------------------- |
|
348 // CCAGroup::IsOwnGroup |
|
349 // From MCAStoredGroup |
|
350 // ----------------------------------------------------------------------------- |
|
351 // |
|
352 EXPORT_C TBool CCAGroup::IsOwnGroup() const |
|
353 { |
|
354 return iIsOwnGroup; |
|
355 } |
|
356 |
|
357 // ----------------------------------------------------------------------------- |
|
358 // CCAGroup::SetOwnGroup |
|
359 // From MCAExtendedStoredGroup |
|
360 // ----------------------------------------------------------------------------- |
|
361 // |
|
362 EXPORT_C void CCAGroup::SetOwnGroup( TBool aOwnGroupStatus ) |
|
363 { |
|
364 iIsOwnGroup = aOwnGroupStatus; |
|
365 iIsChanged |= 1; |
|
366 } |
|
367 |
|
368 // ----------------------------------------------------------------------------- |
|
369 // CCAGroup::SetGroupIdL |
|
370 // From MCAExtendedStoredGroup |
|
371 // ----------------------------------------------------------------------------- |
|
372 // |
|
373 EXPORT_C void CCAGroup::SetGroupIdL( const TDesC& aGroupId ) |
|
374 { |
|
375 HBufC* tempGroupId = aGroupId.AllocL(); |
|
376 delete iGroupId; |
|
377 iGroupId = tempGroupId; |
|
378 iIsChanged |= 1; |
|
379 } |
|
380 |
|
381 // ----------------------------------------------------------------------------- |
|
382 // CCAGroup::GroupId |
|
383 // From MCAStoredGroup |
|
384 // ----------------------------------------------------------------------------- |
|
385 // |
|
386 |
|
387 EXPORT_C const TDesC& CCAGroup::GroupId() const |
|
388 { |
|
389 return *( iGroupId ); |
|
390 } |
|
391 |
|
392 // ----------------------------------------------------------------------------- |
|
393 // CCAGroup::SetGroupNameL |
|
394 // From MCAExtendedStoredGroup |
|
395 // ----------------------------------------------------------------------------- |
|
396 // |
|
397 EXPORT_C void CCAGroup::SetGroupNameL( const TDesC& aGroupName ) |
|
398 { |
|
399 HBufC* tempGroupName = aGroupName.AllocL(); |
|
400 delete iGroupName; |
|
401 iGroupName = tempGroupName; |
|
402 iIsChanged |= 1; |
|
403 } |
|
404 |
|
405 // ----------------------------------------------------------------------------- |
|
406 // CCAGroup::GroupName |
|
407 // From MCAStoredGroup |
|
408 // ----------------------------------------------------------------------------- |
|
409 // |
|
410 EXPORT_C const TDesC& CCAGroup::GroupName() const |
|
411 { |
|
412 return *( iGroupName ); |
|
413 } |
|
414 |
|
415 // ----------------------------------------------------------------------------- |
|
416 // CCAGroup::IsAdmin |
|
417 // From MCAStoredGroup |
|
418 // ----------------------------------------------------------------------------- |
|
419 // |
|
420 EXPORT_C TBool CCAGroup::IsAdmin() const |
|
421 { |
|
422 return iIsAdmin; |
|
423 } |
|
424 |
|
425 // ----------------------------------------------------------------------------- |
|
426 // CCAGroup::SetAdmin |
|
427 // From MCAExtendedStoredGroup |
|
428 // ----------------------------------------------------------------------------- |
|
429 // |
|
430 EXPORT_C void CCAGroup::SetAdmin( const TBool aStatus ) |
|
431 { |
|
432 iIsAdmin = aStatus; |
|
433 iIsChanged |= 1; |
|
434 } |
|
435 |
|
436 // ----------------------------------------------------------------------------- |
|
437 // CCAGroup::NumParticipants |
|
438 // From MCAStoredGroup |
|
439 // ----------------------------------------------------------------------------- |
|
440 // |
|
441 EXPORT_C TInt CCAGroup::NumParticipants() const |
|
442 { |
|
443 return iParticipants->Count(); |
|
444 } |
|
445 |
|
446 // ----------------------------------------------------------------------------- |
|
447 // CCAGroup::IsVisible |
|
448 // From MCAStoredGroup |
|
449 // ----------------------------------------------------------------------------- |
|
450 // |
|
451 EXPORT_C TBool CCAGroup::IsVisible() const |
|
452 { |
|
453 return iIsVisible; |
|
454 } |
|
455 |
|
456 // ----------------------------------------------------------------------------- |
|
457 // CCAGroup::IsVisible |
|
458 // From MCAExtendedStoredGroup |
|
459 // ----------------------------------------------------------------------------- |
|
460 // |
|
461 EXPORT_C void CCAGroup::SetVisible( const TBool aVisible ) |
|
462 { |
|
463 iIsVisible = aVisible; |
|
464 iIsChanged |= 1; |
|
465 |
|
466 // UI needs to know about this. it's convenient to use delete event... |
|
467 if ( iGroupId->Length() > 0 ) |
|
468 { |
|
469 // there's a valid group id |
|
470 if ( !iIsVisible ) |
|
471 { |
|
472 // the group have been set to invisible |
|
473 // => signal observers |
|
474 iObserver->HandleDelete( *iGroupId ); |
|
475 } |
|
476 } |
|
477 |
|
478 // otherwise we can't send observer event. we have no valid group id yet! |
|
479 } |
|
480 |
|
481 // ----------------------------------------------------------------------------- |
|
482 // CCAGroup::Server |
|
483 // From MCAStoredGroup |
|
484 // ----------------------------------------------------------------------------- |
|
485 // |
|
486 EXPORT_C const TDesC& CCAGroup::Server() const |
|
487 { |
|
488 return *( iServerName ); |
|
489 } |
|
490 |
|
491 // ----------------------------------------------------------------------------- |
|
492 // CCAGroup::Server |
|
493 // From MCAExtendedStoredGroup |
|
494 // ----------------------------------------------------------------------------- |
|
495 // |
|
496 EXPORT_C void CCAGroup::SetServerL( const TDesC& aServer ) |
|
497 { |
|
498 HBufC* tempServerName = aServer.AllocL(); |
|
499 delete iServerName; |
|
500 iServerName = tempServerName; |
|
501 iIsChanged |= 1; |
|
502 } |
|
503 |
|
504 // ----------------------------------------------------------------------------- |
|
505 // CCAGroup::SaveChangesL |
|
506 // From MCAExtendedStoredGroup |
|
507 // ----------------------------------------------------------------------------- |
|
508 // |
|
509 EXPORT_C void CCAGroup::SaveChangesL() |
|
510 { |
|
511 TBool wasChanged( 0 != iIsChanged ); |
|
512 iStorage->SaveL( this ); |
|
513 iStorageType = TStorageManagerGlobals::EStoragePersistent; |
|
514 iIsChanged = 0; |
|
515 |
|
516 if ( wasChanged ) |
|
517 { |
|
518 // Notify observer. The observer shall decide whether to pass |
|
519 // the information forward. |
|
520 iObserver->HandleChange( *iGroupId ); |
|
521 } |
|
522 } |
|
523 |
|
524 // ----------------------------------------------------------------------------- |
|
525 // CCAGroup::ExternalizeL |
|
526 // From MCAExtendedStoredGroup |
|
527 // ----------------------------------------------------------------------------- |
|
528 // |
|
529 EXPORT_C void CCAGroup::ExternalizeL( RWriteStream& aStream ) const |
|
530 { |
|
531 // integers etc. |
|
532 aStream.WriteInt8L( ( TInt8 ) iIsOwnGroup ); // TBool |
|
533 |
|
534 // Descriptors are externalized as length-data pairs |
|
535 |
|
536 ExternalizeBufferToStreamL( iGroupId, aStream ); |
|
537 CHAT_DP( D_CHAT_LIT( "CCAGroup::ExternalizeL - Group id: %S" ), iGroupId ); |
|
538 |
|
539 ExternalizeBufferToStreamL( iGroupName, aStream ); |
|
540 CHAT_DP( D_CHAT_LIT( "CCAGroup::ExternalizeL - Group name: %S" ), |
|
541 iGroupName ); |
|
542 |
|
543 ExternalizeBufferToStreamL( iServerName, aStream ); |
|
544 CHAT_DP( D_CHAT_LIT( "CCAGroup::ExternalizeL - Group server: %S" ), |
|
545 iServerName ); |
|
546 } |
|
547 |
|
548 // ----------------------------------------------------------------------------- |
|
549 // CCAGroup::InternalizeL |
|
550 // From MCAExtendedStoredGroup |
|
551 // ----------------------------------------------------------------------------- |
|
552 // |
|
553 EXPORT_C void CCAGroup::InternalizeL( RReadStream& aStream ) |
|
554 { |
|
555 // default values are set in the 2nd phase constructor ConstructL |
|
556 |
|
557 // integers etc. |
|
558 iIsOwnGroup = aStream.ReadInt8L(); // TBool |
|
559 |
|
560 // descriptors |
|
561 // group id |
|
562 HBufC* tempGroupId = InternalizeBufferFromStreamL( aStream ); |
|
563 CleanupStack::PushL( tempGroupId ); |
|
564 |
|
565 HBufC* tempGroupName = InternalizeBufferFromStreamL( aStream ); |
|
566 CleanupStack::PushL( tempGroupName ); |
|
567 |
|
568 HBufC* tempServerName = InternalizeBufferFromStreamL( aStream ); |
|
569 CleanupStack::Pop( tempGroupName ); |
|
570 CleanupStack::Pop( tempGroupId ); |
|
571 |
|
572 delete iGroupId; |
|
573 iGroupId = tempGroupId; |
|
574 CHAT_DP( D_CHAT_LIT( "CCAGroup::InternalizeL - Group id: %S" ), iGroupId ); |
|
575 |
|
576 // group name |
|
577 delete iGroupName; |
|
578 iGroupName = tempGroupName; |
|
579 CHAT_DP( D_CHAT_LIT( "CCAGroup::InternalizeL - Group name: %S" ), |
|
580 iGroupName ); |
|
581 |
|
582 // server name |
|
583 delete iServerName; |
|
584 iServerName = tempServerName; |
|
585 CHAT_DP( D_CHAT_LIT( "CCAGroup::InternalizeL - Group server: %S" ), |
|
586 iServerName ); |
|
587 |
|
588 // CDesCArrays |
|
589 // members |
|
590 iMembers->Reset(); |
|
591 |
|
592 // participants |
|
593 iParticipants->Reset(); |
|
594 |
|
595 // must set saved flag |
|
596 SetStorageType( TStorageManagerGlobals::EStoragePersistent ); |
|
597 |
|
598 // set non-visible flag (set this when you want UI to see this) |
|
599 SetVisible( ETrue ); |
|
600 |
|
601 // we have changed |
|
602 iIsChanged |= 1; |
|
603 } |
|
604 |
|
605 // ----------------------------------------------------------------------------- |
|
606 // CCAGroup::MaximalSize |
|
607 // From MCAExtendedStoredGroup |
|
608 // When changing Externalize/Internalize, be sure to update this method too. |
|
609 // ----------------------------------------------------------------------------- |
|
610 // |
|
611 EXPORT_C TInt32 CCAGroup::MaximalSize() const |
|
612 { |
|
613 TInt len = 1; // TBool, 8 bit/1 byte |
|
614 |
|
615 len += 4; // length of buffer (32 bit/4 byte) |
|
616 len += iGroupId->Size(); |
|
617 |
|
618 len += 4; // length of buffer (32 bit/4 byte)) |
|
619 len += iGroupName->Size(); |
|
620 |
|
621 len += 4; // length of buffer (32 bit/4 byte)) |
|
622 len += iServerName->Size(); |
|
623 |
|
624 return len; |
|
625 } |
|
626 |
|
627 // ----------------------------------------------------------------------------- |
|
628 // CCAGroup::Version |
|
629 // From MCAExtendedStoredGroup |
|
630 // ----------------------------------------------------------------------------- |
|
631 // |
|
632 EXPORT_C TInt32 CCAGroup::Version() const |
|
633 { |
|
634 return KCAGroupVersion; |
|
635 } |
|
636 |
|
637 // End of File |