\section{KFile\-Plugin Class Reference}
\label{classKFilePlugin}\index{KFilePlugin@{KFilePlugin}}
Baseclass for a meta info plugin.  


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

Inheritance diagram for KFile\-Plugin:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=52pt]{classKFilePlugin__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KFile\-Plugin:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=124pt]{classKFilePlugin__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KFile\-Plugin} ({\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}, const  {\bf QString\-List} \&args)\label{classKFilePlugin_a0}

\item 
virtual bool {\bf read\-Info} ({\bf KFile\-Meta\-Info} \&info, uint what=KFile\-Meta\-Info::Fastest)=0
\begin{CompactList}\small\item\em Read the info from the file in this method and insert it into the provided {\bf KFile\-Meta\-Info}{\rm (p.\,\pageref{classKFileMetaInfo})} object. \item\end{CompactList}\item 
virtual bool {\bf write\-Info} (const  {\bf KFile\-Meta\-Info} \&) const 
\begin{CompactList}\small\item\em Similar to the above method, but for writing the info back to the file. \item\end{CompactList}\item 
virtual {\bf QValidator} $\ast$ {\bf create\-Validator} (const  {\bf QString} \&, const  {\bf QString} \&, const  {\bf QString} \&, {\bf QObject} $\ast$, const  char $\ast$) const 
\begin{CompactList}\small\item\em This method should create an appropriate validator for the specified item if it's editable or return a null pointer if not. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf KFile\-Mime\-Type\-Info::Group\-Info} $\ast$ {\bf add\-Group\-Info} ({\bf KFile\-Mime\-Type\-Info} $\ast$info, const  {\bf QString} \&key, const  {\bf QString} \&translated\-Key) const \label{classKFilePlugin_b0}

\item 
void {\bf set\-Attributes} ({\bf KFile\-Mime\-Type\-Info::Group\-Info} $\ast$gi, uint attr) const \label{classKFilePlugin_b1}

\item 
void {\bf add\-Variable\-Info} ({\bf KFile\-Mime\-Type\-Info::Group\-Info} $\ast$gi, QVariant::Type type, uint attr) const \label{classKFilePlugin_b2}

\item 
{\bf KFile\-Mime\-Type\-Info::Item\-Info} $\ast$ {\bf add\-Item\-Info} ({\bf KFile\-Mime\-Type\-Info::Group\-Info} $\ast$gi, const  {\bf QString} \&key, const  {\bf QString} \&translated\-Key, QVariant::Type type)\label{classKFilePlugin_b3}

\item 
void {\bf set\-Attributes} ({\bf KFile\-Mime\-Type\-Info::Item\-Info} $\ast$item, uint attr)\label{classKFilePlugin_b4}

\item 
void {\bf set\-Hint} ({\bf KFile\-Mime\-Type\-Info::Item\-Info} $\ast$item, uint hint)\label{classKFilePlugin_b5}

\item 
void {\bf set\-Unit} ({\bf KFile\-Mime\-Type\-Info::Item\-Info} $\ast$item, uint unit)\label{classKFilePlugin_b6}

\item 
void {\bf set\-Prefix} ({\bf KFile\-Mime\-Type\-Info::Item\-Info} $\ast$item, const  {\bf QString} \&prefix)\label{classKFilePlugin_b7}

\item 
void {\bf set\-Suffix} ({\bf KFile\-Mime\-Type\-Info::Item\-Info} $\ast$item, const  {\bf QString} \&suffix)\label{classKFilePlugin_b8}

\item 
{\bf KFile\-Meta\-Info\-Group} {\bf append\-Group} ({\bf KFile\-Meta\-Info} \&info, const  {\bf QString} \&key)\label{classKFilePlugin_b9}

\item 
void {\bf append\-Item} ({\bf KFile\-Meta\-Info\-Group} \&group, const  {\bf QString} \&key, {\bf QVariant} value)\label{classKFilePlugin_b10}

\item 
{\bf KFile\-Mime\-Type\-Info} $\ast$ {\bf add\-Mime\-Type\-Info} (const  {\bf QString} \&mime\-Type)
\begin{CompactList}\small\item\em Call this in your constructor. \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKFilePlugin_b12}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QString\-List} {\bf m\_\-preferred\-Keys}\label{classKFilePlugin_p0}

\item 
{\bf QString\-List} {\bf m\_\-preferred\-Groups}\label{classKFilePlugin_p1}

\end{CompactItemize}


\subsection{Detailed Description}
Baseclass for a meta info plugin. 

If you want to write your own plugin, you need to derive from this class.

In your plugin, you need to create a factory for the KFile\-Plugin

Example: \small\begin{alltt}
 typedef KGenericFactory<MyPlugin> MyFactory;
 K\_EXPORT\_COMPONENT\_FACTORY(kfile\_foo, MyFactory("kfile\_foo"));
  \end{alltt}\normalsize 


and then just overwrite the methods your plugin supports. If your plugin can only read data, it is sufficient to only write a {\bf read\-Info}{\rm (p.\,\pageref{classKFilePlugin_a2})}() method. If you also want to support changing data and writing it back into the file, you usually need all methods. 



Definition at line 1078 of file kfilemetainfo.h.

\subsection{Member Function Documentation}
\index{KFilePlugin@{KFile\-Plugin}!readInfo@{readInfo}}
\index{readInfo@{readInfo}!KFilePlugin@{KFile\-Plugin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KFile\-Plugin::read\-Info ({\bf KFile\-Meta\-Info} \& {\em info}, uint {\em what} = KFile\-Meta\-Info::Fastest)\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKFilePlugin_a2}


Read the info from the file in this method and insert it into the provided {\bf KFile\-Meta\-Info}{\rm (p.\,\pageref{classKFileMetaInfo})} object. 

You can get the path to the file with info.path() 

Referenced by KFile\-Meta\-Info::KFile\-Meta\-Info().\index{KFilePlugin@{KFile\-Plugin}!writeInfo@{writeInfo}}
\index{writeInfo@{writeInfo}!KFilePlugin@{KFile\-Plugin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KFile\-Plugin::write\-Info (const {\bf KFile\-Meta\-Info} \&) const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKFilePlugin_a3}


Similar to the above method, but for writing the info back to the file. 

If you don't have any writable keys, don't implement this method 

Definition at line 1100 of file kfilemetainfo.h.

Referenced by KFile\-Meta\-Info::apply\-Changes().\index{KFilePlugin@{KFile\-Plugin}!createValidator@{createValidator}}
\index{createValidator@{createValidator}!KFilePlugin@{KFile\-Plugin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QValidator}$\ast$ KFile\-Plugin::create\-Validator (const {\bf QString} \&, const {\bf QString} \&, const {\bf QString} \&, {\bf QObject} $\ast$, const char $\ast$) const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKFilePlugin_a4}


This method should create an appropriate validator for the specified item if it's editable or return a null pointer if not. 

If you don't have any editable items, you don't need this method.

If you you don't need any validation, e.g. you accept any input, you can simply return 0L, or not reimplement this method at all. 

Definition at line 1113 of file kfilemetainfo.h.

Referenced by KFile\-Mime\-Type\-Info::create\-Validator().\index{KFilePlugin@{KFile\-Plugin}!addMimeTypeInfo@{addMimeTypeInfo}}
\index{addMimeTypeInfo@{addMimeTypeInfo}!KFilePlugin@{KFile\-Plugin}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KFile\-Mime\-Type\-Info} $\ast$ KFile\-Plugin::add\-Mime\-Type\-Info (const {\bf QString} \& {\em mime\-Type})\hspace{0.3cm}{\tt  [protected]}}\label{classKFilePlugin_b11}


Call this in your constructor. 



Definition at line 736 of file kfilemetainfo.cpp.

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