|
1 /* |
|
2 * Copyright (c) 2006 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: Implements CNcdNodeTransparentFolder class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "ncdnodetransparentfolder.h" |
|
20 #include "ncdnodemanager.h" |
|
21 #include "ncdnodeidentifier.h" |
|
22 #include "catalogsdebug.h" |
|
23 |
|
24 |
|
25 CNcdNodeTransparentFolder::CNcdNodeTransparentFolder( |
|
26 CNcdNodeManager& aNodeManager, |
|
27 NcdNodeClassIds::TNcdNodeClassId aNodeClassId, |
|
28 NcdNodeClassIds::TNcdNodeClassId aAcceptedLinkClassId, |
|
29 NcdNodeClassIds::TNcdNodeClassId aAcceptedMetaDataClassId ) |
|
30 : CNcdNodeFolder( aNodeManager, |
|
31 aNodeClassId, |
|
32 aAcceptedLinkClassId, |
|
33 aAcceptedMetaDataClassId ) |
|
34 { |
|
35 } |
|
36 |
|
37 void CNcdNodeTransparentFolder::ConstructL( const CNcdNodeIdentifier& aIdentifier ) |
|
38 { |
|
39 DLTRACEIN(("this: %X", this )); |
|
40 |
|
41 CNcdNodeFolder::ConstructL( aIdentifier ); |
|
42 |
|
43 DLTRACEOUT(("")); |
|
44 } |
|
45 |
|
46 |
|
47 CNcdNodeTransparentFolder::~CNcdNodeTransparentFolder() |
|
48 { |
|
49 DLTRACEIN(("this: %X", this)); |
|
50 DLTRACEOUT(("")); |
|
51 } |
|
52 |
|
53 |
|
54 CNcdNodeTransparentFolder* CNcdNodeTransparentFolder::NewL( |
|
55 CNcdNodeManager& aNodeManager, |
|
56 const CNcdNodeIdentifier& aIdentifier ) |
|
57 { |
|
58 CNcdNodeTransparentFolder* self = |
|
59 CNcdNodeTransparentFolder::NewLC( aNodeManager, aIdentifier ); |
|
60 CleanupStack::Pop( self ); |
|
61 return self; |
|
62 } |
|
63 |
|
64 CNcdNodeTransparentFolder* CNcdNodeTransparentFolder::NewLC( |
|
65 CNcdNodeManager& aNodeManager, |
|
66 const CNcdNodeIdentifier& aIdentifier ) |
|
67 { |
|
68 CNcdNodeTransparentFolder* self = |
|
69 new( ELeave ) CNcdNodeTransparentFolder( aNodeManager ); |
|
70 CleanupClosePushL( *self ); |
|
71 self->ConstructL( aIdentifier ); |
|
72 return self; |
|
73 } |
|
74 |
|
75 |
|
76 void CNcdNodeTransparentFolder::ExternalizeL( RWriteStream& aStream ) |
|
77 { |
|
78 DLTRACEIN(("")); |
|
79 |
|
80 // First use the parent to externalize the general data |
|
81 CNcdNodeFolder::ExternalizeL( aStream ); |
|
82 |
|
83 DLTRACEOUT(("")); |
|
84 } |
|
85 |
|
86 void CNcdNodeTransparentFolder::InternalizeL( RReadStream& aStream ) |
|
87 { |
|
88 DLTRACEIN(("")); |
|
89 |
|
90 // First use the parent to internalize the general data |
|
91 CNcdNodeFolder::InternalizeL( aStream ); |
|
92 |
|
93 DLTRACEOUT(("")); |
|
94 } |
|
95 |
|
96 TBool CNcdNodeTransparentFolder::HasExpiredOrMissingChildrenL() |
|
97 { |
|
98 DLTRACEIN(("")); |
|
99 TBool isChildExpired = EFalse; |
|
100 for( TInt i = 0 ; i < ServerChildCountL() ; i++ ) |
|
101 { |
|
102 CNcdNode* child = NULL; |
|
103 TRAPD( err, child = &NodeManager().NodeL( ChildByServerIndexL(i) ) ); |
|
104 if( err == KErrNotFound || child->State() != MNcdNode::EStateInitialized ) |
|
105 { |
|
106 DLTRACE(("At least one child was expired/uninitialized/not found.")); |
|
107 isChildExpired = ETrue; |
|
108 break; |
|
109 } |
|
110 else if( err != KErrNone && err != KErrNotFound ) |
|
111 { |
|
112 DLTRACE(("Error: %d", err)); |
|
113 User::Leave( err ); |
|
114 } |
|
115 } |
|
116 return isChildExpired; |
|
117 } |
|
118 |
|
119 void CNcdNodeTransparentFolder::ExternalizeDataForRequestL( RWriteStream& aStream ) const |
|
120 { |
|
121 DLTRACEIN(("")); |
|
122 |
|
123 CNcdNodeFolder::ExternalizeDataForRequestL( aStream ); |
|
124 |
|
125 DLTRACEOUT(("")); |
|
126 } |
|
127 |