2 * Copyright 2008 Alain Boyer <alainboyer@gmail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License version 2 as
6 * published by the Free Software Foundation
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details
13 * You should have received a copy of the GNU Library General Public
14 * License along with this program; if not, write to the
15 * Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 TaskJob::TaskJob(TaskSource
*source
, const QString
&operation
, QMap
<QString
, QVariant
> ¶meters
, QObject
*parent
) :
22 ServiceJob(source
->objectName(), operation
, parameters
, parent
),
33 // only a subset of task operations are exported
34 QString operation
= operationName();
35 if (operation
.startsWith("set")) {
36 if (operation
== "setMaximized") {
37 m_source
->getTask()->setMaximized(parameters().value("maximized").toBool());
41 else if (operation
== "setMinimized") {
42 m_source
->getTask()->setIconified(parameters().value("minimized").toBool());
46 else if (operation
== "setShaded") {
47 m_source
->getTask()->setShaded(parameters().value("shaded").toBool());
51 else if (operation
== "setFullScreen") {
52 m_source
->getTask()->setFullScreen(parameters().value("fullScreen").toBool());
56 else if (operation
== "setAlwaysOnTop") {
57 m_source
->getTask()->setAlwaysOnTop(parameters().value("alwaysOnTop").toBool());
61 else if (operation
== "setKeptBelowOthers") {
62 m_source
->getTask()->setKeptBelowOthers(parameters().value("keptBelowOthers").toBool());
67 else if (operation
.startsWith("toggle")) {
68 if (operation
== "toggleMaximized") {
69 m_source
->getTask()->toggleMaximized();
73 else if (operation
== "toggleMinimized") {
74 m_source
->getTask()->toggleIconified();
78 else if (operation
== "toggleShaded") {
79 m_source
->getTask()->toggleShaded();
83 else if (operation
== "toggleFullScreen") {
84 m_source
->getTask()->toggleFullScreen();
88 else if (operation
== "toggleAlwaysOnTop") {
89 m_source
->getTask()->toggleAlwaysOnTop();
93 else if (operation
== "toggleKeptBelowOthers") {
94 m_source
->getTask()->toggleKeptBelowOthers();
100 if (operation
== "restore") {
101 m_source
->getTask()->restore();
105 else if (operation
== "raise") {
106 m_source
->getTask()->raise();
110 else if (operation
== "lower") {
111 m_source
->getTask()->lower();
115 else if (operation
== "activate") {
116 m_source
->getTask()->activate();
120 else if (operation
== "activateRaiseOrMaximize") {
121 m_source
->getTask()->activateRaiseOrIconify();
125 else if (operation
== "close") {
126 m_source
->getTask()->close();
130 else if (operation
== "toDesktop") {
131 m_source
->getTask()->toDesktop(parameters().value("desktop").toInt());
135 else if (operation
== "toCurrentDesktop") {
136 m_source
->getTask()->toCurrentDesktop();
144 #include "taskjob.moc"