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 #ifndef __POWER_SAVE_DISPLAY_MODE_H__ |
|
22 #define __POWER_SAVE_DISPLAY_MODE_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * Adaptation API for power save display mode use |
|
31 * |
|
32 * @since Series 60 3.0 |
|
33 */ |
|
34 class CPowerSaveDisplayMode : public CBase |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Power save levels define how much power should be saved. |
|
39 * Note: higher settings result in lower image quality. |
|
40 */ |
|
41 enum TPowerSaveLevel |
|
42 { |
|
43 ENone = 0, //!< No power saving allowed |
|
44 ELow = 1, //!< Minimal saving with high quality (default) |
|
45 EMedium = 2, //!< High saving with medium quality |
|
46 EHigh = 3, //!< Maximum saving with low quality |
|
47 }; |
|
48 |
|
49 /// Destructor |
|
50 IMPORT_C ~CPowerSaveDisplayMode(); |
|
51 |
|
52 /** |
|
53 * Creates object and connects to display. |
|
54 * @param aDisplayNumber Which display to connect to, default is primary display. |
|
55 * @return new CPowerSaveDisplayMode, NULL on error |
|
56 */ |
|
57 IMPORT_C static CPowerSaveDisplayMode* NewL(TInt aDisplayNumber = 0); |
|
58 |
|
59 /** |
|
60 * Enables power save mode. Sets lines between given parameters visible, |
|
61 * other display lines are turned off and not shown. |
|
62 * @pre Image to display must be drawn in videobuffer before calling Set(). |
|
63 * @param aStartRow First visible line, starting from 0 |
|
64 * @param aEndRow Last visible line |
|
65 * @param aFullColors Full color mode if ETrue and hw supports that |
|
66 * Note: full color mode consumes more power |
|
67 * @return KErrNone on success |
|
68 */ |
|
69 IMPORT_C TInt Set(TUint aStartRow, TUint aEndRow, TBool aFullColors = EFalse); |
|
70 |
|
71 /** |
|
72 * Enables power save mode. Sets lines between given parameters visible, |
|
73 * other display lines are turned off and not shown. |
|
74 * @pre Image to display must be drawn in videobuffer before calling Set(). |
|
75 * @param aStartRow First visible line, starting from 0 |
|
76 * @param aEndRow Last visible line |
|
77 * @param aPixels Pointer to array of color of each pixel |
|
78 * @param aFullColors Full color mode if ETrue and hw supports that |
|
79 * Note: full color mode consumes more power |
|
80 * @return KErrNone on success |
|
81 */ |
|
82 IMPORT_C TInt Set(TUint aStartRow, TUint aEndRow, TUint16* aPixels, TBool aFullColors = EFalse); |
|
83 |
|
84 /** |
|
85 * Returns max number of lines that display supports in power save mode |
|
86 * (e.g.50 lines or full screen). |
|
87 * @return Number of supported power save mode lines. |
|
88 */ |
|
89 IMPORT_C TUint MaxLines(); |
|
90 |
|
91 /** |
|
92 * Returns status of power save mode. |
|
93 * @return ETrue = Enabled (on), EFalse = disabled (off, normal display) |
|
94 */ |
|
95 IMPORT_C TBool Status(); |
|
96 |
|
97 /** Turns off power save mode. All lines on display will be shown normally. |
|
98 * @return KErrNone on success. |
|
99 */ |
|
100 IMPORT_C TInt Exit(); |
|
101 |
|
102 /** |
|
103 * Changes the current power save level. |
|
104 * @param aVal New power save level |
|
105 * @return KErrNone operation succeeded, |
|
106 * KErrNotSupported feature is not available. |
|
107 */ |
|
108 IMPORT_C TInt SetPowerSaveLevel(CPowerSaveDisplayMode::TPowerSaveLevel aVal); |
|
109 |
|
110 /** |
|
111 * Return the current power save level. |
|
112 * @return TPowerSaveLevel |
|
113 */ |
|
114 IMPORT_C CPowerSaveDisplayMode::TPowerSaveLevel GetPowerSaveLevel(); |
|
115 |
|
116 private: |
|
117 /// Default constructor |
|
118 CPowerSaveDisplayMode(); |
|
119 |
|
120 /// Second phase constructor |
|
121 void ConstructL(TInt aDisplayNumber); |
|
122 |
|
123 private: |
|
124 /// Display driver pointer |
|
125 TAny* iDisplayDriver; |
|
126 }; |
|
127 |
|
128 #endif // POWER_SAVE_DISPLAY_MODE_H |
|
129 |
|
130 // End of File |
|