1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00
latte-dock/app/infoview.h

91 lines
2.2 KiB
C
Raw Normal View History

/*
* 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/>.
*/
#ifndef INFOVIEW_H
#define INFOVIEW_H
2018-12-02 03:05:52 +03:00
// local
#include "lattecorona.h"
2020-03-21 14:06:03 +03:00
#include "wm/windowinfowrap.h"
2018-12-02 03:05:52 +03:00
// Qt
#include <QObject>
#include <QQuickView>
#include <QScreen>
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
namespace Latte {
2018-07-03 22:15:45 +03:00
class InfoView : public QQuickView
{
Q_OBJECT
Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders NOTIFY enabledBordersChanged)
public:
InfoView(Latte::Corona *corona, QString message, QScreen *screen = qGuiApp->primaryScreen(), QWindow *parent = nullptr);
~InfoView() override;
2020-03-21 14:06:03 +03:00
QString validTitle() const;
Plasma::FrameSvg::EnabledBorders enabledBorders() const;
void init();
Qt::WindowFlags wFlags() const;
void setOnActivities(QStringList activities = {"0"});
public slots:
Q_INVOKABLE void syncGeometry();
signals:
void enabledBordersChanged();
protected:
void showEvent(QShowEvent *ev) override;
bool event(QEvent *e) override;
2020-03-21 14:06:03 +03:00
private slots:
void setupWaylandIntegration();
2020-03-21 14:06:03 +03:00
void updateWaylandId();
private:
2020-03-21 14:06:03 +03:00
QString m_id;
QString m_message;
2017-07-27 17:34:32 +03:00
QScreen *m_screen{nullptr};
Plasma::FrameSvg::EnabledBorders m_borders{Plasma::FrameSvg::TopBorder | Plasma::FrameSvg::BottomBorder};
2020-03-21 14:06:03 +03:00
Latte::WindowSystem::WindowId m_trackedWindowId;
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
Latte::Corona *m_corona{nullptr};
};
}
#endif //INFOVIEW_H