# class KDataToolInfo

###

Module | kio
Namespace |
Class | KDataToolInfo
Inherits |

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

### methods

- KDataToolInfo ( )

  returns ctor

  Create an invalid KDataToolInfo.

- KDataToolInfo (service, instance)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  service | KService.Ptr |
  instance | KComponentData |

  Create a valid KDataToolInfo.

  service - the corresponding service

  instance - the instance to use

- KDataToolInfo (info)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  info | KDataToolInfo |

  Copy constructor.

- commands ( )

  returns QStringList

  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.

- componentData ( )

  returns KComponentData

  The instance of the service. Returns the instance

- createTool (parent)

  returns KDataTool

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | 0

  Creates the data tool described by this KDataToolInfo.

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

- dataType ( )

  returns QString

  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.

- icon ( )

  returns QPixmap

  Returns the icon of this data tool. Returns a large pixmap for the DataTool. @deprecated, use iconName()

- iconName ( )

  returns QString

  Returns the icon name for this DataTool. Returns the name of the icon for the DataTool

- isReadOnly ( )

  returns bool

  Checks whether the DataTool is read-only. Returns true if the DataTool does not modify the data passed to it by KDataTool.run.

- isValid ( )

  returns bool

  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

- mimeTypes ( )

  returns QStringList

  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.

- miniIcon ( )

  returns QPixmap

  Returns the mini icon of this data tool. Returns a mini pixmap for the DataTool. @deprecated, use iconName()

- query (datatype, mimetype, instance)

  returns QList<KDataToolInfo>
  static

  Argument | Type | Default
  --- | --- | ---
  datatype | QString |
  mimetype | QString |
  instance | KComponentData |

  Queries the KServiceTypeTrader about installed KDataTool implementations.

  datatype - a type that the application can 'export' to the tools (e.g. QString)

  mimetype - the mimetype of the data (e.g. text/plain)

  instance - the 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

- service ( )

  returns KService.Ptr

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

- userCommands ( )

  returns QStringList

  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