00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SCREEN_SAVER_PLUGIN_H
00021 #define SCREEN_SAVER_PLUGIN_H
00022
00023
00024 #include <e32base.h>
00025 #include <gulicon.h>
00026 #include <coecntrl.h>
00027
00028 #include <ScreensaverpluginIntDef.hrh>
00029
00030
00031
00032
00033
00034
00035 enum TScreensaverIndicatorIndex
00036 {
00037 EScreensaverIndicatorIndexNewMessages,
00038 EScreensaverIndicatorIndexNewMissedCalls,
00039 EScreensaverIndicatorIndexKeyGuardState,
00040 EScreensaverIndicatorIndexProfileName,
00041 EScreensaverIndicatorIndexChatMessage,
00042 EScreensaverIndicatorIndexEmail,
00043 EScreensaverIndicatorIndexVoicemail,
00044 EScreensaverIndicatorIndexAmPm
00045 };
00046
00047
00048
00049 enum TScreensaverPayloadType
00050 {
00051 EPayloadTypeUnknown = 0,
00052 EPayloadTypeInteger,
00053 EPayloadTypeText,
00054 EPayloadTypeIcon
00055 };
00056
00057
00058
00059 enum TScreensaverPartialModeType
00060 {
00061 EPartialModeTypeDefault = 0,
00062 EPartialModeTypeFull,
00063 EPartialModeTypeReduced,
00064 EPartialModeTypeMostPowerSaving
00065 };
00066
00067
00068
00069 enum TScreensaverEvent
00070 {
00071
00072 EScreensaverEventNothing = 0x00,
00073
00074
00075 EScreensaverEventStarting,
00076
00077 EScreensaverEventStopping,
00078
00079 EScreensaverEventDisplayChanged,
00080
00081
00082
00083
00084 EScreensaverEventTimeout,
00085
00086
00087 EScreensaverEventPreview
00088 };
00089
00090
00091
00092 #if 0
00093
00094 enum TScPluginCaps
00095 {
00096
00097 EScpCapsNone = 0x00,
00098
00099 EScpCapsConfigure = 0x01,
00100
00101 EScpCapsSelectionNotification = 0x02,
00102
00103 EScpCapsPreviewNotification = 0x04
00104 };
00105 #endif
00106
00107 const TInt KMaxPayloadTextLength = 30;
00108 const TInt KScreensaverMaxPartialModes = 6;
00109
00110
00111 const TInt KMaxLightsOnTime = 30;
00112
00113
00114
00115
00116
00117 class TScreensaverPartialMode
00118 {
00119 public:
00120 TScreensaverPartialModeType iType;
00121 TInt iBpp;
00122
00123 };
00124
00125
00126
00127
00128 class TScreensaverColorModel
00129 {
00130 public:
00131 TInt iNumberOfPartialModes;
00132
00133 TScreensaverPartialMode iPartialModes[KScreensaverMaxPartialModes];
00134
00135 TScreensaverPartialMode iSystemPartialMode;
00136
00137
00138 TInt16 iColors[8];
00139
00140
00141 TRgb iDarkGradient[6];
00142
00143
00144
00145 TRgb iLightGradient[6];
00146
00147 };
00148
00149
00150
00151 class TIndicatorPayload
00152 {
00153 public:
00154 TScreensaverPayloadType iType;
00155 TInt iInteger;
00156 TBuf16<KMaxPayloadTextLength> iText;
00157 TBool iIsDisplayed;
00158 CGulIcon* iIcon;
00159
00160 public:
00161 TIndicatorPayload()
00162 : iType(EPayloadTypeUnknown),
00163 iInteger(-1),
00164 iIsDisplayed(EFalse),
00165 iIcon(NULL)
00166 {}
00167 };
00168
00169
00170 class TScreensaverDisplayInfo
00171 {
00172 public:
00173 TInt iSize;
00174 TRect iRect;
00175 CCoeControl* iParent;
00176 };
00177
00178
00179
00180
00181
00182
00183
00184
00191 class MScreensaverPluginHost
00192 {
00193 public:
00198 virtual void UseStandardIndicators() = 0;
00199
00208 virtual void OverrideStandardIndicators() = 0;
00209
00217 virtual TBool StandardIndicatorsUsed() const = 0;
00218
00225 virtual void SetRefreshTimerValue(TInt aValue) = 0;
00226
00232 virtual TInt RefreshTimerValue() const = 0;
00233
00244 virtual TInt GetIndicatorPayload(
00245 TScreensaverIndicatorIndex aIndex,
00246 TIndicatorPayload& aResult) const = 0;
00247
00273 virtual TInt SetActiveDisplayArea(
00274 TInt aStartRow,
00275 TInt aEndRow,
00276 const TScreensaverPartialMode& aMode) = 0;
00277
00282 virtual void ExitPartialMode() = 0;
00283
00290 virtual const TScreensaverColorModel& GetColorModel() const = 0;
00291
00300 virtual void Suspend(TInt aTime) = 0;
00301
00313 virtual void RequestLights(TInt aSecs) = 0;
00314
00324 virtual TInt DisplayInfo(TScreensaverDisplayInfo* aDisplayInfo) = 0;
00325
00351 virtual TInt SetActiveDisplayArea(TRect& aRect, const TScreensaverPartialMode& aMode) = 0;
00352
00361 virtual void UseRefreshTimer(TBool aOn = ETrue) = 0;
00362
00379 virtual void RequestTimeout(TInt aSecs) = 0;
00380
00391 virtual void RevertToDefaultSaver() = 0;
00392 };
00393
00394
00399 class MScreensaverPlugin
00400 {
00401 public:
00405 virtual ~MScreensaverPlugin() {}
00406
00416 virtual TInt InitializeL(MScreensaverPluginHost *aHost) = 0;
00417
00427 virtual TInt Draw(CWindowGc& aGc) = 0;
00428
00437 virtual const TDesC16& Name() const = 0;
00438
00448 virtual TInt HandleScreensaverEventL(
00449 TScreensaverEvent aEvent,
00450 TAny* aData) = 0;
00451
00462 virtual TInt Capabilities() { return EScpCapsNone; }
00463
00474 virtual TInt PluginFunction(
00475 TScPluginCaps ,
00476 TAny* )
00477 {
00478 return KErrNone;
00479 }
00480 };
00481
00482
00483
00484 #endif
00485
00486