williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* 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
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: This abstract class defines consumer policy interface.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef M_SEN_CONSUMER_POLICY_H
|
williamr@2
|
26 |
#define M_SEN_CONSUMER_POLICY_H
|
williamr@2
|
27 |
|
williamr@2
|
28 |
// INCLUDES
|
williamr@2
|
29 |
#include <e32base.h> // for CActive
|
williamr@2
|
30 |
#include <badesca.h>
|
williamr@2
|
31 |
#include <SenDomFragment.h>
|
williamr@2
|
32 |
|
williamr@2
|
33 |
// FORWARD DECLARATIONS
|
williamr@2
|
34 |
class CSenIdentityProviderIdArray8;
|
williamr@2
|
35 |
|
williamr@2
|
36 |
// CLASS DECLARATION
|
williamr@2
|
37 |
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
* This abstract class defines consumer policy interface.
|
williamr@2
|
40 |
* The consumer policy sets the conditions in which some service provider
|
williamr@2
|
41 |
* is capable to operate in. It is defining context, through which these
|
williamr@2
|
42 |
* (possibly remote) services may be contacted and used.
|
williamr@2
|
43 |
* The actual properties may include transport layer settings, like
|
williamr@2
|
44 |
* predefined Internet Access Point (IAP) ID. In addition, consumer policy
|
williamr@2
|
45 |
* may declare, that certain service should only be contacted using certain
|
williamr@2
|
46 |
* identity provider (in ID-WSF). This can be achieved by mapping certain
|
williamr@2
|
47 |
* list of IDP IDs to a consumer policy.
|
williamr@2
|
48 |
* A consumer policy is effective only for a single session, and thus it
|
williamr@2
|
49 |
* applies to one service connection only. This means, that this policy
|
williamr@2
|
50 |
* information is "private", and not shared between different WSC applications
|
williamr@2
|
51 |
* using WSF, event though they might be using the same (remote) service at the
|
williamr@2
|
52 |
* same time. Consumer policy properties are not serialized in any WSF
|
williamr@2
|
53 |
* database, but resides in memory only.
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* Example structure of ConsumerPolicy XML fragment:
|
williamr@2
|
56 |
*
|
williamr@2
|
57 |
* <ConsumerPolicy>
|
williamr@2
|
58 |
* <Transport>
|
williamr@2
|
59 |
* <IapId>
|
williamr@2
|
60 |
* 2
|
williamr@2
|
61 |
* </IapId>
|
williamr@2
|
62 |
* </Transport>
|
williamr@2
|
63 |
* <IdentityProviderIDs strict="false">
|
williamr@2
|
64 |
* <IdentityProviderID>
|
williamr@2
|
65 |
* urn:first.example.idp.com
|
williamr@2
|
66 |
* </IdentityProviderID>
|
williamr@2
|
67 |
* <IdentityProviderID>
|
williamr@2
|
68 |
* urn:second.example.idp.com
|
williamr@2
|
69 |
* </IdentityProviderID>
|
williamr@2
|
70 |
* </IdentityProviderIDs>
|
williamr@2
|
71 |
* </ConsumerPolicy>
|
williamr@2
|
72 |
*
|
williamr@2
|
73 |
* @lib SenServDesc.lib
|
williamr@2
|
74 |
* @since Series60 3.0
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
class MSenConsumerPolicy
|
williamr@2
|
77 |
{
|
williamr@2
|
78 |
public: // New functions
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/**
|
williamr@2
|
81 |
* Setter for Internet Access Point (IAP) ID existing in CommDB.
|
williamr@2
|
82 |
* @since Series60 3.0
|
williamr@2
|
83 |
* @param aIapId IAP ID
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
virtual void SetConsumerIapIdL(TUint32 aIapId) = 0;
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/**
|
williamr@2
|
88 |
* Getter for IAP ID.
|
williamr@2
|
89 |
* @since Series60 3.0
|
williamr@2
|
90 |
* @param aCurrentIapId will contain the current
|
williamr@2
|
91 |
* Internet Access Point ID
|
williamr@2
|
92 |
* @return
|
williamr@2
|
93 |
* - KErrNone if <IapId> element is found and has valid content
|
williamr@2
|
94 |
* - KErrNotFound if no <IapId> element has been found or it has
|
williamr@2
|
95 |
* no content
|
williamr@2
|
96 |
* - TLex error codes, if <IapId> element has non-numeric value,
|
williamr@2
|
97 |
* which cannot be resolved
|
williamr@2
|
98 |
*/
|
williamr@2
|
99 |
virtual TInt ConsumerIapId(TUint32& aCurrentIapId) = 0;
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* Setter for consumer identity provider IDs. Overrides current values
|
williamr@2
|
103 |
* with the given values from the array. If an ID does not exist, it
|
williamr@2
|
104 |
* will be added.
|
williamr@2
|
105 |
* @since Series60 3.0
|
williamr@2
|
106 |
* @param aList list of identity provider IDs.
|
williamr@2
|
107 |
*/
|
williamr@2
|
108 |
virtual void SetConsumerIdentityProviderIdsL(
|
williamr@2
|
109 |
CSenIdentityProviderIdArray8& aList) = 0;
|
williamr@2
|
110 |
|
williamr@2
|
111 |
/**
|
williamr@2
|
112 |
* Adds a new Identity provider ID value at the end of the current list
|
williamr@2
|
113 |
* values.
|
williamr@2
|
114 |
* @since Series60 3.0
|
williamr@2
|
115 |
* @param aProviderId unique ProviderID as UTF-8 descriptor
|
williamr@2
|
116 |
* @return KErrAlreadyExists, if a duplicate is tried to add
|
williamr@2
|
117 |
* KErrArgument if a zero-length descriptor is tried to add
|
williamr@2
|
118 |
* (aProviderId.Length() == 0)
|
williamr@2
|
119 |
*/
|
williamr@2
|
120 |
virtual TInt AddConsumerIdentityProviderIdL(const TDesC8& aProviderId) = 0;
|
williamr@2
|
121 |
|
williamr@2
|
122 |
/**
|
williamr@2
|
123 |
* Rebuilds the consumer policy of this service pattern from the given
|
williamr@2
|
124 |
* consumer policy.
|
williamr@2
|
125 |
* @since Series60 3.0
|
williamr@2
|
126 |
* @param aTemplate the consumer policy to rebuild from.
|
williamr@2
|
127 |
* @return KErrNone or other system-wide Symbian error codes.
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
virtual TInt RebuildFromConsumerPolicy(MSenConsumerPolicy& aTemplate) = 0;
|
williamr@2
|
130 |
|
williamr@2
|
131 |
/**
|
williamr@2
|
132 |
* Getter for Identity provider IDs.
|
williamr@2
|
133 |
* @since Series60 3.0
|
williamr@2
|
134 |
* @return a list of IDP arrays if such value(s) have been set
|
williamr@2
|
135 |
* or an empty array if no IDP:s have been specified.
|
williamr@2
|
136 |
*/
|
williamr@2
|
137 |
virtual const CSenIdentityProviderIdArray8&
|
williamr@2
|
138 |
ConsumerIdentityProviderIds8L() = 0;
|
williamr@2
|
139 |
|
williamr@2
|
140 |
/**
|
williamr@2
|
141 |
* Checks if the policy of this service pattern accepts given policy.
|
williamr@2
|
142 |
* @since Series60 3.0
|
williamr@2
|
143 |
* @param aPolicyPattern the consumer policy to check.
|
williamr@2
|
144 |
* @return ETrue if accepts, EFalse if not
|
williamr@2
|
145 |
*/
|
williamr@2
|
146 |
virtual TBool AcceptsConsumerPolicy(MSenConsumerPolicy& aPolicyPattern) = 0;
|
williamr@2
|
147 |
};
|
williamr@2
|
148 |
|
williamr@2
|
149 |
#endif //M_SEN_CONSUMER_POLICY_H
|
williamr@2
|
150 |
|
williamr@2
|
151 |
// End of File
|
williamr@2
|
152 |
|
williamr@2
|
153 |
|