|
1 /* |
|
2 * Copyright (c) 2006-2008 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_CFEXTENDEDCONTEXTINTERFACE_H |
|
20 #define M_CFEXTENDEDCONTEXTINTERFACE_H |
|
21 |
|
22 #include <cfcontextinterface.h> |
|
23 #include <f32file.h> |
|
24 |
|
25 /** |
|
26 * Extended context interface |
|
27 * |
|
28 * @since S60 5.0 |
|
29 * @lib None- |
|
30 */ |
|
31 class MCFExtendedContextInterface : public MCFContextInterface |
|
32 { |
|
33 public: // New functions |
|
34 |
|
35 /** |
|
36 * Gets the read security policy of particular context. |
|
37 * |
|
38 * @param aContextSource Context Source. |
|
39 * @param aContextType Context Type. |
|
40 * @param aPolicy security policy which will be set by this method. |
|
41 * @return KErrNone if context definition found, KErrNotFound if not. |
|
42 */ |
|
43 virtual TInt GetReadSecurityPolicy( const TDesC& aContextSource, |
|
44 const TDesC& aContextType, |
|
45 TSecurityPolicy& aPolicy ) = 0; |
|
46 |
|
47 |
|
48 /** |
|
49 * Gets the write security policy of particular context. |
|
50 * |
|
51 * @param aContextSource Context Source. |
|
52 * @param aContextType Context Type. |
|
53 * @param aPolicy security policy which will be set by this method. |
|
54 * @return KErrNone if context definition found, KErrNotFound if not. |
|
55 */ |
|
56 virtual TInt GetWriteSecurityPolicy( const TDesC& aContextSource, |
|
57 const TDesC& aContextType, |
|
58 TSecurityPolicy& aPolicy ) = 0; |
|
59 |
|
60 |
|
61 /** |
|
62 * Defines a new context in Context Framework. |
|
63 * Every context needs to be defined before it can be published, |
|
64 * subscribed or requested. |
|
65 * |
|
66 * Security policy for reading and writing are different. |
|
67 * |
|
68 * If some client subscribes for this context, the contex owner |
|
69 * will be notified through MCFContextSource interface. |
|
70 * |
|
71 * @since S60 5.0 |
|
72 * @param aContextSource Source of the context. |
|
73 * @param aContextType Type of the context. |
|
74 * @param aReadWritePolicy Needed capabilities for reading and writing |
|
75 * of the context. |
|
76 * @param aPublisher Publisher listening subscibers/nosubscribers |
|
77 * messages. Can be also NULL. |
|
78 * @param aPublisherUid UID of the publisher process |
|
79 * @return Possible return values: |
|
80 * - KErrNone, no errors, also if context exists but the same |
|
81 * publisher (same publisherUID) redefines it. |
|
82 * - KErrAlreadyExists, defined context already exists. |
|
83 */ |
|
84 virtual TInt DefineContext( const TDesC& aContextSource, |
|
85 const TDesC& aContextType, |
|
86 const TSecurityPolicy& aReadPolicy, |
|
87 const TSecurityPolicy& aWritePolicy, |
|
88 MCFContextSource* aPublisher, const TUid& aPublisherUid ) = 0; |
|
89 |
|
90 /** |
|
91 * Remove all subscriptions for the particular listener. |
|
92 * |
|
93 * @since S60 5.0 |
|
94 * @param aObserver Listener whose subscriptions will be removed. |
|
95 * @return None |
|
96 */ |
|
97 virtual void DeregisterPublisher( |
|
98 MCFContextSource& aPublisher ) = 0; |
|
99 |
|
100 /** |
|
101 * Installs a context source setting. |
|
102 * Setting is stored if install succeeds. |
|
103 * |
|
104 * @since S60 5.0 |
|
105 * @param aSettingFile Open file handle to the setting. |
|
106 * @param aContextSourceUid Implementation UID of the context source to |
|
107 * receive setting. |
|
108 * @param aClientThread Client thread making the request. |
|
109 * @return Possible return values: |
|
110 * - KErrNone, no errors. |
|
111 * - KErrNotSupported, context source does not support the settings. |
|
112 * - KErrBadHandle, context source not found/loaded. |
|
113 * - KErrPermissionDenied, client has insufficient capabilities to |
|
114 * install the settings to the context source. |
|
115 * - KErrExtensionNotSupported, context source does not support |
|
116 * installing settings. |
|
117 * - Otherwise system-wide error code. |
|
118 */ |
|
119 virtual TInt InstallContextSourceSetting( RFile& aSettingFile, |
|
120 const TUid& aContextSourceUid, |
|
121 RThread& aClientThread ) = 0; |
|
122 |
|
123 /** |
|
124 * Uninstalls a context source setting. |
|
125 * Setting is removed if uninstall succeeds. |
|
126 * |
|
127 * @since S60 5.0 |
|
128 * @param aSettingFilename Filename (without path) that was used to |
|
129 * install the setting. |
|
130 * @param aContextSourceUid Implementation UID of the context source. |
|
131 * @param aClientThread Client thread making the request. |
|
132 * @return Possible return values: |
|
133 * - KErrNone, no errors. |
|
134 * - KErrNotFound, specified setting file not found. |
|
135 * - KErrBadHandle, context source not found/loaded. |
|
136 * - KErrPathNotFound, specified context source does not have any |
|
137 * settings. |
|
138 * - KErrExtensionNotSupported, context source does not support |
|
139 * uninstalling settings. |
|
140 * - Otherwise system-wide error code. |
|
141 */ |
|
142 virtual TInt UninstallContextSourceSetting( |
|
143 const TDesC& aSettingFilename, |
|
144 const TUid& aContextSourceUid, |
|
145 RThread& aClientThread ) = 0; |
|
146 |
|
147 /** |
|
148 * Uninstalls context source settings registered by a client. |
|
149 * Uninstalls all settings ever registered by the client for the context |
|
150 * source. Settings are removed if uninstall succeeds. |
|
151 * |
|
152 * @since S60 5.0 |
|
153 * @param aContextSourceUid Implementation UID of the context source. |
|
154 * @param aClientThread Client thread making the request. |
|
155 * @return Possible return values: |
|
156 * - KErrNone, no errors. |
|
157 * - KErrNotFound, specified client has not installed any setting files. |
|
158 * - KErrBadHandle, context source not found/loaded. |
|
159 * - KErrPathNotFound, specified context source does not have any |
|
160 * settings. |
|
161 * - KErrExtensionNotSupported, context source does not support |
|
162 * uninstalling settings. |
|
163 * - Otherwise system-wide error code. |
|
164 */ |
|
165 virtual TInt UninstallContextSourceSettings( |
|
166 const TUid& aContextSourceUid, |
|
167 RThread& aClientThread ) = 0; |
|
168 |
|
169 /** |
|
170 * Publishes a new value of a context into Context Framework. |
|
171 * Subscribed clients will be notified of the change. |
|
172 * Context can be auto-defined if it has not been defined before. |
|
173 * |
|
174 * @since S60 5.0 |
|
175 * @param aContext Context object to be added. |
|
176 * @param aAutoDefine Automatically define context. |
|
177 * @return Possible return values: |
|
178 * - KErrNone, no errors |
|
179 * - KErrAccessDenied, insufficient capabilities for the context |
|
180 * - KErrArgument if context source, type and value not defined |
|
181 */ |
|
182 virtual TInt PublishContextFromAction( CCFContextObject& aContext, |
|
183 TBool aAutoDefine ) = 0; |
|
184 |
|
185 protected: |
|
186 |
|
187 // Deny destruction through this class |
|
188 virtual ~MCFExtendedContextInterface(){}; |
|
189 |
|
190 }; |
|
191 |
|
192 #endif |