\section{KData\-Tool\-Info Class Reference}
\label{classKDataToolInfo}\index{KDataToolInfo@{KDataToolInfo}}
This is a convenience class for {\bf KService}{\rm (p.\,\pageref{classKService})}.  


{\tt \#include $<$kdatatool.h$>$}

Collaboration diagram for KData\-Tool\-Info:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=119pt]{classKDataToolInfo__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KData\-Tool\-Info} ()
\item 
{\bf KData\-Tool\-Info} (const {\bf KService::Ptr} \&service, {\bf KInstance} $\ast$instance)
\item 
{\bf KData\-Tool\-Info} (const {\bf KData\-Tool\-Info} \&info)
\item 
{\bf KData\-Tool\-Info} \& {\bf operator=} (const {\bf KData\-Tool\-Info} \&info)
\item 
{\bf QString} {\bf data\-Type} () const 
\item 
{\bf QString\-List} {\bf mime\-Types} () const 
\item 
bool {\bf is\-Read\-Only} () const 
\item 
{\bf QPixmap} {\bf icon} () const KDE\_\-DEPRECATED
\item 
{\bf QPixmap} {\bf mini\-Icon} () const KDE\_\-DEPRECATED
\item 
{\bf QString} {\bf icon\-Name} () const 
\item 
{\bf QString\-List} {\bf user\-Commands} () const 
\item 
{\bf QString\-List} {\bf commands} () const 
\item 
{\bf KData\-Tool} $\ast$ {\bf create\-Tool} ({\bf QObject} $\ast$parent=0, const char $\ast$name=0) const 
\item 
{\bf KService::Ptr} {\bf service} () const 
\item 
{\bf KInstance} $\ast$ {\bf instance} () const 
\item 
bool {\bf is\-Valid} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QValue\-List}$<$ {\bf KData\-Tool\-Info} $>$ {\bf query} (const {\bf QString} \&datatype, const {\bf QString} \&mimetype, {\bf KInstance} $\ast$instance)
\end{CompactItemize}


\subsection{Detailed Description}
This is a convenience class for {\bf KService}{\rm (p.\,\pageref{classKService})}. 

You can use it if you have a {\bf KService}{\rm (p.\,\pageref{classKService})} describing a {\bf KData\-Tool}{\rm (p.\,\pageref{classKDataTool})}. In this case the KData\-Tool\-Info class is more convenient to work with.

Especially useful is the method create\-Tool which creates the datatool described by the service. \begin{Desc}
\item[See also:]{\bf KData\-Tool}{\rm (p.\,\pageref{classKDataTool})} \end{Desc}




Definition at line 47 of file kdatatool.h.

\subsection{Constructor \& Destructor Documentation}
\index{KDataToolInfo@{KData\-Tool\-Info}!KDataToolInfo@{KDataToolInfo}}
\index{KDataToolInfo@{KDataToolInfo}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KData\-Tool\-Info::KData\-Tool\-Info ()}\label{classKDataToolInfo_a0}


Create an invalid KData\-Tool\-Info. 



Definition at line 38 of file kdatatool.cpp.

Referenced by query().\index{KDataToolInfo@{KData\-Tool\-Info}!KDataToolInfo@{KDataToolInfo}}
\index{KDataToolInfo@{KDataToolInfo}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KData\-Tool\-Info::KData\-Tool\-Info (const {\bf KService::Ptr} \& {\em service}, {\bf KInstance} $\ast$ {\em instance})}\label{classKDataToolInfo_a1}


Create a valid KData\-Tool\-Info. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em service}]the corresponding service \item[{\em instance}]the instance to use \end{description}
\end{Desc}


Definition at line 43 of file kdatatool.cpp.

References endl(), instance(), kd\-Debug(), and service().\index{KDataToolInfo@{KData\-Tool\-Info}!KDataToolInfo@{KDataToolInfo}}
\index{KDataToolInfo@{KDataToolInfo}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KData\-Tool\-Info::KData\-Tool\-Info (const {\bf KData\-Tool\-Info} \& {\em info})}\label{classKDataToolInfo_a2}


Copy constructor. 



Definition at line 56 of file kdatatool.cpp.

\subsection{Member Function Documentation}
\index{KDataToolInfo@{KData\-Tool\-Info}!operator=@{operator=}}
\index{operator=@{operator=}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KData\-Tool\-Info} \& KData\-Tool\-Info::operator= (const {\bf KData\-Tool\-Info} \& {\em info})}\label{classKDataToolInfo_a3}


Assignment operator. 



Definition at line 62 of file kdatatool.cpp.\index{KDataToolInfo@{KData\-Tool\-Info}!dataType@{dataType}}
\index{dataType@{dataType}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KData\-Tool\-Info::data\-Type () const}\label{classKDataToolInfo_a4}


Returns the data type that the Data\-Tool can accept. 

\begin{Desc}
\item[Returns:]the C++ data type that this Data\-Tool accepts. For example \char`\"{}QString\char`\"{} or \char`\"{}QImage\char`\"{} or something more complicated. \end{Desc}


Definition at line 69 of file kdatatool.cpp.\index{KDataToolInfo@{KData\-Tool\-Info}!mimeTypes@{mimeTypes}}
\index{mimeTypes@{mimeTypes}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KData\-Tool\-Info::mime\-Types () const}\label{classKDataToolInfo_a5}


Returns a list of mime type that will be accepted by the Data\-Tool. 

The mimetypes are only used if the data\-Type can be used to store different mimetypes. For example in a \char`\"{}QString\char`\"{} you could save \char`\"{}text/plain\char`\"{} or \char`\"{}text/html\char`\"{} or \char`\"{}text/xml\char`\"{}.

\begin{Desc}
\item[Returns:]the mime types accepted by this Data\-Tool. For example \char`\"{}image/gif\char`\"{} or \char`\"{}text/plain\char`\"{}. In some cases the data\-Type determines the accepted type of data perfectly. In this cases this list may be empty. \end{Desc}


Definition at line 77 of file kdatatool.cpp.\index{KDataToolInfo@{KData\-Tool\-Info}!isReadOnly@{isReadOnly}}
\index{isReadOnly@{isReadOnly}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KData\-Tool\-Info::is\-Read\-Only () const}\label{classKDataToolInfo_a6}


Checks whether the Data\-Tool is read-only. 

\begin{Desc}
\item[Returns:]true if the Data\-Tool does not modify the data passed to it by {\bf KData\-Tool::run}{\rm (p.\,\pageref{classKDataTool_a3})}. \end{Desc}


Definition at line 85 of file kdatatool.cpp.\index{KDataToolInfo@{KData\-Tool\-Info}!icon@{icon}}
\index{icon@{icon}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KData\-Tool\-Info::icon () const}\label{classKDataToolInfo_a7}


Returns the icon of this data tool. 

\begin{Desc}
\item[Returns:]a large pixmap for the Data\-Tool. \end{Desc}
\begin{Desc}
\item[{\bf Deprecated}], use {\bf icon\-Name()}{\rm (p.\,\pageref{classKDataToolInfo_a9})} \end{Desc}


Definition at line 93 of file kdatatool.cpp.

References KGlobal::dirs(), QPixmap::load(), and KStandard\-Dirs::resource\-Dirs().\index{KDataToolInfo@{KData\-Tool\-Info}!miniIcon@{miniIcon}}
\index{miniIcon@{miniIcon}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KData\-Tool\-Info::mini\-Icon () const}\label{classKDataToolInfo_a8}


Returns the mini icon of this data tool. 

\begin{Desc}
\item[Returns:]a mini pixmap for the Data\-Tool. \end{Desc}
\begin{Desc}
\item[{\bf Deprecated}], use {\bf icon\-Name()}{\rm (p.\,\pageref{classKDataToolInfo_a9})} \end{Desc}


Definition at line 107 of file kdatatool.cpp.

References KGlobal::dirs(), QPixmap::load(), and KStandard\-Dirs::resource\-Dirs().\index{KDataToolInfo@{KData\-Tool\-Info}!iconName@{iconName}}
\index{iconName@{iconName}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KData\-Tool\-Info::icon\-Name () const}\label{classKDataToolInfo_a9}


Returns the icon name for this Data\-Tool. 

\begin{Desc}
\item[Returns:]the name of the icon for the Data\-Tool \end{Desc}


Definition at line 121 of file kdatatool.cpp.\index{KDataToolInfo@{KData\-Tool\-Info}!userCommands@{userCommands}}
\index{userCommands@{userCommands}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KData\-Tool\-Info::user\-Commands () const}\label{classKDataToolInfo_a10}


Returns a list of strings that you can put in a {\bf QPopup\-Menu} item, for example to offer the Data\-Tools services to the user. 

The returned value is usually something like \char`\"{}Spell checking\char`\"{}, \char`\"{}Shrink Image\char`\"{}, \char`\"{}Rotate Image\char`\"{} 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.

\begin{Desc}
\item[Returns:]a list of strings that you can put in a {\bf QPopup\-Menu} item \end{Desc}


Definition at line 136 of file kdatatool.cpp.

References QString\-List::split().\index{KDataToolInfo@{KData\-Tool\-Info}!commands@{commands}}
\index{commands@{commands}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KData\-Tool\-Info::commands () const}\label{classKDataToolInfo_a11}


Returns the list of commands the Data\-Tool can execute. 

The application passes the command to the {\bf KData\-Tool::run}{\rm (p.\,\pageref{classKDataTool_a3})} 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 user\-Commands. \begin{Desc}
\item[Returns:]the list of commands the Data\-Tool can execute, suitable for the {\bf KData\-Tool::run}{\rm (p.\,\pageref{classKDataTool_a3})} method. \end{Desc}


Definition at line 128 of file kdatatool.cpp.\index{KDataToolInfo@{KData\-Tool\-Info}!createTool@{createTool}}
\index{createTool@{createTool}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KData\-Tool} $\ast$ KData\-Tool\-Info::create\-Tool ({\bf QObject} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0}) const}\label{classKDataToolInfo_a12}


Creates the data tool described by this KData\-Tool\-Info. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]the parent of the {\bf QObject} (or 0 for parent-less KData\-Tools) \item[{\em name}]the name of the {\bf QObject}, can be 0 \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a pointer to the created data tool or 0 on error. \end{Desc}


Definition at line 144 of file kdatatool.cpp.

References KLib\-Factory::create(), KLib\-Loader::factory(), QObject::inherits(), KLib\-Loader::self(), and KData\-Tool::set\-Instance().\index{KDataToolInfo@{KData\-Tool\-Info}!service@{service}}
\index{service@{service}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService::Ptr} KData\-Tool\-Info::service () const}\label{classKDataToolInfo_a13}


The KData\-Tool\-Info's service that is represented by this class. 

\begin{Desc}
\item[Returns:]the service \end{Desc}


Definition at line 165 of file kdatatool.cpp.

Referenced by KData\-Tool\-Info().\index{KDataToolInfo@{KData\-Tool\-Info}!instance@{instance}}
\index{instance@{instance}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KInstance}$\ast$ KData\-Tool\-Info::instance () const\hspace{0.3cm}{\tt  [inline]}}\label{classKDataToolInfo_a14}


The instance of the service. 

\begin{Desc}
\item[Returns:]the instance \end{Desc}


Definition at line 157 of file kdatatool.h.

Referenced by KData\-Tool\-Info(), and query().\index{KDataToolInfo@{KData\-Tool\-Info}!isValid@{isValid}}
\index{isValid@{isValid}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KData\-Tool\-Info::is\-Valid () const}\label{classKDataToolInfo_a15}


A Data\-Tool\-Info may be invalid if the {\bf KService}{\rm (p.\,\pageref{classKService})} passed to its constructor does not feature the service type \char`\"{}KData\-Tool\char`\"{}. 

\begin{Desc}
\item[Returns:]true if valid, false otherwise \end{Desc}


Definition at line 216 of file kdatatool.cpp.\index{KDataToolInfo@{KData\-Tool\-Info}!query@{query}}
\index{query@{query}!KDataToolInfo@{KData\-Tool\-Info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QValue\-List}$<$ {\bf KData\-Tool\-Info} $>$ KData\-Tool\-Info::query (const {\bf QString} \& {\em datatype}, const {\bf QString} \& {\em mimetype}, {\bf KInstance} $\ast$ {\em instance})\hspace{0.3cm}{\tt  [static]}}\label{classKDataToolInfo_e0}


Queries the {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} about installed {\bf KData\-Tool}{\rm (p.\,\pageref{classKDataTool})} implementations. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em datatype}]a type that the application can 'export' to the tools (e.g. {\bf QString}) \item[{\em mimetype}]the mimetype of the data (e.g. text/plain) \item[{\em 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). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the list of results \end{Desc}


Definition at line 170 of file kdatatool.cpp.

References QValue\-List::append(), QString::arg(), QValue\-List::begin(), QValue\-List::end(), endl(), QString::from\-Latin1(), instance(), KInstance::instance\-Name(), QString::is\-Empty(), KData\-Tool\-Info(), kd\-Debug(), KTrader::query(), and KTrader::self().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kdatatool.h\item 
kdatatool.cpp\end{CompactItemize}
