williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __EIKNOTAPI_H__
|
williamr@2
|
17 |
#define __EIKNOTAPI_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32std.h>
|
williamr@2
|
20 |
#include <e32base.h>
|
williamr@2
|
21 |
#include <f32file.h>
|
williamr@2
|
22 |
|
williamr@4
|
23 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
24 |
#include <uikon/eikscchange.h>
|
williamr@4
|
25 |
#endif
|
williamr@4
|
26 |
|
williamr@2
|
27 |
/** Defines the second Uid value for plug in notifier DLLs.
|
williamr@2
|
28 |
|
williamr@2
|
29 |
@publishedAll
|
williamr@2
|
30 |
@released */
|
williamr@2
|
31 |
const TUid KUidNotifierPlugIn = {0x10005522};
|
williamr@2
|
32 |
const TUid KUidNotifierPlugInV2 = {0x101fdfae};
|
williamr@2
|
33 |
|
williamr@2
|
34 |
/**
|
williamr@2
|
35 |
@publishedAll
|
williamr@2
|
36 |
@released
|
williamr@2
|
37 |
*/
|
williamr@2
|
38 |
enum TEikNotExtStatus
|
williamr@2
|
39 |
{
|
williamr@2
|
40 |
EEikNotExtRequestCompleted = 0,
|
williamr@2
|
41 |
EEikNotExtRequestQueued = 1
|
williamr@2
|
42 |
};
|
williamr@2
|
43 |
|
williamr@2
|
44 |
/** A set of flags that define the capabilities of the notifier.
|
williamr@2
|
45 |
|
williamr@2
|
46 |
Capabilities are returned by calling MEikSrvNotifierBase2::NotifierCapabilites().
|
williamr@2
|
47 |
|
williamr@2
|
48 |
@publishedAll
|
williamr@2
|
49 |
@released */
|
williamr@2
|
50 |
enum TNotifierCapabilities
|
williamr@2
|
51 |
{
|
williamr@2
|
52 |
/** The notifier has no special capabilities. */
|
williamr@2
|
53 |
ENoSpecialCapabilities = 0x00000000,
|
williamr@2
|
54 |
/** The notifier can handle a change to the screen device. */
|
williamr@2
|
55 |
EScreenDeviceChangeSupported = 0x00000001,
|
williamr@2
|
56 |
};
|
williamr@2
|
57 |
|
williamr@2
|
58 |
/**
|
williamr@2
|
59 |
Interface to allow notifiers to manage their own startup/shutdown. This class is likely to be of most
|
williamr@2
|
60 |
interest to notifiers that observe engines using publically available APIs rather than those that are run
|
williamr@2
|
61 |
via RNotifier.
|
williamr@2
|
62 |
|
williamr@2
|
63 |
@publishedAll
|
williamr@2
|
64 |
@released
|
williamr@2
|
65 |
*/
|
williamr@2
|
66 |
class MEikSrvNotifierManager
|
williamr@2
|
67 |
{
|
williamr@2
|
68 |
public:
|
williamr@2
|
69 |
virtual void StartNotifierL(TUid aNotifierUid, const TDesC8& aBuffer, TDes8& aResponse) = 0;
|
williamr@2
|
70 |
virtual void CancelNotifier(TUid aNotifierUid) = 0;
|
williamr@2
|
71 |
virtual void UpdateNotifierL(TUid aNotifierUid, const TDesC8& aBuffer, TDes8& aResponse) = 0;
|
williamr@2
|
72 |
protected:
|
williamr@2
|
73 |
IMPORT_C MEikSrvNotifierManager();
|
williamr@2
|
74 |
private:
|
williamr@2
|
75 |
IMPORT_C virtual void MEikSrvNotifierManager_Reserved1();
|
williamr@2
|
76 |
IMPORT_C virtual void MEikSrvNotifierManager_Reserved2();
|
williamr@2
|
77 |
private:
|
williamr@2
|
78 |
TInt iMEikSrvNotifierManager_Spare1;
|
williamr@2
|
79 |
};
|
williamr@2
|
80 |
|
williamr@2
|
81 |
|
williamr@2
|
82 |
/** Interface to a plug-in server side notifier.
|
williamr@2
|
83 |
|
williamr@2
|
84 |
Any number of MEikSrvNotifierBase2 objects can be included in a single DLL.
|
williamr@2
|
85 |
All notifiers are loaded during device startup and are not destroyed until
|
williamr@2
|
86 |
the Uikon server closes down.
|
williamr@2
|
87 |
|
williamr@2
|
88 |
All notifiers run in the uikon server thread so are able to directly access
|
williamr@2
|
89 |
server side status panes but cannot call any functions on REikAppUiSession.
|
williamr@2
|
90 |
|
williamr@2
|
91 |
@publishedAll
|
williamr@2
|
92 |
@released */
|
williamr@2
|
93 |
class MEikSrvNotifierBase2
|
williamr@2
|
94 |
{
|
williamr@2
|
95 |
public:
|
williamr@2
|
96 |
/** Defines a set of notifier priorities. The use and application of these values
|
williamr@2
|
97 |
is implementation-dependent. */
|
williamr@2
|
98 |
enum TNotifierPriority
|
williamr@2
|
99 |
{
|
williamr@2
|
100 |
/** The highest priority value. */
|
williamr@2
|
101 |
ENotifierPriorityAbsolute = 500,
|
williamr@2
|
102 |
/** The second highest priority value. */
|
williamr@2
|
103 |
ENotifierPriorityVHigh = 400,
|
williamr@2
|
104 |
/** The third highest priority value. */
|
williamr@2
|
105 |
ENotifierPriorityHigh = 300,
|
williamr@2
|
106 |
/** The fourth highest priority value. */
|
williamr@2
|
107 |
ENotifierPriorityLow = 200,
|
williamr@2
|
108 |
/** The fifth highest priority value. */
|
williamr@2
|
109 |
ENotifierPriorityVLow = 100,
|
williamr@2
|
110 |
/** The lowest priority value. */
|
williamr@2
|
111 |
ENotifierPriorityLowest = 0
|
williamr@2
|
112 |
};
|
williamr@2
|
113 |
public:
|
williamr@2
|
114 |
/** Contains the notifier parameters.
|
williamr@2
|
115 |
|
williamr@2
|
116 |
@see TNotifierPriority */
|
williamr@2
|
117 |
class TNotifierInfo
|
williamr@2
|
118 |
{
|
williamr@2
|
119 |
public:
|
williamr@2
|
120 |
/** The Uid that identifies the notifier. */
|
williamr@2
|
121 |
TUid iUid;
|
williamr@2
|
122 |
/** The Uid that identifies the channel to be used by the notifier (e.g. the screen,
|
williamr@2
|
123 |
an LED etc) */
|
williamr@2
|
124 |
TUid iChannel;
|
williamr@2
|
125 |
/** The notifier priority, typically chosen from the standard set.
|
williamr@2
|
126 |
|
williamr@2
|
127 |
@see TNotifierPriority */
|
williamr@2
|
128 |
TInt iPriority;
|
williamr@2
|
129 |
};
|
williamr@2
|
130 |
|
williamr@2
|
131 |
public:
|
williamr@2
|
132 |
IMPORT_C MEikSrvNotifierBase2();
|
williamr@2
|
133 |
IMPORT_C virtual ~MEikSrvNotifierBase2();
|
williamr@2
|
134 |
public:
|
williamr@2
|
135 |
/** Frees all resources owned by this notifier.
|
williamr@2
|
136 |
|
williamr@2
|
137 |
This function is called by the notifier framework when all resources allocated
|
williamr@2
|
138 |
by notifiers should be freed. As a minimum, this function should delete this
|
williamr@2
|
139 |
object (i.e. delete this;).
|
williamr@2
|
140 |
|
williamr@2
|
141 |
Note that it is important to implement this function correctly to avoid memory
|
williamr@2
|
142 |
leaks. */
|
williamr@2
|
143 |
virtual void Release() = 0;
|
williamr@2
|
144 |
/** Performs any initialisation that this notifier may require.
|
williamr@2
|
145 |
|
williamr@2
|
146 |
The function is called when the notifier is loaded (when the plug-in DLL is
|
williamr@2
|
147 |
loaded). It is called only once.
|
williamr@2
|
148 |
|
williamr@2
|
149 |
As a minimum, the function should return a TNotifierInfo instance describing
|
williamr@2
|
150 |
the notifier parameters. A good implementation would be to set this into a
|
williamr@2
|
151 |
data member, and then to return it. This is because the same information is
|
williamr@2
|
152 |
returned by Info().
|
williamr@2
|
153 |
|
williamr@2
|
154 |
The function is safe to leave from, so it is possible, although rarely necessary,
|
williamr@2
|
155 |
to allocate objects as you would normally do in a ConstructL() function as
|
williamr@2
|
156 |
part of two-phase construction.
|
williamr@2
|
157 |
|
williamr@2
|
158 |
@return Describes the parameters of the notifier. */
|
williamr@2
|
159 |
virtual TNotifierInfo RegisterL() = 0;
|
williamr@2
|
160 |
/** Gets the notifier parameters.
|
williamr@2
|
161 |
|
williamr@2
|
162 |
This is usually the same information as returned by RegisterL() but can be
|
williamr@2
|
163 |
varied at run time.
|
williamr@2
|
164 |
|
williamr@2
|
165 |
@return Describes the parameters of the notifier. */
|
williamr@2
|
166 |
virtual TNotifierInfo Info() const = 0;
|
williamr@2
|
167 |
/** Starts the notifier.
|
williamr@2
|
168 |
|
williamr@2
|
169 |
This is called as a result of a client-side call to RNotifier::StartNotifier(),
|
williamr@2
|
170 |
which the client uses to start a notifier from which it does not expect a
|
williamr@2
|
171 |
response.
|
williamr@2
|
172 |
|
williamr@2
|
173 |
The function is synchronous, but it should be implemented so that it completes
|
williamr@2
|
174 |
as soon as possible, allowing the notifier framework to enforce its priority
|
williamr@2
|
175 |
mechanism.
|
williamr@2
|
176 |
|
williamr@2
|
177 |
It is not possible to to wait for a notifier to complete before returning
|
williamr@2
|
178 |
from this function unless the notifier is likely to finish implementing its
|
williamr@2
|
179 |
functionality immediately.
|
williamr@2
|
180 |
|
williamr@2
|
181 |
@param aBuffer Data that can be passed from the client-side. The format and
|
williamr@2
|
182 |
meaning of any data is implementation dependent.
|
williamr@2
|
183 |
@return A pointer descriptor representing data that may be returned. The format
|
williamr@2
|
184 |
and meaning of any data is implementation dependent. */
|
williamr@2
|
185 |
virtual TPtrC8 StartL(const TDesC8& aBuffer) = 0;
|
williamr@2
|
186 |
/** Starts the notifier.
|
williamr@2
|
187 |
|
williamr@2
|
188 |
This is called as a result of a client-side call to the asynchronous function
|
williamr@2
|
189 |
RNotifier::StartNotifierAndGetResponse(). This means that the client is waiting,
|
williamr@2
|
190 |
asynchronously, for the notifier to tell the client that it has finished its
|
williamr@2
|
191 |
work.
|
williamr@2
|
192 |
|
williamr@2
|
193 |
It is important to return from this function as soon as possible, and derived
|
williamr@2
|
194 |
classes may find it useful to take a copy of the reply-slot number and
|
williamr@2
|
195 |
the RMessage object.
|
williamr@2
|
196 |
|
williamr@2
|
197 |
The implementation of a derived class must make sure that Complete() is called
|
williamr@2
|
198 |
on the RMessage object when the notifier is deactivated.
|
williamr@2
|
199 |
|
williamr@2
|
200 |
This function may be called multiple times if more than one client starts
|
williamr@2
|
201 |
the notifier.
|
williamr@2
|
202 |
|
williamr@2
|
203 |
@param aBuffer Data that can be passed from the client-side. The format and
|
williamr@2
|
204 |
meaning of any data is implementation dependent.
|
williamr@2
|
205 |
@param aReplySlot Identifies which message argument to use for the reply.
|
williamr@2
|
206 |
This message argument will refer to a modifiable descriptor, a TDes8 type,
|
williamr@2
|
207 |
into which data can be returned. The format and meaning of any returned data
|
williamr@2
|
208 |
is implementation dependent.
|
williamr@2
|
209 |
@param aMessage Encapsulates a client request. */
|
williamr@2
|
210 |
virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage) = 0;
|
williamr@2
|
211 |
|
williamr@2
|
212 |
/** Cancels an active notifier.
|
williamr@2
|
213 |
|
williamr@2
|
214 |
This is called as a result of a client-side call to RNotifier::CancelNotifier().
|
williamr@2
|
215 |
|
williamr@2
|
216 |
An implementation should free any relevant resources and complete any outstanding
|
williamr@2
|
217 |
messages, if relevant. */
|
williamr@2
|
218 |
virtual void Cancel() = 0;
|
williamr@2
|
219 |
/** Updates a currently active notifier with new data.
|
williamr@2
|
220 |
|
williamr@2
|
221 |
This is called as a result of a client-side call to RNotifier::UpdateNotifier().
|
williamr@2
|
222 |
|
williamr@2
|
223 |
@param aBuffer Data that can be passed from the client-side. The format and
|
williamr@2
|
224 |
meaning of any data is implementation dependent.
|
williamr@2
|
225 |
@return A pointer descriptor representing data that may be returned. The format
|
williamr@2
|
226 |
and meaning of any data is implementation dependent. */
|
williamr@2
|
227 |
virtual TPtrC8 UpdateL(const TDesC8& aBuffer) = 0;
|
williamr@2
|
228 |
/** Updates a currently active notifier with new data.
|
williamr@2
|
229 |
|
williamr@2
|
230 |
This is called as a result of a client-side call to the asynchronous function
|
williamr@2
|
231 |
RNotifier::UpdateNotifierAndGetResponse(). This means that the client is waiting,
|
williamr@2
|
232 |
asynchronously, for the notifier to tell the client that it has finished its
|
williamr@2
|
233 |
work.
|
williamr@2
|
234 |
|
williamr@2
|
235 |
It is important to return from this function as soon as possible, and derived
|
williamr@2
|
236 |
classes may find it useful to take a copy of the reply-slot number and
|
williamr@2
|
237 |
the RMessage object.
|
williamr@2
|
238 |
|
williamr@2
|
239 |
The implementation of a derived class must make sure that Complete() is called
|
williamr@2
|
240 |
on the RMessage object when the notifier is deactivated.
|
williamr@2
|
241 |
|
williamr@2
|
242 |
This function may be called multiple times if more than one client updates
|
williamr@2
|
243 |
the notifier.
|
williamr@2
|
244 |
|
williamr@2
|
245 |
@param aBuffer Data that can be passed from the client-side. The format and
|
williamr@2
|
246 |
meaning of any data is implementation dependent.
|
williamr@2
|
247 |
@param aReplySlot Identifies which message argument to use for the reply.
|
williamr@2
|
248 |
This message argument will refer to a modifiable descriptor, a TDes8 type,
|
williamr@2
|
249 |
into which data can be returned. The format and meaning of any returned data
|
williamr@2
|
250 |
is implementation dependent.
|
williamr@2
|
251 |
@param aMessage Encapsulates a client request. */
|
williamr@2
|
252 |
IMPORT_C virtual void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
|
williamr@2
|
253 |
public:
|
williamr@2
|
254 |
void SetManager(MEikSrvNotifierManager* aManager);
|
williamr@2
|
255 |
protected:
|
williamr@2
|
256 |
MEikSrvNotifierManager* iManager;
|
williamr@2
|
257 |
private:
|
williamr@2
|
258 |
IMPORT_C virtual void MEikSrvNotifierBase2_Reserved_2();
|
williamr@2
|
259 |
public: // internal
|
williamr@2
|
260 |
IMPORT_C virtual void HandleSystemEventL(TUid aEvent);
|
williamr@2
|
261 |
IMPORT_C virtual TInt NotifierCapabilites();
|
williamr@2
|
262 |
private:
|
williamr@2
|
263 |
TInt iNotBSpare;
|
williamr@2
|
264 |
TInt iMEikSrvNotifierBase2_Spare;
|
williamr@2
|
265 |
};
|
williamr@2
|
266 |
|
williamr@2
|
267 |
|
williamr@2
|
268 |
#endif // __EIKNOTAPI_H__
|