Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/abstracttasksmodel.h
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 51 | enum AdditionalRoles { | |||
---|---|---|---|---|---|
85 | SkipTaskbar /**< Task desires not to be shown in a user interface. */ | 85 | SkipTaskbar /**< Task desires not to be shown in a user interface. */ | ||
86 | }; | 86 | }; | ||
87 | 87 | | |||
88 | explicit AbstractTasksModel(QObject *parent = nullptr); | 88 | explicit AbstractTasksModel(QObject *parent = nullptr); | ||
89 | virtual ~AbstractTasksModel(); | 89 | virtual ~AbstractTasksModel(); | ||
90 | 90 | | |||
91 | QHash<int, QByteArray> roleNames() const override; | 91 | QHash<int, QByteArray> roleNames() const override; | ||
92 | 92 | | |||
93 | virtual QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const; | 93 | virtual QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override; | ||
94 | 94 | | |||
95 | /** | 95 | /** | ||
96 | * Request activation of the task at the given index. Derived classes are | 96 | * Request activation of the task at the given index. Derived classes are | ||
97 | * free to interpret the meaning of "activate" themselves depending on | 97 | * free to interpret the meaning of "activate" themselves depending on | ||
98 | * the nature and state of the task, e.g. launch or raise a window task. | 98 | * the nature and state of the task, e.g. launch or raise a window task. | ||
99 | * | 99 | * | ||
100 | * This base implementation does nothing. | 100 | * This base implementation does nothing. | ||
101 | * | 101 | * | ||
102 | * @param index An index in this tasks model. | 102 | * @param index An index in this tasks model. | ||
103 | **/ | 103 | **/ | ||
104 | virtual void requestActivate(const QModelIndex &index); | 104 | virtual void requestActivate(const QModelIndex &index) override; | ||
105 | 105 | | |||
106 | /** | 106 | /** | ||
107 | * Request an additional instance of the application backing the task | 107 | * Request an additional instance of the application backing the task | ||
108 | * at the given index. | 108 | * at the given index. | ||
109 | * | 109 | * | ||
110 | * This base implementation does nothing. | 110 | * This base implementation does nothing. | ||
111 | * | 111 | * | ||
112 | * @param index An index in this tasks model. | 112 | * @param index An index in this tasks model. | ||
113 | **/ | 113 | **/ | ||
114 | virtual void requestNewInstance(const QModelIndex &index); | 114 | virtual void requestNewInstance(const QModelIndex &index) override; | ||
115 | 115 | | |||
116 | /** | 116 | /** | ||
117 | * Request the task at the given index be closed. | 117 | * Request the task at the given index be closed. | ||
118 | * | 118 | * | ||
119 | * This base implementation does nothing. | 119 | * This base implementation does nothing. | ||
120 | * | 120 | * | ||
121 | * @param index An index in this tasks model. | 121 | * @param index An index in this tasks model. | ||
122 | **/ | 122 | **/ | ||
123 | virtual void requestClose(const QModelIndex &index); | 123 | virtual void requestClose(const QModelIndex &index) override; | ||
124 | 124 | | |||
125 | /** | 125 | /** | ||
126 | * Request starting an interactive move for the task at the given index. | 126 | * Request starting an interactive move for the task at the given index. | ||
127 | * | 127 | * | ||
128 | * This is meant for tasks that have an associated window, and may be | 128 | * This is meant for tasks that have an associated window, and may be | ||
129 | * a no-op when there is no window. | 129 | * a no-op when there is no window. | ||
130 | * | 130 | * | ||
131 | * This base implementation does nothing. | 131 | * This base implementation does nothing. | ||
132 | * | 132 | * | ||
133 | * @param index An index in this tasks model. | 133 | * @param index An index in this tasks model. | ||
134 | **/ | 134 | **/ | ||
135 | virtual void requestMove(const QModelIndex &index); | 135 | virtual void requestMove(const QModelIndex &index) override; | ||
136 | 136 | | |||
137 | /** | 137 | /** | ||
138 | * Request starting an interactive resize for the task at the given index. | 138 | * Request starting an interactive resize for the task at the given index. | ||
139 | * | 139 | * | ||
140 | * This is meant for tasks that have an associated window, and may be a | 140 | * This is meant for tasks that have an associated window, and may be a | ||
141 | * no-op when there is no window. | 141 | * no-op when there is no window. | ||
142 | * | 142 | * | ||
143 | * This base implementation does nothing. | 143 | * This base implementation does nothing. | ||
144 | * | 144 | * | ||
145 | * @param index An index in this tasks model. | 145 | * @param index An index in this tasks model. | ||
146 | **/ | 146 | **/ | ||
147 | virtual void requestResize(const QModelIndex &index); | 147 | virtual void requestResize(const QModelIndex &index) override; | ||
148 | 148 | | |||
149 | /** | 149 | /** | ||
150 | * Request toggling the minimized state of the task at the given index. | 150 | * Request toggling the minimized state of the task at the given index. | ||
151 | * | 151 | * | ||
152 | * This is meant for tasks that have an associated window, and may be | 152 | * This is meant for tasks that have an associated window, and may be | ||
153 | * a no-op when there is no window. | 153 | * a no-op when there is no window. | ||
154 | * | 154 | * | ||
155 | * This base implementation does nothing. | 155 | * This base implementation does nothing. | ||
156 | * | 156 | * | ||
157 | * @param index An index in this tasks model. | 157 | * @param index An index in this tasks model. | ||
158 | **/ | 158 | **/ | ||
159 | virtual void requestToggleMinimized(const QModelIndex &index); | 159 | virtual void requestToggleMinimized(const QModelIndex &index) override; | ||
160 | 160 | | |||
161 | /** | 161 | /** | ||
162 | * Request toggling the maximized state of the task at the given index. | 162 | * Request toggling the maximized state of the task at the given index. | ||
163 | * | 163 | * | ||
164 | * This is meant for tasks that have an associated window, and may be | 164 | * This is meant for tasks that have an associated window, and may be | ||
165 | * a no-op when there is no window. | 165 | * a no-op when there is no window. | ||
166 | * | 166 | * | ||
167 | * This base implementation does nothing. | 167 | * This base implementation does nothing. | ||
168 | * | 168 | * | ||
169 | * @param index An index in this tasks model. | 169 | * @param index An index in this tasks model. | ||
170 | **/ | 170 | **/ | ||
171 | virtual void requestToggleMaximized(const QModelIndex &index); | 171 | virtual void requestToggleMaximized(const QModelIndex &index) override; | ||
172 | 172 | | |||
173 | /** | 173 | /** | ||
174 | * Request toggling the keep-above state of the task at the given index. | 174 | * Request toggling the keep-above state of the task at the given index. | ||
175 | * | 175 | * | ||
176 | * This is meant for tasks that have an associated window, and may be | 176 | * This is meant for tasks that have an associated window, and may be | ||
177 | * a no-op when there is no window. | 177 | * a no-op when there is no window. | ||
178 | * | 178 | * | ||
179 | * This base implementation does nothing. | 179 | * This base implementation does nothing. | ||
180 | * | 180 | * | ||
181 | * @param index An index in this tasks model. | 181 | * @param index An index in this tasks model. | ||
182 | **/ | 182 | **/ | ||
183 | virtual void requestToggleKeepAbove(const QModelIndex &index); | 183 | virtual void requestToggleKeepAbove(const QModelIndex &index) override; | ||
184 | 184 | | |||
185 | /** | 185 | /** | ||
186 | * Request toggling the keep-below state of the task at the given index. | 186 | * Request toggling the keep-below state of the task at the given index. | ||
187 | * | 187 | * | ||
188 | * This is meant for tasks that have an associated window, and may be | 188 | * This is meant for tasks that have an associated window, and may be | ||
189 | * a no-op when there is no window. | 189 | * a no-op when there is no window. | ||
190 | * | 190 | * | ||
191 | * This base implementation does nothing. | 191 | * This base implementation does nothing. | ||
192 | * | 192 | * | ||
193 | * @param index An index in this tasks model. | 193 | * @param index An index in this tasks model. | ||
194 | **/ | 194 | **/ | ||
195 | virtual void requestToggleKeepBelow(const QModelIndex &index); | 195 | virtual void requestToggleKeepBelow(const QModelIndex &index) override; | ||
196 | 196 | | |||
197 | /** | 197 | /** | ||
198 | * Request toggling the fullscreen state of the task at the given index. | 198 | * Request toggling the fullscreen state of the task at the given index. | ||
199 | * | 199 | * | ||
200 | * This is meant for tasks that have an associated window, and may be | 200 | * This is meant for tasks that have an associated window, and may be | ||
201 | * a no-op when there is no window. | 201 | * a no-op when there is no window. | ||
202 | * | 202 | * | ||
203 | * This base implementation does nothing. | 203 | * This base implementation does nothing. | ||
204 | * | 204 | * | ||
205 | * @param index An index in this tasks model. | 205 | * @param index An index in this tasks model. | ||
206 | **/ | 206 | **/ | ||
207 | virtual void requestToggleFullScreen(const QModelIndex &index); | 207 | virtual void requestToggleFullScreen(const QModelIndex &index) override; | ||
208 | 208 | | |||
209 | /** | 209 | /** | ||
210 | * Request toggling the shaded state of the task at the given index. | 210 | * Request toggling the shaded state of the task at the given index. | ||
211 | * | 211 | * | ||
212 | * This is meant for tasks that have an associated window, and may be | 212 | * This is meant for tasks that have an associated window, and may be | ||
213 | * a no-op when there is no window. | 213 | * a no-op when there is no window. | ||
214 | * | 214 | * | ||
215 | * This base implementation does nothing. | 215 | * This base implementation does nothing. | ||
216 | * | 216 | * | ||
217 | * @param index An index in this tasks model. | 217 | * @param index An index in this tasks model. | ||
218 | **/ | 218 | **/ | ||
219 | virtual void requestToggleShaded(const QModelIndex &index); | 219 | virtual void requestToggleShaded(const QModelIndex &index) override; | ||
220 | 220 | | |||
221 | /** | 221 | /** | ||
222 | * Request moving the task at the given index to the specified virtual | 222 | * Request moving the task at the given index to the specified virtual | ||
223 | * desktop. | 223 | * desktop. | ||
224 | * | 224 | * | ||
225 | * This is meant for tasks that have an associated window, and may be | 225 | * This is meant for tasks that have an associated window, and may be | ||
226 | * a no-op when there is no window. | 226 | * a no-op when there is no window. | ||
227 | * | 227 | * | ||
228 | * This base implementation does nothing. | 228 | * This base implementation does nothing. | ||
229 | * | 229 | * | ||
230 | * @param index An index in this tasks model. | 230 | * @param index An index in this tasks model. | ||
231 | * @param desktop A virtual desktop number. | 231 | * @param desktop A virtual desktop number. | ||
232 | **/ | 232 | **/ | ||
233 | virtual void requestVirtualDesktop(const QModelIndex &index, qint32 desktop); | 233 | virtual void requestVirtualDesktop(const QModelIndex &index, qint32 desktop) override; | ||
234 | 234 | | |||
235 | /** | 235 | /** | ||
236 | * Request informing the window manager of new geometry for a visual | 236 | * Request informing the window manager of new geometry for a visual | ||
237 | * delegate for the task at the given index. The geometry should be in | 237 | * delegate for the task at the given index. The geometry should be in | ||
238 | * screen coordinates. | 238 | * screen coordinates. | ||
239 | * | 239 | * | ||
240 | * This base implementation does nothing. | 240 | * This base implementation does nothing. | ||
241 | * | 241 | * | ||
242 | * @param index An index in this tasks model. | 242 | * @param index An index in this tasks model. | ||
243 | * @param geometry Visual delegate geometry in screen coordinates. | 243 | * @param geometry Visual delegate geometry in screen coordinates. | ||
244 | * @param delegate The delegate. Implementations are on their own with | 244 | * @param delegate The delegate. Implementations are on their own with | ||
245 | * regard to extracting information from this, and should take care to | 245 | * regard to extracting information from this, and should take care to | ||
246 | * reject invalid objects. | 246 | * reject invalid objects. | ||
247 | **/ | 247 | **/ | ||
248 | virtual void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, | 248 | virtual void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, | ||
249 | QObject *delegate = nullptr); | 249 | QObject *delegate = nullptr) override; | ||
250 | }; | 250 | }; | ||
251 | 251 | | |||
252 | } | 252 | } | ||
253 | 253 | | |||
254 | #endif | 254 | #endif |