\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=114pt]{classKDataToolInfo__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KData\-Tool\-Info} ()
\begin{CompactList}\small\item\em Create an invalid KData\-Tool\-Info. \item\end{CompactList}\item 
{\bf KData\-Tool\-Info} (const  {\bf KService::Ptr} \&service, {\bf KInstance} $\ast$instance)
\begin{CompactList}\small\item\em Create a valid KData\-Tool\-Info. \item\end{CompactList}\item 
{\bf KData\-Tool\-Info} (const  {\bf KData\-Tool\-Info} \&info)
\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
{\bf KData\-Tool\-Info} \& {\bf operator=} (const  {\bf KData\-Tool\-Info} \&info)
\begin{CompactList}\small\item\em Assignment operator. \item\end{CompactList}\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 
\item 
{\bf QPixmap} {\bf mini\-Icon} () const 
\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 
\begin{CompactList}\small\item\em Creates the data tool described by this KData\-Tool\-Info. \item\end{CompactList}\item 
{\bf KService::Ptr} {\bf service} () const \label{classKDataToolInfo_a13}

\item 
{\bf KInstance} $\ast$ {\bf instance} () const \label{classKDataToolInfo_a14}

\item 
bool {\bf is\-Valid} () const 
\begin{CompactList}\small\item\em 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`\"{}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf QValue\-List}$<$ {\bf KData\-Tool\-Info} $>$ {\bf query} (const  {\bf QString} \&datatype, const  {\bf QString} \&mimetype, {\bf KInstance} $\ast$instance)
\begin{CompactList}\small\item\em Queries the {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} about installed {\bf KData\-Tool}{\rm (p.\,\pageref{classKDataTool})} implementations. \item\end{CompactList}\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 {\bf create\-Tool}{\rm (p.\,\pageref{classKDataToolInfo_a12})} which creates the datatool described by the service. 



Definition at line 46 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. 



Definition at line 43 of file kdatatool.cpp.

References KNotify\-Client::instance().\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.

References instance(), and service().

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

References instance(), and service().\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}


\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}


\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}
The mimetypes are only used if the {\bf data\-Type}{\rm (p.\,\pageref{classKDataToolInfo_a4})} 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`\"{}. 

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}


\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}


\begin{Desc}
\item[Returns:]a large pixmap for the Data\-Tool. {\bf This class or method is obsolete, it is provided for compatibility only.}, 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}


\begin{Desc}
\item[Returns:]a mini pixmap for the Data\-Tool. {\bf This class or method is obsolete, it is provided for compatibility only.}, 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}


\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}


\begin{Desc}
\item[Returns:]a list if 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.\end{Desc}
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 {\bf commands}{\rm (p.\,\pageref{classKDataToolInfo_a11})}. 

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}


\begin{Desc}
\item[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.\end{Desc}
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 {\bf user\-Commands}{\rm (p.\,\pageref{classKDataToolInfo_a10})}. 

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} = 0, const char $\ast$ {\em name} = 0) const}\label{classKDataToolInfo_a12}


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

\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(), QFile::encode\-Name(), KLib\-Loader::factory(), QObject::inherits(), KStd\-Accel::name(), KLib\-Loader::self(), and KData\-Tool::set\-Instance().\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`\"{}. 



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}


Definition at line 170 of file kdatatool.cpp.

References QValue\-List::append(), QValue\-List::begin(), QValue\-List::end(), QString::from\-Latin1(), KNotify\-Client::instance(), KInstance::instance\-Name(), QString::is\-Empty(), KData\-Tool\-Info(), KIO::mimetype(), KTrader::Offer\-List, 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}
