org.kde.koala

Class KDataToolInfo

public class KDataToolInfo extends Object implements 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

UNKNOWN: This is a convenience class for KService.

Constructor Summary
protected KDataToolInfo(Class dummy)
KDataToolInfo()
Create an invalid KDataToolInfo.
KDataToolInfo(KDataToolInfo info)
Copy constructor.
Method Summary
ArrayListcommands()
Returns the list of commands the DataTool can execute.
KDataToolcreateTool(QObject parent, String name)
Creates the data tool described by this KDataToolInfo.
KDataToolcreateTool(QObject parent)
KDataToolcreateTool()
StringdataType()
Returns the data type that the DataTool can accept.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
StringiconName()
Returns the icon name for this DataTool.
KInstanceInterfaceinstance()
The instance of the service.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
booleanisReadOnly()
Checks whether the DataTool is read-only.
booleanisValid()
A DataToolInfo may be invalid if the KService passed to its constructor does not feature the service type "KDataTool".
ArrayListmimeTypes()
Returns a list of mime type that will be accepted by the DataTool.
ArrayListuserCommands()
Returns a list of strings that you can put in a QPopupMenu item, for example to offer the DataTools services to the user.

Constructor Detail

KDataToolInfo

protected KDataToolInfo(Class dummy)

KDataToolInfo

public KDataToolInfo()
Create an invalid KDataToolInfo.

UNKNOWN: Create an invalid KDataToolInfo.

KDataToolInfo

public KDataToolInfo(KDataToolInfo info)
Copy constructor.

UNKNOWN: Copy constructor.

Method Detail

commands

public 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.

UNKNOWN: Returns the list of commands the DataTool can execute.

createTool

public KDataTool createTool(QObject parent, 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.

UNKNOWN: Creates the data tool described by this KDataToolInfo.

createTool

public KDataTool createTool(QObject parent)

createTool

public KDataTool createTool()

dataType

public 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.

UNKNOWN: Returns the data type that the DataTool can accept.

dispose

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

finalize

protected void finalize()
Deletes the wrapped C++ instance

iconName

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

Returns: the name of the icon for the DataTool

UNKNOWN: Returns the icon name for this DataTool.

instance

public KInstanceInterface instance()
The instance of the service.

Returns: the instance

UNKNOWN: The instance of the service.

isDisposed

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

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.

UNKNOWN: Checks whether the DataTool is read-only.

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

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

mimeTypes

public 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.

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

userCommands

public 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

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