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.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:        Class implements (web) service credential functionality
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
williamr@2
    24
williamr@2
    25
#ifndef SEN_CREDENTIAL2_H
williamr@2
    26
#define SEN_CREDENTIAL2_H
williamr@2
    27
williamr@2
    28
//  INCLUDES
williamr@2
    29
#include <e32base.h>
williamr@2
    30
#include <s32strm.h>
williamr@2
    31
#include <SenFragmentBase.h>
williamr@2
    32
#include <SenDomFragmentBase.h>
williamr@2
    33
williamr@2
    34
// CONSTANTS
williamr@2
    35
_LIT8(KCredentialsName2,     "Credentials");
williamr@2
    36
_LIT8(KEndpointName2,        "Endpoint");
williamr@2
    37
_LIT8(KSecurityMechIdName2,  "SecurityMechID");
williamr@2
    38
_LIT8(KNotOnOrAfterName2,    "NotOnOrAfter");
williamr@2
    39
_LIT8(KConditionsName2,      "Conditions");
williamr@2
    40
williamr@2
    41
_LIT8(KSenCredentialId,                 "CredentialId");
williamr@2
    42
_LIT8(KSenCredentialValidUntil,         "ValidUntil");
williamr@2
    43
_LIT8(KSenCredentialIdentifierLocalname,"Identifier");
williamr@2
    44
_LIT8(KSenCredentialProperteisLocalname,"Properties");
williamr@2
    45
williamr@2
    46
// FORWARD DECLARATIONS
williamr@2
    47
class SenDateUtils;
williamr@2
    48
class CSenCredentialIdentifier;
williamr@2
    49
class CSenXmlServiceDescription;
williamr@2
    50
class CSenIdentityProvider;
williamr@2
    51
class CSenServiceSession;
williamr@2
    52
class CSenFacet;
williamr@2
    53
williamr@2
    54
// CLASS DECLARATION
williamr@2
    55
williamr@2
    56
/**
williamr@2
    57
* Class implements (web) service credential functionality
williamr@2
    58
*  @lib SenServDesc.lib
williamr@2
    59
*  @since Series60 3.0
williamr@2
    60
*/
williamr@2
    61
class CSenCredential2 : public CSenFragmentBase
williamr@2
    62
    {
williamr@2
    63
    public:  // Constructors and destructor
williamr@2
    64
        
williamr@2
    65
        /**
williamr@2
    66
        * Basic constructor.
williamr@2
    67
        *
williamr@2
    68
        * @since Series60 4.0
williamr@2
    69
        */
williamr@4
    70
        IMPORT_C static CSenCredential2* NewL();
williamr@2
    71
williamr@2
    72
        /**
williamr@2
    73
        * Basic constructor.
williamr@2
    74
        *
williamr@2
    75
        * @since Series60 4.0
williamr@2
    76
        */
williamr@4
    77
        IMPORT_C static CSenCredential2* NewLC();
williamr@2
    78
williamr@2
    79
        /**
williamr@2
    80
        * Basic constructor.
williamr@2
    81
        *
williamr@2
    82
        * @since Series60 4.0
williamr@2
    83
        * @param aNsUri     is the XML namespace of this credential
williamr@2
    84
        * @param aLocalName is the XML localname of this credential
williamr@2
    85
        * @param aPrefix    is the prefix of this credential
williamr@2
    86
        * @param aAttrs     are the XML attributes of this credential
williamr@2
    87
        */
williamr@4
    88
        IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
williamr@2
    89
                                     const TDesC8& aLocalName,
williamr@2
    90
                                     const TDesC8& aQName,
williamr@2
    91
                                     const RAttributeArray& aAttributes);
williamr@2
    92
williamr@2
    93
        /**
williamr@2
    94
        * Basic constructor.
williamr@2
    95
        *
williamr@2
    96
        * @since Series60 4.0
williamr@2
    97
        * @param aNsUri     is the XML namespace of this credential
williamr@2
    98
        * @param aLocalName is the XML localname of this credential
williamr@2
    99
        * @param aPrefix    is the prefix of this credential
williamr@2
   100
        * @param aAttrs     are the XML attributes of this credential
williamr@2
   101
        */
williamr@4
   102
        IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
williamr@2
   103
                                      const TDesC8& aLocalName,
williamr@2
   104
                                      const TDesC8& aQName,
williamr@2
   105
                                      const RAttributeArray& aAttributes);
williamr@2
   106
williamr@2
   107
        /**
williamr@2
   108
        * Basic constructor.
williamr@2
   109
        *
williamr@2
   110
        * @since Series60 4.0
williamr@2
   111
        * @param aNsUri     is the XML namespace of this credential
williamr@2
   112
        * @param aLocalName is the XML localname of this credential
williamr@2
   113
        * @param aPrefix    is the prefix of this credential
williamr@2
   114
        * @param aAttrs     are the XML attributes of this credential
williamr@2
   115
        * @param aParent    is the parent XML element of this credential
williamr@2
   116
        */
williamr@4
   117
        IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
williamr@2
   118
                                     const TDesC8& aLocalName,
williamr@2
   119
                                     const TDesC8& aQName,
williamr@2
   120
                                     const RAttributeArray& aAttributes,
williamr@2
   121
                                     TXmlEngElement& aParent);
williamr@2
   122
williamr@2
   123
        /**
williamr@2
   124
        * Basic constructor.
williamr@2
   125
        *
williamr@2
   126
        * @since Series60 4.0
williamr@2
   127
        * @param aNsUri     is the XML namespace of this credential
williamr@2
   128
        * @param aLocalName is the XML localname of this credential
williamr@2
   129
        * @param aPrefix    is the prefix of this credential
williamr@2
   130
        * @param aAttrs     are the XML attributes of this credential
williamr@2
   131
        * @param aParent    is the parent XML element of this credential
williamr@2
   132
        */
williamr@4
   133
        IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
williamr@2
   134
                                      const TDesC8& aLocalName,
williamr@2
   135
                                      const TDesC8& aQName,
williamr@2
   136
                                      const RAttributeArray& aAttributes,
williamr@2
   137
                                      TXmlEngElement& aParent);
williamr@2
   138
williamr@2
   139
         /**
williamr@2
   140
        * Basic constructor.
williamr@2
   141
        *
williamr@2
   142
        * @since Series60 4.0
williamr@2
   143
        * @param aNsUri         is the XML namespace of this fragment
williamr@2
   144
        * @param aLocalName     is the XML localname of this fragment
williamr@2
   145
        * @param aPrefix        is the prefix of this fragment
williamr@2
   146
        * @param aAttrs         are the XML attributes of this fragment
williamr@2
   147
        * @param aParent        is the parent XML element of this fragment
williamr@2
   148
        * @param aOwnerDocument is the document which will be the owner of
williamr@2
   149
        *                       the elements of this fragment
williamr@2
   150
        */
williamr@4
   151
        IMPORT_C static CSenCredential2* NewL(const TDesC8& aNsUri,
williamr@2
   152
                                     const TDesC8& aLocalName,
williamr@2
   153
                                     const TDesC8& aQName,
williamr@2
   154
                                     const RAttributeArray& aAttrs,
williamr@2
   155
                                     TXmlEngElement& aParent,
williamr@2
   156
                                     RSenDocument& aOwnerDocument);                                         
williamr@2
   157
williamr@2
   158
        /**
williamr@2
   159
        * Basic constructor.
williamr@2
   160
        *
williamr@2
   161
        * @since Series60 4.0
williamr@2
   162
        * @param aNsUri         is the XML namespace of this fragment
williamr@2
   163
        * @param aLocalName     is the XML localname of this fragment
williamr@2
   164
        * @param aPrefix        is the prefix of this fragment
williamr@2
   165
        * @param aAttrs         are the XML attributes of this fragment
williamr@2
   166
        * @param aParent        is the parent XML element of this fragment
williamr@2
   167
        * @param aOwnerDocument is the document which will be the owner of
williamr@2
   168
        *                       the elements of this fragment
williamr@2
   169
        */
williamr@4
   170
        IMPORT_C static CSenCredential2* NewLC(const TDesC8& aNsUri,
williamr@2
   171
                                           const TDesC8& aLocalName,
williamr@2
   172
                                           const TDesC8& aQName,
williamr@2
   173
                                           const RAttributeArray& aAttrs,
williamr@2
   174
                                           TXmlEngElement& aParent,
williamr@2
   175
                                           RSenDocument& aOwnerDocument);
williamr@2
   176
williamr@2
   177
        /**
williamr@2
   178
        * Constructor which copies itself from another credential.
williamr@2
   179
        *
williamr@2
   180
        * @since Series60 4.0
williamr@2
   181
        * @param    aCredential     credential to copy from.
williamr@2
   182
        * @return new CSenCredential instance pointer
williamr@2
   183
        */
williamr@2
   184
        IMPORT_C static CSenCredential2* NewL(const CSenCredential2& aCredential);
williamr@2
   185
williamr@2
   186
        /**
williamr@2
   187
        * Constructor which copies itself from another credential.
williamr@2
   188
        *
williamr@2
   189
        * @since Series60 4.0
williamr@2
   190
        * @param    aCredential     credential to copy from.
williamr@2
   191
        * @return new CSenCredential instance pointer, which is left on
williamr@2
   192
        *         cleanup stack.
williamr@2
   193
        */
williamr@2
   194
        IMPORT_C static CSenCredential2* NewLC(const CSenCredential2& aCredential);
williamr@2
   195
        
williamr@2
   196
        /**
williamr@2
   197
        * Destructor.
williamr@2
   198
        */
williamr@2
   199
        IMPORT_C virtual ~CSenCredential2();        
williamr@2
   200
williamr@2
   201
        // New functions
williamr@2
   202
        
williamr@2
   203
        /**
williamr@2
   204
        * Getter for the credential ID.
williamr@2
   205
        *
williamr@2
   206
        * @since Series60 4.0
williamr@2
   207
        * @return the ID
williamr@2
   208
        */
williamr@2
   209
        IMPORT_C virtual const TDesC8& Id();
williamr@2
   210
williamr@2
   211
        /**
williamr@2
   212
        * Getter for the credential expiration time.
williamr@2
   213
        * @since Series60 3.0
williamr@2
   214
        * @return the the expiration time
williamr@2
   215
        */
williamr@2
   216
        IMPORT_C virtual TTime& ValidUntil();
williamr@2
   217
williamr@2
   218
        /**
williamr@2
   219
        * Setter for the credential expiration time.
williamr@2
   220
        *
williamr@2
   221
        * @since Series60 4.0
williamr@2
   222
        * @param aTime  The new expiration time
williamr@2
   223
        */
williamr@2
   224
        IMPORT_C virtual void SetValidUntil(TTime& aTime);
williamr@2
   225
williamr@2
   226
    protected:  // Functions from base classes
williamr@2
   227
        
williamr@2
   228
        /**
williamr@2
   229
        * C++ default constructor.
williamr@2
   230
        */
williamr@2
   231
        IMPORT_C CSenCredential2();
williamr@2
   232
williamr@2
   233
williamr@2
   234
        IMPORT_C virtual void OnStartElementL(const RTagInfo& aElement,
williamr@2
   235
        							          const RAttributeArray& aAttributes,
williamr@2
   236
        						 	          TInt aErrorCode);
williamr@2
   237
        
williamr@2
   238
        /**
williamr@2
   239
        * @since Series60 4.0
williamr@2
   240
        * @param aNsUri is the XML namespace as UTF-8 descriptor
williamr@2
   241
        * @param aLocalName is the XML localname as UTF-8 descriptor
williamr@2
   242
        * @param aQName is the XML qualifiedname as UTF-8 descriptor
williamr@2
   243
        * @param aAttributes is the list of XML attributes
williamr@2
   244
        */
williamr@2
   245
        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
williamr@2
   246
                                     const TDesC8& aLocalName,
williamr@2
   247
                                     const TDesC8& aQName,
williamr@2
   248
                                     const RAttributeArray& aAttributes);
williamr@2
   249
williamr@2
   250
        /**
williamr@2
   251
        * @since Series60 4.0
williamr@2
   252
        * @param aNsUri is the XML namespace as UTF-8 descriptor
williamr@2
   253
        * @param aLocalName is the XML localname as UTF-8 descriptor
williamr@2
   254
        * @param aQName is the XML qualifiedname as UTF-8 descriptor
williamr@2
   255
        * @param aAttributes is the list of XML attributes
williamr@2
   256
        * @param aParent is the parent element, which may declare other
williamr@2
   257
        *        namespaces.
williamr@2
   258
        */
williamr@2
   259
        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
williamr@2
   260
                                     const TDesC8&  aLocalName,
williamr@2
   261
                                     const TDesC8& aQName,
williamr@2
   262
                                     const RAttributeArray& aAttributes,
williamr@2
   263
                                     TXmlEngElement& aParent);
williamr@2
   264
williamr@2
   265
        /**
williamr@2
   266
        * By default Symbian 2nd phase constructor is private.
williamr@2
   267
        *
williamr@2
   268
        * @since Series60 4.0
williamr@2
   269
        * @param aNsUri is the XML namespace as UTF-8 descriptor
williamr@2
   270
        * @param aLocalName is the XML localname as UTF-8 descriptor
williamr@2
   271
        * @param aQName is the XML qualifiedname as UTF-8 descriptor
williamr@2
   272
        * @param aAttributes is the list of XML attributes
williamr@2
   273
        * @param aParent is the parent element, which may declare other
williamr@2
   274
        *        namespaces.
williamr@2
   275
        * @param aOwnerDocument is the document which will be the owner of
williamr@2
   276
        *                       the elements of this credential
williamr@2
   277
        */
williamr@2
   278
        IMPORT_C void BaseConstructL(const TDesC8& aNsUri,
williamr@2
   279
                                     const TDesC8&  aLocalName,
williamr@2
   280
                                     const TDesC8& aQName,
williamr@2
   281
                                     const RAttributeArray& aAttributes,
williamr@2
   282
                                     TXmlEngElement& aParent,
williamr@2
   283
                                     RSenDocument& aOwnerDocument);                                         
williamr@2
   284
        /**
williamr@2
   285
        * By default Symbian 2nd phase constructor is private.
williamr@2
   286
        *
williamr@2
   287
        * @since Series60 4.0
williamr@2
   288
        * @param aCredential is the source credential to be copied.
williamr@2
   289
        */
williamr@2
   290
        IMPORT_C void BaseConstructL(CSenCredential2& aCredential);
williamr@2
   291
williamr@2
   292
williamr@2
   293
    private:
williamr@2
   294
        /**
williamr@2
   295
        * By default Symbian 2nd phase constructor is private.
williamr@2
   296
        *
williamr@2
   297
        * BaseConstructL for setting XML localname for this Credential.
williamr@2
   298
        * @since Series60 4.0
williamr@2
   299
        * @param aLocalName XML localname for this Credential
williamr@2
   300
        */
williamr@2
   301
        IMPORT_C void ConstructL(const TDesC8& aLocalName);
williamr@2
   302
williamr@2
   303
        // New functions
williamr@2
   304
williamr@2
   305
        /**
williamr@2
   306
        * Setter for Credential ID
williamr@2
   307
        *
williamr@2
   308
        * @since Series60 4.0
williamr@2
   309
        * @param aId is the unique ID for this Credential
williamr@2
   310
        */
williamr@2
   311
        void SetIdL(const TDesC8& aId);
williamr@2
   312
williamr@2
   313
    private: // Data
williamr@2
   314
        // Unique ID for this credential. Owned.
williamr@2
   315
        HBufC8*                     iId;
williamr@2
   316
        // One may use SenDateUtils to convert from XML date descrtor to TTime
williamr@2
   317
        TTime                       iNotOnOrAfter;    
williamr@2
   318
    };
williamr@2
   319
williamr@2
   320
#endif // SEN_CREDENTIAL2_H
williamr@2
   321
williamr@2
   322
// End of File
williamr@2
   323
williamr@2
   324