26
|
1 |
/*
|
|
2 |
* Copyright (c) 2005 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: Defines screensaver shared data connections.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef _SCREENSAVERSHAREDDATAI_H__
|
|
21 |
#define _SCREENSAVERSHAREDDATAI_H__
|
|
22 |
|
|
23 |
#include <msvapi.h> // for MMsvSessionObserver
|
|
24 |
#include <cenrepnotifyhandler.h>
|
|
25 |
|
|
26 |
#include "screensaverplugin.h"
|
|
27 |
#include "ScreensaverUtils.h"
|
|
28 |
#include "ScreensaverInternalPSKeys.h"
|
|
29 |
#include "ScreensaverInternalCRKeys.h"
|
|
30 |
#include "screensaverengine.h"
|
|
31 |
|
|
32 |
enum
|
|
33 |
{
|
|
34 |
ESSForceLightsOff = 0,
|
|
35 |
ESSForceLightsOn
|
|
36 |
};
|
|
37 |
|
|
38 |
// CLASS DECLARATION
|
|
39 |
class CRepository;
|
|
40 |
class CScreensaverRepositoryWatcher;
|
|
41 |
class CSubscriber;
|
|
42 |
class MProfile;
|
|
43 |
class MProfileEngine;
|
|
44 |
|
|
45 |
class CScreensaverSharedDataI : public CBase, public MMsvEntryObserver,
|
|
46 |
public MMsvSessionObserver
|
|
47 |
{
|
|
48 |
public:
|
|
49 |
/**
|
|
50 |
* Two-phased constructor
|
|
51 |
*/
|
|
52 |
static CScreensaverSharedDataI* NewL();
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Destructor
|
|
56 |
*/
|
|
57 |
~CScreensaverSharedDataI();
|
|
58 |
|
|
59 |
public:
|
|
60 |
/**
|
|
61 |
* Get the screensaver object type
|
|
62 |
*/
|
|
63 |
TDisplayObjectType DisplayObjectType() const;
|
|
64 |
|
|
65 |
/*
|
|
66 |
* Change the display object type of screensaver
|
|
67 |
*/
|
|
68 |
void SetDisplayObjectType( const TDisplayObjectType aType );
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Gets the display text
|
|
72 |
*/
|
|
73 |
void GetDisplayObjectText( TDes& aDes ) const;
|
|
74 |
|
|
75 |
/*
|
|
76 |
* Get the plug-in name
|
|
77 |
*/
|
|
78 |
void GetPluginName( TFileName& aFileName ) const;
|
|
79 |
|
|
80 |
/*
|
|
81 |
* Get the flag if uses the inversive color
|
|
82 |
*/
|
|
83 |
TBool IsInvertedColors() const;
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Gets the timeout
|
|
87 |
*/
|
|
88 |
TInt ScreensaverTimeout() const;
|
|
89 |
|
|
90 |
/*
|
|
91 |
* Is the New Contact Note is actived or not
|
|
92 |
*/
|
|
93 |
TBool IsNCNActive() const;
|
|
94 |
|
|
95 |
/*
|
|
96 |
* Get the count of the missed calls
|
|
97 |
*/
|
|
98 |
TInt NewMissedCalls() const;
|
|
99 |
|
|
100 |
/**
|
|
101 |
* Request screen lights to be turned on or off
|
|
102 |
*
|
|
103 |
* @param sSecs - lights on for aSecs seconds, 0 = off, max 30.
|
|
104 |
*/
|
|
105 |
void SetSSForcedLightsOn( const TInt aSecs );
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Publish Screensaver on/off status
|
|
109 |
*
|
|
110 |
* @param aOn ETrue - saver on, EFalse - off
|
|
111 |
*/
|
|
112 |
void SetScreensaverStatus(const TBool aOn = ETrue);
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Publish "Screensaver started from Idle" status
|
|
116 |
*/
|
|
117 |
void SetSSStartedFromIdleStatus();
|
|
118 |
|
|
119 |
/*
|
|
120 |
* Get the flag that if the screensaver is allowed or not
|
|
121 |
*/
|
|
122 |
TInt IsScreenSaverAllowed() const;
|
|
123 |
|
|
124 |
/*
|
|
125 |
* Get the Preview mode of screensaver
|
|
126 |
*/
|
|
127 |
TInt ScreensaverPreviewMode() const;
|
|
128 |
|
|
129 |
/*
|
|
130 |
* Set the preview mode
|
|
131 |
*/
|
|
132 |
void SetScreensaverPreviewMode( const TInt aMode );
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Get preview state
|
|
136 |
*/
|
|
137 |
TScreenSaverPreviewState ScreensaverPreviewState() const;
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Report preview state
|
|
141 |
*/
|
|
142 |
void SetScreensaverPreviewState( const TScreenSaverPreviewState aState );
|
|
143 |
|
|
144 |
/*
|
|
145 |
* Get keyguard status
|
|
146 |
*
|
|
147 |
* @return ETrue key guard is active.
|
|
148 |
* EFalse key guard is inactive.
|
|
149 |
*/
|
|
150 |
TBool IsKeyguardOn() const;
|
|
151 |
|
|
152 |
/**
|
|
153 |
* Query power save mode usage
|
|
154 |
*
|
|
155 |
* @return ETrue, if power save mode should be used
|
|
156 |
*/
|
|
157 |
TBool IsUsePowerSaveMode() const;
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Query system startup completion status
|
|
161 |
*
|
|
162 |
* @return ETrue, if system startup is complete
|
|
163 |
*/
|
|
164 |
TBool IsSystemStartupComplete();
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Gets the default screensaver type
|
|
168 |
*/
|
|
169 |
TDisplayObjectType DefaultScreensaverType() const;
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Returns number of unread messages in inbox.
|
|
173 |
*
|
|
174 |
* @return Number of unread messages in inbox.
|
|
175 |
*/
|
|
176 |
TInt UnreadMessagesNumber();
|
|
177 |
|
|
178 |
/**
|
|
179 |
* Return the name of currently selected profile
|
|
180 |
*
|
|
181 |
* @return Profile name descriptor.
|
|
182 |
*/
|
|
183 |
const TDesC& ProfileName();
|
|
184 |
|
|
185 |
/**
|
|
186 |
* Query active profile.
|
|
187 |
*
|
|
188 |
* @return Id of active profile, or system error code.
|
|
189 |
*/
|
|
190 |
TInt ActiveProfile();
|
|
191 |
|
|
192 |
/**
|
|
193 |
* Query new email status
|
|
194 |
*
|
|
195 |
* @return ETrue if there is new email
|
|
196 |
*/
|
|
197 |
TBool IsHaveNewEmail() const;
|
|
198 |
|
|
199 |
/**
|
|
200 |
* Query new voice mail status
|
|
201 |
*
|
|
202 |
* @return ETrue, if there is new voice mail
|
|
203 |
*/
|
|
204 |
TBool IsHaveNewVoicemail() const;
|
|
205 |
|
|
206 |
/**
|
|
207 |
* Query new instant message status
|
|
208 |
*
|
|
209 |
* @return ETrue, if there are instant messages pending
|
|
210 |
*/
|
|
211 |
TBool IsHaveNewInstantMessages() const;
|
|
212 |
|
|
213 |
/**
|
|
214 |
* Query silent mode status
|
|
215 |
*
|
|
216 |
* @return ETrue, if silent mode is on
|
|
217 |
*/
|
|
218 |
TBool IsSilentMode();
|
|
219 |
|
|
220 |
/**
|
|
221 |
* Query vibra mode status
|
|
222 |
*
|
|
223 |
* @return ETrue, if vibra mode is on
|
|
224 |
*/
|
|
225 |
TBool IsVibraMode();
|
|
226 |
|
|
227 |
/**
|
|
228 |
* Query call state
|
|
229 |
*
|
|
230 |
* @return ETrue if a call is ongoing
|
|
231 |
*/
|
|
232 |
TBool IsOngoingCall();
|
|
233 |
|
|
234 |
public:
|
|
235 |
/**
|
|
236 |
* From MMsvSessionObserver. Not used.
|
|
237 |
*/
|
|
238 |
void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/,
|
|
239 |
TAny* /*aArg2*/, TAny* /*aArg3*/);
|
|
240 |
|
|
241 |
/**
|
|
242 |
* From MMsvEntryObserver. Callback function. Handles global In-box events.
|
|
243 |
* @param aEvent An entry event.
|
|
244 |
*/
|
|
245 |
void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2,
|
|
246 |
TAny* aArg3);
|
|
247 |
|
|
248 |
/*
|
|
249 |
* Returns the pointer of the screensaver repository
|
|
250 |
*/
|
|
251 |
CRepository* ScreensaverRepository() const;
|
|
252 |
|
|
253 |
private:
|
|
254 |
|
|
255 |
/**
|
|
256 |
* C++ default constructor
|
|
257 |
*/
|
|
258 |
CScreensaverSharedDataI();
|
|
259 |
|
|
260 |
/**
|
|
261 |
* Two-phased constructor
|
|
262 |
*/
|
|
263 |
void ConstructL();
|
|
264 |
|
|
265 |
/**
|
|
266 |
* Connect to the screensaver central repository
|
|
267 |
*/
|
|
268 |
void ConnectToSSCRL();
|
|
269 |
|
|
270 |
/**
|
|
271 |
* Connect to the Psln Setting central repository
|
|
272 |
*/
|
|
273 |
void ConnectToPslnSettingCRL();
|
|
274 |
void ConnectToCommonTsyCRL();
|
|
275 |
void ConnectToInboxL();
|
|
276 |
|
|
277 |
/**
|
|
278 |
* Connects to Profile engine. Returns ETrue if successfully connected
|
|
279 |
* iProfileEngine will then point to a valid MProfileEngine
|
|
280 |
*/
|
|
281 |
TBool ConnectToProfileEngine();
|
|
282 |
|
|
283 |
/**
|
|
284 |
* Connects to active profile. Returns ETrue if successfully connected
|
|
285 |
* iActiveProfile will then point to a valid MProfile
|
|
286 |
*/
|
|
287 |
TBool ConnectToActiveProfile();
|
|
288 |
|
|
289 |
/*
|
|
290 |
* Define the screensaver properties
|
|
291 |
*/
|
|
292 |
void DefineScreensaverProperties( TUint32 aKey, const TSecurityPolicy& aWritePolicy );
|
|
293 |
|
|
294 |
private:
|
|
295 |
// Shared data key state handlers.
|
|
296 |
|
|
297 |
/**
|
|
298 |
* Callback fuction. Called when the timeout changed
|
|
299 |
*/
|
|
300 |
static TInt HandleTimeoutChanged(TAny* aPtr);
|
|
301 |
|
|
302 |
/**
|
|
303 |
* Resets the inactivity timeout
|
|
304 |
*/
|
|
305 |
void ResetInactivityTimeout();
|
|
306 |
|
|
307 |
/**
|
|
308 |
* Callback fuction. Called when the display object changed
|
|
309 |
*/
|
|
310 |
static TInt HandleDisplayObjChanged(TAny* aPtr);
|
|
311 |
|
|
312 |
/*
|
|
313 |
* Get the default type
|
|
314 |
*/
|
|
315 |
void GetDefaultType();
|
|
316 |
|
|
317 |
/*
|
|
318 |
* Get the default type string from the CR
|
|
319 |
*/
|
|
320 |
TInt GetDefaultTypeString( TDes& DefaultScreenSaver );
|
|
321 |
|
|
322 |
/*
|
|
323 |
* Get the count of the voice mail
|
|
324 |
*/
|
|
325 |
TInt VoiceMailCount( const TUint32 aKey ) const;
|
|
326 |
|
|
327 |
/**
|
|
328 |
* Invalidate cached active profile
|
|
329 |
*/
|
|
330 |
void InvalidateActiveProfile();
|
|
331 |
|
|
332 |
/**
|
|
333 |
* Returns the AppUi
|
|
334 |
*/
|
|
335 |
CScreensaverAppUi *AppUi() const;
|
|
336 |
|
|
337 |
private:
|
|
338 |
|
|
339 |
/*
|
|
340 |
* The type of the display object
|
|
341 |
*/
|
|
342 |
TDisplayObjectType iDefaultType;
|
|
343 |
/**
|
|
344 |
* not owned!
|
|
345 |
*/
|
|
346 |
CScreensaverAppUi* iAppUi;
|
|
347 |
|
|
348 |
/**
|
|
349 |
* Screensaver specific values.
|
|
350 |
*/
|
|
351 |
CRepository* iScreensaverRepository;
|
|
352 |
CScreensaverRepositoryWatcher* iScreensaverRepositoryWatcher;
|
|
353 |
|
|
354 |
/**
|
|
355 |
* General Settings.
|
|
356 |
*/
|
|
357 |
CRepository* iSettingsRepository;
|
|
358 |
CScreensaverRepositoryWatcher* iSettingsRepositoryWatcher;
|
|
359 |
|
|
360 |
/**
|
|
361 |
* Common tsy repository (voice message waiting)
|
|
362 |
*/
|
|
363 |
CRepository* iCTsyRepository;
|
|
364 |
|
|
365 |
|
|
366 |
/**
|
|
367 |
* Access to the profile engine
|
|
368 |
*/
|
|
369 |
MProfileEngine* iProfileEngine;
|
|
370 |
|
|
371 |
/**
|
|
372 |
* Need to store also the profile, so that it's name
|
|
373 |
* can be used at any time
|
|
374 |
*/
|
|
375 |
MProfile* iActiveProfile;
|
|
376 |
|
|
377 |
/**
|
|
378 |
* The Msv session pointer.
|
|
379 |
*/
|
|
380 |
CMsvSession* iMsvSession;
|
|
381 |
|
|
382 |
/**
|
|
383 |
* In-box folder entry. Note that the entry is not owned by this class.
|
|
384 |
*/
|
|
385 |
CMsvEntry* iInboxFolder;
|
|
386 |
|
|
387 |
/**
|
|
388 |
* System startup completion flag
|
|
389 |
*/
|
|
390 |
TBool iStartupComplete;
|
|
391 |
};
|
|
392 |
|
|
393 |
#endif // C_SCREENSAVERSHAREDDATAI_H
|
|
394 |
// End of file.
|