|
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: Contains CNcdNodeDisclaimerProxy class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_NCD_NODE_DISCLAIMER_PROXY_H |
|
20 #define C_NCD_NODE_DISCLAIMER_PROXY_H |
|
21 |
|
22 |
|
23 // For the streams |
|
24 #include <s32mem.h> |
|
25 |
|
26 #include "ncdinterfacebaseproxy.h" |
|
27 #include "ncdquery.h" |
|
28 |
|
29 class CNcdNodeMetadataProxy; |
|
30 |
|
31 |
|
32 /** |
|
33 * This class implements the functionality for the |
|
34 * MNcdQuery interface. The interface is provided for |
|
35 * API users when the disclaimer is asked from the metadata. |
|
36 * The metadata owns this class object. Because this class object |
|
37 * is part of the metadata, the reference counter keeps this |
|
38 * object alive until the metadata that owns this object |
|
39 * is deleted. |
|
40 * |
|
41 * @since S60 v3.2 |
|
42 */ |
|
43 class CNcdNodeDisclaimerProxy : public CNcdInterfaceBaseProxy, |
|
44 public MNcdQuery |
|
45 { |
|
46 |
|
47 public: |
|
48 |
|
49 /** |
|
50 * @param aSession The session between the client proxy and the |
|
51 * corresponding server object. |
|
52 * @param aHandle The handle which identifies the server object |
|
53 * that this proxy uses. |
|
54 * @param aMetadata Owns and uses the information of this proxy. |
|
55 * The metadata also keeps track of the refence counts of its objects. |
|
56 * And handles the deletion of these objects when the total reference |
|
57 * count reaches zero. If the disclaimer is not part of metadata, give NULL. |
|
58 * Ownership is not transferred. |
|
59 * @return CNcdNodeDisclaimerProxy* Pointer to the created object |
|
60 * of this class. |
|
61 */ |
|
62 static CNcdNodeDisclaimerProxy* NewL( MCatalogsClientServer& aSession, |
|
63 TInt aHandle, |
|
64 CNcdNodeMetadataProxy* aMetadata ); |
|
65 |
|
66 /** |
|
67 * @param aSession The session between the client proxy and the |
|
68 * corresponding server object. |
|
69 * @param aHandle The handle which identifies the server object |
|
70 * that this proxy uses. |
|
71 * @param aMetadata Owns and uses the information of this proxy. |
|
72 * The metadata also keeps track of the refence counts of its objects. |
|
73 * And handles the deletion of these objects when the total reference |
|
74 * count reaches zero. If the dislaimer is not part of metadata, give NULL. |
|
75 * Ownership is not transferred. |
|
76 * @return CNcdNodeDisclaimerProxy* Pointer to the created object |
|
77 * of this class. |
|
78 */ |
|
79 static CNcdNodeDisclaimerProxy* NewLC( MCatalogsClientServer& aSession, |
|
80 TInt aHandle, |
|
81 CNcdNodeMetadataProxy* aMetadata ); |
|
82 |
|
83 |
|
84 /** |
|
85 * Destructor. |
|
86 * The destructor is set public. So, the node that owns the Disclaimer may |
|
87 * delete it directly when the reference count of the node reaches zero |
|
88 * and the destructor of the node is called. |
|
89 */ |
|
90 virtual ~CNcdNodeDisclaimerProxy(); |
|
91 |
|
92 |
|
93 /** |
|
94 * Gets the data for descriptors from the server side. This function is |
|
95 * called to update proxy data. The function uses the protected virtual |
|
96 * internalize functions. So, the child classes may provide their own |
|
97 * implementations for internalizations of certain metadata. |
|
98 */ |
|
99 void InternalizeL(); |
|
100 |
|
101 |
|
102 public: // MNcdQuery |
|
103 |
|
104 /** |
|
105 * @see MNcdQuery::IsOptional |
|
106 */ |
|
107 virtual TBool IsOptional() const; |
|
108 |
|
109 /** |
|
110 * @see MNcdQuery::Semantics |
|
111 */ |
|
112 virtual MNcdQuery::TSemantics Semantics() const; |
|
113 |
|
114 /** |
|
115 * @see MNcdQuery::MessageTitle() |
|
116 */ |
|
117 virtual const TDesC& MessageTitle() const; |
|
118 |
|
119 /** |
|
120 * @see MNcdQuery::MessageBody |
|
121 */ |
|
122 virtual const TDesC& MessageBody() const; |
|
123 |
|
124 /** |
|
125 * Does not do anything. Only returns an empty array. |
|
126 * |
|
127 * @see MNcdQuery::QueryItemsL |
|
128 */ |
|
129 virtual RCatalogsArray< MNcdQueryItem > QueryItemsL(); |
|
130 |
|
131 /** |
|
132 * Can be used for UI's own purposes. Only saves |
|
133 * the response value for this object. The UI |
|
134 * may ask the reponse value by calling Response function. |
|
135 * |
|
136 * @see MNcdQuery::SetResponseL |
|
137 */ |
|
138 virtual void SetResponseL( TResponse aResponse ); |
|
139 |
|
140 /** |
|
141 * @see MNcdQuery::Response |
|
142 */ |
|
143 virtual MNcdQuery::TResponse Response(); |
|
144 |
|
145 /** |
|
146 * Always returns EFalse, because there is no connection |
|
147 * used with disclaimer. |
|
148 * @see MNcdQuery::IsSecureConnection |
|
149 */ |
|
150 virtual TBool IsSecureConnection() const; |
|
151 |
|
152 |
|
153 protected: |
|
154 |
|
155 /** |
|
156 * Constructor |
|
157 * |
|
158 * Sets this class object to be its own interface parent. |
|
159 * |
|
160 * @param aSession The session between the client proxy and the |
|
161 * corresponding server object. |
|
162 * @param aHandle The handle which identifies the server object |
|
163 * that this proxy uses. |
|
164 * @param aMetadata Owns and uses the information of this proxy. |
|
165 * The metadata also keeps track of the refence counts of its objects. |
|
166 * And handles the deletion of these objects when the total reference |
|
167 * count reaches zero. If the disclaimer is not part of metadata, give NULL. |
|
168 * Ownership is not transferred. |
|
169 * @return CNcdNodeDisclaimerProxy* Pointer to the created object |
|
170 * of this class. |
|
171 */ |
|
172 CNcdNodeDisclaimerProxy( MCatalogsClientServer& aSession, |
|
173 TInt aHandle, |
|
174 CNcdNodeMetadataProxy* aMetadata ); |
|
175 |
|
176 /** |
|
177 * ConstructL |
|
178 */ |
|
179 virtual void ConstructL(); |
|
180 |
|
181 |
|
182 // These functions are used to update the data of this class object |
|
183 |
|
184 /** |
|
185 * @param aStream This stream will contain all the data content for |
|
186 * this class object. The stream is gotten from the server side. The |
|
187 * memeber variables will be updated according to the data from |
|
188 * the stream. |
|
189 */ |
|
190 virtual void InternalizeDataL( RReadStream& aStream ); |
|
191 |
|
192 |
|
193 private: |
|
194 |
|
195 // Prevent if not implemented |
|
196 CNcdNodeDisclaimerProxy( const CNcdNodeDisclaimerProxy& aObject ); |
|
197 CNcdNodeDisclaimerProxy& operator =( const CNcdNodeDisclaimerProxy& aObject ); |
|
198 |
|
199 |
|
200 private: // data |
|
201 |
|
202 TBool iOptional; |
|
203 MNcdQuery::TSemantics iSemantics; |
|
204 HBufC* iTitle; |
|
205 HBufC* iBody; |
|
206 MNcdQuery::TResponse iResponse; |
|
207 |
|
208 }; |
|
209 |
|
210 |
|
211 #endif // C_NCD_NODE_DISCLAIMER_PROXY_H |