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-28 10:45:21 +03:00
# ifndef ABSTRACTWINDOWINTERFACE_H
# define ABSTRACTWINDOWINTERFACE_H
# include "windowinfowrap.h"
# include "../liblattedock/dock.h"
2017-02-25 05:40:47 +03:00
# include "../liblattedock/extras.h"
2016-12-28 10:45:21 +03:00
# include <unordered_map>
# include <list>
# include <QObject>
2017-02-25 05:40:47 +03:00
# include <QPointer>
2016-12-29 08:37:53 +03:00
# include <QRect>
2017-02-25 05:40:47 +03:00
# include <QQuickView>
# include <QDialog>
2016-12-28 10:45:21 +03:00
2016-12-29 08:37:53 +03:00
# include <Plasma>
2017-02-25 05:40:47 +03:00
# include <KActivities/Consumer>
2016-12-29 08:37:53 +03:00
2016-12-28 10:45:21 +03:00
namespace Latte {
2016-12-30 10:11:42 +03:00
class XWindowInterface ;
2016-12-28 10:45:21 +03:00
class AbstractWindowInterface : public QObject {
Q_OBJECT
2017-01-16 22:07:49 +03:00
2016-12-28 10:45:21 +03:00
public :
2017-02-25 05:40:47 +03:00
enum class Slide {
None ,
Top ,
Left ,
Bottom ,
Right ,
} ;
explicit AbstractWindowInterface ( QObject * parent = nullptr ) ;
2016-12-28 10:45:21 +03:00
virtual ~ AbstractWindowInterface ( ) ;
2017-01-16 22:07:49 +03:00
2017-02-25 05:40:47 +03:00
virtual void setDockExtraFlags ( QQuickWindow & view ) = 0 ;
virtual void setDockStruts ( WId dockId , const QRect & dockRect , Plasma : : Types : : Location location ) const = 0 ;
virtual void removeDockStruts ( WId dockId ) const = 0 ;
2017-01-16 22:07:49 +03:00
2016-12-28 10:45:21 +03:00
virtual WId activeWindow ( ) const = 0 ;
2017-01-02 09:04:10 +03:00
virtual WindowInfoWrap requestInfo ( WId wid ) const = 0 ;
virtual WindowInfoWrap requestInfoActive ( ) const = 0 ;
virtual bool isOnCurrentDesktop ( WId wid ) const = 0 ;
virtual const std : : list < WId > & windows ( ) const = 0 ;
2017-01-16 22:07:49 +03:00
2017-02-25 05:40:47 +03:00
virtual void skipTaskBar ( const QDialog & dialog ) const = 0 ;
virtual void slideWindow ( QQuickWindow & view , Slide location ) const = 0 ;
virtual void enableBlurBehind ( QQuickWindow & view ) const = 0 ;
2017-01-16 22:07:49 +03:00
2017-02-25 05:40:47 +03:00
void addDock ( WId wid ) ;
void removeDock ( WId wid ) ;
static AbstractWindowInterface & self ( ) ;
2017-01-16 22:07:49 +03:00
2016-12-28 10:45:21 +03:00
signals :
void activeWindowChanged ( WId wid ) ;
2016-12-30 10:11:42 +03:00
void windowChanged ( WId winfo ) ;
2016-12-28 10:45:21 +03:00
void windowAdded ( WId wid ) ;
void windowRemoved ( WId wid ) ;
2017-02-14 01:52:41 +03:00
void currentDesktopChanged ( ) ;
2017-02-12 11:01:12 +03:00
void currentActivityChanged ( ) ;
2017-01-16 22:07:49 +03:00
2016-12-28 10:45:21 +03:00
protected :
std : : list < WId > m_windows ;
2017-02-25 05:40:47 +03:00
std : : list < WId > m_docks ;
QPointer < KActivities : : Consumer > m_activities ;
2017-02-25 20:38:33 +03:00
static std : : unique_ptr < AbstractWindowInterface > m_wm ;
2016-12-28 10:45:21 +03:00
} ;
2017-02-25 05:40:47 +03:00
// namespace alias
using WindowSystem = AbstractWindowInterface ;
2016-12-28 10:45:21 +03:00
2017-02-25 05:40:47 +03:00
}
2016-12-28 10:45:21 +03:00
# endif // ABSTRACTWINDOWINTERFACE_H