2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Class implements (web) service credential functionality
25 #ifndef SEN_CREDENTIAL2_H
26 #define SEN_CREDENTIAL2_H
31 #include <SenFragmentBase.h>
32 #include <SenDomFragmentBase.h>
35 _LIT8(KCredentialsName2, "Credentials");
36 _LIT8(KEndpointName2, "Endpoint");
37 _LIT8(KSecurityMechIdName2, "SecurityMechID");
38 _LIT8(KNotOnOrAfterName2, "NotOnOrAfter");
39 _LIT8(KConditionsName2, "Conditions");
41 _LIT8(KSenCredentialId, "CredentialId");
42 _LIT8(KSenCredentialValidUntil, "ValidUntil");
43 _LIT8(KSenCredentialIdentifierLocalname,"Identifier");
44 _LIT8(KSenCredentialProperteisLocalname,"Properties");
46 // FORWARD DECLARATIONS
48 class CSenCredentialIdentifier;
49 class CSenXmlServiceDescription;
50 class CSenIdentityProvider;
51 class CSenServiceSession;
57 * Class implements (web) service credential functionality
58 * @lib SenServDesc.lib
61 class CSenCredential2 : public CSenFragmentBase
63 public: // Constructors and destructor
70 IMPORT_C static CSenCredential2* NewL();
77 IMPORT_C static CSenCredential2* NewLC();
83 * @param aNsUri is the XML namespace of this credential
84 * @param aLocalName is the XML localname of this credential
85 * @param aPrefix is the prefix of this credential
86 * @param aAttrs are the XML attributes of this credential
88 IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
89 const TDesC8& aLocalName,
91 const RAttributeArray& aAttributes);
97 * @param aNsUri is the XML namespace of this credential
98 * @param aLocalName is the XML localname of this credential
99 * @param aPrefix is the prefix of this credential
100 * @param aAttrs are the XML attributes of this credential
102 IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
103 const TDesC8& aLocalName,
104 const TDesC8& aQName,
105 const RAttributeArray& aAttributes);
110 * @since Series60 4.0
111 * @param aNsUri is the XML namespace of this credential
112 * @param aLocalName is the XML localname of this credential
113 * @param aPrefix is the prefix of this credential
114 * @param aAttrs are the XML attributes of this credential
115 * @param aParent is the parent XML element of this credential
117 IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
118 const TDesC8& aLocalName,
119 const TDesC8& aQName,
120 const RAttributeArray& aAttributes,
121 TXmlEngElement& aParent);
126 * @since Series60 4.0
127 * @param aNsUri is the XML namespace of this credential
128 * @param aLocalName is the XML localname of this credential
129 * @param aPrefix is the prefix of this credential
130 * @param aAttrs are the XML attributes of this credential
131 * @param aParent is the parent XML element of this credential
133 IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
134 const TDesC8& aLocalName,
135 const TDesC8& aQName,
136 const RAttributeArray& aAttributes,
137 TXmlEngElement& aParent);
142 * @since Series60 4.0
143 * @param aNsUri is the XML namespace of this fragment
144 * @param aLocalName is the XML localname of this fragment
145 * @param aPrefix is the prefix of this fragment
146 * @param aAttrs are the XML attributes of this fragment
147 * @param aParent is the parent XML element of this fragment
148 * @param aOwnerDocument is the document which will be the owner of
149 * the elements of this fragment
151 IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
152 const TDesC8& aLocalName,
153 const TDesC8& aQName,
154 const RAttributeArray& aAttrs,
155 TXmlEngElement& aParent,
156 RSenDocument& aOwnerDocument);
161 * @since Series60 4.0
162 * @param aNsUri is the XML namespace of this fragment
163 * @param aLocalName is the XML localname of this fragment
164 * @param aPrefix is the prefix of this fragment
165 * @param aAttrs are the XML attributes of this fragment
166 * @param aParent is the parent XML element of this fragment
167 * @param aOwnerDocument is the document which will be the owner of
168 * the elements of this fragment
170 IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
171 const TDesC8& aLocalName,
172 const TDesC8& aQName,
173 const RAttributeArray& aAttrs,
174 TXmlEngElement& aParent,
175 RSenDocument& aOwnerDocument);
178 * Constructor which copies itself from another credential.
180 * @since Series60 4.0
181 * @param aCredential credential to copy from.
182 * @return new CSenCredential instance pointer
184 IMPORT_C static CSenCredential2* NewL(const CSenCredential2& aCredential);
187 * Constructor which copies itself from another credential.
189 * @since Series60 4.0
190 * @param aCredential credential to copy from.
191 * @return new CSenCredential instance pointer, which is left on
194 IMPORT_C static CSenCredential2* NewLC(const CSenCredential2& aCredential);
199 IMPORT_C virtual ~CSenCredential2();
204 * Getter for the credential ID.
206 * @since Series60 4.0
209 IMPORT_C virtual const TDesC8& Id();
212 * Getter for the credential expiration time.
213 * @since Series60 3.0
214 * @return the the expiration time
216 IMPORT_C virtual TTime& ValidUntil();
219 * Setter for the credential expiration time.
221 * @since Series60 4.0
222 * @param aTime The new expiration time
224 IMPORT_C virtual void SetValidUntil(TTime& aTime);
226 protected: // Functions from base classes
229 * C++ default constructor.
231 IMPORT_C CSenCredential2();
234 IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
235 const RAttributeArray& aAttributes,
239 * @since Series60 4.0
240 * @param aNsUri is the XML namespace as UTF-8 descriptor
241 * @param aLocalName is the XML localname as UTF-8 descriptor
242 * @param aQName is the XML qualifiedname as UTF-8 descriptor
243 * @param aAttributes is the list of XML attributes
245 IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
246 const TDesC8& aLocalName,
247 const TDesC8& aQName,
248 const RAttributeArray& aAttributes);
251 * @since Series60 4.0
252 * @param aNsUri is the XML namespace as UTF-8 descriptor
253 * @param aLocalName is the XML localname as UTF-8 descriptor
254 * @param aQName is the XML qualifiedname as UTF-8 descriptor
255 * @param aAttributes is the list of XML attributes
256 * @param aParent is the parent element, which may declare other
259 IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
260 const TDesC8& aLocalName,
261 const TDesC8& aQName,
262 const RAttributeArray& aAttributes,
263 TXmlEngElement& aParent);
266 * By default Symbian 2nd phase constructor is private.
268 * @since Series60 4.0
269 * @param aNsUri is the XML namespace as UTF-8 descriptor
270 * @param aLocalName is the XML localname as UTF-8 descriptor
271 * @param aQName is the XML qualifiedname as UTF-8 descriptor
272 * @param aAttributes is the list of XML attributes
273 * @param aParent is the parent element, which may declare other
275 * @param aOwnerDocument is the document which will be the owner of
276 * the elements of this credential
278 IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
279 const TDesC8& aLocalName,
280 const TDesC8& aQName,
281 const RAttributeArray& aAttributes,
282 TXmlEngElement& aParent,
283 RSenDocument& aOwnerDocument);
285 * By default Symbian 2nd phase constructor is private.
287 * @since Series60 4.0
288 * @param aCredential is the source credential to be copied.
290 IMPORT_C void BaseConstructL(CSenCredential2& aCredential);
295 * By default Symbian 2nd phase constructor is private.
297 * BaseConstructL for setting XML localname for this Credential.
298 * @since Series60 4.0
299 * @param aLocalName XML localname for this Credential
301 IMPORT_C void ConstructL(const TDesC8& aLocalName);
306 * Setter for Credential ID
308 * @since Series60 4.0
309 * @param aId is the unique ID for this Credential
311 void SetIdL(const TDesC8& aId);
314 // Unique ID for this credential. Owned.
316 // One may use SenDateUtils to convert from XML date descrtor to TTime
320 #endif // SEN_CREDENTIAL2_H