williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 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: Defines screensaver plugin interface.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef SCREEN_SAVER_PLUGIN_H
|
williamr@2
|
20 |
#define SCREEN_SAVER_PLUGIN_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
// INCLUDES
|
williamr@2
|
23 |
#include <e32base.h>
|
williamr@2
|
24 |
#include <gulicon.h>
|
williamr@2
|
25 |
#include <coecntrl.h>
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#include <ScreensaverpluginIntDef.hrh> // For TScPluginCaps
|
williamr@2
|
28 |
|
williamr@2
|
29 |
// CONSTANTS
|
williamr@2
|
30 |
|
williamr@2
|
31 |
//
|
williamr@2
|
32 |
// Enumerations for screensaver indicators.
|
williamr@2
|
33 |
//
|
williamr@2
|
34 |
enum TScreensaverIndicatorIndex
|
williamr@2
|
35 |
{
|
williamr@2
|
36 |
EScreensaverIndicatorIndexNewMessages,
|
williamr@2
|
37 |
EScreensaverIndicatorIndexNewMissedCalls,
|
williamr@2
|
38 |
EScreensaverIndicatorIndexKeyGuardState,
|
williamr@2
|
39 |
EScreensaverIndicatorIndexProfileName,
|
williamr@2
|
40 |
EScreensaverIndicatorIndexChatMessage,
|
williamr@2
|
41 |
EScreensaverIndicatorIndexEmail,
|
williamr@2
|
42 |
EScreensaverIndicatorIndexVoicemail,
|
williamr@2
|
43 |
EScreensaverIndicatorIndexAmPm
|
williamr@2
|
44 |
};
|
williamr@2
|
45 |
|
williamr@2
|
46 |
|
williamr@2
|
47 |
// Screensaver indicator payload types
|
williamr@2
|
48 |
enum TScreensaverPayloadType
|
williamr@2
|
49 |
{
|
williamr@2
|
50 |
EPayloadTypeUnknown = 0,
|
williamr@2
|
51 |
EPayloadTypeInteger, // Icon and and number, or just icon (integer -1)
|
williamr@2
|
52 |
EPayloadTypeText, // E.g. profile, AM/PM
|
williamr@2
|
53 |
EPayloadTypeIcon // Icon only
|
williamr@2
|
54 |
};
|
williamr@2
|
55 |
|
williamr@2
|
56 |
|
williamr@2
|
57 |
// Enumerations for possible partial mode types.
|
williamr@2
|
58 |
enum TScreensaverPartialModeType
|
williamr@2
|
59 |
{
|
williamr@2
|
60 |
EPartialModeTypeDefault = 0, // Default partial mode (usually same as "most power saving"):
|
williamr@2
|
61 |
EPartialModeTypeFull, // Partial mode with maximum number of colors.
|
williamr@2
|
62 |
EPartialModeTypeReduced,
|
williamr@2
|
63 |
EPartialModeTypeMostPowerSaving // Most power saving partial mode (usually only limited number of color available).
|
williamr@2
|
64 |
};
|
williamr@2
|
65 |
|
williamr@2
|
66 |
|
williamr@2
|
67 |
// Events sent to plugin by Screensaver
|
williamr@2
|
68 |
enum TScreensaverEvent
|
williamr@2
|
69 |
{
|
williamr@2
|
70 |
// Null event
|
williamr@2
|
71 |
EScreensaverEventNothing = 0x00,
|
williamr@2
|
72 |
// Screensaver starting, plugin should get Draw() calls soon, or
|
williamr@2
|
73 |
// disable Screensaver timer to do it's own draw timing
|
williamr@2
|
74 |
EScreensaverEventStarting,
|
williamr@2
|
75 |
// Screensaver stopping, plugin should stop drawing
|
williamr@2
|
76 |
EScreensaverEventStopping,
|
williamr@2
|
77 |
// Resolution, orientation, window etc has changed
|
williamr@2
|
78 |
EScreensaverEventDisplayChanged,
|
williamr@2
|
79 |
// Plugin-requested timeout has elapsed. Plugins
|
williamr@2
|
80 |
// can use this for e.g. running a certain
|
williamr@2
|
81 |
// amount of time and suspending to normal
|
williamr@2
|
82 |
// screen saver after the timeout occurs
|
williamr@2
|
83 |
EScreensaverEventTimeout,
|
williamr@2
|
84 |
// Screensaver is about to enter preview mode. Next start and stop events
|
williamr@2
|
85 |
// will indicate preview start and end
|
williamr@2
|
86 |
EScreensaverEventPreview
|
williamr@2
|
87 |
};
|
williamr@2
|
88 |
|
williamr@2
|
89 |
|
williamr@2
|
90 |
// In Rel 3.0 TScPluginCaps is moved to ScreensaverpluginIntDef.hrh
|
williamr@2
|
91 |
#if 0
|
williamr@2
|
92 |
// Screen saver plugin capabilities
|
williamr@2
|
93 |
enum TScPluginCaps
|
williamr@2
|
94 |
{
|
williamr@2
|
95 |
// Plugin has no special capabilities
|
williamr@2
|
96 |
EScpCapsNone = 0x00,
|
williamr@2
|
97 |
// Plugin implements the configure function
|
williamr@2
|
98 |
EScpCapsConfigure = 0x01,
|
williamr@2
|
99 |
// Plugin wants to be notified when selected as the active screensaver
|
williamr@2
|
100 |
EScpCapsSelectionNotification = 0x02,
|
williamr@2
|
101 |
// Plugin wants to be notified when preview command is selected
|
williamr@2
|
102 |
EScpCapsPreviewNotification = 0x04
|
williamr@2
|
103 |
};
|
williamr@2
|
104 |
#endif
|
williamr@2
|
105 |
|
williamr@2
|
106 |
const TInt KMaxPayloadTextLength = 30;
|
williamr@2
|
107 |
const TInt KScreensaverMaxPartialModes = 6;
|
williamr@2
|
108 |
|
williamr@2
|
109 |
// Maximum time (secs) lights can be requested to be on
|
williamr@2
|
110 |
const TInt KMaxLightsOnTime = 30;
|
williamr@2
|
111 |
|
williamr@2
|
112 |
// MACROS
|
williamr@2
|
113 |
|
williamr@2
|
114 |
// DATA TYPES
|
williamr@2
|
115 |
|
williamr@2
|
116 |
class TScreensaverPartialMode
|
williamr@2
|
117 |
{
|
williamr@2
|
118 |
public:
|
williamr@2
|
119 |
TScreensaverPartialModeType iType; // Id of this partial mode level.
|
williamr@2
|
120 |
TInt iBpp; // How many bits per pixels is actually used
|
williamr@2
|
121 |
// if this partial mode level is activated.
|
williamr@2
|
122 |
};
|
williamr@2
|
123 |
|
williamr@2
|
124 |
|
williamr@2
|
125 |
// More or less obsolete - may or may not work. As a rule displays
|
williamr@2
|
126 |
// seem to support only a single partial mode
|
williamr@2
|
127 |
class TScreensaverColorModel
|
williamr@2
|
128 |
{
|
williamr@2
|
129 |
public:
|
williamr@2
|
130 |
TInt iNumberOfPartialModes; // Number of partial mode levels supported
|
williamr@2
|
131 |
// by current display hardware.
|
williamr@2
|
132 |
TScreensaverPartialMode iPartialModes[KScreensaverMaxPartialModes]; // Array of
|
williamr@2
|
133 |
// supported partial modes;
|
williamr@2
|
134 |
TScreensaverPartialMode iSystemPartialMode; // Partial mode level that default
|
williamr@2
|
135 |
// screensaver uses when drawing standard
|
williamr@2
|
136 |
// screensaver bar.
|
williamr@2
|
137 |
TInt16 iColors[8]; // Array of possible background colors
|
williamr@2
|
138 |
// for standard screensaver bar in
|
williamr@2
|
139 |
// single background color mode.
|
williamr@2
|
140 |
TRgb iDarkGradient[6]; // Darker shades for gradient effect
|
williamr@2
|
141 |
// in standard screensaver bar
|
williamr@2
|
142 |
// (these are used only if there is enough
|
williamr@2
|
143 |
// colors to draw gradient effect).
|
williamr@2
|
144 |
TRgb iLightGradient[6]; // Lighter shades for gradient
|
williamr@2
|
145 |
// effect in standard screensaver bar.
|
williamr@2
|
146 |
};
|
williamr@2
|
147 |
|
williamr@2
|
148 |
|
williamr@2
|
149 |
// Screensaver indicator payload. For integer types
|
williamr@2
|
150 |
class TIndicatorPayload
|
williamr@2
|
151 |
{
|
williamr@2
|
152 |
public:
|
williamr@2
|
153 |
TScreensaverPayloadType iType;
|
williamr@2
|
154 |
TInt iInteger;
|
williamr@2
|
155 |
TBuf16<KMaxPayloadTextLength> iText;
|
williamr@2
|
156 |
TBool iIsDisplayed; // Read-only, cannot be set externally
|
williamr@2
|
157 |
CGulIcon* iIcon; // Read-only, cannot be set externally
|
williamr@2
|
158 |
|
williamr@2
|
159 |
public:
|
williamr@2
|
160 |
TIndicatorPayload()
|
williamr@2
|
161 |
: iType(EPayloadTypeUnknown),
|
williamr@2
|
162 |
iInteger(-1),
|
williamr@2
|
163 |
iIsDisplayed(EFalse),
|
williamr@2
|
164 |
iIcon(NULL)
|
williamr@2
|
165 |
{}
|
williamr@2
|
166 |
};
|
williamr@2
|
167 |
|
williamr@2
|
168 |
|
williamr@2
|
169 |
class TScreensaverDisplayInfo
|
williamr@2
|
170 |
{
|
williamr@2
|
171 |
public:
|
williamr@2
|
172 |
TInt iSize; // Size of struct, MUST be set by caller
|
williamr@2
|
173 |
TRect iRect; // Rect of display area, may not be whole screen
|
williamr@2
|
174 |
CCoeControl* iParent; // Parent control, has a window
|
williamr@2
|
175 |
};
|
williamr@2
|
176 |
|
williamr@2
|
177 |
|
williamr@2
|
178 |
// FUNCTION PROTOTYPES
|
williamr@2
|
179 |
|
williamr@2
|
180 |
// FORWARD DECLARATIONS
|
williamr@2
|
181 |
|
williamr@2
|
182 |
// CLASS DECLARATION
|
williamr@2
|
183 |
|
williamr@2
|
184 |
/**
|
williamr@2
|
185 |
* This class defines plugin host interface. Plugin module uses
|
williamr@2
|
186 |
* this interface for communicating with its host application. An instance
|
williamr@2
|
187 |
* of this interface is given as a parameter to plugin module when
|
williamr@2
|
188 |
* it is created.
|
williamr@2
|
189 |
*/
|
williamr@2
|
190 |
class MScreensaverPluginHost
|
williamr@2
|
191 |
{
|
williamr@2
|
192 |
public:
|
williamr@2
|
193 |
/**
|
williamr@2
|
194 |
* Sets screensaver application to use standard indicator view.
|
williamr@2
|
195 |
* This is default mode for indicator drawing.
|
williamr@2
|
196 |
*/
|
williamr@2
|
197 |
virtual void UseStandardIndicators() = 0;
|
williamr@2
|
198 |
|
williamr@2
|
199 |
/**
|
williamr@2
|
200 |
* Notifies plugin host that plugin module is going to take care
|
williamr@2
|
201 |
* of drawing indicator view and host shouldn't display them anymore.
|
williamr@2
|
202 |
* If not overridden, normal screensaver will display when there
|
williamr@2
|
203 |
* are indicators to show. Overriding the indicators does not mean they
|
williamr@2
|
204 |
* _have_ to be drawn by the plugin, but that screensaver will not try to
|
williamr@2
|
205 |
* do it.
|
williamr@2
|
206 |
*/
|
williamr@2
|
207 |
virtual void OverrideStandardIndicators() = 0;
|
williamr@2
|
208 |
|
williamr@2
|
209 |
/**
|
williamr@2
|
210 |
* Returns boolean value indicating whether standard indicator
|
williamr@2
|
211 |
* drawing is used or not.
|
williamr@2
|
212 |
*
|
williamr@2
|
213 |
* @return ETrue if standard indicator drawing is used
|
williamr@2
|
214 |
* EFalse if plugin module takes care of drawing indicators
|
williamr@2
|
215 |
*/
|
williamr@2
|
216 |
virtual TBool StandardIndicatorsUsed() const = 0;
|
williamr@2
|
217 |
|
williamr@2
|
218 |
/**
|
williamr@2
|
219 |
* Sets timeout value for refresh timer. Plugin module's draw
|
williamr@2
|
220 |
* method is called every time when refresh timer expires.
|
williamr@2
|
221 |
*
|
williamr@2
|
222 |
* @param aValue Timeout value for refresh timer in microseconds.
|
williamr@2
|
223 |
*/
|
williamr@2
|
224 |
virtual void SetRefreshTimerValue(TInt aValue) = 0;
|
williamr@2
|
225 |
|
williamr@2
|
226 |
/**
|
williamr@2
|
227 |
* Returns the current timeout value of refresh timer.
|
williamr@2
|
228 |
*
|
williamr@2
|
229 |
* @return The current timeout value of refresh timer in microseconds.
|
williamr@2
|
230 |
*/
|
williamr@2
|
231 |
virtual TInt RefreshTimerValue() const = 0;
|
williamr@2
|
232 |
|
williamr@2
|
233 |
/**
|
williamr@2
|
234 |
* Returns payload associated with given screensaver indicator.
|
williamr@2
|
235 |
* For list of supported indcicator indices see definition of
|
williamr@2
|
236 |
* TScreensaverIndicatorIndex. Also see definition of
|
williamr@2
|
237 |
* TIndicatorPayload class.
|
williamr@2
|
238 |
*
|
williamr@2
|
239 |
* @param aIndex Index of requested indicator.
|
williamr@2
|
240 |
* @param aResult Structure where query results will be stored.
|
williamr@2
|
241 |
* @return KErrNone if query was succesful.
|
williamr@2
|
242 |
*/
|
williamr@2
|
243 |
virtual TInt GetIndicatorPayload(
|
williamr@2
|
244 |
TScreensaverIndicatorIndex aIndex,
|
williamr@2
|
245 |
TIndicatorPayload& aResult) const = 0;
|
williamr@2
|
246 |
|
williamr@2
|
247 |
/**
|
williamr@2
|
248 |
* This method is used for activating so called screensaver partial mode.
|
williamr@2
|
249 |
* Partial mode area specifies an area on the screen where screensaver
|
williamr@2
|
250 |
* plugin module is going to draw during next refresh period. When partial
|
williamr@2
|
251 |
* mode is activated the screen segments outside given area are
|
williamr@2
|
252 |
* physically turned off to decrease power consumption. Whether partial
|
williamr@2
|
253 |
* mode is supported or not depends on actual display hardware.
|
williamr@2
|
254 |
* It is also possible that some devices support only limited number of
|
williamr@2
|
255 |
* colors in partial mode area.
|
williamr@2
|
256 |
* The actual size of the partial mode area may be restricted by the
|
williamr@2
|
257 |
* display hardware, and differ from the size requested. Note that both
|
williamr@2
|
258 |
* minimum and/or maximum size may be restricted.
|
williamr@2
|
259 |
* If partial mode is not supported this method does nothing (that's
|
williamr@2
|
260 |
* always the case in WINS environment).
|
williamr@2
|
261 |
*
|
williamr@2
|
262 |
* @param aStartRow Specifies the topmost pixel row of active
|
williamr@2
|
263 |
* display area on the screen.
|
williamr@2
|
264 |
* @param aEndRow Specifies the bottom pixel row of active display area.
|
williamr@2
|
265 |
*
|
williamr@2
|
266 |
* @param aMode Partial mode to be set.
|
williamr@2
|
267 |
*
|
williamr@2
|
268 |
* @return KErrNone if partial mode was successfully activated.
|
williamr@2
|
269 |
* otherwise system wide error code.
|
williamr@2
|
270 |
* @deprecated Should use the rect-version from S60 v3.0 on
|
williamr@2
|
271 |
*/
|
williamr@2
|
272 |
virtual TInt SetActiveDisplayArea(
|
williamr@2
|
273 |
TInt aStartRow,
|
williamr@2
|
274 |
TInt aEndRow,
|
williamr@2
|
275 |
const TScreensaverPartialMode& aMode) = 0;
|
williamr@2
|
276 |
|
williamr@2
|
277 |
/**
|
williamr@2
|
278 |
* Cancels the effect of SetActiveDisplayArea method. The whole display area
|
williamr@2
|
279 |
* is activated.
|
williamr@2
|
280 |
*/
|
williamr@2
|
281 |
virtual void ExitPartialMode() = 0;
|
williamr@2
|
282 |
|
williamr@2
|
283 |
/**
|
williamr@2
|
284 |
* Queries screensaver color in current environment (includes
|
williamr@2
|
285 |
* partial modes supported by display hardware).
|
williamr@2
|
286 |
*
|
williamr@2
|
287 |
* @param aResult A structure for storing the results of the query.
|
williamr@2
|
288 |
*/
|
williamr@2
|
289 |
virtual const TScreensaverColorModel& GetColorModel() const = 0;
|
williamr@2
|
290 |
|
williamr@2
|
291 |
/**
|
williamr@2
|
292 |
* This method suspends plugin module drawing for given time.
|
williamr@2
|
293 |
* During that time standard screensaver view is drawn.
|
williamr@2
|
294 |
*
|
williamr@2
|
295 |
* @param aTime Suspension time in microseconds. Values below
|
williamr@2
|
296 |
* 500000 are rounded up to 500000. A negative value
|
williamr@2
|
297 |
* suspends the plugin indefinitely.
|
williamr@2
|
298 |
*/
|
williamr@2
|
299 |
virtual void Suspend(TInt aTime) = 0;
|
williamr@2
|
300 |
|
williamr@2
|
301 |
/**
|
williamr@2
|
302 |
* With this method the plugin may request screen backlight to be
|
williamr@2
|
303 |
* turned on or off.
|
williamr@2
|
304 |
*
|
williamr@2
|
305 |
* @param aSecs Desired time in seconds the screen backlight should be
|
williamr@2
|
306 |
* turned on (1 - 30). Less than 1 will turn the lights off,
|
williamr@2
|
307 |
* more than 30 will be treated as 30. The plugin host has the
|
williamr@2
|
308 |
* final control over the lights, so time may be less than
|
williamr@2
|
309 |
* requested, or the lights may be switched off even without
|
williamr@2
|
310 |
* request before the time is up.
|
williamr@2
|
311 |
*/
|
williamr@2
|
312 |
virtual void RequestLights(TInt aSecs) = 0;
|
williamr@2
|
313 |
|
williamr@2
|
314 |
/**
|
williamr@2
|
315 |
* Plugin may use this function to enquire display properties. Should
|
williamr@2
|
316 |
* be called e.g. in response to EScreensaverEventDisplayChanged to
|
williamr@2
|
317 |
* retrieve the new information.
|
williamr@2
|
318 |
*
|
williamr@2
|
319 |
* @param aDisplayInfo Struct to receive the display information. NOTE
|
williamr@2
|
320 |
* that iSize must be set by the caller.
|
williamr@2
|
321 |
*
|
williamr@2
|
322 |
*/
|
williamr@2
|
323 |
virtual TInt DisplayInfo(TScreensaverDisplayInfo* aDisplayInfo) = 0;
|
williamr@2
|
324 |
|
williamr@2
|
325 |
/**
|
williamr@2
|
326 |
* This method is used for activating so called screensaver partial mode.
|
williamr@2
|
327 |
* Partial mode area specifies an area on the screen where screensaver
|
williamr@2
|
328 |
* plugin module is going to draw during next refresh period. When partial
|
williamr@2
|
329 |
* mode is activated the screen segments outside given area are
|
williamr@2
|
330 |
* physically turned off to decrease power consumption. Whether partial
|
williamr@2
|
331 |
* mode is supported or not depends on actual display hardware.
|
williamr@2
|
332 |
* It is also possible that some devices support only limited number of
|
williamr@2
|
333 |
* colors in partial mode area.
|
williamr@2
|
334 |
* The actual size of the partial mode area may be restricted by the
|
williamr@2
|
335 |
* display hardware, and differ from the size requested. Note that both
|
williamr@2
|
336 |
* minimum and/or maximum size may be restricted.
|
williamr@2
|
337 |
* If partial mode is not supported this method does nothing (that's
|
williamr@2
|
338 |
* always the case in WINS environment).
|
williamr@2
|
339 |
*
|
williamr@2
|
340 |
* @param aRect Specifies the active area on the screen. Parts outside
|
williamr@2
|
341 |
* this area will not be visible. Note that x-dimension
|
williamr@2
|
342 |
* needs to be set, even if it's not currently used
|
williamr@2
|
343 |
*
|
williamr@2
|
344 |
* @param aMode Partial mode to be set.
|
williamr@2
|
345 |
*
|
williamr@2
|
346 |
* @return KErrNone if partial mode was successfully activated.
|
williamr@2
|
347 |
* otherwise system wide error code.
|
williamr@2
|
348 |
* @since S60 v3.0
|
williamr@2
|
349 |
*/
|
williamr@2
|
350 |
virtual TInt SetActiveDisplayArea(TRect& aRect, const TScreensaverPartialMode& aMode) = 0;
|
williamr@2
|
351 |
|
williamr@2
|
352 |
/**
|
williamr@2
|
353 |
* With this method the plugin may request Draw() timer to be
|
williamr@2
|
354 |
* turned on or off. When on (the default) the plugins Draw() function
|
williamr@2
|
355 |
* is called in intervals specified in SetRefreshTimerValue().
|
williamr@2
|
356 |
*
|
williamr@2
|
357 |
* @param aOn Specifies whether the refresh timer is used to initiate
|
williamr@2
|
358 |
* Draw() calls.
|
williamr@2
|
359 |
*/
|
williamr@2
|
360 |
virtual void UseRefreshTimer(TBool aOn = ETrue) = 0;
|
williamr@2
|
361 |
|
williamr@2
|
362 |
/**
|
williamr@2
|
363 |
* With this method the plugin may request a one-shot timeout event
|
williamr@2
|
364 |
* (EScreensaverEventTimeout) after the specified amount of seconds
|
williamr@2
|
365 |
* has passed.
|
williamr@2
|
366 |
* If the plugin only wants to be displayed for a certain time, this
|
williamr@2
|
367 |
* can be used instead of defining a timer in the plugin. Note that the
|
williamr@2
|
368 |
* maximum time is about 35 minutes (TTimeIntervalMicroSeconds32).
|
williamr@2
|
369 |
* If the screensaver is stopped before the time has passed, the
|
williamr@2
|
370 |
* timer will be canceled and callback not issued. The timer is also
|
williamr@2
|
371 |
* cancelled after the timeout has occurred. New timeout requests also
|
williamr@2
|
372 |
* cancel any pending timeouts before issuing a new one. A time value
|
williamr@2
|
373 |
* of 0 just cancels a pending timeout.
|
williamr@2
|
374 |
*
|
williamr@2
|
375 |
* @param aSecs Desired time in seconds after which a timeout callback
|
williamr@2
|
376 |
* event should be issued.
|
williamr@2
|
377 |
*/
|
williamr@2
|
378 |
virtual void RequestTimeout(TInt aSecs) = 0;
|
williamr@2
|
379 |
|
williamr@2
|
380 |
/**
|
williamr@2
|
381 |
* With this method the plugin can revert to the default screensaver.
|
williamr@2
|
382 |
* The plugin will be unloaded, and not used any more until the
|
williamr@2
|
383 |
* user re-selects the plugin to be the active screensaver.
|
williamr@2
|
384 |
* Should be used when the plugin encounters an unrecoverable error,
|
williamr@2
|
385 |
* such as a missing file or expired DRM, and will not be able to run
|
williamr@2
|
386 |
* any more.
|
williamr@2
|
387 |
* NOTE: A plugin should not expect any events after calling this
|
williamr@2
|
388 |
* function.
|
williamr@2
|
389 |
*/
|
williamr@2
|
390 |
virtual void RevertToDefaultSaver() = 0;
|
williamr@2
|
391 |
};
|
williamr@2
|
392 |
|
williamr@2
|
393 |
|
williamr@2
|
394 |
/**
|
williamr@2
|
395 |
* The base class for screensaver plugin modules. Every plugin module
|
williamr@2
|
396 |
* must inherit and implement this class.
|
williamr@2
|
397 |
*/
|
williamr@2
|
398 |
class MScreensaverPlugin
|
williamr@2
|
399 |
{
|
williamr@2
|
400 |
public:
|
williamr@2
|
401 |
/**
|
williamr@2
|
402 |
* Virtual desctructor.
|
williamr@2
|
403 |
*/
|
williamr@2
|
404 |
virtual ~MScreensaverPlugin() {}
|
williamr@2
|
405 |
|
williamr@2
|
406 |
/**
|
williamr@2
|
407 |
* Used to initialize the plugin module after creation.
|
williamr@2
|
408 |
* Name() function may be called without the plugin being initialized,
|
williamr@2
|
409 |
* to enable name query from modules that are not plugin hosts.
|
williamr@2
|
410 |
*
|
williamr@2
|
411 |
* @param aHost Screensaver plugin host.
|
williamr@2
|
412 |
* @return KErrNone if everything went ok. Otherwise
|
williamr@2
|
413 |
* system wide error code.
|
williamr@2
|
414 |
*/
|
williamr@2
|
415 |
virtual TInt InitializeL(MScreensaverPluginHost *aHost) = 0;
|
williamr@2
|
416 |
|
williamr@2
|
417 |
/**
|
williamr@2
|
418 |
* When a plugin module is active this method is called every time
|
williamr@2
|
419 |
* when refresh timer expires in screensaver application.
|
williamr@2
|
420 |
*
|
williamr@2
|
421 |
* @param aGc Graphics context for plugin module to draw to.
|
williamr@2
|
422 |
* @return KErrNone if everything went ok. Otherwise
|
williamr@2
|
423 |
* system wide error code (doesn't have any effect in
|
williamr@2
|
424 |
* current version).
|
williamr@2
|
425 |
*/
|
williamr@2
|
426 |
virtual TInt Draw(CWindowGc& aGc) = 0;
|
williamr@2
|
427 |
|
williamr@2
|
428 |
/**
|
williamr@2
|
429 |
* Returns the name of plugin module. Returned name is displayed in
|
williamr@2
|
430 |
* the list of installed plugin modules in Themes application.
|
williamr@2
|
431 |
* If this function returns an empty name (KNullDesC), displayed name is
|
williamr@2
|
432 |
* taken from ECom registration resource.
|
williamr@2
|
433 |
*
|
williamr@2
|
434 |
* @return Descriptor containing the name of the plugin module.
|
williamr@2
|
435 |
*/
|
williamr@2
|
436 |
virtual const TDesC16& Name() const = 0;
|
williamr@2
|
437 |
|
williamr@2
|
438 |
/**
|
williamr@2
|
439 |
* Handler function for screensaver events.
|
williamr@2
|
440 |
*
|
williamr@2
|
441 |
* @param aEvent Event to be handled.
|
williamr@2
|
442 |
* @param aData Data related to the event. To be decided on a case-by-case
|
williamr@2
|
443 |
* basis.
|
williamr@2
|
444 |
*
|
williamr@2
|
445 |
* @return KErrNone if OK, otherwise an error code.
|
williamr@2
|
446 |
*/
|
williamr@2
|
447 |
virtual TInt HandleScreensaverEventL(
|
williamr@2
|
448 |
TScreensaverEvent aEvent,
|
williamr@2
|
449 |
TAny* aData) = 0;
|
williamr@2
|
450 |
|
williamr@2
|
451 |
/**
|
williamr@2
|
452 |
* Screensaver plugin capabilities query. The capabilitities
|
williamr@2
|
453 |
* reveal which functions the plugin implements, that can be
|
williamr@2
|
454 |
* used by calling PluginFunction().
|
williamr@2
|
455 |
*
|
williamr@2
|
456 |
* @return Bit mask of plugin capabilities.
|
williamr@2
|
457 |
*
|
williamr@2
|
458 |
* @note Capabilites need to be defined as opaque_data in ECom plugin
|
williamr@2
|
459 |
* registration file as well.
|
williamr@2
|
460 |
*/
|
williamr@2
|
461 |
virtual TInt Capabilities() { return EScpCapsNone; }
|
williamr@2
|
462 |
|
williamr@2
|
463 |
/**
|
williamr@2
|
464 |
* Screensaver plugin function method. Only the functions
|
williamr@2
|
465 |
* returned by Capabilities() can be used, and only one
|
williamr@2
|
466 |
* function at a time.
|
williamr@2
|
467 |
*
|
williamr@2
|
468 |
* @paran aFunction
|
williamr@2
|
469 |
* @param aParam Parameters to the function. TBD function-by-function.
|
williamr@2
|
470 |
*
|
williamr@2
|
471 |
* @return System wide error code. KErrNone on success.
|
williamr@2
|
472 |
*/
|
williamr@2
|
473 |
virtual TInt PluginFunction(
|
williamr@2
|
474 |
TScPluginCaps /*aFunction*/,
|
williamr@2
|
475 |
TAny* /*aParam*/)
|
williamr@2
|
476 |
{
|
williamr@2
|
477 |
return KErrNone;
|
williamr@2
|
478 |
}
|
williamr@2
|
479 |
};
|
williamr@2
|
480 |
|
williamr@2
|
481 |
|
williamr@2
|
482 |
#endif // SCREEN_SAVER_PLUGIN_H
|
williamr@2
|
483 |
|
williamr@2
|
484 |
// End of file.
|