epoc32/include/mw/sencredential.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-2005 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_CREDENTIAL_H
    26 #define SEN_CREDENTIAL_H
    27 
    28 //  INCLUDES
    29 #include <e32base.h>
    30 #include <s32strm.h>
    31 #include <SenBaseFragment.h>
    32 
    33 // CONSTANTS
    34 _LIT8(KCredentialsName,     "Credentials");
    35 _LIT8(KEndpointName,        "Endpoint");
    36 _LIT8(KSecurityMechIdName,  "SecurityMechID");
    37 _LIT8(KNotOnOrAfterName,    "NotOnOrAfter");
    38 _LIT8(KConditionsName,      "Conditions");
    39 
    40 // FORWARD DECLARATIONS
    41 class SenDateUtils;
    42 
    43 // CLASS DECLARATION
    44 
    45 /**
    46 * Class implements (web) service credential functionality
    47 *  @lib SenServDesc.lib
    48 *  @since Series60 3.0
    49 */
    50 class CSenCredential : public CSenBaseFragment
    51     {
    52     public:  // Constructors and destructor
    53         
    54         /**
    55         * Two-phase constructor.
    56         * @since Series60 3.0
    57         * @param aNsUri     The namespace URI of the new element
    58         * @param aLocalName The local name of the new element
    59         * @param aQName     The qualified name of the new element
    60         * @param aAttributes    The attributes of the new element
    61         * @return new CSenCredential instance pointer
    62         * Leave codes:  
    63         *       KErrSenInvalidCharacters if aLocalName or aQName contains
    64         *       illegal characters.     
    65         *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
    66         */
    67         IMPORT_C static CSenCredential* NewL(const TDesC8& aNsUri,
    68                                              const TDesC8& aLocalName,
    69                                              const TDesC8& aQName,
    70                                              const RAttributeArray& aAttributes);
    71             
    72         /**
    73         * Two-phase constructor.
    74         * @since Series60 3.0
    75         * @param aNsUri     The namespace URI of the new element
    76         * @param aLocalName The local name of the new element
    77         * @param aQName     The qualified name of the new element
    78         * @param aAttributes    The attributes of the new element
    79         * @return new CSenCredential instance pointer, which is left on
    80         *         cleanup stack.
    81         * Leave codes:  
    82         *       KErrSenInvalidCharacters if aLocalName or aQName contains
    83         *       illegal characters.     
    84         *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
    85         */
    86         IMPORT_C static CSenCredential* NewLC(const TDesC8& aNsUri,
    87                                               const TDesC8& aLocalName,
    88                                               const TDesC8& aQName,
    89                                               const RAttributeArray& aAttributes);
    90 
    91         /**
    92         * Constructor with a possibility to set a parent.
    93         * @since Series60 3.0
    94         * @param aNsUri     The namespace URI of the new element
    95         * @param aLocalName The local name of the new element
    96         * @param aQName     The qualified name of the new element
    97         * @param aAttributes    The attributes of the new element
    98         * @param aParent        The parent element of the new element
    99         * @return new CSenCredential instance pointer
   100         * Leave codes:  
   101         *       KErrSenInvalidCharacters if aLocalName or aQName contains
   102         *       illegal characters.     
   103         *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
   104         */
   105         IMPORT_C static CSenCredential* NewL(const TDesC8& aNsUri,
   106                                              const TDesC8& aLocalName,
   107                                              const TDesC8& aQName,
   108                                              const RAttributeArray& aAttributes,
   109                                              CSenElement& aParent);
   110 
   111         /**
   112         * Constructor with a possibility to set a parent.
   113         * @since Series60 3.0
   114         * @param aNsUri     The namespace URI of the new element
   115         * @param aLocalName The local name of the new element
   116         * @param aQName     The qualified name of the new element
   117         * @param aAttributes    The attributes of the new element
   118         * @param aParent        The parent element of the new element
   119         * @return new CSenCredential instance pointer, which is left on
   120         *         cleanup stack.
   121         * Leave codes:  
   122         *       KErrSenInvalidCharacters if aLocalName or aQName contains
   123         *       illegal characters.     
   124         *       KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.
   125         */
   126         IMPORT_C static CSenCredential* NewLC(const TDesC8& aNsUri,
   127                                               const TDesC8& aLocalName,
   128                                               const TDesC8& aQName,
   129                                               const RAttributeArray& aAttributes,
   130                                               CSenElement& aParent);
   131 
   132         /**
   133         * Constructor which copies itself from another credential.
   134         * @since Series60 3.0
   135         * @param    aCredential     credential to copy from.
   136         * @return new CSenCredential instance pointer
   137         */
   138         IMPORT_C static CSenCredential* NewL(const CSenCredential& aCredential);
   139 
   140         /**
   141         * Constructor which copies itself from another credential.
   142         * @since Series60 3.0
   143         * @param    aCredential     credential to copy from.
   144         * @return new CSenCredential instance pointer, which is left on
   145         *         cleanup stack.
   146         */
   147         IMPORT_C static CSenCredential* NewLC(const CSenCredential& aCredential);
   148 
   149         /**
   150         * Destructor.
   151         */
   152         IMPORT_C virtual ~CSenCredential();        
   153 
   154         // New functions
   155         
   156         /**
   157         * Getter for the credential ID.
   158         * @since Series60 3.0
   159         * @return the ID
   160         */
   161         IMPORT_C const TDesC8& Id();
   162 
   163         /**
   164         * Getter for the credential expiration time.
   165         * @since Series60 3.0
   166         * @return the the expiration time
   167         */
   168         IMPORT_C TTime& ValidUntil();
   169 
   170         /**
   171         * Setter for the credential expiration time.
   172         * @since Series60 3.0
   173         * @param aTime  The new expiration time
   174         */
   175         IMPORT_C void SetValidUntil(TTime& aTime);
   176 
   177     protected:  // Functions from base classes
   178 
   179         /**
   180         * From CSenDomFragment Callback function which implement the XML content handler interface.
   181         * @since Series60 3.0
   182         * @param aNsUri     The namespace URI of the new element
   183         * @param aLocalName The local name of the new element
   184         * @param aQName     The qualified name of the new element
   185         * @param aAttributes    The attributes of the new element
   186         */
   187         IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
   188                                             const TDesC8& aLocalName,
   189                                             const TDesC8& aQName,
   190                                             const RAttributeArray& aAttributes);
   191         
   192     private:
   193         
   194         /**
   195         * C++ default constructor.
   196         */
   197         IMPORT_C CSenCredential();
   198 
   199         /**
   200         * By default Symbian 2nd phase constructor is private.
   201         * @since Series60 3.0
   202         * @param aNsUri is the XML namespace as UTF-8 descriptor
   203         * @param aLocalName is the XML localname as UTF-8 descriptor
   204         * @param aQName is the XML qualifiedname as UTF-8 descriptor
   205         * @param aAttributes is the list of XML attributes
   206         */
   207         IMPORT_C void ConstructL(const TDesC8& aNsUri,
   208                                  const TDesC8& aLocalName,
   209                                  const TDesC8& aQName,
   210                                  const RAttributeArray& aAttributes);
   211 
   212         /**
   213         * By default Symbian 2nd phase constructor is private.
   214         * @since Series60 3.0
   215         * @param aNsUri is the XML namespace as UTF-8 descriptor
   216         * @param aLocalName is the XML localname as UTF-8 descriptor
   217         * @param aQName is the XML qualifiedname as UTF-8 descriptor
   218         * @param aAttributes is the list of XML attributes
   219         * @param aParent is the parent element, which may declare other
   220         *        namespaces.
   221         */
   222         IMPORT_C void ConstructL(const TDesC8& aNsUri,
   223                                  const TDesC8&  aLocalName,
   224                                  const TDesC8& aQName,
   225                                  const RAttributeArray& aAttributes,
   226                                  CSenElement& aParent);
   227 
   228         /**
   229         * By default Symbian 2nd phase constructor is private.
   230         * @since Series60 3.0
   231         * @param aCredential is the source credential to be copied.
   232         */
   233         IMPORT_C void ConstructL(CSenCredential& aCredential);
   234 
   235         // New functions
   236 
   237         /**
   238         * Setter for Credential ID
   239         * @since Series60 3.0
   240         * @param aId is the unique ID for this Credential
   241         */
   242         void SetIdL(const TDesC8& aId);
   243 
   244     private: // Data
   245         // Unique ID for this credential. Owned.
   246         HBufC8* iId;
   247         // One may use SenDateUtils to convert from XML date descrtor to TTime
   248         TTime iNotOnOrAfter;    
   249     };
   250 
   251 #endif // SEN_CREDENTIAL_H
   252 
   253 // End of File
   254 
   255