File indexing completed on 2025-03-09 05:02:41
0001 /* 0002 SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef PLASMAQUICKCONTAINMENTVIEW_H 0008 #define PLASMAQUICKCONTAINMENTVIEW_H 0009 0010 #include "plasma/containment.h" 0011 #include "plasma/corona.h" 0012 #include <plasmaquick/plasmaquick_export.h> 0013 #include <plasmaquick/quickviewsharedengine.h> 0014 0015 // 0016 // W A R N I N G 0017 // ------------- 0018 // 0019 // This file is not part of the public Plasma API. It exists purely as an 0020 // implementation detail. This header file may change from version to 0021 // version without notice, or even be removed. 0022 // 0023 // We mean it. 0024 // 0025 0026 namespace PlasmaQuick 0027 { 0028 class ContainmentViewPrivate; 0029 0030 class PLASMAQUICK_EXPORT ContainmentView : public PlasmaQuick::QuickViewSharedEngine 0031 { 0032 Q_OBJECT 0033 Q_PROPERTY(Plasma::Types::Location location READ location WRITE setLocation NOTIFY locationChanged) 0034 Q_PROPERTY(Plasma::Types::FormFactor formFactor READ formFactor NOTIFY formFactorChanged) 0035 Q_PROPERTY(QRectF screenGeometry READ screenGeometry NOTIFY screenGeometryChanged) 0036 0037 public: 0038 /** 0039 * @param corona the corona of this view 0040 * @param parent the QWindow this ContainmentView is parented to 0041 **/ 0042 explicit ContainmentView(Plasma::Corona *corona, QWindow *parent = nullptr); 0043 ~ContainmentView() override; 0044 0045 /** 0046 * Unassign any containment UI from this view, then delete it 0047 */ 0048 void destroy(); 0049 0050 /** 0051 * @return the corona of this view 0052 **/ 0053 Plasma::Corona *corona() const; 0054 0055 /** 0056 * @return the KConfigGroup of this view 0057 **/ 0058 virtual KConfigGroup config() const; 0059 0060 /** 0061 * sets the containment for this view 0062 * @param cont the containment of this view 0063 **/ 0064 void setContainment(Plasma::Containment *cont); 0065 0066 /** 0067 * @return the containment of this ContainmentView 0068 **/ 0069 Plasma::Containment *containment() const; 0070 0071 /** 0072 * @return the location of this ContainmentView 0073 **/ 0074 Plasma::Types::Location location() const; 0075 0076 /** 0077 * Sets the location of the ContainmentView 0078 * @param location the location of the ContainmentView 0079 **/ 0080 void setLocation(Plasma::Types::Location location); 0081 0082 /** 0083 * @return the formfactor of the ContainmentView 0084 **/ 0085 Plasma::Types::FormFactor formFactor() const; 0086 0087 /** 0088 * @return the screenGeometry of the ContainmentView 0089 **/ 0090 QRectF screenGeometry(); 0091 0092 protected Q_SLOTS: 0093 /** 0094 * It will be called when the configuration is requested 0095 */ 0096 virtual void showConfigurationInterface(Plasma::Applet *applet); 0097 0098 Q_SIGNALS: 0099 /** 0100 * emitted when the location is changed 0101 **/ 0102 void locationChanged(Plasma::Types::Location location); 0103 0104 /** 0105 * emitted when the formfactor is changed 0106 **/ 0107 void formFactorChanged(Plasma::Types::FormFactor formFactor); 0108 0109 /** 0110 * emitted when the containment is changed 0111 **/ 0112 void containmentChanged(); 0113 0114 /** 0115 * emitted when the screenGeometry is changed 0116 **/ 0117 void screenGeometryChanged(); 0118 0119 private: 0120 ContainmentViewPrivate *const d; 0121 Q_PRIVATE_SLOT(d, void updateDestroyed(bool)) 0122 friend class ContainmentViewPrivate; 0123 }; 0124 0125 } 0126 0127 #endif // CONTAINMENTVIEW_H