|
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 EDisplayNone |
|
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 * Returns true the screensaver doesn't draw anything |
|
79 */ |
|
80 TBool IsContentlessScreensaver() const; |
|
81 |
|
82 public://From CAknView |
|
83 |
|
84 /** |
|
85 * Returns views id, intended for overriding by sub classes. |
|
86 * @return id for this view. |
|
87 */ |
|
88 TUid Id() const; |
|
89 |
|
90 /** |
|
91 * Handles a view activation and passes the message of type |
|
92 * @c aCustomMessageId. This function is intended for overriding by |
|
93 * sub classes. This function is called by @c AknViewActivatedL(). |
|
94 * Views should not launch waiting or modal notes or dialogs in |
|
95 * @c DoActivateL. |
|
96 * @param aPrevViewId Specifies the view previously active. |
|
97 * @param aCustomMessageId Specifies the message type. |
|
98 * @param aCustomMessage The activation message. |
|
99 */ |
|
100 void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
|
101 const TDesC8& aCustomMessage ); |
|
102 |
|
103 /** |
|
104 * View deactivation function intended for overriding by sub classes. |
|
105 * This function is called by @c AknViewDeactivated(). |
|
106 */ |
|
107 void DoDeactivate(); |
|
108 |
|
109 /** |
|
110 * Shows the display object |
|
111 */ |
|
112 void ShowDisplayObject(); |
|
113 |
|
114 /** |
|
115 * Hides the display object |
|
116 */ |
|
117 void HideDisplayObject(); |
|
118 |
|
119 /** |
|
120 * Update indicator attributes and refresh display |
|
121 */ |
|
122 void UpdateAndRefresh(); |
|
123 |
|
124 private: |
|
125 /** |
|
126 * Returns the default type of screensaver |
|
127 */ |
|
128 TDisplayObjectType DefaultScreensaverType(); |
|
129 |
|
130 /** |
|
131 * Returns the psln setting type of screensaver |
|
132 */ |
|
133 TDisplayObjectType PslnSettingScreensaverType(); |
|
134 |
|
135 /** |
|
136 * Get the model of appui |
|
137 */ |
|
138 CScreensaverEngine& Model() const; |
|
139 |
|
140 /** |
|
141 * Delete the display object |
|
142 */ |
|
143 void DestroyDisplayObject(); |
|
144 |
|
145 private: |
|
146 /** |
|
147 * The type of current control |
|
148 */ |
|
149 TDisplayObjectType iCurrentControlType; |
|
150 |
|
151 /** |
|
152 * The display object of screensaver |
|
153 * |
|
154 * Owned |
|
155 */ |
|
156 CScreensaverBase* iControl; |
|
157 |
|
158 /** |
|
159 * The plugin refresh rate |
|
160 */ |
|
161 TInt iPluginRefreshRate; |
|
162 |
|
163 /** |
|
164 * True if the active screensaver doesn't draw (e.g None) |
|
165 */ |
|
166 TBool iIsContentless; |
|
167 |
|
168 }; |
|
169 |
|
170 #endif // C_SCREENSAVERVIEW_H |