Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/concatenatetasksproxymodel.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | Copyright 2016 Eike Hein <hein.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Lesser General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2.1 of the License, or (at your option) version 3, or any | ||||
8 | later version accepted by the membership of KDE e.V. (or its | ||||
9 | successor approved by the membership of KDE e.V.), which shall | ||||
10 | act as a proxy defined in Section 6 of version 3 of the license. | ||||
11 | | ||||
12 | This library is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
15 | Lesser General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU Lesser General Public | ||||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | | ||||
21 | #ifndef CONCATENATETASKSPROXYMODEL_H | ||||
22 | #define CONCATENATETASKSPROXYMODEL_H | ||||
23 | | ||||
24 | #include "abstracttasksmodeliface.h" | ||||
25 | | ||||
26 | #include <KConcatenateRowsProxyModel> | ||||
27 | | ||||
28 | #include "taskmanager_export.h" | ||||
29 | | ||||
30 | namespace TaskManager | ||||
31 | { | ||||
32 | | ||||
33 | /** | ||||
34 | * @short A proxy tasks model for concatenating multiple source tasks models. | ||||
35 | * | ||||
36 | * This proxy model is a subclass of KConcatenateRowsProxyModel implementing | ||||
37 | * AbstractTasksModelIface, forwarding calls to the correct source model. | ||||
38 | * | ||||
39 | * @author Eike Hein <hein@kde.org> | ||||
40 | **/ | ||||
41 | | ||||
42 | class TASKMANAGER_EXPORT ConcatenateTasksProxyModel : public KConcatenateRowsProxyModel, | ||||
43 | public AbstractTasksModelIface | ||||
44 | { | ||||
45 | Q_OBJECT | ||||
46 | | ||||
47 | public: | ||||
48 | explicit ConcatenateTasksProxyModel(QObject *parent = 0); | ||||
49 | virtual ~ConcatenateTasksProxyModel(); | ||||
50 | | ||||
51 | /** | ||||
52 | * Request activation of the task at the given index. Derived classes are | ||||
53 | * free to interpret the meaning of "activate" themselves depending on | ||||
54 | * the nature and state of the task, e.g. launch or raise a window task. | ||||
55 | * | ||||
56 | * @param index An index in this tasks model. | ||||
57 | **/ | ||||
58 | void requestActivate(const QModelIndex &index); | ||||
59 | | ||||
60 | /** | ||||
61 | * Request an additional instance of the application backing the task | ||||
62 | * at the given index. | ||||
63 | * | ||||
64 | * @param index An index in this tasks model. | ||||
65 | **/ | ||||
66 | void requestNewInstance(const QModelIndex &index); | ||||
67 | | ||||
68 | /** | ||||
69 | * Request the task at the given index be closed. | ||||
70 | * | ||||
71 | * @param index An index in this tasks model. | ||||
72 | **/ | ||||
73 | void requestClose(const QModelIndex &index); | ||||
74 | | ||||
75 | /** | ||||
76 | * Request starting an interactive move for the task at the given index. | ||||
77 | * | ||||
78 | * This is meant for tasks that have an associated window, and may be | ||||
79 | * a no-op when there is no window. | ||||
80 | * | ||||
81 | * @param index An index in this tasks model. | ||||
82 | **/ | ||||
83 | void requestMove(const QModelIndex &index); | ||||
84 | | ||||
85 | /** | ||||
86 | * Request starting an interactive resize for the task at the given index. | ||||
87 | * | ||||
88 | * This is meant for tasks that have an associated window, and may be a | ||||
89 | * no-op when there is no window. | ||||
90 | * | ||||
91 | * @param index An index in this tasks model. | ||||
92 | **/ | ||||
93 | void requestResize(const QModelIndex &index); | ||||
94 | | ||||
95 | /** | ||||
96 | * Request toggling the minimized state of the task at the given index. | ||||
97 | * | ||||
98 | * This is meant for tasks that have an associated window, and may be | ||||
99 | * a no-op when there is no window. | ||||
100 | * | ||||
101 | * @param index An index in this tasks model. | ||||
102 | **/ | ||||
103 | void requestToggleMinimized(const QModelIndex &index); | ||||
104 | | ||||
105 | /** | ||||
106 | * Request toggling the maximized state of the task at the given index. | ||||
107 | * | ||||
108 | * This is meant for tasks that have an associated window, and may be | ||||
109 | * a no-op when there is no window. | ||||
110 | * | ||||
111 | * @param index An index in this tasks model. | ||||
112 | **/ | ||||
113 | void requestToggleMaximized(const QModelIndex &index); | ||||
114 | | ||||
115 | /** | ||||
116 | * Request toggling the keep-above state of the task at the given index. | ||||
117 | * | ||||
118 | * This is meant for tasks that have an associated window, and may be | ||||
119 | * a no-op when there is no window. | ||||
120 | * | ||||
121 | * @param index An index in this tasks model. | ||||
122 | **/ | ||||
123 | void requestToggleKeepAbove(const QModelIndex &index); | ||||
124 | | ||||
125 | /** | ||||
126 | * Request toggling the keep-below state of the task at the given index. | ||||
127 | * | ||||
128 | * This is meant for tasks that have an associated window, and may be | ||||
129 | * a no-op when there is no window. | ||||
130 | * | ||||
131 | * @param index An index in this tasks model. | ||||
132 | **/ | ||||
133 | void requestToggleKeepBelow(const QModelIndex &index); | ||||
134 | | ||||
135 | /** | ||||
136 | * Request toggling the fullscreen state of the task at the given index. | ||||
137 | * | ||||
138 | * This is meant for tasks that have an associated window, and may be | ||||
139 | * a no-op when there is no window. | ||||
140 | * | ||||
141 | * @param index An index in this tasks model. | ||||
142 | **/ | ||||
143 | void requestToggleFullScreen(const QModelIndex &index); | ||||
144 | | ||||
145 | /** | ||||
146 | * Request toggling the shaded state of the task at the given index. | ||||
147 | * | ||||
148 | * This is meant for tasks that have an associated window, and may be | ||||
149 | * a no-op when there is no window. | ||||
150 | * | ||||
151 | * @param index An index in this tasks model. | ||||
152 | **/ | ||||
153 | void requestToggleShaded(const QModelIndex &index); | ||||
154 | | ||||
155 | /** | ||||
156 | * Request moving the task at the given index to the specified virtual | ||||
157 | * desktop. | ||||
158 | * | ||||
159 | * This is meant for tasks that have an associated window, and may be | ||||
160 | * a no-op when there is no window. | ||||
161 | * | ||||
162 | * @param index An index in this tasks model. | ||||
163 | * @param desktop A virtual desktop number. | ||||
164 | **/ | ||||
165 | void requestVirtualDesktop(const QModelIndex &index, qint32 desktop); | ||||
166 | | ||||
167 | /** | ||||
168 | * Request informing the window manager of new geometry for a visual | ||||
169 | * delegate for the task at the given index. The geometry should be in | ||||
170 | * screen coordinates. | ||||
171 | * | ||||
172 | * @param index An index in this tasks model. | ||||
173 | * @param geometry Visual delegate geometry in screen coordinates. | ||||
174 | * @param delegate The delegate. Implementations are on their own with | ||||
175 | * regard to extracting information from this, and should take care to | ||||
176 | * reject invalid objects. | ||||
177 | **/ | ||||
178 | void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, | ||||
179 | QObject *delegate = nullptr); | ||||
180 | }; | ||||
181 | | ||||
182 | } | ||||
183 | | ||||
184 | #endif |