Plasma-workspace

abstracttasksproxymodeliface.h
1/*
2 SPDX-FileCopyrightText: 2016 Eike Hein <hein@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#pragma once
8
9#include <QObject>
10
11#include "abstracttasksmodeliface.h"
12#include "taskmanager_export.h"
13
14namespace TaskManager
15{
16/**
17 * @short Pure method interface for tasks model implementations.
18 *
19 * This is the pure method interface implemented by AbstractTasksModel,
20 * as well as other model classes in this library which cannot inherit from
21 * AbstractTasksModel.
22 *
23 * @author Eike Hein <hein@kde.org>
24 **/
25
27{
28public:
30 {
31 }
32
33 /**
34 * Request activation of the task at the given index. Implementing classes
35 * are free to interpret the meaning of "activate" themselves depending on
36 * the nature and state of the task, e.g. launch or raise a window task.
37 *
38 * @param index An index in this tasks model.
39 **/
40 void requestActivate(const QModelIndex &index) override;
41
42 /**
43 * Request an additional instance of the application backing the task
44 * at the given index.
45 *
46 * @param index An index in this tasks model.
47 **/
48 void requestNewInstance(const QModelIndex &index) override;
49
50 /**
51 * Requests to open the given URLs with the application backing the task
52 * at the given index.
53 *
54 * @param index An index in this tasks model.
55 * @param urls The URLs to be passed to the application.
56 **/
57 void requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) override;
58
59 /**
60 * Request the task at the given index be closed.
61 *
62 * @param index An index in this tasks model.
63 **/
64 void requestClose(const QModelIndex &index) override;
65
66 /**
67 * Request starting an interactive move for the task at the given index.
68 *
69 * This is meant for tasks that have an associated window, and may be
70 * a no-op when there is no window.
71 *
72 * @param index An index in this tasks model.
73 **/
74 void requestMove(const QModelIndex &index) override;
75
76 /**
77 * Request starting an interactive resize for the task at the given index.
78 *
79 * This is meant for tasks that have an associated window, and may be a
80 * no-op when there is no window.
81 *
82 * @param index An index in this tasks model.
83 **/
84 void requestResize(const QModelIndex &index) override;
85
86 /**
87 * Request toggling the minimized state of the task at the given index.
88 *
89 * This is meant for tasks that have an associated window, and may be
90 * a no-op when there is no window.
91 *
92 * @param index An index in this tasks model.
93 **/
94 void requestToggleMinimized(const QModelIndex &index) override;
95
96 /**
97 * Request toggling the maximized state of the task at the given index.
98 *
99 * This is meant for tasks that have an associated window, and may be
100 * a no-op when there is no window.
101 *
102 * @param index An index in this tasks model.
103 **/
104 void requestToggleMaximized(const QModelIndex &index) override;
105
106 /**
107 * Request toggling the keep-above state of the task at the given index.
108 *
109 * This is meant for tasks that have an associated window, and may be
110 * a no-op when there is no window.
111 *
112 * @param index An index in this tasks model.
113 **/
114 void requestToggleKeepAbove(const QModelIndex &index) override;
115
116 /**
117 * Request toggling the keep-below state of the task at the given index.
118 *
119 * This is meant for tasks that have an associated window, and may be
120 * a no-op when there is no window.
121 *
122 * @param index An index in this tasks model.
123 **/
124 void requestToggleKeepBelow(const QModelIndex &index) override;
125
126 /**
127 * Request toggling the fullscreen state of the task at the given index.
128 *
129 * This is meant for tasks that have an associated window, and may be
130 * a no-op when there is no window.
131 *
132 * @param index An index in this tasks model.
133 **/
134 void requestToggleFullScreen(const QModelIndex &index) override;
135
136 /**
137 * Request toggling the shaded state of the task at the given index.
138 *
139 * This is meant for tasks that have an associated window, and may be
140 * a no-op when there is no window.
141 *
142 * @param index An index in this tasks model.
143 **/
144 void requestToggleShaded(const QModelIndex &index) override;
145
146 /**
147 * Request toggling the no border state of the task at given index.
148 *
149 * This is meant for tasks that have an associated window, and may be
150 * a no-op when there is no window.
151 *
152 * @param index An index in this tasks model.
153 * @since 6.4
154 **/
155 void requestToggleNoBorder(const QModelIndex &index) override;
156
157 /**
158 * Request entering the window at the given index on the specified virtual desktops,
159 * leaving any other desktops.
160 *
161 * On Wayland, virtual desktop ids are QStrings. On X11, they are uint >0.
162 *
163 * An empty list has a special meaning: The window is entered on all virtual desktops
164 * in the session.
165 *
166 * On X11, a window can only be on one or all virtual desktops. Therefore, only the
167 * first list entry is actually used.
168 *
169 * On X11, the id 0 has a special meaning: The window is entered on all virtual
170 * desktops in the session.
171 *
172 * @param index An index in this window tasks model.
173 * @param desktops A list of virtual desktop ids.
174 **/
175 void requestVirtualDesktops(const QModelIndex &index, const QVariantList &desktops) override;
176
177 /**
178 * Request entering the window at the given index on a new virtual desktop,
179 * which is created in response to this request.
180 *
181 * @param index An index in this window tasks model.
182 **/
183 void requestNewVirtualDesktop(const QModelIndex &index) override;
184
185 /**
186 * Request moving the task at the given index to the specified activities.
187 *
188 * This is meant for tasks that have an associated window, and may be
189 * a no-op when there is no window.
190 *
191 * @param index An index in this tasks model.
192 * @param activities The new list of activities.
193 **/
194 void requestActivities(const QModelIndex &index, const QStringList &activities) override;
195
196 /**
197 * Request informing the window manager of new geometry for a visual
198 * delegate for the task at the given index. The geometry should be in
199 * screen coordinates.
200 *
201 * @param index An index in this tasks model.
202 * @param geometry Visual delegate geometry in screen coordinates.
203 * @param delegate The delegate. Implementations are on their own with
204 * regard to extracting information from this, and should take care to
205 * reject invalid objects.
206 **/
207 void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate = nullptr) override;
208
209protected:
210 /*
211 * Map the passed QModelIndex to the source model index
212 * so that AbstractTasksModelIface methods can be passed on
213 * Subclasses should override this.
214 */
215 virtual QModelIndex mapIfaceToSource(const QModelIndex &index) const = 0;
216};
217
218}
Pure virtual method interface for tasks model implementations.
Pure method interface for tasks model implementations.
void requestToggleShaded(const QModelIndex &index) override
Request toggling the shaded state of the task at the given index.
void requestResize(const QModelIndex &index) override
Request starting an interactive resize for the task at the given index.
void requestToggleKeepBelow(const QModelIndex &index) override
Request toggling the keep-below state of the task at the given index.
void requestOpenUrls(const QModelIndex &index, const QList< QUrl > &urls) override
Requests to open the given URLs with the application backing the task at the given index.
void requestActivities(const QModelIndex &index, const QStringList &activities) override
Request moving the task at the given index to the specified activities.
void requestVirtualDesktops(const QModelIndex &index, const QVariantList &desktops) override
Request entering the window at the given index on the specified virtual desktops, leaving any other d...
void requestNewInstance(const QModelIndex &index) override
Request an additional instance of the application backing the task at the given index.
void requestToggleKeepAbove(const QModelIndex &index) override
Request toggling the keep-above state of the task at the given index.
void requestToggleMinimized(const QModelIndex &index) override
Request toggling the minimized state of the task at the given index.
void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate=nullptr) override
Request informing the window manager of new geometry for a visual delegate for the task at the given ...
void requestActivate(const QModelIndex &index) override
Request activation of the task at the given index.
void requestToggleMaximized(const QModelIndex &index) override
Request toggling the maximized state of the task at the given index.
void requestClose(const QModelIndex &index) override
Request the task at the given index be closed.
void requestNewVirtualDesktop(const QModelIndex &index) override
Request entering the window at the given index on a new virtual desktop, which is created in response...
void requestMove(const QModelIndex &index) override
Request starting an interactive move for the task at the given index.
void requestToggleFullScreen(const QModelIndex &index) override
Request toggling the fullscreen state of the task at the given index.
void requestToggleNoBorder(const QModelIndex &index) override
Request toggling the no border state of the task at given index.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Mar 28 2025 11:53:53 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.