• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Engines

kuiserverengine.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright © 2008 Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
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 version 2 as
00006  *   published by the Free Software Foundation
00007  *
00008  *   This program is distributed in the hope that it will be useful,
00009  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *   GNU General Public License for more details
00012  *
00013  *   You should have received a copy of the GNU Library General Public
00014  *   License along with this program; if not, write to the
00015  *   Free Software Foundation, Inc.,
00016  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00017  */
00018 
00019 #ifndef KUISERVERENGINE_H
00020 #define KUISERVERENGINE_H
00021 
00022 #include <QDBusObjectPath>
00023 
00024 #include <plasma/dataengine.h>
00025 
00026 class JobView;
00027 
00028 namespace Plasma
00029 {
00030     class Service;
00031 } // namespace Plasma
00032 
00033 class KuiserverEngine : public Plasma::DataEngine
00034 {
00035     Q_OBJECT
00036     Q_CLASSINFO("D-Bus Interface", "org.kde.JobViewServer")
00037 
00038 public:
00039     KuiserverEngine(QObject* parent, const QVariantList& args);
00040     ~KuiserverEngine();
00041 
00042     QDBusObjectPath requestView(const QString &appName, const QString &appIconName,
00043                                 int capabilities);
00044     Plasma::Service* serviceForSource(const QString& source);
00045 
00046     static uint s_jobId;
00047 
00048 public Q_SLOTS:
00049     void sourceUpdated(JobView* jobView);
00050 
00051 protected:
00052     void init();
00053 
00054 private:
00055     QMap<QString, JobView*> m_jobViews;
00056 
00057 };
00058 
00059 class JobView : public QObject
00060 {
00061     Q_OBJECT
00062     Q_CLASSINFO("D-Bus Interface", "org.kde.JobView")
00063 
00064 public:
00065     enum State {
00066                  Running = 0,
00067                  Suspended = 1,
00068                  Stopped = 2
00069                };
00070 
00071     JobView(QObject *parent = 0);
00072 
00073     void setTotalAmount(qlonglong amount, const QString &unit);
00074     QString totalAmountSize() const;
00075     QString totalAmountFiles() const;
00076 
00077     void setProcessedAmount(qlonglong amount, const QString &unit);
00078 
00079     void setSpeed(qlonglong bytesPerSecond);
00080     QString speedString() const;
00081 
00082     void setInfoMessage(const QString &infoMessage);
00083     QString infoMessage() const;
00084 
00085     bool setDescriptionField(uint number, const QString &name, const QString &value);
00086     void clearDescriptionField(uint number);
00087 
00088     void setAppName(const QString &appName);
00089     void setAppIconName(const QString &appIconName);
00090     void setCapabilities(int capabilities);
00091     void setPercent(uint percent);
00092     void setSuspended(bool suspended);
00093 
00094     void terminate(const QString &errorMessage);
00095 
00096     QString sourceName() const;
00097 
00098     QDBusObjectPath objectPath() const;
00099 
00100 Q_SIGNALS:
00101     void suspendRequested();
00102     void resumeRequested();
00103     void cancelRequested();
00104 
00105     void viewUpdated(JobView* view);
00106 
00107 private:
00108     QDBusObjectPath m_objectPath;
00109 
00110     uint m_capabilities;
00111     uint m_jobId;
00112     uint m_percent;
00113 
00114     qlonglong m_speed;
00115 
00116     State m_state;
00117 
00118     QString m_infoMessage;
00119     QString m_appName;
00120     QString m_appIconName;
00121     QString m_error;
00122 
00123     QMap<int, QString> m_labels;
00124     QMap<int, QString> m_labelNames;
00125     QMap<QString, qlonglong> m_totalMap;
00126     QMap<QString, qlonglong> m_processedMap;
00127 
00128     friend class KuiserverEngine;
00129     friend class JobAction;
00130 };
00131 
00132 #endif

Engines

Skip menu "Engines"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal