22 #ifndef DISPLAYMANAGER_H
23 #define DISPLAYMANAGER_H
37 #include "lunaservice.h"
39 #define DISPLAY_LOCK_SCREEN 1
40 #define DISPLAY_UNLOCK_SCREEN 2
41 #define DISPLAY_NIGHT_SCREEN 3
42 #define DISPLAY_DOCK_SCREEN 4
44 #define DISPLAY_EXIT_NIGHT_STAND_MODE 1001
46 #define DISPLAY_SIGNAL_OFF 2001
47 #define DISPLAY_SIGNAL_ON 2002
48 #define DISPLAY_SIGNAL_DIM 2003
49 #define DISPLAY_SIGNAL_DOCK 2004
50 #define DISPLAY_SIGNAL_OFF_ON_CALL 2005
52 #define DISPLAY_ALERT_GENERIC_ACTIVATED 1
53 #define DISPLAY_ALERT_PHONECALL_ACTIVATED 2
54 #define DISPLAY_ALERT_GENERIC_DEACTIVATED 3
55 #define DISPLAY_ALERT_PHONECALL_DEACTIVATED 4
57 #define DISPLAY_BANNER_ACTIVATED 5
58 #define DISPLAY_BANNER_DEACTIVATED 6
60 #define DISPLAY_ALERT_CANCEL 7
62 #define ACTIVE_MESSAGE_PATTERN_SIZE 6
79 bool alert (
int state);
90 static bool controlSetState(LSHandle *sh, LSMessage *message,
void *ctx);
92 static bool controlStatus(LSHandle *sh, LSMessage *message,
void *ctx);
98 static bool timeoutCallback(LSHandle *sh, LSMessage *message,
void *ctx);
100 static bool batteryCallback(LSHandle *sh, LSMessage *message,
void *ctx);
101 static bool chargerCallback(LSHandle *sh, LSMessage *message,
void *ctx);
102 static bool usbDockCallback(LSHandle *sh, LSMessage *message,
void *ctx);
103 static bool sliderCallback(LSHandle *sh, LSMessage *message,
void *ctx);
104 static bool audiodCallback(LSHandle *sh, LSMessage *message,
void *ctx);
136 std::string
puckId()
const;
162 static bool s_forceVsyncDisable;
163 static bool s_vsyncEnabled;
164 static double s_currentLatitude;
165 static double s_currentLongitude;
167 LSPalmService* m_palmService;
169 LSHandle* m_publicService;
174 int32_t m_chargerConnected;
177 bool m_onWhenConnected;
182 int32_t m_blockedPowerKey;
186 enum {SLIDING_NOW = 2, SLIDING_WAIT = 1, NOT_SLIDING = 0} m_slidingNow;
187 uint32_t m_slidingStart;
193 uint32_t m_lastEvent;
194 uint32_t m_lastUserEvent;
195 uint32_t m_lastInternalEvent;
197 int32_t m_dimTimeout;
198 int32_t m_offTimeout;
199 int32_t m_totalTimeout;
200 int32_t m_lockedOffTimeout;
201 int32_t m_activityTimeout;
202 int32_t m_powerKeyTimeout;
209 int32_t m_alertState;
210 int32_t m_proximityCount;
211 bool m_proximityEnabled;
212 bool m_proximityActivated;
214 LSMessageToken m_calbackOnToken;
215 LSMessageToken m_calbackOffToken;
218 bool m_touchpanelIsOn;
219 bool m_backlightIsOn;
220 bool m_activeTouchpanel;
221 Timer<DisplayManager>* m_activity;
222 Timer<DisplayManager>* m_power;
223 Timer<DisplayManager>* m_slider;
224 Timer<DisplayManager>* m_alertTimer;
225 int32_t m_maxBrightness;
227 std::string m_puckId;
233 bool off (sptr<Event> event = 0);
234 bool on (sptr<Event> event = 0);
235 bool dim (sptr<Event> event = 0);
241 bool alertTimerCallback();
242 bool updateTimeout(
int timeoutInMs);
243 bool setTimeout (
int timeout);
244 bool notifySubscribers(
int type, sptr<Event> event = 0);
245 bool updateBrightness ();
246 int32_t getDisplayBrightness ();
247 int32_t getKeypadBrightness ();
249 void setTouchpanelMode (
bool active);
258 void displayAdjust();
266 void requestCurrentLocation();
269 void backlightOn (
int displayBrightness,
int keyBrightness,
bool als);
270 static void backlightOnCallback (
void* ctx);
272 static void backlightOffCallback (
void* ctx);
275 bool touchPanelOff();
276 static bool touchPanelOffCallback (LSHandle* sh, LSMessage* message,
void* ctx);
277 static bool updateCompassBearingInfo(LSHandle* sh, LSMessage* message,
void* ctx);
282 static void changeVsyncControl(
bool enable);
286 void slotEmergencyMode (
bool enable);
287 void slotAlsEnabled (
bool enable);
288 void slotBootFinished();
291 void slotBluetoothKeyboardActive(
bool active);
292 void slotAirplaneModeChanged(
bool change);