2009-09-02 04:27:16 +02:00
|
|
|
/*
|
|
|
|
* Copyright © 2009 Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2009-09-03 01:49:46 +02:00
|
|
|
#ifndef PLASMOIDSERVICE_H
|
|
|
|
#define PLASMOIDSERVICE_H
|
2009-09-02 04:27:16 +02:00
|
|
|
|
2012-09-24 15:51:14 +02:00
|
|
|
#include "dataengineconsumer.h"
|
2009-09-03 01:49:46 +02:00
|
|
|
|
|
|
|
#include "../package.h"
|
|
|
|
#include "../service.h"
|
|
|
|
#include "../servicejob.h"
|
2009-09-02 04:27:16 +02:00
|
|
|
|
2011-10-04 16:50:44 +02:00
|
|
|
#include <qtemporaryfile.h>
|
2009-09-02 04:27:16 +02:00
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
class Applet;
|
|
|
|
class DataEngine;
|
|
|
|
class GetSource;
|
|
|
|
class PlasmoidService;
|
|
|
|
|
|
|
|
class PlasmoidServiceJob : public ServiceJob
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2011-05-31 00:28:06 +02:00
|
|
|
PlasmoidServiceJob(const QString &destination,
|
2009-09-02 04:27:16 +02:00
|
|
|
const QString &operation,
|
2011-05-26 19:01:44 +02:00
|
|
|
QHash<QString,QVariant>& parameters,
|
2011-05-31 00:28:06 +02:00
|
|
|
PlasmoidService *parent);
|
2009-09-02 04:27:16 +02:00
|
|
|
|
|
|
|
void start();
|
|
|
|
|
|
|
|
private:
|
|
|
|
PlasmoidService *m_service;
|
|
|
|
QString m_pluginName;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PlasmoidService : public Service, DataEngineConsumer
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PlasmoidService(Applet *applet);
|
2009-09-03 01:49:46 +02:00
|
|
|
|
2009-09-02 04:27:16 +02:00
|
|
|
protected:
|
2011-05-31 00:28:06 +02:00
|
|
|
Plasma::ServiceJob* createJob(const QString& operation, QHash<QString,QVariant>& parameters);
|
2009-09-02 04:27:16 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_packagePath;
|
2011-05-31 00:28:06 +02:00
|
|
|
QString m_metadata;
|
2011-07-13 20:03:00 +02:00
|
|
|
QString m_pluginName;
|
2011-10-04 16:50:44 +02:00
|
|
|
QTemporaryFile m_tempFile;
|
2009-09-02 04:27:16 +02:00
|
|
|
|
|
|
|
friend class PlasmoidServiceJob;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2011-10-04 16:50:44 +02:00
|
|
|
#endif
|