.TH "KFilePlugin" kde3 "11 Jun 2005" "Version Version 3.4.1" "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
.ti -1c
.RI "virtual bool \fBwriteInfo\fP (const \fBKFileMetaInfo\fP &info) const "
.br
.ti -1c
.RI "virtual \fBQValidator\fP * \fBcreateValidator\fP (const \fBQString\fP &mimeType, const \fBQString\fP &group, const \fBQString\fP &key, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP) const "
.br
.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
.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'));

.fi
.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 1202 of file kfilemetainfo.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KFilePlugin::KFilePlugin (\fBQObject\fP * parent, const char * name, const \fBQStringList\fP & args)"
.PP
Creates a new KFilePlugin instance. 
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP the parent of the \fBQObject\fP, can be 0 
.br
\fIname\fP the name of the \fBQObject\fP, can be 0 
.br
\fIargs\fP currently ignored 
.RE
.PP

.PP
Definition at line 765 of file kfilemetainfo.cpp.
.SH "Member Function Documentation"
.PP 
.SS "virtual bool KFilePlugin::readInfo (\fBKFileMetaInfo\fP & info, uint what = \fCKFileMetaInfo::Fastest\fP)\fC [pure virtual]\fP"
.PP
Read the info from the file in this method and insert it into the provided \fBKFileMetaInfo\fP object. 
.PP
You can get the path to the file with info.path() 
.PP
\fBParameters:\fP
.RS 4
\fIinfo\fP the information will be written here 
.br
\fIwhat\fP defines what to read, see \fBKFileMetaInfo::What\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false if it failed 
.RE
.PP

.SS "virtual bool KFilePlugin::writeInfo (const \fBKFileMetaInfo\fP & info) const\fC [inline, virtual]\fP"
.PP
Similar to the above method, but for writing the info back to the file. 
.PP
If you don't have any writable keys, don't implement this method 
.PP
\fBParameters:\fP
.RS 4
\fIinfo\fP the information that will be written 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false if it failed 
.RE
.PP

.PP
Definition at line 1235 of file kfilemetainfo.h.
.PP
Referenced by KFileMetaInfo::applyChanges().
.SS "virtual \fBQValidator\fP* KFilePlugin::createValidator (const \fBQString\fP & mimeType, const \fBQString\fP & group, const \fBQString\fP & key, \fBQObject\fP * parent, const char * name) 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. 
.PP
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. 
.PP
\fBParameters:\fP
.RS 4
\fImimeType\fP the mime type 
.br
\fIgroup\fP the group name of the validator item 
.br
\fIkey\fP the key name of the validator item 
.br
\fIparent\fP the \fBQObject\fP parent, can be 0 
.br
\fIname\fP the name of the \fBQObject\fP, can be 0 
.RE
.PP

.PP
Definition at line 1254 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. 
.PP
Definition at line 777 of file kfilemetainfo.cpp.

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