ukui-panel/widgets/ukui-task-manager/task-manager-item.h

75 lines
2.4 KiB
C++

/*
*
* * Copyright (C) 2023, KylinSoft Co., Ltd.
* *
* * 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
* * (at your option) 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 <https://www.gnu.org/licenses/>.
* *
* * Authors: iaom <zhangpengfei@kylinos.cn>
*
*/
#ifndef UKUI_TASK_MANAGER_TASK_MANAGER_ITEM_H
#define UKUI_TASK_MANAGER_TASK_MANAGER_ITEM_H
#include <QObject>
#include <QIcon>
#include <QVariant>
#include "actions.h"
namespace TaskManager {
class TaskManagerItemPrivate;
class TaskManagerItem : public QObject
{
Q_OBJECT
public:
explicit TaskManagerItem(QObject *parent = nullptr);
explicit TaskManagerItem(const QString &appID, QObject *parent = nullptr);
explicit TaskManagerItem(const QStringList &winIDs, QObject *parent = nullptr);
~TaskManagerItem();
const QString &ID() const;
void setID(const QString &appID);
const QString &name() const;
const QString &genericName() const;
const QIcon &icon() const;
const QStringList &winIDs() const;
const QStringList &currentDesktopWinIDs();
void addWinID(const QString &winID);
void removeWinID(const QString &winID);
void windowChanged(const QString &winID);
const QString &group() const;
void setGroup(const QString &group);
bool hasLauncher() const;
int quickLauncherIndex() const;
void setQuickLauncherIndex(int index);
Actions actions() const;
void actionActivate(Action::Type type, const QVariant &param = {});
QStringList demandsAttentionWinIDs() const;
const QString &display() const;
uint unReadMessagesNum();
void init();
public Q_SLOTS:
void updateUnreadMessagesNum(const QString &desktopFile, uint num);
private Q_SLOTS:
void refreshWinIdsOnCurrentDesktop();
Q_SIGNALS:
void dataUpdated(QVector<int> roles);
private:
TaskManagerItemPrivate *d = nullptr;
};
}
#endif //UKUI_TASK_MANAGER_TASK_MANAGER_ITEM_H