|
|
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 |
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: caleb on tcdevel on Tue Jan 28 12:54:15 2003, using kdoc $. |