williamr@2: /* williamr@2: * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: This abstract class defines provider policy interface. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: #ifndef M_SEN_PROVIDER_POLICY_H williamr@2: #define M_SEN_PROVIDER_POLICY_H williamr@2: williamr@2: // INCLUDES williamr@2: #include // for CActive williamr@2: #include williamr@2: #include williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CSenIdentityProviderIdArray8; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * This abstract class defines provider policy interface. williamr@2: * The provider policy sets the conditions in which some service provider williamr@2: * is capable to operate in. It is defining context, through which these williamr@2: * (possibly remote) services may be contacted and used. williamr@2: * The actual properties may include transport layer settings, like williamr@2: * predefined Internet Access Point (IAP) ID. In addition, provider policy williamr@2: * may declare, that certain service should only be contacted using certain williamr@2: * identity provider (in ID-WSF). This can be achieved by mapping certain williamr@2: * list of IDP IDs to a provider policy. williamr@2: * Provider Policies are WSF wide settings, which are stored in WSF williamr@2: * databases, and thus they are shared with all the actual Web Service williamr@2: * Consumers (WSCs) accessing same services. williamr@2: * williamr@2: * Example structure of ProviderPolicy XML fragment: williamr@2: * williamr@2: * williamr@2: * williamr@2: * williamr@2: * 1 williamr@2: * williamr@2: * williamr@2: * williamr@2: * williamr@2: * urn:first.id.example.com williamr@2: * williamr@2: * williamr@2: * urn:second.id.example.com williamr@2: * williamr@2: * williamr@2: * williamr@2: * @lib SenServDesc.lib williamr@2: * @since Series60 3.0 williamr@2: */ williamr@2: class MSenProviderPolicy williamr@2: { williamr@2: public: // New functions williamr@2: /** williamr@2: * Setter for Internet Access Point (IAP) ID. williamr@2: * Method is used to define default access point williamr@2: * to avoid IAP selection dialog prompt. williamr@2: * @since Series60 3.0 williamr@2: * @param aIapId is the ID found from CommDB. williamr@2: */ williamr@2: virtual void SetIapIdL(TUint32 aIapId) = 0; williamr@2: williamr@2: /** williamr@2: * Getter for IAP ID williamr@2: * @since Series60 3.0 williamr@2: * @param aCurrentIapId will contain the current williamr@2: * Internet Access Point ID williamr@2: * @return williamr@2: * - KErrNone if element is found and has valid content williamr@2: * - KErrNotFound if no element has been found or it has williamr@2: * no content williamr@2: * - TLex error codes, if element has non-numeric value, williamr@2: * which cannot be resolved williamr@2: */ williamr@2: virtual TInt IapId(TUint32& aCurrentIapId) = 0; williamr@2: williamr@2: /** williamr@2: * Setter for IdentityProvider IDs. Overrides williamr@2: * current values with the given values from the array. williamr@2: * When initiating a new service connection, this list of williamr@2: * ProviderIDs define, which IdentityProviders are preferred williamr@2: * OR which are strictly acceptable ones. williamr@2: * @since Series60 3.0 williamr@2: * @param aList list of IdentityProvider IDs. williamr@2: */ williamr@2: virtual void SetIdentityProviderIdsL( williamr@2: CSenIdentityProviderIdArray8& aList) = 0; williamr@2: williamr@2: /** williamr@2: * Adds a new IdentityProviderID value at the end of the current list williamr@2: * values. williamr@2: * @since Series60 3.0 williamr@2: * @param aProviderID defines, which IdentityProvider is preferred williamr@2: * OR which is strictly acceptable one, when initiating a new williamr@2: * service connection. williamr@2: * @return KErrAlreadyExists, if a duplicate is tried to add williamr@2: * KErrArgument if a zero-length descriptor is tried to add williamr@2: * (aProviderId.Length() == 0) williamr@2: */ williamr@2: virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId) = 0; williamr@2: williamr@2: /** williamr@2: * Method reads provider policy class instance values from given williamr@2: * template. Values may include an IAP ID, preferred IdentityProvider williamr@2: * IDs etc. williamr@2: * @since Series60 3.0 williamr@2: * @param aTemplate from which the values are read. williamr@2: * @return KErrNone Everything went ok. williamr@2: * KErrAlreadyExists Duplicates were found williamr@2: * KErrArgument Invalid providerIds were found williamr@2: * Other error codes are system-wide Symbian error codes. williamr@2: */ williamr@2: virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate) = 0; williamr@2: williamr@2: /** williamr@2: * Getter for IdentityProvider IDs. williamr@2: * @since Series60 3.0 williamr@2: * @return a list of IDP arrays if such value(s) have been set williamr@2: * or an empty array if no IDP:s have been specified. williamr@2: */ williamr@2: virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0; williamr@2: williamr@2: /** williamr@2: * Checks if some policy is accepted by current policy. williamr@2: * @since Series60 3.0 williamr@2: * @param aPolicyPattern is the policy being compared williamr@2: * with this instance. williamr@2: * @return ETrue if policy candidate is accepted by current policy williamr@2: * definition, EFalse if not. williamr@2: */ williamr@2: virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern) = 0; williamr@2: williamr@2: void SetSnapIdL(TUint32 /*aSnapId*/) williamr@2: { williamr@2: } williamr@2: TInt SnapId(TUint32& /*aCurrentSnapId*/) williamr@2: { williamr@2: return KErrNotFound; williamr@2: } williamr@2: }; williamr@2: williamr@2: #endif //M_SEN_PROVIDER_POLICY_H williamr@2: williamr@2: // End of File