File indexing completed on 2022-11-22 15:06:23

0001 /*
0002     SPDX-FileCopyrightText: 2016 Smith AR <audoban@openmailbox.org>
0003     SPDX-FileCopyrightText: 2016 Michail Vourlakos <mvourlakos@gmail.com>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef WINDOWINFOWRAP_H
0008 #define WINDOWINFOWRAP_H
0009 
0010 // Qt
0011 #include <QWindow>
0012 #include <QIcon>
0013 #include <QRect>
0014 #include <QVariant>
0015 
0016 namespace Latte {
0017 namespace WindowSystem {
0018 
0019 using WindowId = QVariant;
0020 
0021 class WindowInfoWrap
0022 {
0023 
0024 public:
0025     WindowInfoWrap();
0026     WindowInfoWrap(const WindowInfoWrap &o);
0027     WindowInfoWrap(WindowInfoWrap &&o);
0028 
0029     WindowInfoWrap &operator=(WindowInfoWrap &&rhs);
0030     WindowInfoWrap &operator=(const WindowInfoWrap &rhs);
0031 
0032     bool isValid() const;
0033     void setIsValid(bool isValid);
0034 
0035     bool isActive() const;
0036     void setIsActive(bool isActive);
0037 
0038     bool isMinimized() const;
0039     void setIsMinimized(bool isMinimized);
0040 
0041     bool isMaximized() const;
0042 
0043     bool isMaxVert() const;
0044     void setIsMaxVert(bool isMaxVert);
0045 
0046     bool isMaxHoriz() const;
0047     void setIsMaxHoriz(bool isMaxHoriz);
0048 
0049     bool isFullscreen() const;
0050     void setIsFullscreen(bool isFullscreen);
0051 
0052     bool isShaded() const;
0053     void setIsShaded(bool isShaded);
0054 
0055     bool isKeepAbove() const;
0056     void setIsKeepAbove(bool isKeepAbove);
0057 
0058     bool isKeepBelow() const;
0059     void setIsKeepBelow(bool isKeepBelow);
0060 
0061     bool hasSkipPager() const;
0062     void setHasSkipPager(bool skipPager);
0063 
0064     bool hasSkipSwitcher() const;
0065     void setHasSkipSwitcher(bool skipSwitcher);
0066 
0067     bool hasSkipTaskbar() const;
0068     void setHasSkipTaskbar(bool skipTaskbar);
0069 
0070     bool isOnAllDesktops() const;
0071     void setIsOnAllDesktops(bool alldesktops);
0072 
0073     bool isOnAllActivities() const;
0074     void setIsOnAllActivities(bool allactivities);
0075 
0076     //!BEGIN: Window Abilities
0077     bool isCloseable() const;
0078     void setIsClosable(bool closable);
0079 
0080     bool isFullScreenable() const;
0081     void setIsFullScreenable(bool fullscreenable);
0082 
0083     bool isGroupable() const;
0084     void setIsGroupable(bool groupable);
0085 
0086     bool isMaximizable() const;
0087     void setIsMaximizable(bool maximizable);
0088 
0089     bool isMinimizable() const;
0090     void setIsMinimizable(bool minimizable);
0091 
0092     bool isMovable() const;
0093     void setIsMovable(bool movable);
0094 
0095     bool isResizable() const;
0096     void setIsResizable(bool resizable);
0097 
0098     bool isShadeable() const;
0099     void setIsShadeable(bool shadeble);
0100 
0101     bool isVirtualDesktopsChangeable() const;
0102     void setIsVirtualDesktopsChangeable(bool virtualdesktopchangeable);
0103     //!END: Window Abilities
0104 
0105     bool isMainWindow() const;
0106     bool isChildWindow() const;
0107 
0108     QRect geometry() const;
0109     void setGeometry(const QRect &geometry);
0110 
0111     QString appName() const;
0112     void setAppName(const QString &appName);
0113 
0114     QString display() const;
0115     void setDisplay(const QString &display);
0116 
0117     QIcon icon() const;
0118     void setIcon(const QIcon &icon);
0119 
0120     WindowId wid() const;
0121     void setWid(const WindowId &wid);
0122 
0123     WindowId parentId() const;
0124     void setParentId(const WindowId &parentId);
0125 
0126     QStringList desktops() const;
0127     void setDesktops(const QStringList &desktops);
0128 
0129     QStringList activities() const;
0130     void setActivities(const QStringList &activities);
0131 
0132     bool isOnDesktop(const QString &desktop) const;
0133     bool isOnActivity(const QString &activity) const;
0134 
0135 private:
0136     WindowId m_wid{0};
0137     WindowId m_parentId{0};
0138 
0139     QRect m_geometry;
0140 
0141     bool m_isValid{false};
0142     bool m_isActive{false};
0143     bool m_isMinimized{false};
0144     bool m_isMaxVert{false};
0145     bool m_isMaxHoriz{false};
0146     bool m_isFullscreen{false};
0147     bool m_isShaded{false};
0148     bool m_isKeepAbove{false};
0149     bool m_isKeepBelow{false};
0150     bool m_hasSkipPager{false};
0151     bool m_hasSkipSwitcher{false};
0152     bool m_hasSkipTaskbar{false};
0153     bool m_isOnAllDesktops{false};
0154     bool m_isOnAllActivities{false};
0155 
0156     //!BEGIN: Window Abilities
0157     bool m_isClosable{false};
0158     bool m_isFullScreenable{false};
0159     bool m_isGroupable{false};
0160     bool m_isMaximizable{false};
0161     bool m_isMinimizable{false};
0162     bool m_isMovable{false};
0163     bool m_isResizable{false};
0164     bool m_isShadeable{false};
0165     bool m_isVirtualDesktopsChangeable{false};
0166     //!END: Window Abilities
0167 
0168     QString m_appName;
0169     QString m_display;
0170 
0171     QIcon m_icon;
0172 
0173     QStringList m_desktops;
0174     QStringList m_activities;
0175 };
0176 
0177 }
0178 }
0179 
0180 #endif // WINDOWINFOWRAP_H