1.1 --- a/epoc32/include/mw/msenproviderpolicy.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/msenproviderpolicy.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,165 @@
1.4 -msenproviderpolicy.h
1.5 +/*
1.6 +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: This abstract class defines provider policy interface.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +#ifndef M_SEN_PROVIDER_POLICY_H
1.30 +#define M_SEN_PROVIDER_POLICY_H
1.31 +
1.32 +// INCLUDES
1.33 +#include <e32base.h> // for CActive
1.34 +#include <badesca.h>
1.35 +#include <SenDomFragment.h>
1.36 +
1.37 +// FORWARD DECLARATIONS
1.38 +class CSenIdentityProviderIdArray8;
1.39 +
1.40 +// CLASS DECLARATION
1.41 +
1.42 +/**
1.43 +* This abstract class defines provider policy interface.
1.44 +* The provider policy sets the conditions in which some service provider
1.45 +* is capable to operate in. It is defining context, through which these
1.46 +* (possibly remote) services may be contacted and used.
1.47 +* The actual properties may include transport layer settings, like
1.48 +* predefined Internet Access Point (IAP) ID. In addition, provider policy
1.49 +* may declare, that certain service should only be contacted using certain
1.50 +* identity provider (in ID-WSF). This can be achieved by mapping certain
1.51 +* list of IDP IDs to a provider policy.
1.52 +* Provider Policies are WSF wide settings, which are stored in WSF
1.53 +* databases, and thus they are shared with all the actual Web Service
1.54 +* Consumers (WSCs) accessing same services.
1.55 +*
1.56 +* Example structure of ProviderPolicy XML fragment:
1.57 +*
1.58 +* <ProviderPolicy>
1.59 +* <Transport>
1.60 +* <IapId>
1.61 +* 1
1.62 +* </IapId>
1.63 +* </Transport>
1.64 +* <IdentityProviderIDs strict="true">
1.65 +* <IdentityProviderID>
1.66 +* urn:first.id.example.com
1.67 +* </IdentityProviderID>
1.68 +* <IdentityProviderID>
1.69 +* urn:second.id.example.com
1.70 +* </IdentityProviderID>
1.71 +* </IdentityProviderIDs>
1.72 +* </ProviderPolicy>
1.73 +* @lib SenServDesc.lib
1.74 +* @since Series60 3.0
1.75 +*/
1.76 +class MSenProviderPolicy
1.77 + {
1.78 + public: // New functions
1.79 + /**
1.80 + * Setter for Internet Access Point (IAP) ID.
1.81 + * Method is used to define default access point
1.82 + * to avoid IAP selection dialog prompt.
1.83 + * @since Series60 3.0
1.84 + * @param aIapId is the ID found from CommDB.
1.85 + */
1.86 + virtual void SetIapIdL(TUint32 aIapId) = 0;
1.87 +
1.88 + /**
1.89 + * Getter for IAP ID
1.90 + * @since Series60 3.0
1.91 + * @param aCurrentIapId will contain the current
1.92 + * Internet Access Point ID
1.93 + * @return
1.94 + * - KErrNone if <IapId> element is found and has valid content
1.95 + * - KErrNotFound if no <IapId> element has been found or it has
1.96 + * no content
1.97 + * - TLex error codes, if <IapId> element has non-numeric value,
1.98 + * which cannot be resolved
1.99 + */
1.100 + virtual TInt IapId(TUint32& aCurrentIapId) = 0;
1.101 +
1.102 + /**
1.103 + * Setter for IdentityProvider IDs. Overrides
1.104 + * current values with the given values from the array.
1.105 + * When initiating a new service connection, this list of
1.106 + * ProviderIDs define, which IdentityProviders are preferred
1.107 + * OR which are strictly acceptable ones.
1.108 + * @since Series60 3.0
1.109 + * @param aList list of IdentityProvider IDs.
1.110 + */
1.111 + virtual void SetIdentityProviderIdsL(
1.112 + CSenIdentityProviderIdArray8& aList) = 0;
1.113 +
1.114 + /**
1.115 + * Adds a new IdentityProviderID value at the end of the current list
1.116 + * values.
1.117 + * @since Series60 3.0
1.118 + * @param aProviderID defines, which IdentityProvider is preferred
1.119 + * OR which is strictly acceptable one, when initiating a new
1.120 + * service connection.
1.121 + * @return KErrAlreadyExists, if a duplicate is tried to add
1.122 + * KErrArgument if a zero-length descriptor is tried to add
1.123 + * (aProviderId.Length() == 0)
1.124 + */
1.125 + virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId) = 0;
1.126 +
1.127 + /**
1.128 + * Method reads provider policy class instance values from given
1.129 + * template. Values may include an IAP ID, preferred IdentityProvider
1.130 + * IDs etc.
1.131 + * @since Series60 3.0
1.132 + * @param aTemplate from which the values are read.
1.133 + * @return KErrNone Everything went ok.
1.134 + * KErrAlreadyExists Duplicates were found
1.135 + * KErrArgument Invalid providerIds were found
1.136 + * Other error codes are system-wide Symbian error codes.
1.137 + */
1.138 + virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate) = 0;
1.139 +
1.140 + /**
1.141 + * Getter for IdentityProvider IDs.
1.142 + * @since Series60 3.0
1.143 + * @return a list of IDP arrays if such value(s) have been set
1.144 + * or an empty array if no IDP:s have been specified.
1.145 + */
1.146 + virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0;
1.147 +
1.148 + /**
1.149 + * Checks if some policy is accepted by current policy.
1.150 + * @since Series60 3.0
1.151 + * @param aPolicyPattern is the policy being compared
1.152 + * with this instance.
1.153 + * @return ETrue if policy candidate is accepted by current policy
1.154 + * definition, EFalse if not.
1.155 + */
1.156 + virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern) = 0;
1.157 +
1.158 + void SetSnapIdL(TUint32 /*aSnapId*/)
1.159 + {
1.160 + }
1.161 + TInt SnapId(TUint32& /*aCurrentSnapId*/)
1.162 + {
1.163 + return KErrNotFound;
1.164 + }
1.165 + };
1.166 +
1.167 +#endif //M_SEN_PROVIDER_POLICY_H
1.168 +
1.169 +// End of File
1.170 \ No newline at end of file