2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This abstract class defines provider policy interface.
25 #ifndef M_SEN_PROVIDER_POLICY_H
26 #define M_SEN_PROVIDER_POLICY_H
29 #include <e32base.h> // for CActive
31 #include <SenDomFragment.h>
33 // FORWARD DECLARATIONS
34 class CSenIdentityProviderIdArray8;
39 * This abstract class defines provider policy interface.
40 * The provider policy sets the conditions in which some service provider
41 * is capable to operate in. It is defining context, through which these
42 * (possibly remote) services may be contacted and used.
43 * The actual properties may include transport layer settings, like
44 * predefined Internet Access Point (IAP) ID. In addition, provider policy
45 * may declare, that certain service should only be contacted using certain
46 * identity provider (in ID-WSF). This can be achieved by mapping certain
47 * list of IDP IDs to a provider policy.
48 * Provider Policies are WSF wide settings, which are stored in WSF
49 * databases, and thus they are shared with all the actual Web Service
50 * Consumers (WSCs) accessing same services.
52 * Example structure of ProviderPolicy XML fragment:
60 * <IdentityProviderIDs strict="true">
61 * <IdentityProviderID>
62 * urn:first.id.example.com
63 * </IdentityProviderID>
64 * <IdentityProviderID>
65 * urn:second.id.example.com
66 * </IdentityProviderID>
67 * </IdentityProviderIDs>
69 * @lib SenServDesc.lib
72 class MSenProviderPolicy
74 public: // New functions
76 * Setter for Internet Access Point (IAP) ID.
77 * Method is used to define default access point
78 * to avoid IAP selection dialog prompt.
80 * @param aIapId is the ID found from CommDB.
82 virtual void SetIapIdL(TUint32 aIapId) = 0;
87 * @param aCurrentIapId will contain the current
88 * Internet Access Point ID
90 * - KErrNone if <IapId> element is found and has valid content
91 * - KErrNotFound if no <IapId> element has been found or it has
93 * - TLex error codes, if <IapId> element has non-numeric value,
94 * which cannot be resolved
96 virtual TInt IapId(TUint32& aCurrentIapId) = 0;
99 * Setter for IdentityProvider IDs. Overrides
100 * current values with the given values from the array.
101 * When initiating a new service connection, this list of
102 * ProviderIDs define, which IdentityProviders are preferred
103 * OR which are strictly acceptable ones.
104 * @since Series60 3.0
105 * @param aList list of IdentityProvider IDs.
107 virtual void SetIdentityProviderIdsL(
108 CSenIdentityProviderIdArray8& aList) = 0;
111 * Adds a new IdentityProviderID value at the end of the current list
113 * @since Series60 3.0
114 * @param aProviderID defines, which IdentityProvider is preferred
115 * OR which is strictly acceptable one, when initiating a new
116 * service connection.
117 * @return KErrAlreadyExists, if a duplicate is tried to add
118 * KErrArgument if a zero-length descriptor is tried to add
119 * (aProviderId.Length() == 0)
121 virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId) = 0;
124 * Method reads provider policy class instance values from given
125 * template. Values may include an IAP ID, preferred IdentityProvider
127 * @since Series60 3.0
128 * @param aTemplate from which the values are read.
129 * @return KErrNone Everything went ok.
130 * KErrAlreadyExists Duplicates were found
131 * KErrArgument Invalid providerIds were found
132 * Other error codes are system-wide Symbian error codes.
134 virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate) = 0;
137 * Getter for IdentityProvider IDs.
138 * @since Series60 3.0
139 * @return a list of IDP arrays if such value(s) have been set
140 * or an empty array if no IDP:s have been specified.
142 virtual const CSenIdentityProviderIdArray8& IdentityProviderIds8L() = 0;
145 * Checks if some policy is accepted by current policy.
146 * @since Series60 3.0
147 * @param aPolicyPattern is the policy being compared
148 * with this instance.
149 * @return ETrue if policy candidate is accepted by current policy
150 * definition, EFalse if not.
152 virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern) = 0;
154 void SetSnapIdL(TUint32 /*aSnapId*/)
157 TInt SnapId(TUint32& /*aCurrentSnapId*/)
163 #endif //M_SEN_PROVIDER_POLICY_H