22 #ifndef OVERLAYWINDOWMANAGER_H
23 #define OVERLAYWINDOWMANAGER_H
39 #include <QGraphicsSceneMouseEvent>
40 #include <QPropertyAnimation>
41 #include <QParallelAnimationGroup>
42 #include <QTapAndHoldGesture>
149 void resize(
int width,
int height);
172 bool dockInAnimation()
const;
173 void mapCoordToWindow(
Window* win,
int& x,
int& y)
const;
175 void setupSearchPill();
177 bool setupLauncher();
178 void setupDragWindow();
179 void setupFeedbackWindow();
181 void setupLauncherAnimations();
182 void setupDockAnimations();
183 void setupSearchPillAnimations();
184 void setupUniversalSearchAnimations();
186 void setupDockStateMachine();
187 void setupLauncherStateMachine();
188 void setupSearchPillStateMachine();
189 void setupUniversalSearchStateMachine();
191 QState* createState(QString name,
QState *parent = NULL);
193 bool handlePenDownEvent(Event* event);
194 bool handlePenMoveEvent(Event* event);
195 bool handlePenUpEvent(Event* event);
196 bool handlePenFlickEvent(Event* event);
197 bool handlePenCancelEvent(Event* event);
198 bool handlePressAndHoldEvent(Event* event);
200 bool handlePenMoveEventStateNormal(Event* event);
201 void handlePenMoveEventStateStache(Event* event);
203 bool handlePenUpEventStateNormal(Event* event);
204 bool handlePenUpEventStateStache(Event* event);
206 void handlePenCancelEventStateStache(Event* event);
208 void cancelReorder();
231 void slotFSMUniversalSearchVisible();
232 void slotFSMUniversalSearchHidden();
233 void slotUniversalSearchFocusChange (
bool enabled);
247 void slotSystemAPIToggleLauncher();
248 void slotSystemAPICloseLauncher();
249 void slotSystemAPIOpenLauncher();
250 void slotSystemAPIRecreateLauncher();
254 void slotLauncherOpenState();
255 void slotLauncherClosedState();
257 void slotPositiveSpaceAboutToChange(
const QRect& r,
bool fullScreen,
bool screenResizing);
258 void slotPositiveSpaceChangeFinished(
const QRect& r);
259 void slotPositiveSpaceChanged(
const QRect& r);
260 void slotCardWindowMaximized();
261 void slotCardWindowMinimized();
262 void slotEmergencyModeChanged(
bool enabled);
269 void slotLauncherReady();
270 void slotLauncherNotReady();
272 void slotQuickLaunchReady();
273 void slotQuickLaunchNotReady();
278 void slotStartShowLauncherSequence();
279 void slotStartHideLauncherSequence();
281 void slotAnimateShowDock();
282 void slotAnimateHideDock();
284 void slotAnimateFadeOutSearchPill();
285 void slotAnimateFadeInSearchPill();
287 void slotAnimateHideUniversalSearch();
288 void slotAnimateShowUniversalSearch();
290 void slotFadeDock(
bool fadeOut);
291 void slotLauncherOpened();
292 void slotLauncherClosed();
294 void slotShowUniversalSearch(
bool hideLauncher=
true);
295 void slotHideUniversalSearch(
bool showLauncher,
bool speedDial);
297 void launcherAnimationFinished();
298 void dockAnimationFinished();
299 void universalSearchOpacityAnimationFinished();
302 void dockStateTransition();
303 void launcherStateTransition();
305 void slotDisplayStateChange(
int);
309 QPropertyAnimation * dimensionsLauncherShowUpAnimation();
310 void dimensionsLauncherShowUpAnimation(QPropertyAnimation * p_anim);
311 QPropertyAnimation * dimensionsLauncherHideDownAnimation();
312 void dimensionsLauncherHideDownAnimation(QPropertyAnimation * p_anim);
314 void fadeOutSearchPillAnimation(QPropertyAnimation * p_anim);
315 void fadeInSearchPillAnimation(QPropertyAnimation * p_anim);
317 void fadeOutUniversalSearchAnimation(QPropertyAnimation * p_anim);
318 void fadeInUniversalSearchAnimation(QPropertyAnimation * p_anim);
321 void dimensionsLauncherAdjustPositionOnResize();
323 void animateShowLauncher();
324 void animateHideLauncher();
326 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
327 bool handleTouchBegin(QTouchEvent *e);
328 bool handleTouchEnd(QTouchEvent *e);
329 bool handleTouchUpdate(QTouchEvent *e);
349 QPoint m_dockShownPos;
350 QPoint m_dockHiddenPos;
352 int m_dockOffsetFromBottom;
353 int m_oldDockOffsetFromBottom;
355 Window* m_universalSearchWin;
356 bool m_universalSearchShown;
357 bool m_ignoreKeyDueToSpeedDialEvent;
361 DragWindow* m_dragWin;
363 int m_lastPenX, m_lastPenY;
364 bool m_dockWasShownBeforeDrag;
368 PenDownState m_penDownState;
370 bool m_dockHasMetFinger;
373 QSize m_feedbackOffset;
375 QPointer<QStateMachine> m_searchPillStateMachine;
376 QPointer<QStateMachine> m_dockStateMachine;
377 QPointer<QStateMachine> m_launcherStateMachine;
378 QPointer<QStateMachine> m_universalSearchStateMachine;
380 struct SearchPillStateManager {
385 struct DockStateManager {
391 struct LauncherStateManager {
397 struct UniversalSearchStateManager {
402 SearchPillStateManager *m_searchPillStates;
403 DockStateManager *m_dockStates;
404 LauncherStateManager *m_launcherStates;
405 UniversalSearchStateManager *m_uSearchStates;
410 DragIconState m_dragSource;
414 QPropertyAnimation *m_animateLauncherOpacity;
415 QPointer<QPropertyAnimation> m_qp_animateUniversalSearchOpacity;
416 QPointer<QPropertyAnimation> m_qp_animateSearchPillOpacity;
419 QPropertyAnimation *m_dockOpacityAnimation;
420 QPropertyAnimation *m_dockPosAnimation;
421 QPropertyAnimation *m_dockBgOpacityAnimation;
423 QPointer<QPropertyAnimation> m_qp_launcherPosAnimation;
425 bool m_pendingLauncherRecreate;