.TH "KFilePlugin" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KFilePlugin \- Baseclass for a meta info plugin.  

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

.in +1c
.ti -1c
.RI "\fBKFilePlugin\fP (\fBQObject\fP *\fBparent\fP, const  char *\fBname\fP, const  \fBQStringList\fP &args)"
.br
.ti -1c
.RI "virtual bool \fBreadInfo\fP (\fBKFileMetaInfo\fP &info, uint what=KFileMetaInfo::Fastest)=0"
.br
.RI "\fIRead the info from the file in this method and insert it into the provided \fBKFileMetaInfo\fP object. \fP"
.ti -1c
.RI "virtual bool \fBwriteInfo\fP (const  \fBKFileMetaInfo\fP &) const "
.br
.RI "\fISimilar to the above method, but for writing the info back to the file. \fP"
.ti -1c
.RI "virtual \fBQValidator\fP * \fBcreateValidator\fP (const  \fBQString\fP &, const  \fBQString\fP &, const  \fBQString\fP &, \fBQObject\fP *, const  char *) const "
.br
.RI "\fIThis method should create an appropriate validator for the specified item if it's editable or return a null pointer if not. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKFileMimeTypeInfo::GroupInfo\fP * \fBaddGroupInfo\fP (\fBKFileMimeTypeInfo\fP *info, const  \fBQString\fP &key, const  \fBQString\fP &translatedKey) const "
.br
.ti -1c
.RI "void \fBsetAttributes\fP (\fBKFileMimeTypeInfo::GroupInfo\fP *gi, uint attr) const "
.br
.ti -1c
.RI "void \fBaddVariableInfo\fP (\fBKFileMimeTypeInfo::GroupInfo\fP *gi, QVariant::Type type, uint attr) const "
.br
.ti -1c
.RI "\fBKFileMimeTypeInfo::ItemInfo\fP * \fBaddItemInfo\fP (\fBKFileMimeTypeInfo::GroupInfo\fP *gi, const  \fBQString\fP &key, const  \fBQString\fP &translatedKey, QVariant::Type type)"
.br
.ti -1c
.RI "void \fBsetAttributes\fP (\fBKFileMimeTypeInfo::ItemInfo\fP *item, uint attr)"
.br
.ti -1c
.RI "void \fBsetHint\fP (\fBKFileMimeTypeInfo::ItemInfo\fP *item, uint hint)"
.br
.ti -1c
.RI "void \fBsetUnit\fP (\fBKFileMimeTypeInfo::ItemInfo\fP *item, uint unit)"
.br
.ti -1c
.RI "void \fBsetPrefix\fP (\fBKFileMimeTypeInfo::ItemInfo\fP *item, const  \fBQString\fP &prefix)"
.br
.ti -1c
.RI "void \fBsetSuffix\fP (\fBKFileMimeTypeInfo::ItemInfo\fP *item, const  \fBQString\fP &suffix)"
.br
.ti -1c
.RI "\fBKFileMetaInfoGroup\fP \fBappendGroup\fP (\fBKFileMetaInfo\fP &info, const  \fBQString\fP &key)"
.br
.ti -1c
.RI "void \fBappendItem\fP (\fBKFileMetaInfoGroup\fP &group, const  \fBQString\fP &key, \fBQVariant\fP value)"
.br
.ti -1c
.RI "\fBKFileMimeTypeInfo\fP * \fBaddMimeTypeInfo\fP (const  \fBQString\fP &mimeType)"
.br
.RI "\fICall this in your constructor. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBQStringList\fP \fBm_preferredKeys\fP"
.br
.ti -1c
.RI "\fBQStringList\fP \fBm_preferredGroups\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
Baseclass for a meta info plugin. 

If you want to write your own plugin, you need to derive from this class.
.PP
In your plugin, you need to create a factory for the KFilePlugin
.PP
Example: 
.PP
.nf

 typedef KGenericFactory<MyPlugin> MyFactory;
 K_EXPORT_COMPONENT_FACTORY(kfile_foo, MyFactory('kfile_foo'));
  
.PP
.PP
and then just overwrite the methods your plugin supports. If your plugin can only read data, it is sufficient to only write a \fBreadInfo\fP() method. If you also want to support changing data and writing it back into the file, you usually need all methods. 
.PP
Definition at line 1078 of file kfilemetainfo.h.
.SH "Member Function Documentation"
.PP 
.SS "virtual bool KFilePlugin::readInfo (\fBKFileMetaInfo\fP & info, uint what = KFileMetaInfo::Fastest)\fC [pure virtual]\fP"
.PP
Read the info from the file in this method and insert it into the provided \fBKFileMetaInfo\fP object. You can get the path to the file with info.path() Referenced by KFileMetaInfo::KFileMetaInfo().
.SS "virtual bool KFilePlugin::writeInfo (const \fBKFileMetaInfo\fP &) const\fC [inline, virtual]\fP"
.PP
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.
.PP
Referenced by KFileMetaInfo::applyChanges().
.SS "virtual \fBQValidator\fP* KFilePlugin::createValidator (const \fBQString\fP &, const \fBQString\fP &, const \fBQString\fP &, \fBQObject\fP *, const char *) const\fC [inline, virtual]\fP"
.PP
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.
.PP
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.
.PP
Referenced by KFileMimeTypeInfo::createValidator().
.SS "\fBKFileMimeTypeInfo\fP * KFilePlugin::addMimeTypeInfo (const \fBQString\fP & mimeType)\fC [protected]\fP"
.PP
Call this in your constructor. Definition at line 736 of file kfilemetainfo.cpp.

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