From 2e89127d6eec770546ab38f3c05e0d3c43e13378 Mon Sep 17 00:00:00 2001 From: audoban Date: Wed, 28 Dec 2016 02:54:26 -0500 Subject: [PATCH] The new interface as we agreed. also VisibilityManager will perform the logic of the visibility as it corresponds through a class d-pointer using AbstractWindowInterface. --- app/visibilitymanager.h | 49 +++++++++++++---------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/app/visibilitymanager.h b/app/visibilitymanager.h index 20f9f0110..aa8c7adb6 100644 --- a/app/visibilitymanager.h +++ b/app/visibilitymanager.h @@ -14,9 +14,14 @@ class VisibilityManager : public QObject { Q_OBJECT Q_PROPERTY(Latte::Dock::Visibility mode READ mode WRITE setMode NOTIFY modeChanged) + + Q_PROPERTY(bool isHidden READ isHidden WRITE isHidden NOTIFY isHiddenChanged) + + Q_PROPERTY(bool containsMouse READ containsMouse NOTIFY containsMouseChanged) + Q_PROPERTY(int timerShow READ timerShow WRITE setTimerShow NOTIFY timerShowChanged) + Q_PROPERTY(int timerHide READ timerHide WRITE setTimerHide NOTIFY timerHideChanged) - Q_PROPERTY(Latte::Dock::VisibilityState state READ state WRITE setState NOTIFY stateChanged) public: explicit VisibilityManager(PlasmaQuick::ContainmentView *view); @@ -32,45 +37,21 @@ public: void setTimerHide(int msec); /** - * @brief show, change state to Dock::Visible when show timer is triggered. - */ - Q_INVOKABLE void show(); - - /** - * @brief showImmediately, same that show, but without timer - */ - Q_INVOKABLE void showImmediately(); - - /** - * @brief restore, change to last state, respecting the timers. - */ - Q_INVOKABLE void restore(); - - /** - * @brief showTemporarily, same that show but restores last state automatically - * @param msec, timeout before restoring - */ - Q_INVOKABLE void showTemporarily(int msec); - - /** - * @brief updateDockGeometry, the geometry should be inside screen, not into window. + * @brief updateDockGeometry, the window geometry in absolute coordinates. */ void updateDockGeometry(QRect &geometry); - + signals: - /** - * @brief mouseEntered, emitted when mouse enters the dock - */ - void mouseEntered(); + void mustBeShown(); + void mustBeHide(); - /** - * @brief mouseExited, emitted when mouse leaves the dock - */ - void mouseExited(); - void modeChanged(); + void isHiddenChanged(); + void containsMouseChanged(); void timerShowChanged(); void timerHideChanged(); - void stateChanged(); + +private: + VisibilityManagerPrivate *const d; }; #endif // VISIBILITYMANAGER_H