KIO
kdatatool.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KDATATOOL_H
00022 #define KDATATOOL_H
00023
00024 #include <kio/kio_export.h>
00025 #include <QtCore/QObject>
00026 #include <QtCore/QString>
00027
00028 #include <kaction.h>
00029 #include <kservice.h>
00030 #include <kcomponentdata.h>
00031
00032 class KDataTool;
00033 class QPixmap;
00034 class QStringList;
00035 class KActionCollection;
00036
00037
00038
00039
00049 class KIO_EXPORT KDataToolInfo
00050 {
00051 public:
00055 KDataToolInfo();
00061 KDataToolInfo(const KService::Ptr& service, const KComponentData &instance);
00065 ~KDataToolInfo();
00069 KDataToolInfo( const KDataToolInfo& info );
00073 KDataToolInfo& operator= ( const KDataToolInfo& info );
00074
00081 QString dataType() const;
00093 QStringList mimeTypes() const;
00094
00099 bool isReadOnly() const;
00100
00106 KDE_DEPRECATED QPixmap icon() const;
00112 KDE_DEPRECATED QPixmap miniIcon() const;
00117 QString iconName() const;
00131 QStringList userCommands() const;
00143 QStringList commands() const;
00144
00150 KDataTool* createTool( QObject* parent = 0 ) const;
00151
00156 KService::Ptr service() const;
00157
00162 KComponentData componentData() const;
00163
00169 bool isValid() const;
00170
00179 static QList<KDataToolInfo> query(const QString& datatype, const QString& mimetype, const KComponentData &instance);
00180
00181 private:
00182 class KDataToolInfoPrivate;
00183 KDataToolInfoPrivate * const d;
00184 };
00185
00186
00197 class KIO_EXPORT KDataToolAction : public KAction
00198 {
00199 Q_OBJECT
00200 public:
00210 KDataToolAction( const QString & text, const KDataToolInfo & info, const QString & command, QObject *parent );
00211
00215 ~KDataToolAction();
00216
00228 static QList<QAction*> dataToolActionList( const QList<KDataToolInfo> & tools, const QObject *receiver, const char* slot, KActionCollection* parent );
00229
00230 Q_SIGNALS:
00236 void toolActivated( const KDataToolInfo & info, const QString & command );
00237
00238 protected:
00239 virtual void slotActivated();
00240
00241 private:
00242 class KDataToolActionPrivate;
00243 KDataToolActionPrivate * const d;
00244
00245 };
00246
00258 class KIO_EXPORT KDataTool : public QObject
00259 {
00260 Q_OBJECT
00261 public:
00267 KDataTool( QObject* parent = 0 );
00268
00272 ~KDataTool();
00273
00277 void setComponentData(const KComponentData &componentData);
00278
00284 const KComponentData &componentData() const;
00285
00299 virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype) = 0;
00300
00301 private:
00302 class KDataToolPrivate;
00303 KDataToolPrivate * const d;
00304 };
00305
00306 #endif