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

KIO

Public Member Functions | Static Public Member Functions | List of all members
KDataToolInfo Class Reference

#include <kdatatool.h>

Public Member Functions

 KDataToolInfo ()
 
 KDataToolInfo (const KService::Ptr &service, const KComponentData &instance)
 
 KDataToolInfo (const KDataToolInfo &info)
 
 ~KDataToolInfo ()
 
QStringList commands () const
 
KComponentData componentData () const
 
KDataTool * createTool (QObject *parent=0) const
 
QString dataType () const
 
QPixmap icon () const
 
QString iconName () const
 
bool isReadOnly () const
 
bool isValid () const
 
QStringList mimeTypes () const
 
QPixmap miniIcon () const
 
KDataToolInfo & operator= (const KDataToolInfo &info)
 
KService::Ptr service () const
 
QStringList userCommands () const
 

Static Public Member Functions

static QList< KDataToolInfo > query (const QString &datatype, const QString &mimetype, const KComponentData &instance)
 

Detailed Description

This is a convenience class for KService.

You can use it if you have a KService describing a KDataTool. In this case the KDataToolInfo class is more convenient to work with.

Especially useful is the method createTool which creates the datatool described by the service.

See also
KDataTool

Definition at line 49 of file kdatatool.h.

Constructor & Destructor Documentation

KDataToolInfo::KDataToolInfo ( )

Create an invalid KDataToolInfo.

Definition at line 50 of file kdatatool.cpp.

KDataToolInfo::KDataToolInfo ( const KService::Ptr &  service,
const KComponentData &  instance 
)

Create a valid KDataToolInfo.

Parameters
servicethe corresponding service
instancethe instance to use

Definition at line 55 of file kdatatool.cpp.

KDataToolInfo::~KDataToolInfo ( )

Destructor.

Definition at line 83 of file kdatatool.cpp.

KDataToolInfo::KDataToolInfo ( const KDataToolInfo &  info)

Copy constructor.

Definition at line 69 of file kdatatool.cpp.

Member Function Documentation

QStringList KDataToolInfo::commands ( ) const

Returns the list of commands the DataTool can execute.

The application passes the command to the KDataTool::run method.

This list comes from the Commands field of the tool's desktop file.

Each of the strings returned corresponds to a string in the list returned by userCommands.

Returns
the list of commands the DataTool can execute, suitable for the KDataTool::run method.

Definition at line 151 of file kdatatool.cpp.

KComponentData KDataToolInfo::componentData ( ) const

The instance of the service.

Returns
the instance

Definition at line 183 of file kdatatool.cpp.

KDataTool * KDataToolInfo::createTool ( QObject *  parent = 0) const

Creates the data tool described by this KDataToolInfo.

Parameters
parentthe parent of the QObject (or 0 for parent-less KDataTools)
Returns
a pointer to the created data tool or 0 on error.

Definition at line 167 of file kdatatool.cpp.

QString KDataToolInfo::dataType ( ) const

Returns the data type that the DataTool can accept.

Returns
the C++ data type that this DataTool accepts. For example "QString" or "QImage" or something more complicated.

Definition at line 88 of file kdatatool.cpp.

QPixmap KDataToolInfo::icon ( ) const

Returns the icon of this data tool.

Returns
a large pixmap for the DataTool.
Deprecated:
, use iconName()

Definition at line 113 of file kdatatool.cpp.

QString KDataToolInfo::iconName ( ) const

Returns the icon name for this DataTool.

Returns
the name of the icon for the DataTool

Definition at line 144 of file kdatatool.cpp.

bool KDataToolInfo::isReadOnly ( ) const

Checks whether the DataTool is read-only.

Returns
true if the DataTool does not modify the data passed to it by KDataTool::run.

Definition at line 104 of file kdatatool.cpp.

bool KDataToolInfo::isValid ( ) const

A DataToolInfo may be invalid if the KService passed to its constructor does not feature the service type "KDataTool".

Returns
true if valid, false otherwise

Definition at line 235 of file kdatatool.cpp.

QStringList KDataToolInfo::mimeTypes ( ) const

Returns a list of mime type that will be accepted by the DataTool.

The mimetypes are only used if the dataType can be used to store different mimetypes. For example in a "QString" you could save "text/plain" or "text/html" or "text/xml".

Returns
the mime types accepted by this DataTool. For example "image/gif" or "text/plain". In some cases the dataType determines the accepted type of data perfectly. In this cases this list may be empty.

Definition at line 96 of file kdatatool.cpp.

QPixmap KDataToolInfo::miniIcon ( ) const

Returns the mini icon of this data tool.

Returns
a mini pixmap for the DataTool.
Deprecated:
, use iconName()

Definition at line 129 of file kdatatool.cpp.

KDataToolInfo & KDataToolInfo::operator= ( const KDataToolInfo &  info)

Assignment operator.

Definition at line 76 of file kdatatool.cpp.

QList< KDataToolInfo > KDataToolInfo::query ( const QString &  datatype,
const QString &  mimetype,
const KComponentData &  instance 
)
static

Queries the KServiceTypeTrader about installed KDataTool implementations.

Parameters
datatypea type that the application can 'export' to the tools (e.g. QString)
mimetypethe mimetype of the data (e.g. text/plain)
instancethe application (or the part)'s instance (to check if a tool is excluded from this part, and also used if the tool wants to read its configuration in the app's config file).
Returns
the list of results

Definition at line 188 of file kdatatool.cpp.

KService::Ptr KDataToolInfo::service ( ) const

The KDataToolInfo's service that is represented by this class.

Returns
the service

Definition at line 178 of file kdatatool.cpp.

QStringList KDataToolInfo::userCommands ( ) const

Returns a list of strings that you can put in a QPopupMenu item, for example to offer the DataTools services to the user.

The returned value is usually something like "Spell checking", "Shrink Image", "Rotate Image" or something like that. This list comes from the Comment field of the tool's desktop file (so that it can be translated).

Each of the strings returned corresponds to a string in the list returned by commands.

Returns
a list of strings that you can put in a QPopupMenu item

Definition at line 159 of file kdatatool.cpp.


The documentation for this class was generated from the following files:
  • kdatatool.h
  • kdatatool.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:04 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • 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