File indexing completed on 2024-05-05 05:38:34
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 #include <memory> 0015 0016 namespace TaskManager 0017 { 0018 /** 0019 * @short A tasks model for startup notifications. 0020 * 0021 * This model presents tasks sourced from startup notifications. 0022 * 0023 * Startup notifications are given a timeout sourced from klaunchrc, falling 0024 * back to a default of 5 seconds if no configuration is present. 0025 * 0026 * Startup tasks are removed 500 msec after cancellation or timeout to 0027 * overlap with window tasks appearing in window task models. 0028 * 0029 * @author Eike Hein <hein@kde.org> 0030 */ 0031 0032 class TASKMANAGER_EXPORT StartupTasksModel : public QIdentityProxyModel, public AbstractTasksProxyModelIface 0033 { 0034 Q_OBJECT 0035 0036 public: 0037 explicit StartupTasksModel(QObject *parent = nullptr); 0038 ~StartupTasksModel() override; 0039 0040 QHash<int, QByteArray> roleNames() const override; 0041 0042 protected: 0043 QModelIndex mapIfaceToSource(const QModelIndex &index) const override; 0044 0045 private: 0046 class Private; 0047 std::unique_ptr<Private> d; 0048 }; 0049 0050 }