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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kio
kdatatool.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org>
3  Copyright (C) 2001 David Faure <faure@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KDATATOOL_H
22 #define KDATATOOL_H
23 
24 #include <kio/kio_export.h>
25 #include <QtCore/QObject>
26 #include <QtCore/QString>
27 
28 #include <kaction.h>
29 #include <kservice.h>
30 #include <kcomponentdata.h>
31 
32 class KDataTool;
33 class QPixmap;
34 class QStringList;
35 class KActionCollection;
36 
37 // If you're only looking at implementing a data-tool, skip directly to the last
38 // class definition, KDataTool.
39 
49 class KIO_EXPORT KDataToolInfo
50 {
51 public:
55  KDataToolInfo();
61  KDataToolInfo(const KService::Ptr& service, const KComponentData &instance);
65  ~KDataToolInfo();
69  KDataToolInfo( const KDataToolInfo& info );
73  KDataToolInfo& operator= ( const KDataToolInfo& info );
74 
81  QString dataType() const;
93  QStringList mimeTypes() const;
94 
99  bool isReadOnly() const;
100 
106 #ifndef KDE_NO_DEPRECATED
107  KDE_DEPRECATED QPixmap icon() const;
108 #endif
109 
114 #ifndef KDE_NO_DEPRECATED
115  KDE_DEPRECATED QPixmap miniIcon() const;
116 #endif
117 
121  QString iconName() const;
135  QStringList userCommands() const;
147  QStringList commands() const;
148 
154  KDataTool* createTool( QObject* parent = 0 ) const;
155 
160  KService::Ptr service() const;
161 
166  KComponentData componentData() const;
167 
173  bool isValid() const;
174 
183  static QList<KDataToolInfo> query(const QString& datatype, const QString& mimetype, const KComponentData &instance);
184 
185 private:
186  class KDataToolInfoPrivate;
187  KDataToolInfoPrivate * const d;
188 };
189 
190 
201 class KIO_EXPORT KDataToolAction : public KAction
202 {
203  Q_OBJECT
204 public:
214  KDataToolAction( const QString & text, const KDataToolInfo & info, const QString & command, QObject *parent );
215 
219  ~KDataToolAction();
220 
232  static QList<QAction*> dataToolActionList( const QList<KDataToolInfo> & tools, const QObject *receiver, const char* slot, KActionCollection* parent );
233 
234 Q_SIGNALS:
240  void toolActivated( const KDataToolInfo & info, const QString & command );
241 
242 protected:
243  virtual void slotActivated();
244 
245 private:
246  class KDataToolActionPrivate;
247  KDataToolActionPrivate * const d;
248 
249 };
250 
262 class KIO_EXPORT KDataTool : public QObject
263 {
264  Q_OBJECT
265 public:
271  KDataTool( QObject* parent = 0 );
272 
276  ~KDataTool();
277 
281  void setComponentData(const KComponentData &componentData);
282 
288  const KComponentData &componentData() const;
289 
303  virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype) = 0;
304 
305 private:
306  class KDataToolPrivate;
307  KDataToolPrivate * const d;
308 };
309 
310 #endif
kio_export.h
KSharedPtr< KService >
KActionCollection
KDataToolAction
This class helps applications implement support for KDataTool.
Definition: kdatatool.h:201
KIO::mimetype
MimetypeJob * mimetype(const KUrl &url, JobFlags flags=DefaultFlags)
Find mimetype for one file or directory.
Definition: job.cpp:1856
KDesktopFileActions::run
bool run(const KUrl &_url, bool _is_local)
Invokes the default action for the desktop entry.
Definition: kdesktopfileactions.cpp:54
KDataToolInfo
This is a convenience class for KService.
Definition: kdatatool.h:49
QObject
QString
QList
QStringList
KImageIO::mimeTypes
QStringList mimeTypes(Mode mode=Writing)
Returns a list of MIME types for all KImageIO supported formats.
Definition: kimageio.cpp:64
kservice.h
QPixmap
kaction.h
KAction
kcomponentdata.h
KDataTool
A generic tool that processes data.
Definition: kdatatool.h:262
KComponentData
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal