webservices/wsidentitymanager/inc/msenidentitymanager.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     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: Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef M_SEN_IDENTITY_MANAGER_H
       
    26 #define M_SEN_IDENTITY_MANAGER_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <e32base.h>
       
    30 #include <e32des8.h>    // HBufC8
       
    31 #include <badesca.h>    // CDesC8Array
       
    32 
       
    33 #include <SenIdentityProvider.h>
       
    34 #include <MSenServiceDescription.h>
       
    35 
       
    36 #include "msenidentity.h" 
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class CSenSecurityMechanism;
       
    40 
       
    41 /**
       
    42 * An MSenIdentityManager knows about  the various Identitities
       
    43 * of the user(s) of the system. Components use this interface
       
    44 * to register identities and query for identities in various
       
    45 * situations.
       
    46 *
       
    47 * An Identity can contain all kinds of information and is not
       
    48 * further specified here. For maximum flexibility an identity
       
    49 * is modelled as an XML Element that can have arbitrary children
       
    50 * elements.
       
    51 *
       
    52 * The IdentityManager can have a rather complex list of Identities,
       
    53 * the Identity that it returns is based upon:
       
    54 * - the currently active user identity (set)
       
    55 * - a URL (Endpoint) or ProviderID given in the request
       
    56 *
       
    57 * An IdentityManager can return a full Identity (which can contain a
       
    58 * lot of information); but also offer methods to only return an
       
    59 * IdentityProvider that can be used to obtain access to a particular service.
       
    60 */
       
    61 class MSenIdentityManager
       
    62     {
       
    63     public: // New functions
       
    64 
       
    65         /**
       
    66         * This method is not intended for the developer API and is for internal
       
    67         * use only. It may be exposed the developers of
       
    68         * ServiceInvocationFrameworks.
       
    69         * @return the currently active default identity.
       
    70         */
       
    71         virtual MSenIdentity& IdentityL() = 0;
       
    72 
       
    73         /**
       
    74         * This method is not intended for the developer API and is for internal
       
    75         * use only. It may be exposed the developers of
       
    76         * ServiceInvocationFrameworks.
       
    77         * @param the (System) userName of the currently active user.
       
    78         * @return KErrNone if no error, or some of the system wide error codes
       
    79         */
       
    80         virtual TInt UserNameL(HBufC8*& aUserName) = 0;
       
    81 
       
    82         /**
       
    83         * This method is not intended for the developer API and is for internal
       
    84         * use only. It may be exposed the developers of
       
    85         * ServiceInvocationFrameworks.
       
    86         * @return the default IdentityProvider of the currently active Identity
       
    87         *         or NULL if not found(!)
       
    88         */
       
    89         virtual CSenIdentityProvider* IdentityProviderL() = 0;
       
    90 
       
    91         /**
       
    92         * This method is not intended for the developer API and is for internal
       
    93         * use only. It may be exposed the developers of
       
    94         * ServiceInvocationFrameworks.
       
    95         * @param aServiceDescription
       
    96         * @return the IdentityProvider of the currently active
       
    97         * Identity that has the ServiceID that best mathces the
       
    98         * endpoint or providerID of the given ServiceDescription.
       
    99         */
       
   100         virtual CSenIdentityProvider* IdentityProviderL(
       
   101                             MSenServiceDescription& aServiceDescription ) = 0;
       
   102 
       
   103         /**
       
   104         * This method is not intended for the developer API and is for internal
       
   105         * use only. It may be exposed the developers of
       
   106         * ServiceInvocationFrameworks.
       
   107         * @param aURI
       
   108         * @return the IdentityProvider of the currently active
       
   109         * Identity that has the ServiceID that best mathces the
       
   110         * given URI or NULL if not found(!).
       
   111         */
       
   112         virtual CSenIdentityProvider* IdentityProviderL( const TDesC8& aURI ) = 0;
       
   113 
       
   114         /**
       
   115         * This method is not intended for the developer API and is for internal
       
   116         * use only. It may be exposed the developers of
       
   117         * ServiceInvocationFrameworks.
       
   118         * @param aIdpList an array of ProviderIDs
       
   119         * @param aStrict if set to true only an IdentityProvider from the List
       
   120         * will be returned, and null if none of the list entries is known to
       
   121         * the current active Identity.
       
   122         * @return the currently preferred IdentityProvider
       
   123         * from within the given List with ProviderIDs.
       
   124         */
       
   125         virtual CSenIdentityProvider* IdentityProviderL(
       
   126                                                 const CDesC8Array& aIdpList,
       
   127                                                 TBool aStrict) = 0;
       
   128 
       
   129         /**
       
   130         * This method is not intended for the developer API and is for internal
       
   131         * use only. It may be exposed the developers of
       
   132         * ServiceInvocationFrameworks.
       
   133         * @param aServiceDescription
       
   134         * @param aIdpList an array of ProviderIDs
       
   135         * @param aStrict if set to true only an IdentityProvider from the List
       
   136         * will be returned, and null if none of the list entries is known to the
       
   137         * current active Identity.
       
   138         * @return the currently preferred IdentityProvider
       
   139         * from within the given List with ProviderIDs.
       
   140         */
       
   141         virtual CSenIdentityProvider* IdentityProviderL(
       
   142                                 MSenServiceDescription& aServiceDescription,
       
   143                                 const CDesC8Array& aIdpList,
       
   144                                 TBool aStrict) = 0;
       
   145 
       
   146         /**
       
   147         * Register an IdentityProvider for the current active Identity.
       
   148         * @param aIdp a registered IdentityProvider
       
   149         * @return true if succesful.
       
   150         */
       
   151         virtual TInt RegisterIdentityProviderL( CSenIdentityProvider* aIdp ) = 0;
       
   152 
       
   153         /**
       
   154         * Unregister an IdentityProvider for the current active Identity.
       
   155         * @param aIdp an unregistered IdentityProvider
       
   156         * @return true if succesful.
       
   157         */
       
   158         virtual TInt UnregisterIdentityProviderL( CSenIdentityProvider& aIdp) = 0;
       
   159 
       
   160         /**
       
   161         * Associate a service to an IdentityProvider.
       
   162         * @param aServiceID the contract or endpoint of a service
       
   163         * @param aProviderID the id of an IdentityProvider
       
   164         * @return true if successful. Failure may be caused by non-existence
       
   165         * of the IdentityProvider for the current user.
       
   166         */
       
   167         virtual TBool AssociateServiceL(const TDesC8& aServiceID,
       
   168                                         const TDesC8& providerID ) = 0;
       
   169 
       
   170         /**
       
   171         * Dissociate a service from an IdentityProvider.
       
   172         * @param aServiceID the contract or endpoint of a service
       
   173         * @param aProviderID the id of an IdentityProvider
       
   174         * @return true if successful. Failure may be caused by non-existence
       
   175         * of the IdentityProvider for the current user.
       
   176         */
       
   177         virtual TBool DissociateServiceL(const TDesC8& aServiceID,
       
   178                                          const TDesC8& aProviderID ) = 0;
       
   179 
       
   180         /**
       
   181         * This method is not intended for the developer API and is for internal
       
   182         * use only. It may be exposed the developers of
       
   183         * ServiceInvocationFrameworks.
       
   184         * Status codes:
       
   185         *   KErrNone                        ok
       
   186         *   KErrNotFound                    no identities
       
   187         *   Other codes are system error codes
       
   188         * @param aIdentitiesList an array where the identities can be inserted
       
   189         * @return status/error code.
       
   190         */
       
   191         virtual TInt IdentitiesL( CDesC8Array& aIdentitiesList ) = 0;
       
   192         
       
   193         virtual TInt AuthenticationForL(CSenIdentityProvider& aAccount, TPckgBuf<TSenAuthentication>& aResponse) = 0;
       
   194         virtual TPtrC8 SenSecurityMechanismNames8L() = 0;
       
   195         virtual CSenSecurityMechanism* MechanismNamedL(const TDesC8& aName) = 0;
       
   196 
       
   197         /**
       
   198         * For encoding and decoding base 64:
       
   199         */
       
   200         virtual HBufC8* EncodeToBase64LC(const TDesC8& aSource) = 0;
       
   201         virtual HBufC8* DecodeFromBase64LC(const TDesC8& aSource) = 0;
       
   202 
       
   203         virtual void SetShowPasswordDialog(const TBool aState) = 0;
       
   204         
       
   205         virtual TInt FindMatchingIdentityProviderL(CSenIdentityProvider &aIdp,
       
   206                                                    CSenIdentityProvider*& apMatch) = 0;
       
   207                                                    
       
   208         virtual TInt UpdateIdentityProviderL(CSenIdentityProvider& aIdp) = 0;
       
   209         virtual const RPointerArray<CSenIdentityProvider>& IdentityProvidersL() = 0;
       
   210     };
       
   211 
       
   212 #endif // M_SEN_IDENTITY_MANAGER_H
       
   213 
       
   214 // End of File