2017-01-03 01:05:30 +03:00
/*
* Copyright 2016 Smith AR < audoban @ openmailbox . org >
* Michail Vourlakos < mvourlakos @ gmail . com >
*
* This file is part of Latte - Dock
*
* Latte - Dock is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation ; either version 2 of
* the License , or ( at your option ) any later version .
*
* Latte - Dock is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
2016-12-25 10:25:27 +03:00
# ifndef VISIBILITYMANAGER_H
# define VISIBILITYMANAGER_H
2018-02-03 12:34:13 +03:00
# include "../plasmaquick/containmentview.h"
# include "../../liblattedock/dock.h"
2016-12-25 10:25:27 +03:00
2016-12-26 02:12:31 +03:00
# include <QObject>
2016-12-25 10:25:27 +03:00
# include <QTimer>
# include <Plasma/Containment>
2016-12-29 08:42:55 +03:00
namespace Latte {
class VisibilityManagerPrivate ;
2016-12-25 10:25:27 +03:00
class VisibilityManager : public QObject {
Q_OBJECT
2017-01-16 22:07:49 +03:00
2016-12-26 02:12:31 +03:00
Q_PROPERTY ( Latte : : Dock : : Visibility mode READ mode WRITE setMode NOTIFY modeChanged )
2017-03-12 12:01:27 +03:00
Q_PROPERTY ( bool raiseOnDesktop READ raiseOnDesktop WRITE setRaiseOnDesktop NOTIFY raiseOnDesktopChanged )
Q_PROPERTY ( bool raiseOnActivity READ raiseOnActivity WRITE setRaiseOnActivity NOTIFY raiseOnActivityChanged )
2016-12-30 10:18:08 +03:00
Q_PROPERTY ( bool isHidden READ isHidden WRITE setIsHidden NOTIFY isHiddenChanged )
2017-01-02 11:06:47 +03:00
Q_PROPERTY ( bool blockHiding READ blockHiding WRITE setBlockHiding NOTIFY blockHidingChanged )
2016-12-28 10:54:26 +03:00
Q_PROPERTY ( bool containsMouse READ containsMouse NOTIFY containsMouseChanged )
2017-12-24 21:54:45 +03:00
//! Dynamic Background Feature (needed options)
Q_PROPERTY ( bool enabledDynamicBackground READ enabledDynamicBackground WRITE setEnabledDynamicBackground NOTIFY enabledDynamicBackgroundChanged )
Q_PROPERTY ( bool existsWindowMaximized READ existsWindowMaximized NOTIFY existsWindowMaximizedChanged )
Q_PROPERTY ( bool existsWindowSnapped READ existsWindowSnapped NOTIFY existsWindowSnappedChanged )
2018-03-28 20:39:52 +03:00
//! KWin Edges Support Options
Q_PROPERTY ( bool enableKWinEdges READ enableKWinEdges WRITE setEnableKWinEdges NOTIFY enableKWinEdgesChanged )
Q_PROPERTY ( bool supportsKWinEdges READ supportsKWinEdges NOTIFY supportsKWinEdgesChanged )
2016-12-26 02:12:31 +03:00
Q_PROPERTY ( int timerShow READ timerShow WRITE setTimerShow NOTIFY timerShowChanged )
Q_PROPERTY ( int timerHide READ timerHide WRITE setTimerHide NOTIFY timerHideChanged )
2017-01-16 22:07:49 +03:00
2016-12-25 10:25:27 +03:00
public :
explicit VisibilityManager ( PlasmaQuick : : ContainmentView * view ) ;
2016-12-26 02:12:31 +03:00
virtual ~ VisibilityManager ( ) ;
2017-01-16 22:07:49 +03:00
2016-12-26 02:12:31 +03:00
Latte : : Dock : : Visibility mode ( ) const ;
void setMode ( Latte : : Dock : : Visibility mode ) ;
2017-01-16 22:07:49 +03:00
2018-01-21 12:53:15 +03:00
void setWindowOnActivities ( QWindow & window , const QStringList & activities ) ;
2018-03-28 20:39:52 +03:00
void applyActivitiesToHiddenWindows ( const QStringList & activities ) ;
2018-01-13 13:55:13 +03:00
2017-03-12 12:01:27 +03:00
bool raiseOnDesktop ( ) const ;
void setRaiseOnDesktop ( bool enable ) ;
bool raiseOnActivity ( ) const ;
void setRaiseOnActivity ( bool enable ) ;
2016-12-28 11:00:01 +03:00
bool isHidden ( ) const ;
2016-12-30 10:18:08 +03:00
void setIsHidden ( bool isHidden ) ;
2017-01-16 22:07:49 +03:00
2017-01-02 11:06:47 +03:00
bool blockHiding ( ) const ;
void setBlockHiding ( bool blockHiding ) ;
2017-01-16 22:07:49 +03:00
2016-12-28 11:00:01 +03:00
bool containsMouse ( ) const ;
2017-01-16 22:07:49 +03:00
2016-12-26 02:12:31 +03:00
int timerShow ( ) const ;
void setTimerShow ( int msec ) ;
2017-01-16 22:07:49 +03:00
2016-12-26 02:12:31 +03:00
int timerHide ( ) const ;
void setTimerHide ( int msec ) ;
2017-01-16 22:07:49 +03:00
2017-12-24 21:54:45 +03:00
//! Dynamic Background functions
bool enabledDynamicBackground ( ) const ;
void setEnabledDynamicBackground ( bool active ) ;
bool existsWindowMaximized ( ) const ;
void setExistsWindowMaximized ( bool windowMaximized ) ;
bool existsWindowSnapped ( ) const ;
void setExistsWindowSnapped ( bool windowSnapped ) ;
2018-03-28 20:39:52 +03:00
//! KWin Edges Support functions
bool enableKWinEdges ( ) const ;
void setEnableKWinEdges ( bool enable ) ;
bool supportsKWinEdges ( ) const ;
2016-12-26 02:12:31 +03:00
signals :
2017-03-12 21:09:38 +03:00
void mustBeShown ( QPrivateSignal ) ;
void mustBeHide ( QPrivateSignal ) ;
2017-01-16 22:07:49 +03:00
2016-12-26 02:12:31 +03:00
void modeChanged ( ) ;
2017-03-12 12:01:27 +03:00
void raiseOnDesktopChanged ( ) ;
void raiseOnActivityChanged ( ) ;
2016-12-28 10:54:26 +03:00
void isHiddenChanged ( ) ;
2017-01-02 11:06:47 +03:00
void blockHidingChanged ( ) ;
2016-12-28 10:54:26 +03:00
void containsMouseChanged ( ) ;
2016-12-26 02:12:31 +03:00
void timerShowChanged ( ) ;
void timerHideChanged ( ) ;
2017-01-16 22:07:49 +03:00
2017-12-24 21:54:45 +03:00
//! Dynamic Background signals (from options)
void enabledDynamicBackgroundChanged ( ) ;
void existsWindowMaximizedChanged ( ) ;
void existsWindowSnappedChanged ( ) ;
2018-03-28 20:39:52 +03:00
//! KWin Edges Support signals
void enableKWinEdgesChanged ( ) ;
void supportsKWinEdgesChanged ( ) ;
2016-12-28 10:54:26 +03:00
private :
VisibilityManagerPrivate * const d ;
2017-03-12 21:09:38 +03:00
friend class VisibilityManagerPrivate ;
2016-12-25 10:25:27 +03:00
} ;
2016-12-29 08:42:55 +03:00
}
2016-12-26 02:12:31 +03:00
# endif // VISIBILITYMANAGER_H