2020-07-05 18:26:03 +03:00
/*
* Copyright 2020 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/>.
*/
# ifndef SUBCONFIGVIEW_H
# define SUBCONFIGVIEW_H
// local
2020-07-09 02:39:25 +03:00
# include <coretypes.h>
2020-07-05 18:26:03 +03:00
# include "../../wm/windowinfowrap.h"
//Qt
# include <QObject>
# include <QPointer>
# include <QQuickView>
# include <QTimer>
// Plasma
# include <Plasma/FrameSvg>
namespace KWayland {
namespace Client {
class PlasmaShellSurface ;
}
}
namespace Latte {
class Corona ;
class View ;
}
namespace Latte {
namespace ViewPart {
class SubConfigView : public QQuickView
{
Q_OBJECT
Q_PROPERTY ( Plasma : : FrameSvg : : EnabledBorders enabledBorders READ enabledBorders NOTIFY enabledBordersChanged )
public :
2020-07-09 02:39:25 +03:00
SubConfigView ( Latte : : View * view , const QString & title , const bool & isNormalWindow = true ) ;
2020-07-05 18:26:03 +03:00
~ SubConfigView ( ) override ;
2020-07-06 14:35:03 +03:00
virtual void requestActivate ( ) ;
2020-07-05 18:26:03 +03:00
QString validTitle ( ) const ;
Plasma : : FrameSvg : : EnabledBorders enabledBorders ( ) const ;
2020-07-31 20:16:14 +03:00
Latte : : Corona * corona ( ) const ;
2020-07-05 18:26:03 +03:00
Latte : : View * parentView ( ) const ;
2020-07-18 18:46:49 +03:00
virtual void setParentView ( Latte : : View * view , const bool & immediate = false ) ;
2020-07-11 10:26:04 +03:00
virtual void showAfter ( int msecs = 0 ) ;
2020-07-05 18:26:03 +03:00
2020-07-11 18:13:47 +03:00
Latte : : WindowSystem : : WindowId trackedWindowId ( ) ;
KWayland : : Client : : PlasmaShellSurface * surface ( ) ;
2020-07-05 18:26:03 +03:00
public slots :
2020-07-06 01:34:11 +03:00
virtual void syncGeometry ( ) = 0 ;
2020-07-05 18:26:03 +03:00
signals :
void enabledBordersChanged ( ) ;
protected :
2021-01-16 19:12:42 +02:00
virtual void syncSlideEffect ( ) ;
2020-07-05 18:26:03 +03:00
2020-07-06 01:34:11 +03:00
virtual void init ( ) ;
virtual void initParentView ( Latte : : View * view ) ;
2020-07-05 18:26:03 +03:00
virtual void updateEnabledBorders ( ) = 0 ;
2020-07-11 20:13:19 +03:00
void showEvent ( QShowEvent * ev ) override ;
2020-07-05 18:26:03 +03:00
bool event ( QEvent * e ) override ;
2021-01-16 19:12:42 +02:00
virtual Qt : : WindowFlags wFlags ( ) const ;
2020-07-05 18:26:03 +03:00
protected :
2020-07-09 02:39:25 +03:00
bool m_isNormalWindow { true } ;
2020-07-06 01:34:11 +03:00
QTimer m_screenSyncTimer ;
2020-07-05 18:26:03 +03:00
QPointer < Latte : : View > m_latteView ;
QList < QMetaObject : : Connection > connections ;
QList < QMetaObject : : Connection > viewconnections ;
2020-07-06 01:34:11 +03:00
Plasma : : FrameSvg : : EnabledBorders m_enabledBorders { Plasma : : FrameSvg : : AllBorders } ;
2020-07-05 18:26:03 +03:00
Latte : : Corona * m_corona { nullptr } ;
2020-07-06 01:34:11 +03:00
KWayland : : Client : : PlasmaShellSurface * m_shellSurface { nullptr } ;
2020-07-05 18:26:03 +03:00
2020-07-11 10:26:04 +03:00
private slots :
void updateWaylandId ( ) ;
2020-07-05 18:26:03 +03:00
private :
void setupWaylandIntegration ( ) ;
private :
QString m_validTitle ;
2020-07-11 10:26:04 +03:00
QTimer m_showTimer ;
2020-07-05 18:26:03 +03:00
Latte : : WindowSystem : : WindowId m_waylandWindowId ;
} ;
}
}
# endif //SUBCONFIGVIEW_H