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: |
|
15 * Defines an API used by Series 60 to access the power save display mode |
|
16 * features. |
|
17 * |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include "power_save_display_mode.h" |
|
25 #include <e32std.h> |
|
26 |
|
27 // CONSTANTS |
|
28 // Stub uses a constant value for power save size |
|
29 const TInt KMaxPowerSaveLinesStub = 50; |
|
30 |
|
31 |
|
32 // ============================ MEMBER FUNCTIONS =============================== |
|
33 |
|
34 /** |
|
35 * @see power_save_display_mode.h |
|
36 */ |
|
37 CPowerSaveDisplayMode::CPowerSaveDisplayMode() : |
|
38 CBase(), |
|
39 iDisplayDriver(NULL) |
|
40 { |
|
41 } |
|
42 |
|
43 |
|
44 /** |
|
45 * @see power_save_display_mode.h |
|
46 */ |
|
47 EXPORT_C CPowerSaveDisplayMode* CPowerSaveDisplayMode::NewL(TInt aDisplayNumber) |
|
48 { |
|
49 CPowerSaveDisplayMode* result = new(ELeave) CPowerSaveDisplayMode; |
|
50 |
|
51 CleanupStack::PushL(result); |
|
52 result->ConstructL(aDisplayNumber); |
|
53 CleanupStack::Pop(); |
|
54 |
|
55 return result; |
|
56 } |
|
57 |
|
58 |
|
59 /** |
|
60 * @see power_save_display_mode.h |
|
61 */ |
|
62 void CPowerSaveDisplayMode::ConstructL(TInt /* aDisplayNumber */) |
|
63 { |
|
64 /* |
|
65 * ADAPTATION IMPLEMENTATION NEEDED |
|
66 * |
|
67 * Create and initialize all the member variables that are needed |
|
68 * in order to complete the tasks assigned to this class here. |
|
69 * Note that this function may leave. |
|
70 */ |
|
71 } |
|
72 |
|
73 |
|
74 /** |
|
75 * @see power_save_display_mode.h |
|
76 */ |
|
77 EXPORT_C CPowerSaveDisplayMode::~CPowerSaveDisplayMode() |
|
78 { |
|
79 /* |
|
80 * ADAPTATION IMPLEMENTATION NEEDED |
|
81 * |
|
82 * Destroy all member variables that have been created by |
|
83 * ConstructL(). Close open connections. |
|
84 */ |
|
85 } |
|
86 |
|
87 |
|
88 /** |
|
89 * @see power_save_display_mode.h |
|
90 */ |
|
91 EXPORT_C TBool CPowerSaveDisplayMode::Status() |
|
92 { |
|
93 /* |
|
94 * ADAPTATION IMPLEMENTATION NEEDED |
|
95 * |
|
96 * Return ETrue if the power save mode is activated, otherwise EFalse |
|
97 */ |
|
98 return EFalse; |
|
99 } |
|
100 |
|
101 |
|
102 /** |
|
103 * @see power_save_display_mode.h |
|
104 */ |
|
105 EXPORT_C TInt CPowerSaveDisplayMode::Exit() |
|
106 { |
|
107 /* |
|
108 * ADAPTATION IMPLEMENTATION NEEDED |
|
109 * |
|
110 * Instruct the display driver to exit power save mode. |
|
111 * Return KErrNone on success, or an error code. |
|
112 */ |
|
113 |
|
114 return KErrNone; |
|
115 } |
|
116 |
|
117 |
|
118 /** |
|
119 * @see power_save_display_mode.h |
|
120 */ |
|
121 EXPORT_C TUint CPowerSaveDisplayMode::MaxLines() |
|
122 { |
|
123 /* |
|
124 * ADAPTATION IMPLEMENTATION NEEDED |
|
125 * |
|
126 * Return the maximum number of screen display lines supported in |
|
127 * power save mode. This should be queried from the display driver. |
|
128 */ |
|
129 return KMaxPowerSaveLinesStub; |
|
130 } |
|
131 |
|
132 |
|
133 /** |
|
134 * @see power_save_display_mode.h |
|
135 */ |
|
136 EXPORT_C TInt CPowerSaveDisplayMode::Set( |
|
137 TUint aStartRow, |
|
138 TUint aEndRow, |
|
139 TBool /* aFullColors */) |
|
140 { |
|
141 /* |
|
142 * ADAPTATION IMPLEMENTATION NEEDED |
|
143 * |
|
144 * Instruct the display driver to enter power save mode starting from |
|
145 * row "aStartRow" (0-based) and finishing at row "aEndRow". The image |
|
146 * to be displayed should already be drawn in display buffer. |
|
147 */ |
|
148 |
|
149 // Sanity-check params |
|
150 if (aEndRow <= aStartRow) |
|
151 { |
|
152 return KErrArgument; |
|
153 } |
|
154 else |
|
155 { |
|
156 return KErrNone; |
|
157 } |
|
158 } |
|
159 |
|
160 |
|
161 /** |
|
162 * @see power_save_display_mode.h |
|
163 */ |
|
164 EXPORT_C TInt CPowerSaveDisplayMode::Set( |
|
165 TUint aStartRow, |
|
166 TUint aEndRow, |
|
167 TUint16* aPixels, |
|
168 TBool /* aFullColors */) |
|
169 { |
|
170 /* |
|
171 * ADAPTATION IMPLEMENTATION NEEDED |
|
172 * |
|
173 * Instruct the display driver to enter power save mode starting from |
|
174 * row "aStartRow" (0-based) and finishing at row "aEndRow". The image |
|
175 * to be displayed should already be drawn in display buffer. |
|
176 */ |
|
177 |
|
178 // Sanity-check params |
|
179 if (aEndRow <= aStartRow || aPixels == NULL) |
|
180 { |
|
181 return KErrArgument; |
|
182 } |
|
183 else |
|
184 { |
|
185 return KErrNone; |
|
186 } |
|
187 } |
|
188 |
|
189 |
|
190 /** |
|
191 * @see power_save_display_mode.h |
|
192 */ |
|
193 EXPORT_C TInt CPowerSaveDisplayMode::SetPowerSaveLevel(CPowerSaveDisplayMode::TPowerSaveLevel aVal) |
|
194 { |
|
195 if ( aVal >= ENone && aVal <= EHigh ) |
|
196 { |
|
197 return KErrNone; |
|
198 } |
|
199 else |
|
200 { |
|
201 return KErrNotSupported; |
|
202 } |
|
203 } |
|
204 |
|
205 |
|
206 /** |
|
207 * @see power_save_display_mode.h |
|
208 */ |
|
209 EXPORT_C CPowerSaveDisplayMode::TPowerSaveLevel CPowerSaveDisplayMode::GetPowerSaveLevel() |
|
210 { |
|
211 return CPowerSaveDisplayMode::ELow; |
|
212 } |
|
213 |
|
214 // End of File |
|