.TH "KFileMetaInfo" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KFileMetaInfo \- This is the class for objects that hold meta information about a file. 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
.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
.ti -1c
.RI "\fBKFileMetaInfo\fP (const \fBKURL\fP &url, const \fBQString\fP &mimeType=QString::null, uint what=Fastest)"
.br
.ti -1c
.RI "\fBKFileMetaInfo\fP ()"
.br
.ti -1c
.RI "\fBKFileMetaInfo\fP (const \fBKFileMetaInfo\fP &original)"
.br
.ti -1c
.RI "const \fBKFileMetaInfo\fP & \fBoperator=\fP (const \fBKFileMetaInfo\fP &info)"
.br
.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
.ti -1c
.RI "bool \fBremoveGroup\fP (const \fBQString\fP &name)"
.br
.ti -1c
.RI "\fBQStringList\fP \fBremovedGroups\fP ()"
.br
.ti -1c
.RI "bool \fBapplyChanges\fP ()"
.br
.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
.ti -1c
.RI "\fBKURL\fP \fBurl\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 "KIO_EXPORT friend \fBQDataStream\fP & \fBoperator>>\fP (\fBQDataStream\fP &s, \fBKFileMetaInfo\fP &)"
.br
.ti -1c
.RI "KIO_EXPORT friend \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. 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 887 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. 
.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fIFastest \fP\fP
do the fastest possible read and omit all items that might need a significantly longer time than the others 
.TP
\fB\fIDontCare \fP\fP
let the plugin decide what to read 
.TP
\fB\fITechnicalInfo \fP\fP
extract technical details about the file, like e.g 
.PP
play time, resolution or a compressioni type 
.TP
\fB\fIContentInfo \fP\fP
read information about the content of the file, like comments or id3 tags 
.TP
\fB\fIExtenedAttr \fP\fP
read filesystem based extended attributes if they are supported for the filesystem 
.TP
\fB\fIThumbnail \fP\fP
only read the file's thumbnail, if it contains one 
.TP
\fB\fIPreferred \fP\fP
get at least the preferred items 
.TP
\fB\fIEverything \fP\fP
read everything, even if it might take a while 
.PP
Definition at line 899 of file kfilemetainfo.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KFileMetaInfo::KFileMetaInfo (const \fBQString\fP & path, const \fBQString\fP & mimeType = \fCQString::null\fP, uint what = \fCFastest\fP)"
.PP
The constructor. 
.PP
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 What enum values. It gives some hint to the plugin what information is desired. The plugin may still return more items.
.RE
.PP
\fBNote:\fP
.RS 4
This version will \fBonly\fP work for \fBlocal\fP (file:/) files. 
.RE
.PP

.PP
Definition at line 297 of file kfilemetainfo.cpp.
.PP
References mimeType(), path(), and KURL::setPath().
.SS "KFileMetaInfo::KFileMetaInfo (const \fBKURL\fP & url, const \fBQString\fP & mimeType = \fCQString::null\fP, uint what = \fCFastest\fP)"
.PP
Another constructor. 
.PP
Similar to the above, but takes a URL so that meta-data may be retrieved over other protocols (ftp, etc.) 
.PP
Definition at line 306 of file kfilemetainfo.cpp.
.PP
References mimeType(), and url().
.SS "KFileMetaInfo::KFileMetaInfo ()"
.PP
Default constructor. 
.PP
This will create an invalid object (see \fBisValid()\fP. 
.PP
Definition at line 351 of file kfilemetainfo.cpp.
.SS "KFileMetaInfo::KFileMetaInfo (const \fBKFileMetaInfo\fP & original)"
.PP
Copy constructor. 
.PP
This creates a copy of the original object, but that copy will point to the same data, so if you change the original, the copy will be changed, too. After all, they are referring to the same file. 
.PP
Definition at line 344 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');

.fi
.PP
. 
.PP
This will create a shared copy of the object. The actual data is automatically deleted if all copies go out of scope. 
.PP
Definition at line 500 of file kfilemetainfo.cpp.
.PP
References d.
.SS "\fBQStringList\fP KFileMetaInfo::groups () const"
.PP
Returns a list of all groups. 
.PP
\fBReturns:\fP
.RS 4
the keys of the groups that the file has. 
.RE
.PP

.PP
Definition at line 373 of file kfilemetainfo.cpp.
.PP
Referenced by contains(), containsGroup(), item(), preferredGroups(), and saveItem().
.SS "\fBQStringList\fP KFileMetaInfo::supportedGroups () const"
.PP
Returns a list of all supported groups. 
.PP
\fBReturns:\fP
.RS 4
the supported keys of the groups that the file has. 
.RE
.PP

.PP
Definition at line 361 of file kfilemetainfo.cpp.
.PP
References isValid().
.PP
Referenced by editableGroups().
.SS "\fBQStringList\fP KFileMetaInfo::preferredGroups () const"
.PP
Returns a list of the preferred groups. 
.PP
\fBReturns:\fP
.RS 4
the keys of the preferred groups that the file has. 
.RE
.PP

.PP
Definition at line 398 of file kfilemetainfo.cpp.
.PP
References group(), groups(), and isValid().
.PP
Referenced by item(), preferredKeys(), and saveItem().
.SS "\fBQStringList\fP KFileMetaInfo::preferredKeys () const"
.PP
Returns a list of all preferred keys. 
.PP
\fBReturns:\fP
.RS 4
a list of all preferred keys. 
.RE
.PP

.PP
Definition at line 424 of file kfilemetainfo.cpp.
.PP
References preferredGroups().
.PP
Referenced by KFileItem::getToolTipText().
.SS "\fBQStringList\fP KFileMetaInfo::supportedKeys () const"
.PP
Returns a list of supported keys. 
.PP
\fBReturns:\fP
.RS 4
a list of supported keys 
.RE
.PP

.PP
Definition at line 367 of file kfilemetainfo.cpp.
.PP
References isValid().
.SS "\fBQStringList\fP KFileMetaInfo::editableGroups () const"
.PP
Returns the list of groups that you can add or remove from the file. 
.PP
\fBReturns:\fP
.RS 4
the groups can be added or removed 
.RE
.PP

.PP
Definition at line 383 of file kfilemetainfo.cpp.
.PP
References KFileMimeTypeInfo::GroupInfo::attributes(), and supportedGroups().
.SS "\fBKFileMetaInfoItem\fP KFileMetaInfo::item (const \fBQString\fP & key) const"
.PP
Returns the \fBKFileMetaInfoItem\fP with the given \fCkey\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the item 
.RE
.PP
\fBReturns:\fP
.RS 4
the item. Invalid if there is no item with the given \fCkey\fP. 
.RE
.PP

.PP
Definition at line 598 of file kfilemetainfo.cpp.
.PP
References groups(), KFileMetaInfoItem::isValid(), and preferredGroups().
.PP
Referenced by KFileItem::getToolTipText(), and saveItem().
.SS "\fBKFileMetaInfoItem\fP KFileMetaInfo::item (const KFileMetaInfoItem::Hint hint) const"
.PP
Returns the \fBKFileMetaInfoItem\fP with the given \fChint\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIhint\fP the hint of the item 
.RE
.PP
\fBReturns:\fP
.RS 4
the item. Invalid if there is no item with the given \fChint\fP. 
.RE
.PP

.PP
Definition at line 609 of file kfilemetainfo.cpp.
.PP
References groups(), KFileMetaInfoItem::isValid(), and preferredGroups().
.SS "\fBKFileMetaInfoItem\fP KFileMetaInfo::saveItem (const \fBQString\fP & key, const \fBQString\fP & preferredGroup = \fCQString::null\fP, bool createGroup = \fCtrue\fP)"
.PP
Saves the item with the given \fCkey\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the item 
.br
\fIpreferredGroup\fP the preferred group, or QString::null 
.br
\fIcreateGroup\fP true to create the group if necessary 
.RE
.PP
\fBReturns:\fP
.RS 4
the saved item 
.RE
.PP

.PP
Definition at line 621 of file kfilemetainfo.cpp.
.PP
References addGroup(), KFileMetaInfoGroup::addItem(), QMapIterator::data(), group(), groups(), KFileMetaInfoItem::isValid(), isValid(), item(), preferredGroups(), and KFileMimeTypeInfo::GroupInfo::supportedKeys().
.SS "\fBKFileMetaInfoGroup\fP KFileMetaInfo::group (const \fBQString\fP & key) const"
.PP
Returns the \fBKFileMetaInfoGroup\fP with the given \fCkey\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the item 
.RE
.PP
\fBReturns:\fP
.RS 4
the group. Invalid if there is no group with the given \fCkey\fP. 
.RE
.PP

.PP
Definition at line 437 of file kfilemetainfo.cpp.
.PP
References QMapIterator::data().
.PP
Referenced by addGroup(), preferredGroups(), and saveItem().
.SS "\fBKFileMetaInfoGroup\fP KFileMetaInfo::operator[] (const \fBQString\fP & key) const\fC [inline]\fP"
.PP
Returns the \fBKFileMetaInfoGroup\fP with the given \fCkey\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the item 
.RE
.PP
\fBReturns:\fP
.RS 4
the group. Invalid if there is no group with the given \fCkey\fP. 
.RE
.PP

.PP
Definition at line 1058 of file kfilemetainfo.h.
.SS "bool KFileMetaInfo::addGroup (const \fBQString\fP & name)"
.PP
Try to add the specified group. 
.PP
This will only succeed if it is in the list of \fBeditableGroups()\fP. 
.PP
\fBNote:\fP
.RS 4
that all non-variable items that belong to this group are automatically added as empty item. 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the group to add 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false if not 
.RE
.PP

.PP
Definition at line 446 of file kfilemetainfo.cpp.
.PP
References KFileMetaInfoGroup::appendItem(), KFileMimeTypeInfo::ItemInfo::attributes(), group(), isValid(), KFileMimeTypeInfo::GroupInfo::itemInfo(), KFileMimeTypeInfo::ItemInfo::key(), KFileMetaInfoGroup::setAdded(), and KFileMimeTypeInfo::GroupInfo::supportedKeys().
.PP
Referenced by saveItem().
.SS "bool KFileMetaInfo::removeGroup (const \fBQString\fP & name)"
.PP
Remove the specified group. 
.PP
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! 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the group to remove 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false if not 
.RE
.PP

.PP
Definition at line 483 of file kfilemetainfo.cpp.
.SS "\fBQStringList\fP KFileMetaInfo::removedGroups ()"
.PP
Returns a list of removed groups. 
.PP
\fBReturns:\fP
.RS 4
a list of removed groups. 
.RE
.PP

.PP
Definition at line 495 of file kfilemetainfo.cpp.
.SS "bool KFileMetaInfo::applyChanges ()"
.PP
This method writes all pending changes of the meta info back to the file. 
.PP
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

.PP
Definition at line 528 of file kfilemetainfo.cpp.
.PP
References QMapConstIterator::data(), kdDebug(), plugin(), and KFilePlugin::writeInfo().
.SS "bool KFileMetaInfo::contains (const \fBQString\fP & key) const"
.PP
Checks whether an item with the given \fCkey\fP exists. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to check 
.RE
.PP
\fBReturns:\fP
.RS 4
whether an item for this \fCkey\fP exists. 
.RE
.PP

.PP
Definition at line 582 of file kfilemetainfo.cpp.
.PP
References KFileMetaInfoGroup::contains(), and groups().
.SS "bool KFileMetaInfo::containsGroup (const \fBQString\fP & key) const"
.PP
Checks whether a group with the given \fCkey\fP exists. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to check 
.RE
.PP
\fBReturns:\fP
.RS 4
whether a group with this name exists. 
.RE
.PP

.PP
Definition at line 593 of file kfilemetainfo.cpp.
.PP
References groups().
.SS "bool KFileMetaInfo::isValid () const"
.PP
Returns true if the item is valid, i.e. 
.PP
if actually represents the info about a file, false if the object is uninitialized. 
.PP
\fBReturns:\fP
.RS 4
true if valid, false otherwise 
.RE
.PP

.PP
Definition at line 513 of file kfilemetainfo.cpp.
.PP
Referenced by addGroup(), KFileItem::getToolTipText(), KFileItem::metaInfo(), mimeType(), plugin(), preferredGroups(), saveItem(), supportedGroups(), and supportedKeys().
.SS "bool KFileMetaInfo::isEmpty () const"
.PP
Returns false if the object contains data, true if it's empty. 
.PP
You'll get an empty object if no plugin for the file could be found. 
.PP
\fBReturns:\fP
.RS 4
true if empty, false otherwise 
.RE
.PP

.PP
Definition at line 519 of file kfilemetainfo.cpp.
.PP
Referenced by KFileItem::getToolTipText().
.SS "\fBQString\fP KFileMetaInfo::mimeType () const"
.PP
Returns the mime type of file. 
.PP
\fBReturns:\fP
.RS 4
the file's mime type 
.RE
.PP

.PP
Definition at line 576 of file kfilemetainfo.cpp.
.PP
References isValid().
.PP
Referenced by KFileMetaInfo().
.SS "\fBQString\fP KFileMetaInfo::path () const"
.PP
Returns the path of file - or QString::null if file is non-local. 
.PP
\fBReturns:\fP
.RS 4
the file's path - or QString::null if file is non-local 
.RE
.PP

.PP
Definition at line 718 of file kfilemetainfo.cpp.
.PP
Referenced by KFileMetaInfo().
.SS "\fBKURL\fP KFileMetaInfo::url () const"
.PP
Returns the url of file. 
.PP
\fBReturns:\fP
.RS 4
the file's url 
.RE
.PP

.PP
Definition at line 723 of file kfilemetainfo.cpp.
.PP
References KURL::url().
.PP
Referenced by KFileMetaInfo().
.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

.PP
Definition at line 569 of file kfilemetainfo.cpp.
.PP
References isValid().
.PP
Referenced by applyChanges().

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