2016-12-25 10:25:27 +03:00
/*
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
2018-12-06 13:15:58 +03:00
# ifndef VIEW_H
# define VIEW_H
2016-12-25 10:25:27 +03:00
2018-12-02 03:05:52 +03:00
// local
2020-04-24 14:52:16 +03:00
# include <coretypes.h>
2019-12-21 19:53:02 +03:00
# include "containmentinterface.h"
2018-11-30 22:33:46 +03:00
# include "effects.h"
2018-12-01 01:13:11 +03:00
# include "positioner.h"
2018-02-03 12:34:13 +03:00
# include "visibilitymanager.h"
2019-06-03 18:36:45 +03:00
# include "indicator/indicator.h"
2018-12-09 01:06:14 +03:00
# include "settings/primaryconfigview.h"
2019-06-08 16:20:43 +03:00
# include "windowstracker/windowstracker.h"
2019-02-06 19:15:59 +03:00
# include "../shortcuts/globalshortcuts.h"
2019-04-06 02:00:37 +03:00
# include "../layout/genericlayout.h"
2018-12-13 20:51:22 +03:00
# include "../plasma/quick/containmentview.h"
# include "../plasma/quick/configview.h"
2016-12-25 10:25:27 +03:00
2018-12-02 03:05:52 +03:00
// C++
2018-08-01 14:38:16 +03:00
# include <array>
2018-12-02 03:05:52 +03:00
// Qt
2016-12-25 10:25:27 +03:00
# include <QQuickView>
2017-01-03 16:33:30 +03:00
# include <QMenu>
2020-04-05 14:40:32 +03:00
# include <QMetaObject>
2017-06-11 18:06:03 +03:00
# include <QMimeData>
2016-12-25 10:25:27 +03:00
# include <QScreen>
# include <QPointer>
# include <QTimer>
2020-04-22 14:09:42 +03:00
2016-12-25 10:25:27 +03:00
namespace Plasma {
class Types ;
class Corona ;
class Containment ;
}
2020-04-05 17:01:10 +03:00
namespace PlasmaQuick {
class AppletQuickItem ;
}
2017-04-25 19:18:49 +03:00
namespace KWayland {
namespace Client {
class PlasmaShellSurface ;
}
}
2016-12-30 10:20:06 +03:00
namespace Latte {
2019-04-12 18:55:45 +03:00
class Corona ;
2020-05-12 14:45:31 +03:00
class Interfaces ;
2019-04-06 02:00:37 +03:00
class GenericLayout ;
2018-12-02 01:53:40 +03:00
2018-12-06 12:37:14 +03:00
namespace ViewPart {
2018-12-02 01:53:40 +03:00
class ContextMenu ;
}
2018-02-03 12:34:13 +03:00
}
namespace Latte {
2018-01-10 23:55:19 +03:00
2018-12-06 13:15:58 +03:00
class View : public PlasmaQuick : : ContainmentView
2018-07-03 22:15:45 +03:00
{
2016-12-25 10:25:27 +03:00
Q_OBJECT
2019-02-11 17:49:10 +03:00
Q_PROPERTY ( Latte : : Types : : ViewType type READ type WRITE setType NOTIFY typeChanged )
2017-08-09 03:33:03 +03:00
Q_PROPERTY ( bool alternativesIsShown READ alternativesIsShown NOTIFY alternativesIsShownChanged )
2017-05-07 15:06:29 +03:00
Q_PROPERTY ( bool behaveAsPlasmaPanel READ behaveAsPlasmaPanel WRITE setBehaveAsPlasmaPanel NOTIFY behaveAsPlasmaPanelChanged )
2018-12-06 16:34:04 +03:00
Q_PROPERTY ( bool byPassWM READ byPassWM WRITE setByPassWM NOTIFY byPassWMChanged )
2019-05-17 21:28:39 +03:00
Q_PROPERTY ( bool containsDrag READ containsDrag NOTIFY containsDragChanged )
2017-07-27 18:24:31 +03:00
Q_PROPERTY ( bool contextMenuIsShown READ contextMenuIsShown NOTIFY contextMenuIsShownChanged )
2020-04-23 21:57:17 +03:00
Q_PROPERTY ( bool inSettingsAdvancedMode READ inSettingsAdvancedMode NOTIFY inSettingsAdvancedModeChanged )
2020-04-08 15:22:38 +03:00
2018-02-12 17:11:33 +03:00
//! Because Latte uses animations, changing to edit mode it may be different than
//! when the isUserConfiguring changes value
Q_PROPERTY ( bool inEditMode READ inEditMode WRITE setInEditMode NOTIFY inEditModeChanged )
2018-09-22 20:21:57 +03:00
Q_PROPERTY ( bool isPreferredForShortcuts READ isPreferredForShortcuts WRITE setIsPreferredForShortcuts NOTIFY isPreferredForShortcutsChanged )
2017-02-27 01:53:27 +03:00
Q_PROPERTY ( bool onPrimary READ onPrimary WRITE setOnPrimary NOTIFY onPrimaryChanged )
2020-03-19 16:32:36 +03:00
Q_PROPERTY ( bool screenEdgeMarginEnabled READ screenEdgeMarginEnabled WRITE setScreenEdgeMarginEnabled NOTIFY screenEdgeMarginEnabledChanged )
2017-01-16 22:07:49 +03:00
2019-08-01 18:18:40 +03:00
//! values to be used from Smart surrounding Views
2019-08-01 23:56:09 +03:00
Q_PROPERTY ( bool isTouchingBottomViewAndIsBusy READ isTouchingBottomViewAndIsBusy WRITE setIsTouchingBottomViewAndIsBusy NOTIFY isTouchingBottomViewAndIsBusyChanged )
Q_PROPERTY ( bool isTouchingTopViewAndIsBusy READ isTouchingTopViewAndIsBusy WRITE setIsTouchingTopViewAndIsBusy NOTIFY isTouchingTopViewAndIsBusyChanged )
2019-08-01 18:18:40 +03:00
2017-02-04 17:41:12 +03:00
Q_PROPERTY ( int alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged )
2018-02-17 20:02:06 +03:00
Q_PROPERTY ( int fontPixelSize READ fontPixelSize WRITE setFontPixelSize NOTIFY fontPixelSizeChanged )
2017-02-26 16:49:50 +03:00
Q_PROPERTY ( int x READ x NOTIFY xChanged )
Q_PROPERTY ( int y READ y NOTIFY yChanged )
2017-01-13 02:54:23 +03:00
Q_PROPERTY ( int width READ width NOTIFY widthChanged )
2016-12-25 10:25:27 +03:00
Q_PROPERTY ( int height READ height NOTIFY heightChanged )
2020-07-07 18:20:16 +03:00
Q_PROPERTY ( int editThickness READ editThickness NOTIFY editThicknessChanged )
2016-12-25 10:25:27 +03:00
Q_PROPERTY ( int maxThickness READ maxThickness WRITE setMaxThickness NOTIFY maxThicknessChanged )
2017-01-27 21:31:41 +03:00
Q_PROPERTY ( int normalThickness READ normalThickness WRITE setNormalThickness NOTIFY normalThicknessChanged )
2020-07-07 18:20:16 +03:00
Q_PROPERTY ( int normalHighestThickness READ normalHighestThickness WRITE setNormalHighestThickness NOTIFY normalHighestThicknessChanged )
2020-05-11 17:31:03 +03:00
Q_PROPERTY ( int headThicknessGap READ headThicknessGap WRITE setHeadThicknessGap NOTIFY headThicknessGapChanged )
2019-12-24 13:35:28 +03:00
Q_PROPERTY ( int screenEdgeMargin READ screenEdgeMargin WRITE setScreenEdgeMargin NOTIFY screenEdgeMarginChanged )
2017-01-31 22:25:00 +03:00
Q_PROPERTY ( float maxLength READ maxLength WRITE setMaxLength NOTIFY maxLengthChanged )
2020-04-29 09:54:16 +03:00
Q_PROPERTY ( float offset READ offset WRITE setOffset NOTIFY offsetChanged )
2017-01-31 22:25:00 +03:00
2019-05-08 23:42:06 +03:00
Q_PROPERTY ( Latte : : Layout : : GenericLayout * layout READ layout WRITE setLayout NOTIFY layoutChanged )
2019-03-23 18:49:09 +03:00
Q_PROPERTY ( Latte : : ViewPart : : Effects * effects READ effects NOTIFY effectsChanged )
2020-04-08 14:34:05 +03:00
Q_PROPERTY ( Latte : : ViewPart : : ContainmentInterface * extendedInterface READ extendedInterface NOTIFY extendedInterfaceChanged )
2019-03-23 18:49:09 +03:00
Q_PROPERTY ( Latte : : ViewPart : : Indicator * indicator READ indicator NOTIFY indicatorChanged )
2018-12-06 12:37:14 +03:00
Q_PROPERTY ( Latte : : ViewPart : : Positioner * positioner READ positioner NOTIFY positionerChanged )
2018-12-09 01:29:35 +03:00
Q_PROPERTY ( Latte : : ViewPart : : VisibilityManager * visibility READ visibility NOTIFY visibilityChanged )
2019-02-07 20:15:25 +03:00
Q_PROPERTY ( Latte : : ViewPart : : WindowsTracker * windowsTracker READ windowsTracker NOTIFY windowsTrackerChanged )
2018-11-30 22:33:46 +03:00
2020-05-12 14:45:31 +03:00
Q_PROPERTY ( Latte : : Interfaces * interfacesGraphicObj READ interfacesGraphicObj WRITE setInterfacesGraphicObj NOTIFY interfacesGraphicObjChanged )
2019-04-23 10:41:35 +03:00
Q_PROPERTY ( QRect absoluteGeometry READ absoluteGeometry NOTIFY absoluteGeometryChanged )
2017-03-09 16:49:24 +03:00
Q_PROPERTY ( QRect localGeometry READ localGeometry WRITE setLocalGeometry NOTIFY localGeometryChanged )
2017-02-26 16:49:50 +03:00
Q_PROPERTY ( QRect screenGeometry READ screenGeometry NOTIFY screenGeometryChanged )
2016-12-25 10:25:27 +03:00
public :
2018-12-06 16:34:04 +03:00
View ( Plasma : : Corona * corona , QScreen * targetScreen = nullptr , bool byPassWM = false ) ;
2018-12-06 13:15:58 +03:00
virtual ~ View ( ) ;
2017-01-16 22:07:49 +03:00
2020-05-02 13:23:37 +03:00
void init ( Plasma : : Containment * plasma_containment = nullptr ) ;
2017-01-16 22:07:49 +03:00
2019-02-11 17:49:10 +03:00
Types : : ViewType type ( ) const ;
void setType ( Types : : ViewType type ) ;
2017-08-09 03:33:03 +03:00
bool alternativesIsShown ( ) const ;
void setAlternativesIsShown ( bool show ) ;
2018-11-29 22:30:00 +03:00
bool inDelete ( ) const ;
2020-05-08 10:16:26 +03:00
bool inReadyState ( ) const ;
2018-11-29 22:30:00 +03:00
2017-02-27 01:53:27 +03:00
bool onPrimary ( ) const ;
void setOnPrimary ( bool flag ) ;
2017-01-13 02:54:23 +03:00
int currentThickness ( ) const ;
2017-01-16 22:07:49 +03:00
2017-05-07 15:06:29 +03:00
bool behaveAsPlasmaPanel ( ) const ;
void setBehaveAsPlasmaPanel ( bool behavior ) ;
2019-05-17 21:28:39 +03:00
bool containsDrag ( ) const ;
2019-03-08 17:14:34 +03:00
bool containsMouse ( ) const ;
2017-07-27 18:24:31 +03:00
bool contextMenuIsShown ( ) const ;
2018-12-06 16:34:04 +03:00
bool byPassWM ( ) const ;
void setByPassWM ( bool bypass ) ;
2017-03-19 00:32:27 +03:00
2018-02-12 17:11:33 +03:00
bool inEditMode ( ) const ;
void setInEditMode ( bool edit ) ;
2020-01-04 14:52:11 +03:00
bool isFloatingWindow ( ) const ;
2018-09-22 20:21:57 +03:00
bool isPreferredForShortcuts ( ) const ;
void setIsPreferredForShortcuts ( bool preferred ) ;
2020-04-23 21:57:17 +03:00
bool inSettingsAdvancedMode ( ) const ;
2019-08-01 23:56:09 +03:00
bool isTouchingBottomViewAndIsBusy ( ) const ;
void setIsTouchingBottomViewAndIsBusy ( bool touchAndBusy ) ;
2019-08-01 18:18:40 +03:00
2019-08-01 23:56:09 +03:00
bool isTouchingTopViewAndIsBusy ( ) const ;
void setIsTouchingTopViewAndIsBusy ( bool touchAndBusy ) ;
2019-08-01 18:18:40 +03:00
2019-12-24 13:35:28 +03:00
bool screenEdgeMarginEnabled ( ) const ;
2020-04-29 09:54:16 +03:00
void setScreenEdgeMarginEnabled ( bool enabled ) ;
2017-01-31 22:25:00 +03:00
2018-02-17 20:02:06 +03:00
int fontPixelSize ( ) const ;
void setFontPixelSize ( int size ) ;
2019-03-06 21:10:36 +03:00
int editThickness ( ) const ;
2017-01-13 02:54:23 +03:00
int maxThickness ( ) const ;
void setMaxThickness ( int thickness ) ;
2017-01-16 22:07:49 +03:00
2017-01-27 21:31:41 +03:00
int normalThickness ( ) const ;
void setNormalThickness ( int thickness ) ;
2020-07-07 18:20:16 +03:00
int normalHighestThickness ( ) const ;
void setNormalHighestThickness ( int thickness ) ;
2020-05-11 17:31:03 +03:00
int headThicknessGap ( ) const ;
void setHeadThicknessGap ( int thickness ) ;
2019-12-24 13:35:28 +03:00
int screenEdgeMargin ( ) const ;
void setScreenEdgeMargin ( int margin ) ;
2017-02-04 17:41:12 +03:00
int alignment ( ) const ;
void setAlignment ( int alignment ) ;
2020-04-29 09:54:16 +03:00
float maxLength ( ) const ;
void setMaxLength ( float length ) ;
float offset ( ) const ;
void setOffset ( float offset ) ;
2019-04-23 10:41:35 +03:00
QRect absoluteGeometry ( ) const ;
2017-02-26 16:49:50 +03:00
QRect screenGeometry ( ) const ;
2017-03-09 16:49:24 +03:00
QRect localGeometry ( ) const ;
void setLocalGeometry ( const QRect & geometry ) ;
2020-03-02 04:10:59 +03:00
QString validTitle ( ) const ;
2019-06-08 01:38:27 +03:00
bool isOnActivity ( const QString & activity ) const ;
bool isOnAllActivities ( ) const ;
2020-03-21 13:44:52 +03:00
2019-06-08 01:38:27 +03:00
QStringList activities ( ) const ;
2020-03-21 13:44:52 +03:00
void setActivities ( const QStringList & ids ) ;
2018-02-09 20:22:04 +03:00
bool settingsWindowIsShown ( ) ;
2017-11-19 15:51:15 +03:00
void showSettingsWindow ( ) ;
2020-06-27 14:42:29 +03:00
QQuickView * configView ( ) ;
2019-03-09 00:43:08 +03:00
2019-12-21 19:53:02 +03:00
ViewPart : : Effects * effects ( ) const ;
2020-04-08 14:34:05 +03:00
ViewPart : : ContainmentInterface * extendedInterface ( ) const ;
2019-03-23 18:49:09 +03:00
ViewPart : : Indicator * indicator ( ) const ;
2018-12-06 12:37:14 +03:00
ViewPart : : Positioner * positioner ( ) const ;
2018-12-09 01:29:35 +03:00
ViewPart : : VisibilityManager * visibility ( ) const ;
2019-02-07 20:15:25 +03:00
ViewPart : : WindowsTracker * windowsTracker ( ) const ;
2017-01-16 22:07:49 +03:00
2020-05-12 14:45:31 +03:00
Latte : : Interfaces * interfacesGraphicObj ( ) const ;
void setInterfacesGraphicObj ( Latte : : Interfaces * ifaces ) ;
2019-05-08 23:42:06 +03:00
Layout : : GenericLayout * layout ( ) const ;
void setLayout ( Layout : : GenericLayout * layout ) ;
2018-01-10 23:55:19 +03:00
2018-03-28 20:39:52 +03:00
KWayland : : Client : : PlasmaShellSurface * surface ( ) ;
2019-08-26 01:22:22 +03:00
//! release grab and restore mouse state
void unblockMouse ( int x , int y ) ;
2018-11-29 22:30:00 +03:00
void reconsiderScreen ( ) ;
2017-01-16 22:07:49 +03:00
2018-01-11 22:11:46 +03:00
//! these are signals that create crashes, such a example is the availableScreenRectChanged from corona
//! when its containment is destroyed
void disconnectSensitiveSignals ( ) ;
2020-06-28 18:15:16 +03:00
//! used from ViewSettingsFactory in order to move Configuration Windows to different View
void releaseConfigView ( ) ;
2016-12-25 10:25:27 +03:00
public slots :
2018-12-06 16:57:20 +03:00
Q_INVOKABLE void copyView ( ) ;
Q_INVOKABLE void removeView ( ) ;
2017-01-16 22:07:49 +03:00
2017-01-13 02:54:23 +03:00
Q_INVOKABLE QVariantList containmentActions ( ) ;
2017-06-11 18:06:03 +03:00
2018-01-21 12:34:18 +03:00
Q_INVOKABLE void moveToLayout ( QString layoutName ) ;
2017-01-16 22:07:49 +03:00
2017-06-11 18:06:03 +03:00
Q_INVOKABLE bool mimeContainsPlasmoid ( QMimeData * mimeData , QString name ) ;
2019-04-23 10:41:35 +03:00
void updateAbsoluteGeometry ( bool bypassChecks = false ) ;
2017-03-08 22:00:09 +03:00
2019-02-06 19:15:59 +03:00
Q_INVOKABLE bool isHighestPriorityView ( ) ;
2016-12-25 10:25:27 +03:00
protected slots :
void showConfigurationInterface ( Plasma : : Applet * applet ) override ;
2017-01-16 22:07:49 +03:00
2016-12-25 10:25:27 +03:00
protected :
bool event ( QEvent * ev ) override ;
2017-01-03 16:33:30 +03:00
void mousePressEvent ( QMouseEvent * event ) override ;
2017-01-16 22:07:49 +03:00
2016-12-25 10:25:27 +03:00
signals :
2016-12-30 14:46:56 +03:00
void eventTriggered ( QEvent * ev ) ;
2019-04-17 20:17:28 +03:00
void mousePressed ( const QPoint pos , const int button ) ;
void mouseReleased ( const QPoint pos , const int button ) ;
2020-01-31 18:59:08 +03:00
void wheelScrolled ( const QPoint pos , const QPoint angleDelta , const int buttons ) ;
2017-01-16 22:07:49 +03:00
2018-01-14 14:21:11 +03:00
void activitiesChanged ( ) ;
2017-08-09 03:33:03 +03:00
void alternativesIsShownChanged ( ) ;
2017-02-04 17:41:12 +03:00
void alignmentChanged ( ) ;
2017-05-07 15:06:29 +03:00
void behaveAsPlasmaPanelChanged ( ) ;
2018-12-06 16:34:04 +03:00
void byPassWMChanged ( ) ;
2019-03-09 00:43:08 +03:00
void configWindowGeometryChanged ( ) ; // is called from config windows
2019-05-17 21:28:39 +03:00
void containsDragChanged ( ) ;
2017-07-27 18:24:31 +03:00
void contextMenuIsShownChanged ( ) ;
2017-01-22 14:29:40 +03:00
void dockLocationChanged ( ) ;
2019-03-06 21:10:36 +03:00
void editThicknessChanged ( ) ;
2018-11-30 22:33:46 +03:00
void effectsChanged ( ) ;
2020-04-08 14:34:05 +03:00
void extendedInterfaceChanged ( ) ;
2018-02-17 20:02:06 +03:00
void fontPixelSizeChanged ( ) ;
2019-07-16 13:23:20 +03:00
void forcedShown ( ) ; //[workaround] forced shown to avoid a KWin issue that hides windows when closing activities
2017-01-13 02:54:23 +03:00
void widthChanged ( ) ;
2020-05-11 17:31:03 +03:00
void headThicknessGapChanged ( ) ;
2016-12-25 10:25:27 +03:00
void heightChanged ( ) ;
2018-02-12 17:11:33 +03:00
void inEditModeChanged ( ) ;
2019-03-23 18:49:09 +03:00
void indicatorChanged ( ) ;
2020-04-23 21:57:17 +03:00
void inSettingsAdvancedModeChanged ( ) ;
2020-05-12 14:45:31 +03:00
void interfacesGraphicObjChanged ( ) ;
2018-09-22 20:21:57 +03:00
void isPreferredForShortcutsChanged ( ) ;
2019-08-01 23:56:09 +03:00
void isTouchingBottomViewAndIsBusyChanged ( ) ;
void isTouchingTopViewAndIsBusyChanged ( ) ;
2019-05-08 23:42:06 +03:00
void layoutChanged ( ) ;
2017-03-09 16:49:24 +03:00
void localGeometryChanged ( ) ;
2017-01-31 22:25:00 +03:00
void maxLengthChanged ( ) ;
2016-12-25 10:25:27 +03:00
void maxThicknessChanged ( ) ;
2017-01-27 21:31:41 +03:00
void normalThicknessChanged ( ) ;
2020-07-07 18:20:16 +03:00
void normalHighestThicknessChanged ( ) ;
2017-04-09 01:06:48 +03:00
void offsetChanged ( ) ;
2017-02-27 01:53:27 +03:00
void onPrimaryChanged ( ) ;
2018-11-29 22:30:00 +03:00
void positionerChanged ( ) ;
2019-12-24 13:35:28 +03:00
void screenEdgeMarginChanged ( ) ;
2019-12-29 15:08:07 +03:00
void screenEdgeMarginEnabledChanged ( ) ;
2017-02-26 16:49:50 +03:00
void screenGeometryChanged ( ) ;
2019-02-11 17:49:10 +03:00
void typeChanged ( ) ;
2019-02-07 20:15:25 +03:00
void visibilityChanged ( ) ;
void windowsTrackerChanged ( ) ;
2017-02-26 16:49:50 +03:00
void xChanged ( ) ;
void yChanged ( ) ;
2017-01-16 22:07:49 +03:00
2019-04-23 10:41:35 +03:00
void absoluteGeometryChanged ( const QRect & geometry ) ;
2017-01-16 22:07:49 +03:00
2019-12-31 16:49:53 +03:00
void indicatorPluginChanged ( const QString & indicatorId ) ;
void indicatorPluginRemoved ( const QString & indicatorId ) ;
2019-06-20 17:42:49 +03:00
2019-12-28 14:59:36 +03:00
//! are used to trigger the Corona relevant signals and in that
//! way we can disable any such signaling all together, e.g. through disconnectSensitiveSignals()
void availableScreenRectChangedFrom ( Latte : : View * origin ) ;
2019-12-27 20:14:31 +03:00
void availableScreenRegionChangedFrom ( Latte : : View * origin ) ;
2017-01-13 18:15:53 +03:00
private slots :
2020-03-21 13:44:52 +03:00
void applyActivitiesToWindows ( ) ;
2019-12-28 14:59:36 +03:00
void availableScreenRectChangedFromSlot ( View * origin ) ;
2018-12-01 01:13:11 +03:00
void hideWindowsForSlidingOut ( ) ;
2018-12-06 13:15:58 +03:00
void preferredViewForShortcutsChangedSlot ( Latte : : View * view ) ;
2019-08-26 01:22:22 +03:00
void releaseGrab ( ) ;
2019-06-20 17:42:49 +03:00
void reloadSource ( ) ;
2020-04-05 14:40:32 +03:00
void updateTransientWindowsTracking ( ) ;
2017-01-14 02:59:25 +03:00
void statusChanged ( Plasma : : Types : : ItemStatus ) ;
2017-01-16 22:07:49 +03:00
2020-04-05 14:40:32 +03:00
void addTransientWindow ( QWindow * window ) ;
void removeTransientWindow ( const bool & visible ) ;
2020-05-09 12:26:33 +03:00
//! workaround in order for top panels to be always on top
void topViewAlwaysOnTop ( ) ;
void verticalUnityViewHasFocus ( ) ;
2020-05-11 23:04:44 +03:00
//!workround for when kwin hides view when an activity is closing
void showHiddenViewFromActivityStopping ( ) ;
2017-02-27 01:53:27 +03:00
void restoreConfig ( ) ;
void saveConfig ( ) ;
2017-01-13 02:54:23 +03:00
private :
2017-12-10 20:54:13 +03:00
void initSignalingForLocationChangeSliding ( ) ;
2017-04-25 19:18:49 +03:00
void setupWaylandIntegration ( ) ;
2017-04-23 02:31:36 +03:00
void updateAppletContainsMethod ( ) ;
2017-01-16 22:07:49 +03:00
2019-05-17 21:28:39 +03:00
void setContainsDrag ( bool contains ) ;
2016-12-25 10:25:27 +03:00
private :
2017-02-06 04:55:41 +03:00
Plasma : : Containment * containmentById ( uint id ) ;
2017-01-27 21:03:24 +03:00
2017-08-09 03:33:03 +03:00
bool m_alternativesIsShown { false } ;
2017-05-07 15:06:29 +03:00
bool m_behaveAsPlasmaPanel { false } ;
2018-12-06 16:34:04 +03:00
bool m_byPassWM { true } ;
2019-05-17 21:28:39 +03:00
bool m_containsDrag { false } ;
2019-03-08 17:14:34 +03:00
bool m_containsMouse { false } ;
2017-06-21 22:42:09 +03:00
bool m_inDelete { false } ;
2018-02-12 17:11:33 +03:00
bool m_inEditMode { false } ;
2018-09-22 20:21:57 +03:00
bool m_isPreferredForShortcuts { false } ;
2017-02-27 01:53:27 +03:00
bool m_onPrimary { true } ;
2019-12-29 15:08:07 +03:00
bool m_screenEdgeMarginEnabled { false } ;
2019-04-14 13:25:16 +03:00
2019-08-01 23:56:09 +03:00
bool m_isTouchingBottomViewAndIsBusy { false } ;
bool m_isTouchingTopViewAndIsBusy { false } ;
2019-08-01 18:18:40 +03:00
2018-03-06 23:54:37 +03:00
int m_fontPixelSize { - 1 } ;
2017-01-13 02:54:23 +03:00
int m_maxThickness { 24 } ;
2017-01-27 21:31:41 +03:00
int m_normalThickness { 24 } ;
2020-07-07 18:20:16 +03:00
int m_normalHighestThickness { 24 } ;
2020-05-11 17:31:03 +03:00
int m_headThicknessGap { 0 } ;
2019-12-24 13:35:28 +03:00
int m_screenEdgeMargin { - 1 } ;
2017-01-31 22:25:00 +03:00
float m_maxLength { 1 } ;
2020-04-29 09:54:16 +03:00
float m_offset { 0 } ;
2017-01-16 22:07:49 +03:00
2018-12-07 19:55:35 +03:00
Types : : Alignment m_alignment { Types : : Center } ;
2019-02-11 17:49:10 +03:00
Types : : ViewType m_type { Types : : DockView } ;
2017-02-04 17:41:12 +03:00
2017-03-08 22:00:09 +03:00
QRect m_localGeometry ;
2019-04-23 10:41:35 +03:00
QRect m_absoluteGeometry ;
2018-04-05 10:09:04 +03:00
2019-06-08 01:38:27 +03:00
QStringList m_activities ;
2020-03-07 19:30:22 +03:00
//! HACK: In order to avoid crashes when the View is added and removed
//! immediately during startup
QTimer m_initLayoutTimer ;
2019-05-07 22:06:00 +03:00
//! HACK: Timers in order to handle KWin faulty
//! behavior that hides Views when closing Activities
//! with no actual reason
QTimer m_visibleHackTimer1 ;
QTimer m_visibleHackTimer2 ;
2019-08-26 01:22:22 +03:00
QTimer m_releaseGrabTimer ;
int m_releaseGrab_x ;
int m_releaseGrab_y ;
2019-05-08 23:42:06 +03:00
Layout : : GenericLayout * m_layout { nullptr } ;
2020-06-27 14:42:29 +03:00
QPointer < PlasmaQuick : : ConfigView > m_appletConfigView ;
2020-07-06 14:35:03 +03:00
QPointer < ViewPart : : PrimaryConfigView > m_primaryConfigView ;
2018-01-18 22:21:32 +03:00
2018-12-06 12:37:14 +03:00
QPointer < ViewPart : : ContextMenu > m_contextMenu ;
QPointer < ViewPart : : Effects > m_effects ;
2019-03-23 18:49:09 +03:00
QPointer < ViewPart : : Indicator > m_indicator ;
2019-12-21 19:53:02 +03:00
QPointer < ViewPart : : ContainmentInterface > m_interface ;
2018-12-06 12:37:14 +03:00
QPointer < ViewPart : : Positioner > m_positioner ;
2018-12-09 01:29:35 +03:00
QPointer < ViewPart : : VisibilityManager > m_visibility ;
2019-02-07 20:15:25 +03:00
QPointer < ViewPart : : WindowsTracker > m_windowsTracker ;
2017-02-26 20:15:20 +03:00
2020-05-12 14:45:31 +03:00
QPointer < Latte : : Interfaces > m_interfacesGraphicObj ;
2019-05-08 23:42:06 +03:00
//! Connections to release and bound for the assigned layout
2019-05-09 23:45:52 +03:00
QList < QMetaObject : : Connection > connectionsLayout ;
2018-01-20 01:34:55 +03:00
2020-04-05 14:40:32 +03:00
//! track transientWindows
QList < QWindow * > m_transientWindows ;
2019-04-12 18:55:45 +03:00
QPointer < Latte : : Corona > m_corona ;
2017-04-25 19:18:49 +03:00
KWayland : : Client : : PlasmaShellSurface * m_shellSurface { nullptr } ;
2016-12-25 10:25:27 +03:00
} ;
2016-12-30 10:20:06 +03:00
}
2016-12-25 10:25:27 +03:00
# endif