webservices/wscredentialmanager/inc/seninternalcredential.h
changeset 0 62f9d29f7211
child 12 20aafbbfb68e
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     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:           This internal class implements (web) service credential functionality
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 #ifndef SEN_INTERNAL_CREDENTIAL_H
       
    29 #define SEN_INTERNAL_CREDENTIAL_H
       
    30 
       
    31 //  INCLUDES
       
    32 #include <e32base.h>
       
    33 #include <s32strm.h>
       
    34 #include <SenCredential2.h>
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class CSenCredentialProperties;
       
    38 class CSenCredentialIdentifier;
       
    39 class CSenWSDescription;
       
    40 
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45 * Class implements (web) service credential functionality
       
    46 *  @lib SenServDesc.lib
       
    47 *  @since Series60 3.0
       
    48 */
       
    49 class CSenInternalCredential : public CSenCredential2
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52 
       
    53         /**
       
    54         * Basic constructor.
       
    55         *
       
    56         * @since Series60 3.2.3
       
    57         */
       
    58         IMPORT_C static CSenInternalCredential* NewL();
       
    59 
       
    60         /**
       
    61         * Basic constructor.
       
    62         *
       
    63         * @since Series60 3.2.3
       
    64         */
       
    65         IMPORT_C static CSenInternalCredential* NewLC();
       
    66 
       
    67         /**
       
    68         * Basic constructor.
       
    69         *
       
    70         * @since Series60 3.2.3
       
    71         * @param aNsUri     is the XML namespace of this credential
       
    72         * @param aLocalName is the XML localname of this credential
       
    73         * @param aPrefix    is the prefix of this credential
       
    74         * @param aAttrs     are the XML attributes of this credential
       
    75         */
       
    76         IMPORT_C static CSenInternalCredential* NewL(const TDesC8& aNsUri,
       
    77                                             const TDesC8& aLocalName,
       
    78                                             const TDesC8& aQName,
       
    79                                             const RAttributeArray& aAttributes);
       
    80 
       
    81         /**
       
    82         * Basic constructor.
       
    83         *
       
    84         * @since Series60 3.2.3
       
    85         * @param aNsUri     is the XML namespace of this credential
       
    86         * @param aLocalName is the XML localname of this credential
       
    87         * @param aPrefix    is the prefix of this credential
       
    88         * @param aAttrs     are the XML attributes of this credential
       
    89         */
       
    90         IMPORT_C static CSenInternalCredential* NewLC(const TDesC8& aNsUri,
       
    91                                              const TDesC8& aLocalName,
       
    92                                              const TDesC8& aQName,
       
    93                                              const RAttributeArray& aAttributes);
       
    94 
       
    95         /**
       
    96         * Basic constructor.
       
    97         *
       
    98         * @since Series60 3.2.3
       
    99         * @param aNsUri     is the XML namespace of this credential
       
   100         * @param aLocalName is the XML localname of this credential
       
   101         * @param aPrefix    is the prefix of this credential
       
   102         * @param aAttrs     are the XML attributes of this credential
       
   103         * @param aParent    is the parent XML element of this credential
       
   104         */
       
   105         IMPORT_C static CSenInternalCredential* NewL(const TDesC8& aNsUri,
       
   106                                             const TDesC8& aLocalName,
       
   107                                             const TDesC8& aQName,
       
   108                                             const RAttributeArray& aAttributes,
       
   109                                             TXmlEngElement& aParent);
       
   110 
       
   111         /**
       
   112         * Basic constructor.
       
   113         *
       
   114         * @since Series60 3.2.3
       
   115         * @param aNsUri     is the XML namespace of this credential
       
   116         * @param aLocalName is the XML localname of this credential
       
   117         * @param aPrefix    is the prefix of this credential
       
   118         * @param aAttrs     are the XML attributes of this credential
       
   119         * @param aParent    is the parent XML element of this credential
       
   120         */
       
   121         IMPORT_C static CSenInternalCredential* NewLC(const TDesC8& aNsUri,
       
   122                                              const TDesC8& aLocalName,
       
   123                                              const TDesC8& aQName,
       
   124                                              const RAttributeArray& aAttributes,
       
   125                                              TXmlEngElement& aParent);
       
   126 
       
   127          /**
       
   128         * Basic constructor.
       
   129         *
       
   130         * @since Series60 3.2.3
       
   131         * @param aNsUri         is the XML namespace of this fragment
       
   132         * @param aLocalName     is the XML localname of this fragment
       
   133         * @param aPrefix        is the prefix of this fragment
       
   134         * @param aAttrs         are the XML attributes of this fragment
       
   135         * @param aParent        is the parent XML element of this fragment
       
   136         * @param aOwnerDocument is the document which will be the owner of
       
   137         *                       the elements of this fragment
       
   138         */
       
   139         IMPORT_C static CSenInternalCredential* NewL(const TDesC8& aNsUri,
       
   140                                             const TDesC8& aLocalName,
       
   141                                             const TDesC8& aQName,
       
   142                                             const RAttributeArray& aAttrs,
       
   143                                             TXmlEngElement& aParent,
       
   144                                             RSenDocument& aOwnerDocument);
       
   145 
       
   146         /**
       
   147         * Basic constructor.
       
   148         *
       
   149         * @since Series60 3.2.3
       
   150         * @param aNsUri         is the XML namespace of this fragment
       
   151         * @param aLocalName     is the XML localname of this fragment
       
   152         * @param aPrefix        is the prefix of this fragment
       
   153         * @param aAttrs         are the XML attributes of this fragment
       
   154         * @param aParent        is the parent XML element of this fragment
       
   155         * @param aOwnerDocument is the document which will be the owner of
       
   156         *                       the elements of this fragment
       
   157         */
       
   158         IMPORT_C static CSenInternalCredential* NewLC(const TDesC8& aNsUri,
       
   159                                              const TDesC8& aLocalName,
       
   160                                              const TDesC8& aQName,
       
   161                                              const RAttributeArray& aAttrs,
       
   162                                              TXmlEngElement& aParent,
       
   163                                              RSenDocument& aOwnerDocument);
       
   164 
       
   165         /**
       
   166         * Constructor which copies itself from another credential.
       
   167         *
       
   168         * @since Series60 3.2.3
       
   169         * @param    aCredential     credential to copy from.
       
   170         * @return new CSenCredential instance pointer
       
   171         */
       
   172         IMPORT_C static CSenInternalCredential* NewL(const CSenInternalCredential& aCredential);
       
   173 
       
   174         /**
       
   175         * Constructor which copies itself from another credential.
       
   176         *
       
   177         * @since Series60 3.2.3
       
   178         * @param    aCredential     credential to copy from.
       
   179         * @return new CSenCredential instance pointer, which is left on
       
   180         *         cleanup stack.
       
   181         */
       
   182         IMPORT_C static CSenInternalCredential* NewLC(const CSenInternalCredential& aCredential);
       
   183 
       
   184         /**
       
   185         * Destructor.
       
   186         */
       
   187         IMPORT_C virtual ~CSenInternalCredential();
       
   188 
       
   189         // New functions
       
   190 
       
   191         /**
       
   192         * Method for checking if this credential is applicable for
       
   193         * given pattern.
       
   194         *
       
   195         * @since Series60 3.2.3
       
   196         * @param    aPattern    pattern to check.
       
   197         * @return   ETrue       if Credential is applicable
       
   198         *           EFalse      if Credential is not applicable
       
   199         */
       
   200         IMPORT_C virtual TBool IsApplicableL(const CSenWSDescription& aPattern);	//codescannerwarings
       
   201 
       
   202         /**
       
   203         * Method for setting CredentialIdentifier.
       
   204         *
       
   205         * @since Series60 3.2.3
       
   206         * @param    aIdentifier identifier to set.
       
   207         */
       
   208         IMPORT_C virtual void SetIdentifier(CSenCredentialIdentifier* aIdentifier);
       
   209 
       
   210         /**
       
   211         * Method for getting CredentialIdentifier.
       
   212         *
       
   213         * @since Series60 3.2.3
       
   214         * @return   Identifier for this Credentiel
       
   215         */
       
   216         IMPORT_C virtual CSenCredentialIdentifier& IdentifierL();		//codescannerwarings
       
   217 
       
   218         /**
       
   219         * Method for setting CredentialProperties.
       
   220         *
       
   221         * @since Series60 3.2.3
       
   222         * @param    aProperties properties to set.
       
   223         */
       
   224         IMPORT_C virtual void SetProperties(CSenCredentialProperties* aProperties);
       
   225 
       
   226         /**
       
   227         * Method for getting CredentialProperties.
       
   228         *
       
   229         * @since Series60 3.2.3
       
   230         * @return   Properties for this Credentiel
       
   231         */
       
   232         IMPORT_C virtual CSenCredentialProperties& PropertiesL();	//codescannerwarings
       
   233         
       
   234         /**
       
   235         * Method for checking if Credential has  properties.
       
   236         *
       
   237         * @since Series60 3.2.3
       
   238         * @return   ETrue, if Credential has properties or
       
   239         *           EFalse, if Credential does not have properties
       
   240         */
       
   241         IMPORT_C TBool CSenInternalCredential::HasProperties();
       
   242 
       
   243         /**
       
   244         * Method for setting IdentityProviderId for this Credential.
       
   245         * Setting IdentityProviderId does build relation between this
       
   246         * Credential and IdentityProvider for which IdentityProviderId
       
   247         * refers to.
       
   248         *
       
   249         * @param   aIdentityProviderId    IdentityProviderId for IdentityProvider
       
   250         *                                 which is related to this Credentiel.
       
   251         */
       
   252         IMPORT_C virtual void SetIdentityProviderIdL(TDesC8& aIdentityProviderId);
       
   253 
       
   254         /**
       
   255         * Method for setting Authentiaction information for this Credential.
       
   256         * Setting Authentiaction does build relation between this
       
   257         * Credential and IdentityProvider for which Authentiaction
       
   258         * refers to.
       
   259         *
       
   260         * @param   aUserId    UserId for IdentityProvider
       
   261         * @param   aPassword  Password for IdentityProvider
       
   262         *                                 which is related to this Credentiel.
       
   263         */
       
   264         IMPORT_C void SetAuthInfo(TDesC8& aUserId, TDesC8& aPassword) ;
       
   265 
       
   266         /**
       
   267         * Method for getting IdentityProviderId of IdentityProvider which
       
   268         * is related to this Credential.
       
   269         *
       
   270         * @since Series60 3.2.3
       
   271         * @param aIdTo              a reference to TPtrC8 for which
       
   272         *                           IdentityProviderId will be placed.
       
   273         * @return   KErrNotFound    if IdentityProviderId is not stored
       
   274         *                           into this Credential
       
   275         *           KErrNone        If IdentityProviderId was found
       
   276         *                           from this Credential.
       
   277         */
       
   278         IMPORT_C virtual TInt IdentityProviderIdL(TPtrC8& aIdTo);
       
   279 
       
   280         /**
       
   281         * Method for setting ServiceSession for this Credential.
       
   282         * Setting ServiceSession does build relation between this
       
   283         * Credential and given ServiceSession.
       
   284         *
       
   285         * @since Series60 3.2.3
       
   286         * @param   aSession             ServiceSession for this Credentiel
       
   287         */
       
   288         IMPORT_C virtual void SetSession(CSenServiceSession& aSession);
       
   289 
       
   290         /**
       
   291         * Method for getting ServiceSession which is related to this
       
   292         * Credential.
       
   293         *
       
   294         * @since Series60 3.2.3
       
   295         * @return   ServiceSession for this Credentiel or NULL
       
   296         *           if related ServiceSession is not set
       
   297         */
       
   298         IMPORT_C virtual CSenServiceSession* Session();
       
   299 
       
   300     private:
       
   301 
       
   302         /**
       
   303         * C++ default constructor.
       
   304         */
       
   305         IMPORT_C CSenInternalCredential();
       
   306 
       
   307 
       
   308         /**
       
   309         * By default Symbian 2nd phase constructor is private.
       
   310         *
       
   311         * @since Series60 3.2.3
       
   312         * @param aNsUri is the XML namespace as UTF-8 descriptor
       
   313         * @param aLocalName is the XML localname as UTF-8 descriptor
       
   314         * @param aQName is the XML qualifiedname as UTF-8 descriptor
       
   315         * @param aAttributes is the list of XML attributes
       
   316         */
       
   317         IMPORT_C void ConstructL(const TDesC8& aNsUri,
       
   318                                  const TDesC8& aLocalName,
       
   319                                  const TDesC8& aQName,
       
   320                                  const RAttributeArray& aAttributes);
       
   321 
       
   322         /**
       
   323         * By default Symbian 2nd phase constructor is private.
       
   324         *
       
   325         * @since Series60 3.2.3
       
   326         * @param aNsUri is the XML namespace as UTF-8 descriptor
       
   327         * @param aLocalName is the XML localname as UTF-8 descriptor
       
   328         * @param aQName is the XML qualifiedname as UTF-8 descriptor
       
   329         * @param aAttributes is the list of XML attributes
       
   330         * @param aParent is the parent element, which may declare other
       
   331         *        namespaces.
       
   332         */
       
   333         IMPORT_C void ConstructL(const TDesC8& aNsUri,
       
   334                                  const TDesC8&  aLocalName,
       
   335                                  const TDesC8& aQName,
       
   336                                  const RAttributeArray& aAttributes,
       
   337                                  TXmlEngElement& aParent);
       
   338 
       
   339         /**
       
   340         * By default Symbian 2nd phase constructor is private.
       
   341         *
       
   342         * @since Series60 3.2.3
       
   343         * @param aNsUri is the XML namespace as UTF-8 descriptor
       
   344         * @param aLocalName is the XML localname as UTF-8 descriptor
       
   345         * @param aQName is the XML qualifiedname as UTF-8 descriptor
       
   346         * @param aAttributes is the list of XML attributes
       
   347         * @param aParent is the parent element, which may declare other
       
   348         *        namespaces.
       
   349         * @param aOwnerDocument is the document which will be the owner of
       
   350         *                       the elements of this credential
       
   351         */
       
   352         IMPORT_C void ConstructL(const TDesC8& aNsUri,
       
   353                                  const TDesC8&  aLocalName,
       
   354                                  const TDesC8& aQName,
       
   355                                  const RAttributeArray& aAttributes,
       
   356                                  TXmlEngElement& aParent,
       
   357                                  RSenDocument& aOwnerDocument);
       
   358 
       
   359         /**
       
   360         * By default Symbian 2nd phase constructor is private.
       
   361         *
       
   362         * @since Series60 3.2.3
       
   363         * @param aCredential is the source credential to be copied.
       
   364         */
       
   365         IMPORT_C void ConstructL(CSenInternalCredential& aCredential);
       
   366 
       
   367         /**
       
   368         * By default Symbian 2nd phase constructor is private.
       
   369         *
       
   370         * BaseConstructL for setting XML localname for this Credential.
       
   371         * @since Series60 3.2.3
       
   372         * @param aLocalName XML localname for this Credential
       
   373         */
       
   374         IMPORT_C void ConstructL(const TDesC8& aLocalName);
       
   375 
       
   376         // New functions
       
   377 
       
   378         /**
       
   379         * Setter for Credential ID
       
   380         *
       
   381         * @since Series60 3.2.3
       
   382         * @param aId is the unique ID for this Credential
       
   383         */
       
   384         void SetIdL(const TDesC8& aId);
       
   385 
       
   386     private: // Data
       
   387         CSenCredentialIdentifier*   ipIdentifier;
       
   388         CSenCredentialProperties*   ipProperties;
       
   389         CSenIdentityProvider*       ipIdentityProvider;
       
   390         CSenServiceSession*         ipSession;
       
   391     };
       
   392 
       
   393 class CSenCredentialProperties : public CSenDomFragmentBase
       
   394     {
       
   395     public:  // Constructors and destructor
       
   396 
       
   397         /**
       
   398         * Basic constructor.
       
   399         *
       
   400         * @since Series60 3.2.3
       
   401         */
       
   402         IMPORT_C static CSenCredentialProperties* NewL();
       
   403 
       
   404         /**
       
   405         * Basic constructor.
       
   406         *
       
   407         * @since Series60 3.2.3
       
   408         */
       
   409         IMPORT_C static CSenCredentialProperties* NewLC();
       
   410 
       
   411         /**
       
   412         * Basic constructor.
       
   413         *
       
   414         * @since Series60 3.2.3
       
   415         * @param aNsUri     is the XML namespace of this credential
       
   416         * @param aLocalName is the XML localname of this credential
       
   417         * @param aPrefix    is the prefix of this credential
       
   418         * @param aAttrs     are the XML attributes of this credential
       
   419         */
       
   420         IMPORT_C static CSenCredentialProperties* NewL(const TDesC8& aNsUri,
       
   421                                                            const TDesC8& aLocalName,
       
   422                                                            const TDesC8& aQName,
       
   423                                                            const RAttributeArray& aAttributes);
       
   424 
       
   425         /**
       
   426         * Basic constructor.
       
   427         *
       
   428         * @since Series60 3.2.3
       
   429         * @param aNsUri     is the XML namespace of this credential
       
   430         * @param aLocalName is the XML localname of this credential
       
   431         * @param aPrefix    is the prefix of this credential
       
   432         * @param aAttrs     are the XML attributes of this credential
       
   433         */
       
   434         IMPORT_C static CSenCredentialProperties* NewLC(const TDesC8& aNsUri,
       
   435                                                             const TDesC8& aLocalName,
       
   436                                                             const TDesC8& aQName,
       
   437                                                             const RAttributeArray& aAttributes);
       
   438 
       
   439         /**
       
   440         * Basic constructor.
       
   441         *
       
   442         * @since Series60 3.2.3
       
   443         * @param aNsUri     is the XML namespace of this credential
       
   444         * @param aLocalName is the XML localname of this credential
       
   445         * @param aPrefix    is the prefix of this credential
       
   446         * @param aAttrs     are the XML attributes of this credential
       
   447         * @param aParent    is the parent XML element of this credential
       
   448         */
       
   449         IMPORT_C static CSenCredentialProperties* NewL(const TDesC8& aNsUri,
       
   450                                                            const TDesC8& aLocalName,
       
   451                                                            const TDesC8& aQName,
       
   452                                                            const RAttributeArray& aAttributes,
       
   453                                                            TXmlEngElement& aParent);
       
   454 
       
   455         /**
       
   456         * Basic constructor.
       
   457         *
       
   458         * @since Series60 3.2.3
       
   459         * @param aNsUri     is the XML namespace of this credential
       
   460         * @param aLocalName is the XML localname of this credential
       
   461         * @param aPrefix    is the prefix of this credential
       
   462         * @param aAttrs     are the XML attributes of this credential
       
   463         * @param aParent    is the parent XML element of this credential
       
   464         */
       
   465         IMPORT_C static CSenCredentialProperties* NewLC(const TDesC8& aNsUri,
       
   466                                                             const TDesC8& aLocalName,
       
   467                                                             const TDesC8& aQName,
       
   468                                                             const RAttributeArray& aAttributes,
       
   469                                                             TXmlEngElement& aParent);
       
   470 
       
   471          /**
       
   472         * Basic constructor.
       
   473         *
       
   474         * @since Series60 3.2.3
       
   475         * @param aNsUri         is the XML namespace of this fragment
       
   476         * @param aLocalName     is the XML localname of this fragment
       
   477         * @param aPrefix        is the prefix of this fragment
       
   478         * @param aAttrs         are the XML attributes of this fragment
       
   479         * @param aParent        is the parent XML element of this fragment
       
   480         * @param aOwnerDocument is the document which will be the owner of
       
   481         *                       the elements of this fragment
       
   482         */
       
   483         IMPORT_C static CSenCredentialProperties* NewL(const TDesC8& aNsUri,
       
   484                                                            const TDesC8& aLocalName,
       
   485                                                            const TDesC8& aQName,
       
   486                                                            const RAttributeArray& aAttrs,
       
   487                                                            TXmlEngElement& aParent,
       
   488                                                            RSenDocument& aOwnerDocument);
       
   489 
       
   490         /**
       
   491         * Basic constructor.
       
   492         *
       
   493         * @since Series60 3.2.3
       
   494         * @param aNsUri         is the XML namespace of this fragment
       
   495         * @param aLocalName     is the XML localname of this fragment
       
   496         * @param aPrefix        is the prefix of this fragment
       
   497         * @param aAttrs         are the XML attributes of this fragment
       
   498         * @param aParent        is the parent XML element of this fragment
       
   499         * @param aOwnerDocument is the document which will be the owner of
       
   500         *                       the elements of this fragment
       
   501         */
       
   502         IMPORT_C static CSenCredentialProperties* NewLC(const TDesC8& aNsUri,
       
   503                                                             const TDesC8& aLocalName,
       
   504                                                             const TDesC8& aQName,
       
   505                                                             const RAttributeArray& aAttrs,
       
   506                                                             TXmlEngElement& aParent,
       
   507                                                             RSenDocument& aOwnerDocument);
       
   508 
       
   509         /**
       
   510         * Destructor.
       
   511         */
       
   512         IMPORT_C virtual ~CSenCredentialProperties();
       
   513 
       
   514         /**
       
   515         * Sets new property.
       
   516         *
       
   517         * If property with given name does not exist,
       
   518         * new property with given value will be added. Otherwise the value of
       
   519         * existing property will be updated.
       
   520         *
       
   521         * @since Series60 3.2.3
       
   522         * @param aName         Name of the property, which can be later used
       
   523         *                      to refer the given value.
       
   524         * @param aValue        Is the value of this property.
       
   525         * @return              KErrNone if no error, or some of the system wide
       
   526         *                      error codes.
       
   527         */
       
   528         IMPORT_C virtual TInt SetPropertyL(const TDesC8& aName, const TDesC8& aValue);
       
   529 
       
   530         /**
       
   531         * Gets the value of the property behind certain name.
       
   532         *
       
   533         * @since Series60 3.2.3
       
   534         * @param aName    The name identifying this property.
       
   535         * @param aValue   A TPtrC8 reference to be filled in with the value of
       
   536         *                 the property.
       
   537         * @return         KErrNone if no error, or some of the system wide
       
   538         *                 error codes.
       
   539         */
       
   540         IMPORT_C virtual TInt PropertyL(const TDesC8& aName, TPtrC8& aValue);
       
   541 
       
   542         /**
       
   543         * Method for checking if CredentialIdentifier has a certain facet.
       
   544         *
       
   545         * @since Series60 3.2.3
       
   546         * @param aURI           the facet to get, typically some URI.
       
   547         * @param aValueTo       a ref-to-pointer into which the value will
       
   548         *                       be allocated, which ownership is transferred
       
   549         *                       to the caller.
       
   550         * @return               KErrNone or other system-wide Symbian error
       
   551         *                       codes.
       
   552         */
       
   553         IMPORT_C virtual TInt FacetValueL(TDesC8& aURI, HBufC8*& aValueTo);
       
   554 
       
   555         /**
       
   556         * Method for adding a facet. Will NOT override an already
       
   557         * existing facet with a same name.
       
   558         *
       
   559         * @since Series60 3.2.3
       
   560         * @param        aFacet is the one to be added. A copy of the
       
   561         *               the original facet instance will be added.
       
   562         * @return       KErrNone or other system-wide Symbian error codes.
       
   563         *               KErrAlreadyExists if a facet with same name exists
       
   564         */
       
   565         IMPORT_C virtual TInt AddFacetL(const CSenFacet& aFacet);
       
   566 
       
   567         /**
       
   568         * Method for setting a facet. Adds a new facet, if non-existent.
       
   569         * But, if a facet with same name exists, it will be overridden.
       
   570         *
       
   571         * @since Series60 3.2.3
       
   572         * @param        aFacet to be set. A copy of the original will be
       
   573         *               created.
       
   574         * @return       KErrNotFound if facet can not be found
       
   575         *               KErrNone     if facet was found
       
   576         *               KErrNoMemory if no memory could be allocated for the value
       
   577         *               Other system-wide Symbian error codes.
       
   578         */
       
   579         IMPORT_C virtual TInt SetFacetL(const CSenFacet& aFacet);
       
   580         /**
       
   581         * Removes a characteristic (Facet) from the description
       
   582         *
       
   583         * @since Series60 3.2.3
       
   584         * @param        aURI of the facet to be removed.
       
   585         * @return       KErrNone     if a Facet was successfully removed
       
   586         *               KErrNotFound if a Facet could not be found
       
   587         *               Other system-wide Symbian error codes.
       
   588         */
       
   589         IMPORT_C virtual TInt RemoveFacetL(const TDesC8& aURI);
       
   590 
       
   591         IMPORT_C virtual void SetValidUntilL(TTime aValidUntil);
       
   592         
       
   593         IMPORT_C virtual TTime ValidUntilL();
       
   594         
       
   595      protected:
       
   596 
       
   597         /**
       
   598         * C++ default constructor.
       
   599         */
       
   600         CSenCredentialProperties();
       
   601 
       
   602    };
       
   603 
       
   604 class CSenCredentialIdentifier : public CSenCredentialProperties
       
   605     {
       
   606     public:  // Constructors and destructor
       
   607 
       
   608         /**
       
   609         * Basic constructor.
       
   610         *
       
   611         * @since Series60 3.2.3
       
   612         */
       
   613         IMPORT_C static CSenCredentialIdentifier* NewL();
       
   614 
       
   615         /**
       
   616         * Basic constructor.
       
   617         *
       
   618         * @since Series60 3.2.3
       
   619         */
       
   620         IMPORT_C static CSenCredentialIdentifier* NewLC();
       
   621 
       
   622         /**
       
   623         * Basic constructor.
       
   624         *
       
   625         * @since Series60 3.2.3
       
   626         * @param aNsUri     is the XML namespace of this credential
       
   627         * @param aLocalName is the XML localname of this credential
       
   628         * @param aPrefix    is the prefix of this credential
       
   629         * @param aAttrs     are the XML attributes of this credential
       
   630         */
       
   631         IMPORT_C static CSenCredentialIdentifier* NewL(const TDesC8& aNsUri,
       
   632                                                        const TDesC8& aLocalName,
       
   633                                                        const TDesC8& aQName,
       
   634                                                           const RAttributeArray& aAttributes);
       
   635 
       
   636         /**
       
   637         * Basic constructor.
       
   638         *
       
   639         * @since Series60 3.2.3
       
   640         * @param aNsUri     is the XML namespace of this credential
       
   641         * @param aLocalName is the XML localname of this credential
       
   642         * @param aPrefix    is the prefix of this credential
       
   643         * @param aAttrs     are the XML attributes of this credential
       
   644         */
       
   645         IMPORT_C static CSenCredentialIdentifier* NewLC(const TDesC8& aNsUri,
       
   646                                                         const TDesC8& aLocalName,
       
   647                                                         const TDesC8& aQName,
       
   648                                                         const RAttributeArray& aAttributes);
       
   649 
       
   650         /**
       
   651         * Basic constructor.
       
   652         *
       
   653         * @since Series60 3.2.3
       
   654         * @param aNsUri     is the XML namespace of this credential
       
   655         * @param aLocalName is the XML localname of this credential
       
   656         * @param aPrefix    is the prefix of this credential
       
   657         * @param aAttrs     are the XML attributes of this credential
       
   658         * @param aParent    is the parent XML element of this credential
       
   659         */
       
   660         IMPORT_C static CSenCredentialIdentifier* NewL(const TDesC8& aNsUri,
       
   661                                                        const TDesC8& aLocalName,
       
   662                                                        const TDesC8& aQName,
       
   663                                                        const RAttributeArray& aAttributes,
       
   664                                                        TXmlEngElement& aParent);
       
   665 
       
   666         /**
       
   667         * Basic constructor.
       
   668         *
       
   669         * @since Series60 3.2.3
       
   670         * @param aNsUri     is the XML namespace of this credential
       
   671         * @param aLocalName is the XML localname of this credential
       
   672         * @param aPrefix    is the prefix of this credential
       
   673         * @param aAttrs     are the XML attributes of this credential
       
   674         * @param aParent    is the parent XML element of this credential
       
   675         */
       
   676         IMPORT_C static CSenCredentialIdentifier* NewLC(const TDesC8& aNsUri,
       
   677                                                         const TDesC8& aLocalName,
       
   678                                                         const TDesC8& aQName,
       
   679                                                         const RAttributeArray& aAttributes,
       
   680                                                         TXmlEngElement& aParent);
       
   681 
       
   682          /**
       
   683         * Basic constructor.
       
   684         *
       
   685         * @since Series60 3.2.3
       
   686         * @param aNsUri         is the XML namespace of this fragment
       
   687         * @param aLocalName     is the XML localname of this fragment
       
   688         * @param aPrefix        is the prefix of this fragment
       
   689         * @param aAttrs         are the XML attributes of this fragment
       
   690         * @param aParent        is the parent XML element of this fragment
       
   691         * @param aOwnerDocument is the document which will be the owner of
       
   692         *                       the elements of this fragment
       
   693         */
       
   694         IMPORT_C static CSenCredentialIdentifier* NewL(const TDesC8& aNsUri,
       
   695                                                        const TDesC8& aLocalName,
       
   696                                                        const TDesC8& aQName,
       
   697                                                        const RAttributeArray& aAttrs,
       
   698                                                        TXmlEngElement& aParent,
       
   699                                                        RSenDocument& aOwnerDocument);
       
   700 
       
   701         /**
       
   702         * Basic constructor.
       
   703         *
       
   704         * @since Series60 3.2.3
       
   705         * @param aNsUri         is the XML namespace of this fragment
       
   706         * @param aLocalName     is the XML localname of this fragment
       
   707         * @param aPrefix        is the prefix of this fragment
       
   708         * @param aAttrs         are the XML attributes of this fragment
       
   709         * @param aParent        is the parent XML element of this fragment
       
   710         * @param aOwnerDocument is the document which will be the owner of
       
   711         *                       the elements of this fragment
       
   712         */
       
   713         IMPORT_C static CSenCredentialIdentifier* NewLC(const TDesC8& aNsUri,
       
   714                                                         const TDesC8& aLocalName,
       
   715                                                         const TDesC8& aQName,
       
   716                                                         const RAttributeArray& aAttrs,
       
   717                                                         TXmlEngElement& aParent,
       
   718                                                         RSenDocument& aOwnerDocument);
       
   719 
       
   720         /**
       
   721         * Destructor.
       
   722         */
       
   723         IMPORT_C virtual ~CSenCredentialIdentifier();
       
   724 
       
   725         IMPORT_C virtual void SetIdL(TInt aId);
       
   726 
       
   727         IMPORT_C virtual TInt IdL();
       
   728         
       
   729      private:
       
   730 
       
   731         /**
       
   732         * C++ default constructor.
       
   733         */
       
   734         CSenCredentialIdentifier();
       
   735 
       
   736    };
       
   737    
       
   738 class MSenCredentialObserver
       
   739     {
       
   740     public:
       
   741         enum TSenCredentialChange
       
   742             {
       
   743             EDestroyed  = 1,
       
   744             EReplaced   = 2,
       
   745             EAdded
       
   746             };
       
   747 
       
   748 		virtual void CredentialChanged(TSenCredentialChange aChange,
       
   749 		                               TAny* aPointer = NULL) = 0;
       
   750     };
       
   751     
       
   752 typedef RPointerArray<MSenCredentialObserver> RSenCredentialObserverArray;
       
   753    
       
   754 class CSenCredentialData : public CBase
       
   755     {
       
   756     public:
       
   757         /**
       
   758         * Basic constructor.
       
   759         *
       
   760         * @since Series60 3.2.3
       
   761         */
       
   762         static CSenCredentialData* NewL();
       
   763 
       
   764         /**
       
   765         * Basic constructor.
       
   766         *
       
   767         * @since Series60 3.2.3
       
   768         */
       
   769         static CSenCredentialData* NewLC();
       
   770 
       
   771         /**
       
   772         * Destructor.
       
   773         */
       
   774         virtual ~CSenCredentialData();
       
   775         
       
   776     private:
       
   777         /**
       
   778         * C++ default constructor.
       
   779         */
       
   780         CSenCredentialData();
       
   781     
       
   782     public:
       
   783         CSenInternalCredential*     ipCredential;
       
   784         TInt                        iCounter;
       
   785         RSenCredentialObserverArray iObserverArray;
       
   786     };
       
   787 
       
   788 class RSenCredentialPtr
       
   789 	{
       
   790     public:
       
   791 	    IMPORT_C void OpenL(CSenInternalCredential* apCredential);
       
   792 	    IMPORT_C CSenInternalCredential* Credential();
       
   793 	    IMPORT_C void SetCredential(CSenInternalCredential* apCredential);
       
   794 	    IMPORT_C RSenCredentialPtr Clone();
       
   795 	    IMPORT_C void Close();
       
   796 	    IMPORT_C void CloseAndDestroyCredential();
       
   797 	    IMPORT_C void AddCredentialObserverL(MSenCredentialObserver &aObserver);	//codescannerwarnings
       
   798 	    IMPORT_C TInt RemoveCredentialObserver(MSenCredentialObserver &aObserver);
       
   799 
       
   800         /**
       
   801         * C++ default constructor.
       
   802         */
       
   803         IMPORT_C RSenCredentialPtr();
       
   804 
       
   805     private: // Data
       
   806         CSenCredentialData* ipCredentialData;
       
   807 	};
       
   808 
       
   809 #endif // SEN_INTERNAL_CREDENTIAL2_H
       
   810 
       
   811 // End of File
       
   812 
       
   813