Plasma-workspace

abstracttasksmodeliface.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 "taskmanager_export.h"
12
13namespace TaskManager
14{
15/**
16 * @short Pure virtual method interface for tasks model implementations.
17 *
18 * This is the pure virtual method interface implemented by AbstractTasksModel,
19 * as well as other model classes in this library which cannot inherit from
20 * AbstractTasksModel.
21 *
22 * @author Eike Hein <hein@kde.org>
23 **/
24
25class TASKMANAGER_EXPORT AbstractTasksModelIface
26{
27public:
29 {
30 }
31
32 /**
33 * Request activation of the task at the given index. Implementing classes
34 * are free to interpret the meaning of "activate" themselves depending on
35 * the nature and state of the task, e.g. launch or raise a window task.
36 *
37 * @param index An index in this tasks model.
38 **/
39 virtual void requestActivate(const QModelIndex &index) = 0;
40
41 /**
42 * Request an additional instance of the application backing the task at
43 * the given index.
44 *
45 * @param index An index in this tasks model.
46 **/
47 virtual void requestNewInstance(const QModelIndex &index) = 0;
48
49 /**
50 * Requests to open the given URLs with the application backing the task
51 * at the given index.
52 *
53 * @param index An index in this tasks model.
54 * @param urls The URLs to be passed to the application.
55 **/
56 virtual void requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) = 0;
57
58 /**
59 * Request the task at the given index be closed.
60 *
61 * @param index An index in this tasks model.
62 **/
63 virtual void requestClose(const QModelIndex &index) = 0;
64
65 /**
66 * Request starting an interactive move for the task at the given index.
67 *
68 * This is meant for tasks that have an associated window, and may be
69 * a no-op when there is no window.
70 *
71 * @param index An index in this tasks model.
72 **/
73 virtual void requestMove(const QModelIndex &index) = 0;
74
75 /**
76 * Request starting an interactive resize for the task at the given index.
77 *
78 * This is meant for tasks that have an associated window, and may be a
79 * no-op when there is no window.
80 *
81 * @param index An index in this tasks model.
82 **/
83 virtual void requestResize(const QModelIndex &index) = 0;
84
85 /**
86 * Request toggling the minimized state of the task at the given index.
87 *
88 * This is meant for tasks that have an associated window, and may be
89 * a no-op when there is no window.
90 *
91 * @param index An index in this tasks model.
92 **/
93 virtual void requestToggleMinimized(const QModelIndex &index) = 0;
94
95 /**
96 * Request toggling the maximized 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 virtual void requestToggleMaximized(const QModelIndex &index) = 0;
104
105 /**
106 * Request toggling the keep-above 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 virtual void requestToggleKeepAbove(const QModelIndex &index) = 0;
114
115 /**
116 * Request toggling the keep-below 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 virtual void requestToggleKeepBelow(const QModelIndex &index) = 0;
124
125 /**
126 * Request toggling the fullscreen 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 virtual void requestToggleFullScreen(const QModelIndex &index) = 0;
134
135 /**
136 * Request toggling the shaded 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 virtual void requestToggleShaded(const QModelIndex &index) = 0;
144
145 /**
146 * Request entering the window at the given index on the specified virtual desktops,
147 * leaving any other desktops.
148 *
149 * On Wayland, virtual desktop ids are QStrings. On X11, they are uint >0.
150 *
151 * An empty list has a special meaning: The window is entered on all virtual desktops
152 * in the session.
153 *
154 * On X11, a window can only be on one or all virtual desktops. Therefore, only the
155 * first list entry is actually used.
156 *
157 * On X11, the id 0 has a special meaning: The window is entered on all virtual
158 * desktops in the session.
159 *
160 * @param index An index in this window tasks model.
161 * @param desktops A list of virtual desktop ids.
162 **/
163 virtual void requestVirtualDesktops(const QModelIndex &index, const QVariantList &desktops) = 0;
164
165 /**
166 * Request entering the window at the given index on a new virtual desktop,
167 * which is created in response to this request.
168 *
169 * @param index An index in this window tasks model.
170 **/
171 virtual void requestNewVirtualDesktop(const QModelIndex &index) = 0;
172
173 /**
174 * Request moving the task at the given index to the specified virtual
175 * activities.
176 *
177 * This is meant for tasks that have an associated window, and may be
178 * a no-op when there is no window.
179 *
180 * @param index An index in this tasks model.
181 * @param activities The new list of activities.
182 **/
183 virtual void requestActivities(const QModelIndex &index, const QStringList &activities) = 0;
184
185 /**
186 * Request informing the window manager of new geometry for a visual
187 * delegate for the task at the given index. The geometry should be in
188 * screen coordinates.
189 *
190 * FIXME: Doesn't deal with the long-standing problem of multiple
191 * delegates in multiple applets.
192 *
193 * @param index An index in this tasks model.
194 * @param geometry Visual delegate geometry in screen coordinates.
195 * @param delegate The delegate. Implementations are on their own with
196 * regard to extracting information from this, and should take care to
197 * reject invalid objects.
198 **/
199 virtual void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate = nullptr) = 0;
200};
201
202}
Pure virtual method interface for tasks model implementations.
virtual void requestResize(const QModelIndex &index)=0
Request starting an interactive resize for the task at the given index.
virtual void requestNewInstance(const QModelIndex &index)=0
Request an additional instance of the application backing the task at the given index.
virtual void requestOpenUrls(const QModelIndex &index, const QList< QUrl > &urls)=0
Requests to open the given URLs with the application backing the task at the given index.
virtual void requestToggleMinimized(const QModelIndex &index)=0
Request toggling the minimized state of the task at the given index.
virtual void requestNewVirtualDesktop(const QModelIndex &index)=0
Request entering the window at the given index on a new virtual desktop, which is created in response...
virtual void requestVirtualDesktops(const QModelIndex &index, const QVariantList &desktops)=0
Request entering the window at the given index on the specified virtual desktops, leaving any other d...
virtual void requestToggleShaded(const QModelIndex &index)=0
Request toggling the shaded state of the task at the given index.
virtual void requestToggleFullScreen(const QModelIndex &index)=0
Request toggling the fullscreen state of the task at the given index.
virtual void requestMove(const QModelIndex &index)=0
Request starting an interactive move for the task at the given index.
virtual void requestToggleKeepAbove(const QModelIndex &index)=0
Request toggling the keep-above state of the task at the given index.
virtual void requestToggleMaximized(const QModelIndex &index)=0
Request toggling the maximized state of the task at the given index.
virtual void requestClose(const QModelIndex &index)=0
Request the task at the given index be closed.
virtual void requestActivate(const QModelIndex &index)=0
Request activation of the task at the given index.
virtual void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate=nullptr)=0
Request informing the window manager of new geometry for a visual delegate for the task at the given ...
virtual void requestActivities(const QModelIndex &index, const QStringList &activities)=0
Request moving the task at the given index to the specified virtual activities.
virtual void requestToggleKeepBelow(const QModelIndex &index)=0
Request toggling the keep-below state of the task at the given index.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:42 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.