.TH "KFileMetaInfo" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KFileMetaInfo \- This is the class for objects that hold meta information about a file.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kfilemetainfo.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef \fBKFileMimeTypeInfo::Hint\fP \fBHint\fP"
.br
.ti -1c
.RI "typedef \fBKFileMimeTypeInfo::Unit\fP \fBUnit\fP"
.br
.ti -1c
.RI "typedef \fBKFileMimeTypeInfo::Attributes\fP \fBAttributes\fP"
.br
.ti -1c
.RI "enum \fBWhat\fP { \fBFastest\fP =  0x1, \fBDontCare\fP =  0x2, \fBTechnicalInfo\fP =  0x4, \fBContentInfo\fP =  0x8, \fBExtenedAttr\fP =  0x10, \fBThumbnail\fP =  0x20, \fBPreferred\fP =  0x40, \fBEverything\fP =  0xffff }"
.br
.RI "\fIThis is used to specify what a KFileMetaInfo object should read, so you can specify if you want to read 'expensive' items or not. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKFileMetaInfo\fP (const  \fBQString\fP &path, const  \fBQString\fP &mimeType=QString::null, uint what=Fastest)"
.br
.RI "\fIThe constructor. \fP"
.ti -1c
.RI "\fBKFileMetaInfo\fP ()"
.br
.RI "\fIDefault constructor. \fP"
.ti -1c
.RI "\fBKFileMetaInfo\fP (const  \fBKFileMetaInfo\fP &original)"
.br
.RI "\fICopy constructor. \fP"
.ti -1c
.RI "const  \fBKFileMetaInfo\fP & \fBoperator=\fP (const  \fBKFileMetaInfo\fP &info)"
.br
.RI "\fIThe assignment operator, so you can do e.g.:. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBgroups\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBsupportedGroups\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBpreferredGroups\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBpreferredKeys\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBsupportedKeys\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBeditableGroups\fP () const "
.br
.ti -1c
.RI "\fBKFileMetaInfoItem\fP \fBitem\fP (const  \fBQString\fP &key) const "
.br
.ti -1c
.RI "\fBKFileMetaInfoItem\fP \fBitem\fP (const  KFileMetaInfoItem::Hint hint) const "
.br
.ti -1c
.RI "\fBKFileMetaInfoItem\fP \fBsaveItem\fP (const  \fBQString\fP &key, const  \fBQString\fP &preferredGroup=QString::null, bool createGroup=true)"
.br
.ti -1c
.RI "\fBKFileMetaInfoGroup\fP \fBgroup\fP (const  \fBQString\fP &key) const "
.br
.ti -1c
.RI "\fBKFileMetaInfoGroup\fP \fBoperator[]\fP (const  \fBQString\fP &key) const "
.br
.ti -1c
.RI "bool \fBaddGroup\fP (const  \fBQString\fP &name)"
.br
.RI "\fITry to add the specified group. \fP"
.ti -1c
.RI "bool \fBremoveGroup\fP (const  \fBQString\fP &name)"
.br
.RI "\fIremove the specified group. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBremovedGroups\fP ()"
.br
.ti -1c
.RI "bool \fBapplyChanges\fP ()"
.br
.RI "\fIThis method writes all pending changes of the meta info back to the file. \fP"
.ti -1c
.RI "bool \fBcontains\fP (const  \fBQString\fP &key) const "
.br
.ti -1c
.RI "bool \fBcontainsGroup\fP (const  \fBQString\fP &key) const "
.br
.ti -1c
.RI "const  \fBQVariant\fP \fBvalue\fP (const  \fBQString\fP &key) const "
.br
.ti -1c
.RI "bool \fBisValid\fP () const "
.br
.ti -1c
.RI "bool \fBisEmpty\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBmimeType\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBpath\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKFileMetaInfoGroup\fP \fBappendGroup\fP (const  \fBQString\fP &name)"
.br
.ti -1c
.RI "\fBKFilePlugin\fP *const  \fBplugin\fP () const "
.br
.ti -1c
.RI "void \fBref\fP ()"
.br
.ti -1c
.RI "void \fBderef\fP ()"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "Data * \fBd\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKFilePlugin\fP"
.br
.ti -1c
.RI "\fBQDataStream\fP & \fBoperator>>\fP (\fBQDataStream\fP &s, \fBKFileMetaInfo\fP &)"
.br
.ti -1c
.RI "\fBQDataStream\fP & \fBoperator<<\fP (\fBQDataStream\fP &s, const  \fBKFileMetaInfo\fP &)"
.br
.in -1c
.SH "Detailed Description"
.PP 
This is the class for objects that hold meta information about a file. 

The information is kept in form of a system of key/value pairs. See also \fBKFileMetaInfoItem\fP. This information is retrieved from the file through a plugin system, and this class is the main interface to it. If you want to write your own plugin, have a look at \fBKFilePlugin\fP. There are basically two different kinds of meta information: Fixed ones that the plugin knows about (e.g. an mp3 id3v1 tag has a well defined fixed list of fields), and variable keys that exist in mimetypes that support their own key/value system (comments in png files are of this type). Almost every file has fixed keys, but some also have variable keys.
.PP
The groups and the What enum are not yet supported, but already added to the interface so that adding support doesn't break compatibility. 
.PP
Definition at line 853 of file kfilemetainfo.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKFileMetaInfo::What\fP"
.PP
This is used to specify what a KFileMetaInfo object should read, so you can specify if you want to read 'expensive' items or not. .IP "\(bu" 2
\fCFastest\fP do the fastest possible read and omit all items that might need a significantly longer time than the others 
.IP "\(bu" 2
\fCEverything\fP read everything, even if it might take a while 
.IP "\(bu" 2
\fCDontCare\fP let the plugin decide what to read 
.IP "\(bu" 2
\fCTechnicalInfo\fP extract technical details about the file, like e.g. play time, resolution or a compression type 
.IP "\(bu" 2
\fCContentInfo\fP read information about the content of the file, like comments or id3 tags 
.IP "\(bu" 2
\fCExtendedAttr\fP read filesystem based extended attributes if they are supported for the filesystem 
.IP "\(bu" 2
\fCThumbnail\fP only read the file's thumbnail, if it contains one 
.IP "\(bu" 2
\fCPreferred\fP get at least the preferred items 
.PP
Definition at line 880 of file kfilemetainfo.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KFileMetaInfo::KFileMetaInfo (const \fBQString\fP & path, const \fBQString\fP & mimeType = QString::null, uint what = Fastest)"
.PP
The constructor. creating a KFileMetaInfo item through this will autoload the plugin belonging to the mimetype and try to get meta information about the specified file.
.PP
If no info is available, you'll get an empty (not invalid) object. You can test for it with the \fBisEmpty\fP() method.
.PP
\fBParameters:\fP
.RS 4
\fIpath\fP The file name. This must be the path to a local file. 
.br
\fImimeType\fP The name of the file's mimetype. If ommited, the mimetype is autodetected 
.br
\fIwhat\fP one or more of the \fCWhat\fP enum values. It gives some hint to the plugin what information is desired. The plugin may still return more items. 
.RE
.PP
Definition at line 288 of file kfilemetainfo.cpp.
.PP
References KMimeType::findByPath(), QString::isEmpty(), KFileMetaInfo(), plugin(), and KFilePlugin::readInfo().
.SS "KFileMetaInfo::KFileMetaInfo ()"
.PP
Default constructor. This will create an invalid object (see \fBisValid\fP(). Definition at line 325 of file kfilemetainfo.cpp.
.PP
Referenced by KFileMetaInfo().
.SS "KFileMetaInfo::KFileMetaInfo (const \fBKFileMetaInfo\fP & original)"
.PP
Copy constructor. Definition at line 318 of file kfilemetainfo.cpp.
.SH "Member Function Documentation"
.PP 
.SS "const  \fBKFileMetaInfo\fP & KFileMetaInfo::operator= (const \fBKFileMetaInfo\fP & info)"
.PP
The assignment operator, so you can do e.g.:. .PP
.nf

    KFileMetaInfo info;
    if (something) info = KFileMetaInfo('/the/file');
 
.PP
.PP
This will create a shared copy of the object. The actual data is automatically deleted if all copies go out of scope Definition at line 470 of file kfilemetainfo.cpp.
.PP
References d.
.SS "\fBQStringList\fP KFileMetaInfo::groups () const"
.PP
\fBReturns:\fP
.RS 4
all keys groups that the file has. 
.RE
.PP
Definition at line 345 of file kfilemetainfo.cpp.
.PP
Referenced by contains(), and containsGroup().
.SS "\fBQStringList\fP KFileMetaInfo::editableGroups () const"
.PP
\fBReturns:\fP
.RS 4
the list of groups that you can add or remove from the file. 
.RE
.PP
Definition at line 355 of file kfilemetainfo.cpp.
.PP
References KFileMimeTypeInfo::GroupInfo::attributes().
.SS "bool KFileMetaInfo::addGroup (const \fBQString\fP & name)"
.PP
Try to add the specified group. This will only succeed if it is in the list of \fBeditableGroups\fP(). Note that all non-variable items that belong to this group are automatically added as empty item. Definition at line 417 of file kfilemetainfo.cpp.
.PP
References KFileMetaInfoGroup::appendItem(), KFileMimeTypeInfo::ItemInfo::attributes(), KFileMimeTypeInfo::GroupInfo::itemInfo(), KFileMimeTypeInfo::ItemInfo::key(), KStdAccel::name(), KFileMetaInfoGroup::setAdded(), and KFileMimeTypeInfo::GroupInfo::supportedKeys().
.SS "bool KFileMetaInfo::removeGroup (const \fBQString\fP & name)"
.PP
remove the specified group. This will only succeed if it is in the list of \fBeditableGroups\fP(). Beware that this also removes all the items in that group, so always ask the user before removing it! Definition at line 453 of file kfilemetainfo.cpp.
.PP
References KStdAccel::name().
.SS "bool KFileMetaInfo::applyChanges ()"
.PP
This method writes all pending changes of the meta info back to the file. If any items are marked as removed, they are really removed from the list. The info object as well as all items are updated. 
.PP
\fBReturns:\fP
.RS 4
true if successful, false if not 
.RE
.PP
Definition at line 498 of file kfilemetainfo.cpp.
.PP
References QMapConstIterator::data(), plugin(), and KFilePlugin::writeInfo().
.SS "bool KFileMetaInfo::contains (const \fBQString\fP & key) const"
.PP
\fBReturns:\fP
.RS 4
whether an item for this key exists. 
.RE
.PP
Definition at line 550 of file kfilemetainfo.cpp.
.PP
References KFileMetaInfoGroup::contains(), groups(), and KStdAccel::key().
.SS "bool KFileMetaInfo::containsGroup (const \fBQString\fP & key) const"
.PP
\fBReturns:\fP
.RS 4
whether a group with this name exists. 
.RE
.PP
Definition at line 561 of file kfilemetainfo.cpp.
.PP
References groups(), and KStdAccel::key().
.SS "bool KFileMetaInfo::isValid () const"
.PP
\fBReturns:\fP
.RS 4
true if the item is valid, i.e. if actually represents the info about a file, false if the object is uninitialized 
.RE
.PP
Definition at line 483 of file kfilemetainfo.cpp.
.PP
Referenced by KFileItem::getToolTipText(), and KFileItem::metaInfo().
.SS "bool KFileMetaInfo::isEmpty () const"
.PP
\fBReturns:\fP
.RS 4
false if the object contains data, true if it's empty. You'll get an empty object if no plugin for the file could be found. 
.RE
.PP
Definition at line 489 of file kfilemetainfo.cpp.
.PP
Referenced by KFileItem::getToolTipText().
.SS "\fBKFilePlugin\fP *const  KFileMetaInfo::plugin () const\fC [protected]\fP"
.PP
\fBReturns:\fP
.RS 4
a pointer to the plugin that belogs to this object's mimetype. It will be auto-loaded if it's currently not loaded 
.RE
.PP
Definition at line 539 of file kfilemetainfo.cpp.
.PP
Referenced by applyChanges(), and KFileMetaInfo().

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