class KFilePlugin

# class KFilePlugin | Baseclass for a meta info plugin. More...
Contains pure virtuals
Definition | `#include <kfilemetainfo.h>`
Inherits | QObject (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KFilePlugin ( QObject *parent, const char *name, const QStringList& args )
- virtual ~KFilePlugin ()
- virtual bool readInfo ( KFileMetaInfo& info, uint what = KFileMetaInfo::Fastest )
- virtual bool writeInfo ( const KFileMetaInfo& ) const
- virtual QValidator* createValidator ( const QString& , const QString& , const QString& , QObject* , const char* ) const

#### Protected Methods

- KFileMimeTypeInfo::GroupInfo* addGroupInfo (KFileMimeTypeInfo* info, const QString& key, const QString& translatedKey) const
- void setAttributes (KFileMimeTypeInfo::GroupInfo* gi, uint attr) const
- void addVariableInfo (KFileMimeTypeInfo::GroupInfo* gi, QVariant::Type type, uint attr) const
- KFileMimeTypeInfo::ItemInfo* addItemInfo (KFileMimeTypeInfo::GroupInfo* gi, const QString& key, const QString& translatedKey, QVariant::Type type)
- void setAttributes (KFileMimeTypeInfo::ItemInfo* item, uint attr)
- void setHint (KFileMimeTypeInfo::ItemInfo* item, uint hint)
- void setUnit (KFileMimeTypeInfo::ItemInfo* item, uint unit)
- void setPrefix (KFileMimeTypeInfo::ItemInfo* item, const QString& prefix)
- void setSuffix (KFileMimeTypeInfo::ItemInfo* item, const QString& suffix)
- KFileMetaInfoGroup appendGroup (KFileMetaInfo& info, const QString& key)
- void appendItem (KFileMetaInfoGroup& group, const QString& key, QVariant value)
- KFileMimeTypeInfo * addMimeTypeInfo ( const QString& mimeType )
- virtual void virtual_hook ( int id, void* data )

#### Protected Members

- QStringList m_preferredKeys
- QStringList m_preferredGroups

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

KFilePlugin ( QObject *parent, const char *name, const QStringList& args ) | ### KFilePlugin

~KFilePlugin () | ### ~KFilePlugin

[virtual]

bool readInfo ( KFileMetaInfo& info, uint what = KFileMetaInfo::Fastest ) | ### readInfo

[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()

bool writeInfo ( const KFileMetaInfo& ) | ### writeInfo

[const 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

QValidator* createValidator ( const QString& , const QString& , const QString& , QObject* , const char* ) | ### createValidator

[const 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.

KFileMimeTypeInfo::GroupInfo* addGroupInfo (KFileMimeTypeInfo* info, const QString& key, const QString& translatedKey) | ### addGroupInfo

[protected const]

void setAttributes (KFileMimeTypeInfo::GroupInfo* gi, uint attr) | ### setAttributes

[protected const]

void addVariableInfo (KFileMimeTypeInfo::GroupInfo* gi, QVariant::Type type, uint attr) | ### addVariableInfo

[protected const]

KFileMimeTypeInfo::ItemInfo* addItemInfo (KFileMimeTypeInfo::GroupInfo* gi, const QString& key, const QString& translatedKey, QVariant::Type type) | ### addItemInfo

[protected]

void setAttributes (KFileMimeTypeInfo::ItemInfo* item, uint attr) | ### setAttributes

[protected]

void setHint (KFileMimeTypeInfo::ItemInfo* item, uint hint) | ### setHint

[protected]

void setUnit (KFileMimeTypeInfo::ItemInfo* item, uint unit) | ### setUnit

[protected]

void setPrefix (KFileMimeTypeInfo::ItemInfo* item, const QString& prefix) | ### setPrefix

[protected]

void setSuffix (KFileMimeTypeInfo::ItemInfo* item, const QString& suffix) | ### setSuffix

[protected]

KFileMetaInfoGroup appendGroup (KFileMetaInfo& info, const QString& key) | ### appendGroup

[protected]

void appendItem (KFileMetaInfoGroup& group, const QString& key, QVariant value) | ### appendItem

[protected]

KFileMimeTypeInfo * addMimeTypeInfo ( const QString& mimeType ) | ### addMimeTypeInfo

[protected]

Call this in your constructor

QStringList m_preferredKeys | ### m_preferredKeys

[protected]

QStringList m_preferredGroups | ### m_preferredGroups

[protected]

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:57 2003, using kdoc 2.0a54.