File indexing completed on 2024-05-05 17:44:50

0001 /*
0002     SPDX-FileCopyrightText: 2016 Eike Hein <hein@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstracttasksproxymodeliface.h"
0010 #include "taskmanager_export.h"
0011 
0012 #include <QIdentityProxyModel>
0013 
0014 namespace TaskManager
0015 {
0016 /**
0017  * @short A tasks model for startup notifications.
0018  *
0019  * This model presents tasks sourced from startup notifications.
0020  *
0021  * Startup notifications are given a timeout sourced from klaunchrc, falling
0022  * back to a default of 5 seconds if no configuration is present.
0023  *
0024  * Startup tasks are removed 500 msec after cancellation or timeout to
0025  * overlap with window tasks appearing in window task models.
0026  *
0027  * @author Eike Hein <hein@kde.org>
0028  */
0029 
0030 class TASKMANAGER_EXPORT StartupTasksModel : public QIdentityProxyModel, public AbstractTasksProxyModelIface
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     explicit StartupTasksModel(QObject *parent = nullptr);
0036     ~StartupTasksModel() override;
0037 
0038     QHash<int, QByteArray> roleNames() const override;
0039 
0040 protected:
0041     QModelIndex mapIfaceToSource(const QModelIndex &index) const override;
0042 
0043 private:
0044     class Private;
0045     QScopedPointer<Private> d;
0046 };
0047 
0048 }