22 #ifndef WINDOWSERVERLUNA_H
23 #define WINDOWSERVERLUNA_H
30 #include <QPropertyAnimation>
31 #include <QParallelAnimationGroup>
32 #include <QSequentialAnimationGroup>
33 #include <QGraphicsItem>
34 #include <QGraphicsObject>
37 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
38 #include <QWeakPointer>
50 class QDeclarativeEngine;
68 virtual void startDrag(
int x,
int y,
void* imgRef,
const std::string& lpid);
69 virtual void endDrag(
int x,
int y,
const std::string& lpid,
bool handled);
86 virtual bool okToResizeUi(
bool ignorePendingRequests=
false);
99 void slotWallPaperChanged(
const char* filePath);
100 void slotDisplayStateChange(
int state);
101 void slotScreenLockStatusChanged(
bool locked);
102 void slotDockAnimationFinished();
103 void slotDockModeEnable(
bool enabled);
104 void slotPuckConnected(
bool connected);
105 void slotFullEraseDevice();
106 void slotShowFullEraseWindow();
107 void slotMemoryStateChanged(
bool critical);
108 void slotAppLaunchPreventedUnderLowMemory();
109 void slotBrickModeFailed();
110 void slotFirstCardRun();
116 bool sysmgrEventFilters(
QEvent* event);
118 void initDockModeAnimations();
119 void setupDockModeAnimations();
120 void cleanupDockModeAnimations();
121 void dockModeUiTransition(
bool enter);
122 void animateDockMode(
bool in);
123 void reorderWindowManagersForDockMode(
bool enabled);
125 bool triggerFullEraseCountdown();
126 void cancelFullEraseCountdown();
127 static bool cbFullEraseCallback(LSHandle*, LSMessage*,
void*);
129 bool processSystemShortcut(
QEvent* event );
131 QPixmap* takeScreenShot();
133 void generateWallpaperImages();
134 void updateWallpaperForRotation(OrientationEvent::Orientation newOrient);
135 void drawBackground ( QPainter * painter,
const QRectF & rect );
137 void createMemoryAlertWindow();
138 void createMsmEntryFailedAlertWindow();
139 void createDismissCardWindow();
150 QDeclarativeEngine* m_qmlEngine;
152 QString m_wallpaperFileName;
153 QPixmap m_normalWallpaperImage, m_rotatedWallpaperImage;
154 QPixmap* m_currWallpaperImg;
155 bool m_drawWallpaper;
156 bool m_wallpaperFullScreen;
160 QPixmap *m_screenShot, *m_dockImage;
162 QPropertyAnimation m_screenFade, m_dockFade;
163 QPropertyAnimation m_screenScale, m_dockScale;
164 QParallelAnimationGroup m_screenGroup, m_dockGroup;
165 QSequentialAnimationGroup m_dockSequence, m_dockModeAnimation;
167 struct PowerVolumeKeyComboState {
169 bool volDownKeyPress;
172 PowerVolumeKeyComboState()
173 : powerKeyPress(false)
174 , volDownKeyPress(false)
175 , volUpKeyPress(false) {
178 bool fullEraseComboDown()
const {
179 return powerKeyPress && volUpKeyPress;
182 bool msmEntryComboDown()
const {
183 return powerKeyPress && volDownKeyPress;
186 bool comboDown()
const {
187 return fullEraseComboDown() || msmEntryComboDown();
191 powerKeyPress = volDownKeyPress = volUpKeyPress =
false;
195 PowerVolumeKeyComboState m_powerVolumeKeyComboState;
197 bool m_fullErasePending;
199 bool m_dashboardOpenInDockMode;
200 bool m_inDockModeTransition;
201 bool m_dockModeTransitionDirection;
203 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
204 QWeakPointer<QmlAlertWindow> m_memoryAlert;
205 QWeakPointer<QmlAlertWindow> m_msmEntryFailedAlert;
206 QWeakPointer<QmlAlertWindow> m_dismissCardDialog;
208 QPointer<QmlAlertWindow> m_memoryAlert;
209 QPointer<QmlAlertWindow> m_msmEntryFailedAlert;
210 QPointer<QmlAlertWindow> m_dismissCardDialog;