|
1 /* |
|
2 * Copyright (c) 2002 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: Context manager interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MWPCONTEXTMANAGER_H |
|
20 #define MWPCONTEXTMANAGER_H |
|
21 |
|
22 // FORWARD DECLARATIONS |
|
23 class HBufC16; |
|
24 class MDesC16Array; |
|
25 class CDesC16Array; |
|
26 class MWPContextExtension; |
|
27 class MWPContextExtensionArray; |
|
28 class MWPContextObserver; |
|
29 |
|
30 // CONSTANTS |
|
31 const TUint32 KWPMgrUidNoContext = 0xffffffff; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * MWPContextManager declares an interface to be implemented by |
|
37 * context managers. |
|
38 * |
|
39 * @lib ProvisioningEngine |
|
40 * @since 2.0 |
|
41 */ |
|
42 class MWPContextManager |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~MWPContextManager() {}; |
|
49 |
|
50 /** |
|
51 * Called after saving one setting. |
|
52 * @param aExtension Extension interface for the saving adapter |
|
53 * @param aItem Setting number |
|
54 */ |
|
55 virtual void SaveL( MWPContextExtension& aExtension, TInt aItem ) = 0; |
|
56 |
|
57 /** |
|
58 * Creates a context. Leaves with KErrOverflow if the max. number of contexts |
|
59 * has been reached. |
|
60 * @param aName Name of the context |
|
61 * @param aTPS TPS of the context |
|
62 * @param aProxies Proxies that can be used in the context |
|
63 * @return UID of the new context |
|
64 */ |
|
65 virtual TUint32 CreateContextL( const TDesC& aName, const TDesC& aTPS, |
|
66 const MDesC16Array& aProxies ) = 0; |
|
67 |
|
68 /** |
|
69 * Deletes a context. |
|
70 * @param aArray The context extension array |
|
71 * @param aUID UID of the context |
|
72 */ |
|
73 virtual void DeleteContextL( MWPContextExtensionArray& aArray, |
|
74 TUint32 aUid ) = 0; |
|
75 |
|
76 /** |
|
77 * Number of contexts available. |
|
78 * @return Array of context uids. Ownership is transferred. |
|
79 */ |
|
80 virtual CArrayFix<TUint32>* ContextUidsL() = 0; |
|
81 |
|
82 /** |
|
83 * Name of a context. |
|
84 * @param aUid UID of the context. |
|
85 * @return Context name. Ownership is transferred. |
|
86 */ |
|
87 virtual HBufC16* ContextNameL( TUint32 aUid ) = 0; |
|
88 |
|
89 /** |
|
90 * TPS of a context. |
|
91 * @param aUid UID of the context. |
|
92 * @return TPS. Ownership is transferred. |
|
93 */ |
|
94 virtual HBufC16* ContextTPSL( TUint32 aUid ) = 0; |
|
95 |
|
96 /** |
|
97 * Trusted proxies of a context. |
|
98 * @param aUid UID of the context. |
|
99 * @return Array of proxies. Ownership is transferred. |
|
100 */ |
|
101 virtual CDesC16Array* ContextProxiesL( TUint32 aUid ) = 0; |
|
102 |
|
103 /** |
|
104 * Deletes a context data item. |
|
105 * @param aArray The context extension array |
|
106 * @param aUid UID of the context. |
|
107 * @return ETrue if there is more data in the context |
|
108 */ |
|
109 virtual TBool DeleteContextDataL( MWPContextExtensionArray& aArray, TUint32 aUid ) = 0; |
|
110 |
|
111 /** |
|
112 * Returns the number of context data items. Note that this |
|
113 * count is an approximate and should not be relied on except |
|
114 * for giving user progress feedback. |
|
115 * @param aUid UID of the context |
|
116 * @return The number of context data items |
|
117 */ |
|
118 virtual TInt ContextDataCountL( TUint32 aUid ) = 0; |
|
119 |
|
120 /** |
|
121 * Returns the current context. |
|
122 * @return Current context UID |
|
123 */ |
|
124 virtual TUint32 CurrentContextL() = 0; |
|
125 |
|
126 /** |
|
127 * Sets the current context. |
|
128 * @param aUID The UID of the context |
|
129 */ |
|
130 virtual void SetCurrentContextL( TUint32 aUid ) = 0; |
|
131 |
|
132 /** |
|
133 * Returns a specific context. |
|
134 * @param aTPS TPS whose context should be looked for |
|
135 * @return The UID of the context |
|
136 */ |
|
137 virtual TUint32 ContextL( const TDesC& aTPS ) = 0; |
|
138 |
|
139 /** |
|
140 * Checks if a context exists. |
|
141 * @param aUid The UID of the context |
|
142 * @return ETrue if context exists |
|
143 */ |
|
144 virtual TBool ContextExistsL( TUint32 aUid ) = 0; |
|
145 |
|
146 /** |
|
147 * Checks if a context exists. |
|
148 * @param aTPS The TPS of the context |
|
149 * @return ETrue if context exists |
|
150 */ |
|
151 virtual TBool ContextExistsL( const TDesC& aTPS ) = 0; |
|
152 |
|
153 /** |
|
154 * Register an observer to context information. |
|
155 * @param aObserver The new observer |
|
156 */ |
|
157 virtual void RegisterContextObserverL( |
|
158 MWPContextObserver* aObserver ) = 0; |
|
159 |
|
160 /** |
|
161 * Unregister an observer to context information. |
|
162 * @param aObserver The observer to unregister |
|
163 * @return KErrNone, or an error code |
|
164 */ |
|
165 virtual TInt UnregisterContextObserver( |
|
166 MWPContextObserver* aObserver ) = 0; |
|
167 }; |
|
168 |
|
169 #endif /* MWPCONTEXTMANAGER_H */ |