kio Library API Documentation

KFilePlugin Class Reference

Baseclass for a meta info plugin. More...

#include <kfilemetainfo.h>

Inheritance diagram for KFilePlugin:

QObject List of all members.

Public Methods

virtual bool readInfo (KFileMetaInfo &info, uint what=KFileMetaInfo::Fastest)=0
 Read the info from the file in this method and insert it into the provided KFileMetaInfo object.

virtual bool writeInfo (const KFileMetaInfo &) const
 Similar to the above method, but for writing the info back to the file.

virtual QValidatorcreateValidator (const QString &, const QString &, const QString &, QObject *, const char *) const
 This method should create an appropriate validator for the specified item if it's editable or return a null pointer if not.


Protected Methods

KFileMimeTypeInfoaddMimeTypeInfo (const QString &mimeType)
 Call this in your constructor.


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 KFilePlugin

Example:

 typedef KGenericFactory<MyPlugin> MyFactory;
 K_EXPORT_COMPONENT_FACTORY(kfile_foo, MyFactory("kfile_foo"));
  

and then just overwrite the methods your plugin supports. If your plugin can only read data, it is sufficient to only write a readInfo() method. If you also want to support changing data and writing it back into the file, you usually need all methods.

Definition at line 1072 of file kfilemetainfo.h.


Member Function Documentation

virtual bool KFilePlugin::readInfo KFileMetaInfo   info,
uint    what = KFileMetaInfo::Fastest
[pure virtual]
 

Read the info from the file in this method and insert it into the provided KFileMetaInfo object.

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

Referenced by KFileMetaInfo::KFileMetaInfo().

virtual bool KFilePlugin::writeInfo const KFileMetaInfo   const [inline, virtual]
 

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 1094 of file kfilemetainfo.h.

Referenced by KFileMetaInfo::applyChanges().

virtual QValidator* KFilePlugin::createValidator const QString  ,
const QString  ,
const QString  ,
QObject  ,
const char *   
const [inline, virtual]
 

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 1107 of file kfilemetainfo.h.

Referenced by KFileMimeTypeInfo::createValidator().

KFileMimeTypeInfo * KFilePlugin::addMimeTypeInfo const QString   mimeType [protected]
 

Call this in your constructor.

Definition at line 732 of file kfilemetainfo.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:36 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001