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

KIO

  • 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
32class KDataTool;
33class QPixmap;
34class QStringList;
35class KActionCollection;
36
37// If you're only looking at implementing a data-tool, skip directly to the last
38// class definition, KDataTool.
39
49class KIO_EXPORT KDataToolInfo
50{
51public:
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
114#ifndef KDE_NO_DEPRECATED
115 KDE_DEPRECATED QPixmap miniIcon() const;
116#endif
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
185private:
186 class KDataToolInfoPrivate;
187 KDataToolInfoPrivate * const d;
188};
189
190
201class KIO_EXPORT KDataToolAction : public KAction
202{
203 Q_OBJECT
204public:
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
234Q_SIGNALS:
240 void toolActivated( const KDataToolInfo & info, const QString & command );
241
242protected:
243 virtual void slotActivated();
244
245private:
246 class KDataToolActionPrivate;
247 KDataToolActionPrivate * const d;
248
249};
250
262class KIO_EXPORT KDataTool : public QObject
263{
264 Q_OBJECT
265public:
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
305private:
306 class KDataToolPrivate;
307 KDataToolPrivate * const d;
308};
309
310#endif
KActionCollection
KAction
KComponentData
KDataToolAction
This class helps applications implement support for KDataTool.
Definition: kdatatool.h:202
KDataToolAction::toolActivated
void toolActivated(const KDataToolInfo &info, const QString &command)
Emitted when a tool has been activated.
KDataToolInfo
This is a convenience class for KService.
Definition: kdatatool.h:50
KDataTool
A generic tool that processes data.
Definition: kdatatool.h:263
KDataTool::run
virtual bool run(const QString &command, void *data, const QString &datatype, const QString &mimetype)=0
Interface for 'running' this tool.
KSharedPtr< KService >
QList
QObject
kaction.h
kcomponentdata.h
kio_export.h
kservice.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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