1 /* |
|
2 * Copyright (c) 2009 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: Screensaver view class defination. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_SCREENSAVERVIEW_H |
|
21 #define C_SCREENSAVERVIEW_H |
|
22 |
|
23 #include <aknview.h> |
|
24 #include <babitflags.h> |
|
25 |
|
26 #include "screensaver.hrh" |
|
27 |
|
28 //CLASS DECLARATION |
|
29 class CScreensaverBase; |
|
30 class CScreensaverEngine; |
|
31 |
|
32 const TUid KUidScreensaverView ={ 1 }; |
|
33 // |
|
34 // class CScreensaverView |
|
35 // an empty place holder for when we are in the background |
|
36 class CScreensaverView : public CAknView |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Two-phased constructor |
|
42 */ |
|
43 static CScreensaverView* NewL(); |
|
44 |
|
45 /** |
|
46 * C++ default constructor |
|
47 */ |
|
48 CScreensaverView(); |
|
49 |
|
50 /** |
|
51 * Destructor |
|
52 */ |
|
53 ~CScreensaverView(); |
|
54 |
|
55 /** |
|
56 * Two-phased constructor |
|
57 */ |
|
58 void ConstructL(); |
|
59 |
|
60 /** |
|
61 * Creates the display object by the parameter |
|
62 * |
|
63 * @param the object factory object, default type is EDisplayTime |
|
64 */ |
|
65 void CreateDisplayObjectL( TDisplayObjectType aType ); |
|
66 |
|
67 /** |
|
68 * Resets the display object |
|
69 */ |
|
70 void SetDisplayObject( TDisplayObjectType aType ); |
|
71 |
|
72 /** |
|
73 * Creates the preview display object |
|
74 */ |
|
75 void CreatePreviewDisplayObjectL(); |
|
76 |
|
77 |
|
78 public://From CAknView |
|
79 |
|
80 /** |
|
81 * Returns views id, intended for overriding by sub classes. |
|
82 * @return id for this view. |
|
83 */ |
|
84 TUid Id() const; |
|
85 |
|
86 /** |
|
87 * Handles a view activation and passes the message of type |
|
88 * @c aCustomMessageId. This function is intended for overriding by |
|
89 * sub classes. This function is called by @c AknViewActivatedL(). |
|
90 * Views should not launch waiting or modal notes or dialogs in |
|
91 * @c DoActivateL. |
|
92 * @param aPrevViewId Specifies the view previously active. |
|
93 * @param aCustomMessageId Specifies the message type. |
|
94 * @param aCustomMessage The activation message. |
|
95 */ |
|
96 void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
|
97 const TDesC8& aCustomMessage ); |
|
98 |
|
99 /** |
|
100 * View deactivation function intended for overriding by sub classes. |
|
101 * This function is called by @c AknViewDeactivated(). |
|
102 */ |
|
103 void DoDeactivate(); |
|
104 |
|
105 /** |
|
106 * Shows the display object |
|
107 */ |
|
108 void ShowDisplayObject(); |
|
109 |
|
110 /** |
|
111 * Hides the display object |
|
112 */ |
|
113 void HideDisplayObject(); |
|
114 |
|
115 /** |
|
116 * Update indicator attributes and refresh display |
|
117 */ |
|
118 void UpdateAndRefresh(); |
|
119 |
|
120 private: |
|
121 /** |
|
122 * Returns the default type of screensaver |
|
123 */ |
|
124 TDisplayObjectType DefaultScreensaverType(); |
|
125 |
|
126 /** |
|
127 * Returns the psln setting type of screensaver |
|
128 */ |
|
129 TDisplayObjectType PslnSettingScreensaverType(); |
|
130 |
|
131 /** |
|
132 * Get the model of appui |
|
133 */ |
|
134 CScreensaverEngine& Model() const; |
|
135 |
|
136 /** |
|
137 * Delete the display object |
|
138 */ |
|
139 void DestroyDisplayObject(); |
|
140 |
|
141 private: |
|
142 /** |
|
143 * The type of current control |
|
144 */ |
|
145 TDisplayObjectType iCurrentControlType; |
|
146 |
|
147 /** |
|
148 * The display object of screensaver |
|
149 * |
|
150 * Owned |
|
151 */ |
|
152 CScreensaverBase* iControl; |
|
153 |
|
154 /** |
|
155 * The plugin refresh rate |
|
156 */ |
|
157 TInt iPluginRefreshRate; |
|
158 |
|
159 }; |
|
160 |
|
161 #endif // C_SCREENSAVERVIEW_H |
|