/* * Copyright (C) 2021 ~ 2022 Deepin Technology Co., Ltd. * * Author: weizhixiang * * Maintainer: weizhixiang * * This program 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 3 of the License, or * any later version. * * This program 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 . */ #ifndef DBUSADAPTORDOCK_H #define DBUSADAPTORDOCK_H #include "dock.h" #include #include #include #include #include #include #include #include #include #include #include #include /* * Adaptor class for interface org.deepin.dde.daemon.Dock1 */ class DBusAdaptorDock: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.deepin.dde.daemon.Dock1") Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: DBusAdaptorDock(QObject *parent); virtual ~DBusAdaptorDock(); public: // PROPERTIES Q_PROPERTY(int DisplayMode READ displayMode WRITE setDisplayMode NOTIFY DisplayModeChanged) int displayMode() const; void setDisplayMode(int value); Q_PROPERTY(QStringList DockedApps READ dockedApps NOTIFY DockedAppsChanged) QStringList dockedApps() const; Q_PROPERTY(QList Entries READ entries NOTIFY EntriesChanged) QList entries() const; Q_PROPERTY(int HideMode READ hideMode WRITE setHideMode NOTIFY HideModeChanged) int hideMode() const; void setHideMode(int value); Q_PROPERTY(int HideState READ hideState NOTIFY HideStateChanged) int hideState() const; Q_PROPERTY(uint HideTimeout READ hideTimeout WRITE setHideTimeout NOTIFY HideTimeoutChanged) uint hideTimeout() const; void setHideTimeout(uint value); Q_PROPERTY(uint WindowSizeEfficient READ windowSizeEfficient WRITE setWindowSizeEfficient NOTIFY WindowSizeEfficientChanged) uint windowSizeEfficient() const; void setWindowSizeEfficient(uint value); Q_PROPERTY(uint WindowSizeFashion READ windowSizeFashion WRITE setWindowSizeFashion NOTIFY WindowSizeFashionChanged) uint windowSizeFashion() const; void setWindowSizeFashion(uint value); Q_PROPERTY(QRect FrontendWindowRect READ frontendWindowRect NOTIFY FrontendWindowRectChanged) QRect frontendWindowRect() const; Q_PROPERTY(double Opacity READ opacity NOTIFY OpacityChanged) double opacity() const; Q_PROPERTY(uint IconSize READ iconSize WRITE setIconSize NOTIFY IconSizeChanged) uint iconSize() const; void setIconSize(uint value); Q_PROPERTY(int Position READ position WRITE setPosition NOTIFY PositionChanged) int position() const; void setPosition(int value); Q_PROPERTY(uint ShowTimeout READ showTimeout WRITE setShowTimeout NOTIFY ShowTimeoutChanged) uint showTimeout() const; void setShowTimeout(uint value); Dock *parent() const; public Q_SLOTS: // METHODS void CloseWindow(uint win); QStringList GetEntryIDs(); bool IsDocked(const QString &desktopFile); bool IsOnDock(const QString &desktopFile); void MoveEntry(int index, int newIndex); QString QueryWindowIdentifyMethod(uint win); QStringList GetDockedAppsDesktopFiles(); QString GetPluginSettings(); void SetPluginSettings(QString jsonStr); void MergePluginSettings(QString jsonStr); void RemovePluginSettings(QString key1, QStringList key2List); bool RequestDock(const QString &desktopFile, int index); bool RequestUndock(const QString &desktopFile); void SetFrontendWindowRect(int x, int y, uint width, uint height); Q_SIGNALS: // SIGNALS void ServiceRestarted(); void EntryAdded(const QDBusObjectPath &path, int index); void EntryRemoved(const QString &entryId); void DisplayModeChanged(int value) const; void DockedAppsChanged(const QStringList &value) const; void EntriesChanged(const QList &value) const; void FrontendWindowRectChanged() const; void HideModeChanged(int value) const; void HideStateChanged(int value) const; void HideTimeoutChanged(uint value) const; void IconSizeChanged(uint value) const; void OpacityChanged(double value) const; void PositionChanged(int value) const; void ShowTimeoutChanged(uint value) const; void WindowSizeEfficientChanged(uint value) const; void WindowSizeFashionChanged(uint value) const; }; #endif