2017-01-02 17:05:30 -05: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 02:45:21 -05:00
# ifndef ABSTRACTWINDOWINTERFACE_H
# define ABSTRACTWINDOWINTERFACE_H
# include "windowinfowrap.h"
# include "../liblattedock/dock.h"
# include <unordered_map>
# include <memory>
# include <list>
# include <QObject>
2016-12-29 00:37:53 -05:00
# include <QRect>
2016-12-28 02:45:21 -05:00
# include <QQuickWindow>
2016-12-29 00:37:53 -05:00
# include <Plasma>
2016-12-28 02:45:21 -05:00
namespace Latte {
2016-12-30 02:11:42 -05:00
class XWindowInterface ;
2016-12-28 02:45:21 -05:00
class AbstractWindowInterface : public QObject {
Q_OBJECT
public :
explicit AbstractWindowInterface ( QQuickWindow * const view , QObject * parent = nullptr ) ;
virtual ~ AbstractWindowInterface ( ) ;
virtual void setDockDefaultFlags ( ) = 0 ;
virtual WId activeWindow ( ) const = 0 ;
2017-01-02 01:04:10 -05: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 ;
2016-12-28 02:45:21 -05:00
2017-01-02 01:04:10 -05:00
virtual void setDockStruts ( const QRect & dockRect , Plasma : : Types : : Location location ) const = 0 ;
virtual void removeDockStruts ( ) const = 0 ;
2016-12-29 00:37:53 -05:00
2016-12-30 02:11:42 -05:00
static AbstractWindowInterface * getInstance ( QQuickWindow * const view , QObject * parent = nullptr ) ;
2016-12-28 02:45:21 -05:00
signals :
void activeWindowChanged ( WId wid ) ;
2016-12-30 02:11:42 -05:00
void windowChanged ( WId winfo ) ;
2016-12-28 02:45:21 -05:00
void windowAdded ( WId wid ) ;
void windowRemoved ( WId wid ) ;
void currentDesktopChanged ( int desktop ) ;
protected :
QQuickWindow * const m_view ;
std : : list < WId > m_windows ;
} ;
}
# endif // ABSTRACTWINDOWINTERFACE_H