Plasma
servicejob.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2008 Aaron Seigo <aseigo@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PLASMA_SERVICEJOB_H 00021 #define PLASMA_SERVICEJOB_H 00022 00023 #include <QtCore/QVariant> 00024 00025 #include <kjob.h> 00026 #include <kservice.h> 00027 00028 #include <plasma/plasma_export.h> 00029 #include "credentials.h" 00030 00031 namespace Plasma 00032 { 00033 00034 class ServiceJobPrivate; 00035 00054 class PLASMA_EXPORT ServiceJob : public KJob 00055 { 00056 Q_OBJECT 00057 Q_PROPERTY(QString destination READ destination) 00058 Q_PROPERTY(QString operationName READ operationName) 00059 Q_PROPERTY(QVariant result READ result) 00060 00061 00062 public: 00071 ServiceJob(const QString &destination, const QString &operation, 00072 const QMap<QString, QVariant> ¶meters, QObject *parent = 0); 00073 00077 ~ServiceJob(); 00078 00082 QString destination() const; 00083 00087 QString operationName() const; 00088 00092 QMap<QString, QVariant> parameters() const; 00093 00097 Credentials identity() const; 00098 00110 QVariant result() const; 00111 00116 Q_INVOKABLE virtual void start(); 00117 00118 protected: 00122 void setResult(const QVariant &result); 00123 00124 private: 00125 Q_PRIVATE_SLOT(d, void slotStart()) 00126 00127 ServiceJobPrivate * const d; 00128 00129 friend class ServiceProvider; 00130 friend class RemoteServiceJob; 00131 }; 00132 00133 } // namespace Plasma 00134 00135 #endif // multiple inclusion guard 00136
KDE 4.6 API Reference