File indexing completed on 2024-07-14 14:38:31

0001 /*
0002     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef KWINDOWINFO_P_H
0008 #define KWINDOWINFO_P_H
0009 #include "netwm_def.h"
0010 #include <kwindowsystem_export.h>
0011 
0012 #include <QByteArray>
0013 #include <QRect>
0014 #include <QScopedPointer>
0015 #include <QSharedData>
0016 #include <QString>
0017 #include <QStringList>
0018 #include <QWidgetList> //For WId
0019 
0020 class KWindowInfoPrivateDesktopFileNameExtension;
0021 class KWindowInfoPrivateGtkApplicationIdExtension;
0022 class KWindowInfoPrivatePidExtension;
0023 class KWindowInfoPrivateAppMenuExtension;
0024 
0025 class KWINDOWSYSTEM_EXPORT KWindowInfoPrivate : public QSharedData
0026 {
0027 public:
0028     virtual ~KWindowInfoPrivate();
0029 
0030     WId win() const;
0031 
0032     virtual bool valid(bool withdrawn_is_valid) const = 0;
0033     virtual NET::States state() const = 0;
0034     virtual bool isMinimized() const = 0;
0035     virtual NET::MappingState mappingState() const = 0;
0036     virtual NETExtendedStrut extendedStrut() const = 0;
0037     virtual NET::WindowType windowType(NET::WindowTypes supported_types) const = 0;
0038     virtual QString visibleName() const = 0;
0039     virtual QString visibleNameWithState() const = 0;
0040     virtual QString name() const = 0;
0041     virtual QString visibleIconName() const = 0;
0042     virtual QString visibleIconNameWithState() const = 0;
0043     virtual QString iconName() const = 0;
0044     virtual bool onAllDesktops() const = 0;
0045     virtual bool isOnDesktop(int desktop) const = 0;
0046     virtual int desktop() const = 0;
0047     virtual QStringList activities() const = 0;
0048     virtual QRect geometry() const = 0;
0049     virtual QRect frameGeometry() const = 0;
0050     virtual WId transientFor() const = 0;
0051     virtual WId groupLeader() const = 0;
0052     virtual QByteArray windowClassClass() const = 0;
0053     virtual QByteArray windowClassName() const = 0;
0054     virtual QByteArray windowRole() const = 0;
0055     virtual QByteArray clientMachine() const = 0;
0056     virtual bool actionSupported(NET::Action action) const = 0;
0057 
0058     KWindowInfoPrivateDesktopFileNameExtension *desktopFileNameExtension() const;
0059     KWindowInfoPrivateGtkApplicationIdExtension *gtkApplicationIdExtension() const;
0060     KWindowInfoPrivatePidExtension *pidExtension() const;
0061     KWindowInfoPrivateAppMenuExtension *appMenuExtension() const;
0062 
0063     static KWindowInfoPrivate *create(WId window, NET::Properties properties, NET::Properties2 properties2);
0064 
0065 protected:
0066     KWindowInfoPrivate(WId window, NET::Properties properties, NET::Properties2 properties2);
0067 
0068     void installDesktopFileNameExtension(KWindowInfoPrivateDesktopFileNameExtension *extension);
0069     void installGtkApplicationIdExtension(KWindowInfoPrivateGtkApplicationIdExtension *extension);
0070     void installPidExtension(KWindowInfoPrivatePidExtension *extension);
0071     void installAppMenuExtension(KWindowInfoPrivateAppMenuExtension *extension);
0072 
0073 private:
0074     class Private;
0075     const QScopedPointer<Private> d;
0076 };
0077 
0078 class KWINDOWSYSTEM_EXPORT KWindowInfoPrivateDesktopFileNameExtension
0079 {
0080 public:
0081     virtual ~KWindowInfoPrivateDesktopFileNameExtension();
0082 
0083     virtual QByteArray desktopFileName() const = 0;
0084 
0085 protected:
0086     explicit KWindowInfoPrivateDesktopFileNameExtension();
0087 };
0088 
0089 class KWINDOWSYSTEM_EXPORT KWindowInfoPrivateGtkApplicationIdExtension
0090 {
0091 public:
0092     virtual ~KWindowInfoPrivateGtkApplicationIdExtension();
0093 
0094     virtual QByteArray gtkApplicationId() const = 0;
0095 
0096 protected:
0097     explicit KWindowInfoPrivateGtkApplicationIdExtension();
0098 };
0099 
0100 class KWINDOWSYSTEM_EXPORT KWindowInfoPrivatePidExtension
0101 {
0102 public:
0103     virtual ~KWindowInfoPrivatePidExtension();
0104 
0105     virtual int pid() const = 0;
0106 
0107 protected:
0108     explicit KWindowInfoPrivatePidExtension();
0109 };
0110 
0111 class KWINDOWSYSTEM_EXPORT KWindowInfoPrivateAppMenuExtension
0112 {
0113 public:
0114     virtual ~KWindowInfoPrivateAppMenuExtension();
0115 
0116     virtual QByteArray applicationMenuServiceName() const = 0;
0117     virtual QByteArray applicationMenuObjectPath() const = 0;
0118 
0119 protected:
0120     explicit KWindowInfoPrivateAppMenuExtension();
0121 };
0122 
0123 #endif