.TH "KDataToolInfo" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDataToolInfo \- This is a convenience class for \fBKService\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kdatatool.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDataToolInfo\fP ()"
.br
.RI "\fICreate an invalid KDataToolInfo. \fP"
.ti -1c
.RI "\fBKDataToolInfo\fP (const  \fBKService::Ptr\fP &service, \fBKInstance\fP *instance)"
.br
.RI "\fICreate a valid KDataToolInfo. \fP"
.ti -1c
.RI "\fBKDataToolInfo\fP (const  \fBKDataToolInfo\fP &info)"
.br
.RI "\fICopy constructor. \fP"
.ti -1c
.RI "\fBKDataToolInfo\fP & \fBoperator=\fP (const  \fBKDataToolInfo\fP &info)"
.br
.RI "\fIAssignment operator. \fP"
.ti -1c
.RI "\fBQString\fP \fBdataType\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBmimeTypes\fP () const "
.br
.ti -1c
.RI "bool \fBisReadOnly\fP () const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBicon\fP () const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBminiIcon\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBiconName\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBuserCommands\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBcommands\fP () const "
.br
.ti -1c
.RI "\fBKDataTool\fP * \fBcreateTool\fP (\fBQObject\fP *parent=0, const  char *name=0) const "
.br
.RI "\fICreates the data tool described by this KDataToolInfo. \fP"
.ti -1c
.RI "\fBKService::Ptr\fP \fBservice\fP () const "
.br
.ti -1c
.RI "\fBKInstance\fP * \fBinstance\fP () const "
.br
.ti -1c
.RI "bool \fBisValid\fP () const "
.br
.RI "\fIA DataToolInfo may be invalid if the \fBKService\fP passed to its constructor does not feature the service type 'KDataTool'. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQValueList\fP< \fBKDataToolInfo\fP > \fBquery\fP (const  \fBQString\fP &datatype, const  \fBQString\fP &mimetype, \fBKInstance\fP *instance)"
.br
.RI "\fIQueries the \fBKTrader\fP about installed \fBKDataTool\fP implementations. \fP"
.in -1c
.SH "Detailed Description"
.PP 
This is a convenience class for \fBKService\fP. 

You can use it if you have a \fBKService\fP describing a \fBKDataTool\fP. In this case the KDataToolInfo class is more convenient to work with.
.PP
Especially useful is the method \fBcreateTool\fP which creates the datatool described by the service. 
.PP
Definition at line 46 of file kdatatool.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDataToolInfo::KDataToolInfo ()"
.PP
Create an invalid KDataToolInfo. Definition at line 38 of file kdatatool.cpp.
.PP
Referenced by query().
.SS "KDataToolInfo::KDataToolInfo (const \fBKService::Ptr\fP & service, \fBKInstance\fP * instance)"
.PP
Create a valid KDataToolInfo. Definition at line 43 of file kdatatool.cpp.
.PP
References KNotifyClient::instance().
.SS "KDataToolInfo::KDataToolInfo (const \fBKDataToolInfo\fP & info)"
.PP
Copy constructor. Definition at line 56 of file kdatatool.cpp.
.PP
References instance(), and service().
.SH "Member Function Documentation"
.PP 
.SS "\fBKDataToolInfo\fP & KDataToolInfo::operator= (const \fBKDataToolInfo\fP & info)"
.PP
Assignment operator. Definition at line 62 of file kdatatool.cpp.
.PP
References instance(), and service().
.SS "\fBQString\fP KDataToolInfo::dataType () const"
.PP
\fBReturns:\fP
.RS 4
the C++ data type that this DataTool accepts. For example 'QString' or 'QImage' or something more complicated. 
.RE
.PP
Definition at line 69 of file kdatatool.cpp.
.SS "\fBQStringList\fP KDataToolInfo::mimeTypes () const"
.PP
\fBReturns:\fP
.RS 4
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.
.RE
.PP
The mimetypes are only used if the \fBdataType\fP can be used to store different mimetypes. For example in a 'QString' you could save 'text/plain' or 'text/html' or 'text/xml'. Definition at line 77 of file kdatatool.cpp.
.SS "bool KDataToolInfo::isReadOnly () const"
.PP
\fBReturns:\fP
.RS 4
TRUE if the DataTool does not modify the data passed to it by \fBKDataTool::run\fP. 
.RE
.PP
Definition at line 85 of file kdatatool.cpp.
.SS "\fBQPixmap\fP KDataToolInfo::icon () const"
.PP
\fBReturns:\fP
.RS 4
a large pixmap for the DataTool. \fBThis class or method is obsolete, it is provided for compatibility only.\fP, use \fBiconName()\fP 
.RE
.PP
Definition at line 93 of file kdatatool.cpp.
.PP
References KGlobal::dirs(), QPixmap::load(), and KStandardDirs::resourceDirs().
.SS "\fBQPixmap\fP KDataToolInfo::miniIcon () const"
.PP
\fBReturns:\fP
.RS 4
a mini pixmap for the DataTool. \fBThis class or method is obsolete, it is provided for compatibility only.\fP, use \fBiconName()\fP 
.RE
.PP
Definition at line 107 of file kdatatool.cpp.
.PP
References KGlobal::dirs(), QPixmap::load(), and KStandardDirs::resourceDirs().
.SS "\fBQString\fP KDataToolInfo::iconName () const"
.PP
\fBReturns:\fP
.RS 4
the name of the icon for the DataTool 
.RE
.PP
Definition at line 121 of file kdatatool.cpp.
.SS "\fBQStringList\fP KDataToolInfo::userCommands () const"
.PP
\fBReturns:\fP
.RS 4
a list if strings that you can put in a \fBQPopupMenu\fP 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.
.RE
.PP
This list comes from the Comment field of the tool's desktop file (so that it can be translated).
.PP
Each of the strings returned corresponds to a string in the list returned by \fBcommands\fP. Definition at line 136 of file kdatatool.cpp.
.PP
References QStringList::split().
.SS "\fBQStringList\fP KDataToolInfo::commands () const"
.PP
\fBReturns:\fP
.RS 4
the list of commands the DataTool can execute. The application passes the command to the \fBKDataTool::run\fP method.
.RE
.PP
This list comes from the Commands field of the tool's desktop file.
.PP
Each of the strings returned corresponds to a string in the list returned by \fBuserCommands\fP. Definition at line 128 of file kdatatool.cpp.
.SS "\fBKDataTool\fP * KDataToolInfo::createTool (\fBQObject\fP * parent = 0, const char * name = 0) const"
.PP
Creates the data tool described by this KDataToolInfo. \fBReturns:\fP
.RS 4
a pointer to the created data tool or 0 on error. 
.RE
.PP
Definition at line 144 of file kdatatool.cpp.
.PP
References KLibFactory::create(), QFile::encodeName(), KLibLoader::factory(), QObject::inherits(), KStdAccel::name(), KLibLoader::self(), and KDataTool::setInstance().
.SS "bool KDataToolInfo::isValid () const"
.PP
A DataToolInfo may be invalid if the \fBKService\fP passed to its constructor does not feature the service type 'KDataTool'. Definition at line 216 of file kdatatool.cpp.
.SS "\fBQValueList\fP< \fBKDataToolInfo\fP > KDataToolInfo::query (const \fBQString\fP & datatype, const \fBQString\fP & mimetype, \fBKInstance\fP * instance)\fC [static]\fP"
.PP
Queries the \fBKTrader\fP about installed \fBKDataTool\fP implementations. \fBParameters:\fP
.RS 4
\fIdatatype\fP a type that the application can 'export' to the tools (e.g. \fBQString\fP) 
.br
\fImimetype\fP the mimetype of the data (e.g. text/plain) 
.br
\fIinstance\fP 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). 
.RE
.PP
Definition at line 170 of file kdatatool.cpp.
.PP
References QValueList::append(), QValueList::begin(), QValueList::end(), QString::fromLatin1(), KNotifyClient::instance(), KInstance::instanceName(), QString::isEmpty(), KDataToolInfo(), KIO::mimetype(), KTrader::OfferList, KTrader::query(), and KTrader::self().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
