1/*
2 * Copyright 2006, 2007 Thiago Macieira <thiago@kde.org>
3 * Copyright 2006-2008 David Faure <faure@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) version 3, or any
9 * later version accepted by the membership of KDE e.V. (or its
10 * successor approved by the membership of KDE e.V.), which shall
11 * act as a proxy defined in Section 6 of version 3 of the license.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#include "klauncher_adaptor.h"
24#include <QtCore/QArgument>
25#include <QtCore/QByteRef>
26#include <QtCore/QList>
27#include <QtCore/QMap>
28#include <QtCore/QString>
29#include <QtCore/QStringList>
30#include <QtCore/QVariant>
31
32#include "klauncher.h"
33
34/*
35 * Implementation of adaptor class KLauncherAdaptor
36 *
37 * This file was initially generated by dbusidl2cpp version 0.4,
38 * but then modified by hand.
39 */
40
41KLauncherAdaptor::KLauncherAdaptor(QObject *parent)
42 : QDBusAbstractAdaptor(parent)
43{
44 // constructor
45 setAutoRelaySignals(true);
46}
47
48KLauncherAdaptor::~KLauncherAdaptor()
49{
50 // destructor
51}
52
53void KLauncherAdaptor::autoStart(int phase)
54{
55 // handle method call org.kde.KLauncher.autoStart
56 static_cast<KLauncher *>(parent())->autoStart(phase);
57}
58
59void KLauncherAdaptor::exec_blind(const QString &name, const QStringList &arg_list)
60{
61 // handle method call org.kde.KLauncher.exec_blind
62 static_cast<KLauncher *>(parent())->exec_blind(name, arg_list);
63}
64
65void KLauncherAdaptor::exec_blind(const QString &name, const QStringList &arg_list, const QStringList &envs, const QString &startup_id)
66{
67 // handle method call org.kde.KLauncher.exec_blind
68 static_cast<KLauncher *>(parent())->exec_blind(name, arg_list, envs, startup_id);
69}
70
71int KLauncherAdaptor::kdeinit_exec(const QString &app, const QStringList &args, const QStringList &env, const QString& startup_id, const QDBusMessage &msg, QString &, QString &, int &)
72{
73 // handle method call org.kde.KLauncher.kdeinit_exec
74 static_cast<KLauncher *>(parent())->kdeinit_exec(app, args, QString(), env, startup_id, false, msg);
75 return 0; // delayed reply
76}
77
78int KLauncherAdaptor::kdeinit_exec_wait(const QString &app, const QStringList &args, const QStringList &env, const QString& startup_id, const QDBusMessage &msg, QString &, QString &, int &)
79{
80 // handle method call org.kde.KLauncher.kdeinit_exec_wait
81 static_cast<KLauncher *>(parent())->kdeinit_exec(app, args, QString(), env, startup_id, true, msg);
82 return 0; // delayed reply
83}
84
85int KLauncherAdaptor::kdeinit_exec_with_workdir(const QString &app, const QStringList &args, const QString& workdir, const QStringList &env, const QString& startup_id, const QDBusMessage &msg, QString &, QString &, int &)
86{
87 // handle method call org.kde.KLauncher.kdeinit_exec_with_workdir
88 static_cast<KLauncher *>(parent())->kdeinit_exec(app, args, workdir, env, startup_id, false, msg);
89 return 0; // delayed reply
90}
91
92void KLauncherAdaptor::reparseConfiguration()
93{
94 // handle method call org.kde.KLauncher.reparseConfiguration
95 static_cast<KLauncher *>(parent())->reparseConfiguration();
96}
97
98int KLauncherAdaptor::requestHoldSlave(const QString &url, const QString &app_socket)
99{
100 // handle method call org.kde.KLauncher.requestHoldSlave
101 return static_cast<KLauncher *>(parent())->requestHoldSlave(KUrl(url), app_socket);
102}
103
104int KLauncherAdaptor::requestSlave(const QString &protocol, const QString &host, const QString &app_socket, QString &error)
105{
106 // handle method call org.kde.KLauncher.requestSlave
107 return static_cast<KLauncher *>(parent())->requestSlave(protocol, host, app_socket, error);
108}
109
110bool KLauncherAdaptor::checkForHeldSlave (const QString &url)
111{
112 return static_cast<KLauncher *>(parent())->checkForHeldSlave(url);
113}
114
115void KLauncherAdaptor::setLaunchEnv(const QString &name, const QString &value)
116{
117 // handle method call org.kde.KLauncher.setLaunchEnv
118 static_cast<KLauncher *>(parent())->setLaunchEnv(name, value);
119}
120
121int KLauncherAdaptor::start_service_by_desktop_name(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, int &pid)
122{
123 // handle method call org.kde.KLauncher.start_service_by_desktop_name
124 KLauncher *p = static_cast<KLauncher *>(parent());
125 p->start_service_by_desktop_name(serviceName, urls, envs, startup_id, blind, msg);
126 dbusServiceName = p->requestResult.dbusName;
127 error = p->requestResult.error;
128 pid = p->requestResult.pid;
129 return p->requestResult.result;
130}
131
132int KLauncherAdaptor::start_service_by_desktop_path(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, int &pid)
133{
134 // handle method call org.kde.KLauncher.start_service_by_desktop_path
135 KLauncher *p = static_cast<KLauncher *>(parent());
136 p->start_service_by_desktop_path(serviceName, urls, envs, startup_id, blind, msg);
137 dbusServiceName = p->requestResult.dbusName;
138 error = p->requestResult.error;
139 pid = p->requestResult.pid;
140 return p->requestResult.result;
141}
142
143int KLauncherAdaptor::start_service_by_name(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, int &pid)
144{
145 // handle method call org.kde.KLauncher.start_service_by_name
146 KLauncher *p = static_cast<KLauncher *>(parent());
147 p->start_service_by_name(serviceName, urls, envs, startup_id, blind, msg);
148 dbusServiceName = p->requestResult.dbusName;
149 error = p->requestResult.error;
150 pid = p->requestResult.pid;
151 return p->requestResult.result;
152}
153
154void KLauncherAdaptor::waitForSlave(int pid, const QDBusMessage &msg)
155{
156 // handle method call org.kde.KLauncher.waitForSlave
157 static_cast<KLauncher *>(parent())->waitForSlave(pid, msg);
158}
159
160void KLauncherAdaptor::terminate_kdeinit()
161{
162 KLauncher *p = static_cast<KLauncher *>(parent());
163 p->terminate_kdeinit();
164}
165
166#include "klauncher_adaptor.moc"
167