epoc32/include/mw/sencredential2.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2002-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:        Class implements (web) service credential functionality
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 
    22 
    23 
    24 
    25 #ifndef SEN_CREDENTIAL2_H
    26 #define SEN_CREDENTIAL2_H
    27 
    28 //  INCLUDES
    29 #include <e32base.h>
    30 #include <s32strm.h>
    31 #include <SenFragmentBase.h>
    32 #include <SenDomFragmentBase.h>
    33 
    34 // CONSTANTS
    35 _LIT8(KCredentialsName2,     "Credentials");
    36 _LIT8(KEndpointName2,        "Endpoint");
    37 _LIT8(KSecurityMechIdName2,  "SecurityMechID");
    38 _LIT8(KNotOnOrAfterName2,    "NotOnOrAfter");
    39 _LIT8(KConditionsName2,      "Conditions");
    40 
    41 _LIT8(KSenCredentialId,                 "CredentialId");
    42 _LIT8(KSenCredentialValidUntil,         "ValidUntil");
    43 _LIT8(KSenCredentialIdentifierLocalname,"Identifier");
    44 _LIT8(KSenCredentialProperteisLocalname,"Properties");
    45 
    46 // FORWARD DECLARATIONS
    47 class SenDateUtils;
    48 class CSenCredentialIdentifier;
    49 class CSenXmlServiceDescription;
    50 class CSenIdentityProvider;
    51 class CSenServiceSession;
    52 class CSenFacet;
    53 
    54 // CLASS DECLARATION
    55 
    56 /**
    57 * Class implements (web) service credential functionality
    58 *  @lib SenServDesc.lib
    59 *  @since Series60 3.0
    60 */
    61 class CSenCredential2 : public CSenFragmentBase
    62     {
    63     public:  // Constructors and destructor
    64         
    65         /**
    66         * Basic constructor.
    67         *
    68         * @since Series60 4.0
    69         */
    70         IMPORT_C static CSenCredential2* NewL();
    71 
    72         /**
    73         * Basic constructor.
    74         *
    75         * @since Series60 4.0
    76         */
    77         IMPORT_C static CSenCredential2* NewLC();
    78 
    79         /**
    80         * Basic constructor.
    81         *
    82         * @since Series60 4.0
    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
    87         */
    88         IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
    89                                      const TDesC8& aLocalName,
    90                                      const TDesC8& aQName,
    91                                      const RAttributeArray& aAttributes);
    92 
    93         /**
    94         * Basic constructor.
    95         *
    96         * @since Series60 4.0
    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
   101         */
   102         IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
   103                                       const TDesC8& aLocalName,
   104                                       const TDesC8& aQName,
   105                                       const RAttributeArray& aAttributes);
   106 
   107         /**
   108         * Basic constructor.
   109         *
   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
   116         */
   117         IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
   118                                      const TDesC8& aLocalName,
   119                                      const TDesC8& aQName,
   120                                      const RAttributeArray& aAttributes,
   121                                      TXmlEngElement& aParent);
   122 
   123         /**
   124         * Basic constructor.
   125         *
   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
   132         */
   133         IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
   134                                       const TDesC8& aLocalName,
   135                                       const TDesC8& aQName,
   136                                       const RAttributeArray& aAttributes,
   137                                       TXmlEngElement& aParent);
   138 
   139          /**
   140         * Basic constructor.
   141         *
   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
   150         */
   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);                                         
   157 
   158         /**
   159         * Basic constructor.
   160         *
   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
   169         */
   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);
   176 
   177         /**
   178         * Constructor which copies itself from another credential.
   179         *
   180         * @since Series60 4.0
   181         * @param    aCredential     credential to copy from.
   182         * @return new CSenCredential instance pointer
   183         */
   184         IMPORT_C static CSenCredential2* NewL(const CSenCredential2& aCredential);
   185 
   186         /**
   187         * Constructor which copies itself from another credential.
   188         *
   189         * @since Series60 4.0
   190         * @param    aCredential     credential to copy from.
   191         * @return new CSenCredential instance pointer, which is left on
   192         *         cleanup stack.
   193         */
   194         IMPORT_C static CSenCredential2* NewLC(const CSenCredential2& aCredential);
   195         
   196         /**
   197         * Destructor.
   198         */
   199         IMPORT_C virtual ~CSenCredential2();        
   200 
   201         // New functions
   202         
   203         /**
   204         * Getter for the credential ID.
   205         *
   206         * @since Series60 4.0
   207         * @return the ID
   208         */
   209         IMPORT_C virtual const TDesC8& Id();
   210 
   211         /**
   212         * Getter for the credential expiration time.
   213         * @since Series60 3.0
   214         * @return the the expiration time
   215         */
   216         IMPORT_C virtual TTime& ValidUntil();
   217 
   218         /**
   219         * Setter for the credential expiration time.
   220         *
   221         * @since Series60 4.0
   222         * @param aTime  The new expiration time
   223         */
   224         IMPORT_C virtual void SetValidUntil(TTime& aTime);
   225 
   226     protected:  // Functions from base classes
   227         
   228         /**
   229         * C++ default constructor.
   230         */
   231         IMPORT_C CSenCredential2();
   232 
   233 
   234         IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
   235         							          const RAttributeArray& aAttributes,
   236         						 	          TInt aErrorCode);
   237         
   238         /**
   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
   244         */
   245         IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
   246                                      const TDesC8& aLocalName,
   247                                      const TDesC8& aQName,
   248                                      const RAttributeArray& aAttributes);
   249 
   250         /**
   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
   257         *        namespaces.
   258         */
   259         IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
   260                                      const TDesC8&  aLocalName,
   261                                      const TDesC8& aQName,
   262                                      const RAttributeArray& aAttributes,
   263                                      TXmlEngElement& aParent);
   264 
   265         /**
   266         * By default Symbian 2nd phase constructor is private.
   267         *
   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
   274         *        namespaces.
   275         * @param aOwnerDocument is the document which will be the owner of
   276         *                       the elements of this credential
   277         */
   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);                                         
   284         /**
   285         * By default Symbian 2nd phase constructor is private.
   286         *
   287         * @since Series60 4.0
   288         * @param aCredential is the source credential to be copied.
   289         */
   290         IMPORT_C void BaseConstructL(CSenCredential2& aCredential);
   291 
   292 
   293     private:
   294         /**
   295         * By default Symbian 2nd phase constructor is private.
   296         *
   297         * BaseConstructL for setting XML localname for this Credential.
   298         * @since Series60 4.0
   299         * @param aLocalName XML localname for this Credential
   300         */
   301         IMPORT_C void ConstructL(const TDesC8& aLocalName);
   302 
   303         // New functions
   304 
   305         /**
   306         * Setter for Credential ID
   307         *
   308         * @since Series60 4.0
   309         * @param aId is the unique ID for this Credential
   310         */
   311         void SetIdL(const TDesC8& aId);
   312 
   313     private: // Data
   314         // Unique ID for this credential. Owned.
   315         HBufC8*                     iId;
   316         // One may use SenDateUtils to convert from XML date descrtor to TTime
   317         TTime                       iNotOnOrAfter;    
   318     };
   319 
   320 #endif // SEN_CREDENTIAL2_H
   321 
   322 // End of File
   323 
   324