org.kde.koala
Class KDataToolInfo

java.lang.Object
  extended by org.kde.koala.KDataToolInfo
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KDataToolInfo
extends java.lang.Object
implements org.kde.qt.QtSupport

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

Constructor Summary
  KDataToolInfo()
          Create an invalid KDataToolInfo.
protected KDataToolInfo(java.lang.Class dummy)
           
  KDataToolInfo(KDataToolInfo info)
          Copy constructor.
 
Method Summary
 java.util.ArrayList commands()
          Returns the list of commands the DataTool can execute.
 KDataTool createTool()
           
 KDataTool createTool(org.kde.qt.QObject parent)
           
 KDataTool createTool(org.kde.qt.QObject parent, java.lang.String name)
          Creates the data tool described by this KDataToolInfo.
 java.lang.String dataType()
          Returns the data type that the DataTool can accept.
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 java.lang.String iconName()
          Returns the icon name for this DataTool.
 KInstanceInterface instance()
          The instance of the service.
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 boolean isReadOnly()
          Checks whether the DataTool is read-only.
 boolean isValid()
          A DataToolInfo may be invalid if the KService passed to its constructor does not feature the service type "KDataTool".
 java.util.ArrayList mimeTypes()
          Returns a list of mime type that will be accepted by the DataTool.
 java.util.ArrayList userCommands()
          Returns a list of strings that you can put in a QPopupMenu item, for example to offer the DataTools services to the user.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KDataToolInfo

protected KDataToolInfo(java.lang.Class dummy)

KDataToolInfo

public KDataToolInfo()
Create an invalid KDataToolInfo.


KDataToolInfo

public KDataToolInfo(KDataToolInfo info)
Copy constructor.

Method Detail

dataType

public java.lang.String dataType()
Returns the data type that the DataTool can accept.

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

mimeTypes

public java.util.ArrayList mimeTypes()
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 "String" 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.

isReadOnly

public boolean isReadOnly()
Checks whether the DataTool is read-only.

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

iconName

public java.lang.String iconName()
Returns the icon name for this DataTool.

Returns:
the name of the icon for the DataTool

userCommands

public java.util.ArrayList userCommands()
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

commands

public java.util.ArrayList commands()
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.

createTool

public KDataTool createTool(org.kde.qt.QObject parent,
                            java.lang.String name)
Creates the data tool described by this KDataToolInfo.

Parameters:
parent - the parent of the QObject (or 0 for parent-less KDataTools)
name - the name of the QObject, can be 0
Returns:
a pointer to the created data tool or 0 on error.

createTool

public KDataTool createTool(org.kde.qt.QObject parent)

createTool

public KDataTool createTool()

instance

public KInstanceInterface instance()
The instance of the service.

Returns:
the instance

isValid

public boolean isValid()
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

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?