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

KIO

kdatatool.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org>
00003    Copyright (C) 2001 David Faure <faure@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
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 // If you're only looking at implementing a data-tool, skip directly to the last
00038 // class definition, KDataTool.
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

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs 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