|
1 /* |
|
2 * Copyright (c) 2006-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: Contains CNcdNodeDependencyProxy class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_NCD_NODE_DEPENDENCY_PROXY_H |
|
20 #define C_NCD_NODE_DEPENDENCY_PROXY_H |
|
21 |
|
22 |
|
23 // For the streams |
|
24 #include <s32mem.h> |
|
25 // For array |
|
26 #include <e32cmn.h> |
|
27 |
|
28 #include "ncdinterfacebaseproxy.h" |
|
29 #include "ncdnodedependency.h" |
|
30 |
|
31 class CNcdNodeMetadataProxy; |
|
32 class CNcdNodeManagerProxy; |
|
33 class MNcdNodeDependencyInfo; |
|
34 |
|
35 /** |
|
36 * This class implements the functionality for the |
|
37 * MNcdNodeDependency interfaces. The interface is provided for |
|
38 * API users. |
|
39 * |
|
40 * @since S60 v3.2 |
|
41 */ |
|
42 class CNcdNodeDependencyProxy : public CNcdInterfaceBaseProxy, |
|
43 public MNcdNodeDependency |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 /** |
|
49 * @param aSession The session between the client proxy and the |
|
50 * corresponding server object. |
|
51 * @param aHandle The handle which identifies the server object |
|
52 * that this proxy uses. |
|
53 * @param aMetadata Owns and uses the information of this proxy. |
|
54 * The metadata also keeps track of the refence counts of its objects. |
|
55 * And handles the deletion of these objects when the total reference |
|
56 * count reaches zero. |
|
57 * @return CNcdNodeDependencyProxy* Pointer to the created object |
|
58 * of this class. |
|
59 */ |
|
60 static CNcdNodeDependencyProxy* NewL( |
|
61 MCatalogsClientServer& aSession, |
|
62 TInt aHandle, |
|
63 CNcdNodeMetadataProxy& aMetadata ); |
|
64 |
|
65 /** |
|
66 * @param aSession The session between the client proxy and the |
|
67 * corresponding server object. |
|
68 * @param aHandle The handle which identifies the server object |
|
69 * that this proxy uses. |
|
70 * @param aMetadata Owns and uses the information of this proxy. |
|
71 * The metadata also keeps track of the refence counts of its objects. |
|
72 * And handles the deletion of these objects when the total reference |
|
73 * count reaches zero. |
|
74 * @return CNcdNodeDependencyProxy* Pointer to the created object |
|
75 * of this class. |
|
76 */ |
|
77 static CNcdNodeDependencyProxy* NewLC( |
|
78 MCatalogsClientServer& aSession, |
|
79 TInt aHandle, |
|
80 CNcdNodeMetadataProxy& aMetadata ); |
|
81 |
|
82 |
|
83 /** |
|
84 * Destructor. |
|
85 * The destructor is set public. So, the node that owns the Dependency may |
|
86 * delete it directly when the reference count of the node reaches zero |
|
87 * and the destructor of the node is called. |
|
88 */ |
|
89 virtual ~CNcdNodeDependencyProxy(); |
|
90 |
|
91 |
|
92 /** |
|
93 * @return CNcdNodeManageraProxy& Can be used to create nodes. |
|
94 */ |
|
95 CNcdNodeManagerProxy& NodeManager() const; |
|
96 |
|
97 |
|
98 /** |
|
99 * Gets the data for descriptors from the server side. This function is |
|
100 * called to update proxy data. The function uses the protected virtual |
|
101 * internalize functions. So, the child classes may provide their own |
|
102 * implementations for internalizations of certain metadata. |
|
103 */ |
|
104 void InternalizeL(); |
|
105 |
|
106 |
|
107 public: // MNcdNodeDependency |
|
108 |
|
109 /** |
|
110 * @see MNcdNodeDependency::DependencyInfos() |
|
111 */ |
|
112 virtual const RPointerArray< MNcdNodeDependencyInfo >& DependencyInfos() const; |
|
113 |
|
114 |
|
115 /** |
|
116 * @see MNcdNodeDependency::State() |
|
117 */ |
|
118 virtual TNcdDependencyState State() const; |
|
119 |
|
120 |
|
121 protected: |
|
122 |
|
123 /** |
|
124 * Constructor |
|
125 * |
|
126 * @param aSession The session between the client proxy and the |
|
127 * corresponding server object. |
|
128 * @param aHandle The handle which identifies the server object |
|
129 * that this proxy uses. |
|
130 * @param aMetadata Owns and uses the information of this proxy. |
|
131 * The metadata also keeps track of the refence counts of its objects. |
|
132 * And handles the deletion of these objects when the total reference |
|
133 * count reaches zero. |
|
134 * @return CNcdNodeDependencyProxy* Pointer to the created object |
|
135 * of this class. |
|
136 */ |
|
137 CNcdNodeDependencyProxy( |
|
138 MCatalogsClientServer& aSession, |
|
139 TInt aHandle, |
|
140 CNcdNodeMetadataProxy& aMetadata ); |
|
141 |
|
142 /** |
|
143 * ConstructL |
|
144 */ |
|
145 virtual void ConstructL(); |
|
146 |
|
147 |
|
148 // These functions are used to update the data of this class object |
|
149 |
|
150 /** |
|
151 * @param aStream This stream will contain all the data content for |
|
152 * this class object. The stream is gotten from the server side. The |
|
153 * memeber variables will be updated according to the data from |
|
154 * the stream. |
|
155 */ |
|
156 virtual void InternalizeDataL( RReadStream& aStream ); |
|
157 |
|
158 |
|
159 private: |
|
160 |
|
161 // Prevent if not implemented |
|
162 CNcdNodeDependencyProxy( const CNcdNodeDependencyProxy& aObject ); |
|
163 CNcdNodeDependencyProxy& operator =( const CNcdNodeDependencyProxy& aObject ); |
|
164 |
|
165 // Internalizes the Dependency target array from given stream. |
|
166 void InternalizeDependencyArrayL( RReadStream& aStream ); |
|
167 |
|
168 |
|
169 private: // data |
|
170 |
|
171 CNcdNodeManagerProxy& iNodeManager; |
|
172 |
|
173 RPointerArray<MNcdNodeDependencyInfo> iDependencyTargets; |
|
174 |
|
175 }; |
|
176 |
|
177 |
|
178 #endif // C_NCD_NODE_DEPENDENCY_PROXY_H |