• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kio
 

kio/kio

  • kio
  • kio
kdatatool.h
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 <david@mandrakesoft.com>
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 <tqobject.h>
25 #include <tqvaluelist.h>
26 
27 #include <kaction.h>
28 #include <kservice.h>
29 
30 class KDataTool;
31 class TQPixmap;
32 class TQStringList;
33 class KInstance;
34 
35 // If you're only looking at implementing a data-tool, skip directly to the last
36 // class definition, KDataTool.
37 
47 class KIO_EXPORT KDataToolInfo
48 {
49 public:
53  KDataToolInfo();
59  KDataToolInfo( const KService::Ptr& service, KInstance* instance );
63  KDataToolInfo( const KDataToolInfo& info );
67  KDataToolInfo& operator= ( const KDataToolInfo& info );
68 
75  TQString dataType() const;
87  TQStringList mimeTypes() const;
88 
93  bool isReadOnly() const;
94 
100  TQPixmap icon() const KDE_DEPRECATED;
106  TQPixmap miniIcon() const KDE_DEPRECATED;
111  TQString iconName() const;
125  TQStringList userCommands() const;
137  TQStringList commands() const;
138 
145  KDataTool* createTool( TQObject* parent = 0, const char* name = 0 ) const;
146 
151  KService::Ptr service() const;
152 
157  KInstance* instance() const { return m_instance; }
158 
164  bool isValid() const;
165 
174  static TQValueList<KDataToolInfo> query( const TQString& datatype, const TQString& mimetype, KInstance * instance );
175 
176 private:
177  KService::Ptr m_service;
178  KInstance* m_instance;
179 private:
180  class KDataToolInfoPrivate* d;
181 };
182 
183 
194 class KIO_EXPORT KDataToolAction : public KAction
195 {
196  Q_OBJECT
197  TQ_OBJECT
198 public:
208  KDataToolAction( const TQString & text, const KDataToolInfo & info, const TQString & command, TQObject * parent = 0, const char * name = 0);
209 
220  static TQPtrList<KAction> dataToolActionList( const TQValueList<KDataToolInfo> & tools, const TQObject *receiver, const char* slot );
221 
222 signals:
228  void toolActivated( const KDataToolInfo & info, const TQString & command );
229 
230 protected:
231  virtual void slotActivated();
232 
233 private:
234  TQString m_command;
235  KDataToolInfo m_info;
236 protected:
237  virtual void virtual_hook( int id, void* data );
238 private:
239  class KDataToolActionPrivate* d;
240 
241 };
242 
254 class KIO_EXPORT KDataTool : public TQObject
255 {
256  Q_OBJECT
257  TQ_OBJECT
258 public:
265  KDataTool( TQObject* parent = 0, const char* name = 0 );
266 
270  void setInstance( KInstance* instance ) { m_instance = instance; }
271 
277  KInstance* instance() const;
278 
292  virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype) = 0;
293 
294 private:
295  KInstance * m_instance;
296 protected:
297  virtual void virtual_hook( int id, void* data );
298 private:
299  class KDataToolPrivate;
300  KDataToolPrivate * d;
301 };
302 
303 #endif
KDataToolInfo::instance
KInstance * instance() const
The instance of the service.
Definition: kdatatool.h:157
KDataToolAction
This class helps applications implement support for KDataTool.
Definition: kdatatool.h:194
KDataToolInfo
This is a convenience class for KService.
Definition: kdatatool.h:47
KDataTool
A generic tool that processes data.
Definition: kdatatool.h:254

kio/kio

Skip menu "kio/kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |