.TH "KFileItem" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KFileItem \- A KFileItem is a generic class to handle a file, local or remote.  

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

.in +1c
.ti -1c
.RI "enum { \fBUnknown\fP =  (mode_t) - 1 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKFileItem\fP (const \fBKIO::UDSEntry\fP &_entry, const \fBKURL\fP &_url, bool _determineMimeTypeOnDemand=false, bool _urlIsDirectory=false)"
.br
.ti -1c
.RI "\fBKFileItem\fP (mode_t _mode, mode_t _permissions, const \fBKURL\fP &_url, bool _determineMimeTypeOnDemand=false)"
.br
.ti -1c
.RI "\fBKFileItem\fP (const \fBKURL\fP &url, const \fBQString\fP &mimeType, mode_t mode)"
.br
.ti -1c
.RI "\fBKFileItem\fP (const \fBKFileItem\fP &item)"
.br
.ti -1c
.RI "virtual \fB~KFileItem\fP ()"
.br
.ti -1c
.RI "void \fBrefresh\fP ()"
.br
.ti -1c
.RI "void \fBrefreshMimeType\fP ()"
.br
.ti -1c
.RI "const \fBKURL\fP & \fBurl\fP () const "
.br
.ti -1c
.RI "void \fBsetURL\fP (const \fBKURL\fP &url)"
.br
.ti -1c
.RI "void \fBsetName\fP (const \fBQString\fP &name)"
.br
.ti -1c
.RI "mode_t \fBpermissions\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBpermissionsString\fP () const "
.br
.ti -1c
.RI "mode_t \fBmode\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBuser\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgroup\fP () const "
.br
.ti -1c
.RI "bool \fBisLink\fP () const "
.br
.ti -1c
.RI "bool \fBisDir\fP () const "
.br
.ti -1c
.RI "bool \fBisFile\fP () const "
.br
.ti -1c
.RI "bool \fBisReadable\fP () const "
.br
.ti -1c
.RI "bool \fBisWritable\fP () const "
.br
.ti -1c
.RI "bool \fBisHidden\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBlinkDest\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBlocalPath\fP () const "
.br
.ti -1c
.RI "\fBKIO::filesize_t\fP \fBsize\fP () const "
.br
.ti -1c
.RI "time_t \fBtime\fP (unsigned int which) const "
.br
.ti -1c
.RI "\fBQString\fP \fBtimeString\fP (unsigned int which=KIO::UDS_MODIFICATION_TIME) const "
.br
.ti -1c
.RI "bool \fBisLocalFile\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBtext\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBname\fP (bool lowerCase=false) const "
.br
.ti -1c
.RI "\fBQString\fP \fBmimetype\fP () const "
.br
.ti -1c
.RI "\fBKMimeType::Ptr\fP \fBdetermineMimeType\fP ()"
.br
.ti -1c
.RI "\fBKMimeType::Ptr\fP \fBmimeTypePtr\fP () const "
.br
.ti -1c
.RI "bool \fBisMimeTypeKnown\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBmimeComment\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBiconName\fP ()"
.br
.ti -1c
.RI "\fBQPixmap\fP \fBpixmap\fP (int _size, int _state=0) const "
.br
.ti -1c
.RI "int \fBoverlays\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgetStatusBarInfo\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBgetToolTipText\fP (int maxcount=6)"
.br
.ti -1c
.RI "bool \fBacceptsDrops\fP ()"
.br
.ti -1c
.RI "void \fBrun\fP ()"
.br
.ti -1c
.RI "const \fBKIO::UDSEntry\fP & \fBentry\fP () const "
.br
.ti -1c
.RI "bool \fBisMarked\fP () const "
.br
.ti -1c
.RI "void \fBmark\fP ()"
.br
.ti -1c
.RI "void \fBunmark\fP ()"
.br
.ti -1c
.RI "bool \fBcmp\fP (const \fBKFileItem\fP &item)"
.br
.ti -1c
.RI "virtual void \fBsetExtraData\fP (const void *key, void *value)"
.br
.ti -1c
.RI "virtual const void * \fBextraData\fP (const void *key) const "
.br
.ti -1c
.RI "virtual void * \fBextraData\fP (const void *key)"
.br
.ti -1c
.RI "virtual void \fBremoveExtraData\fP (const void *key)"
.br
.ti -1c
.RI "void \fBsetMetaInfo\fP (const \fBKFileMetaInfo\fP &info)"
.br
.ti -1c
.RI "const \fBKFileMetaInfo\fP & \fBmetaInfo\fP (bool autoget=true, int what=KFileMetaInfo::Fastest) const "
.br
.ti -1c
.RI "void \fBassign\fP (const \fBKFileItem\fP &item)"
.br
.ti -1c
.RI "void \fBsetUDSEntry\fP (const \fBKIO::UDSEntry\fP &entry, const \fBKURL\fP &url, bool determineMimeTypeOnDemand=false, bool urlIsDirectory=false)"
.br
.ti -1c
.RI "\fBKFileItem\fP & \fBoperator=\fP (const \fBKFileItem\fP &)"
.br
.ti -1c
.RI "\fBKURL\fP \fBmostLocalURL\fP (bool &local) const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBinit\fP (bool _determineMimeTypeOnDemand)"
.br
.ti -1c
.RI "void \fBreadUDSEntry\fP (bool _urlIsDirectory)"
.br
.ti -1c
.RI "\fBQString\fP \fBparsePermissions\fP (mode_t perm) const "
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "KIO_EXPORT friend \fBQDataStream\fP & \fBoperator<<\fP (\fBQDataStream\fP &s, const \fBKFileItem\fP &a)"
.br
.ti -1c
.RI "KIO_EXPORT friend \fBQDataStream\fP & \fBoperator>>\fP (\fBQDataStream\fP &s, \fBKFileItem\fP &a)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A KFileItem is a generic class to handle a file, local or remote. 

In particular, it makes it easier to handle the result of \fBKIO::listDir\fP (UDSEntry isn't very friendly to use). It includes many file attributes such as mimetype, icon, text, mode, link... 
.PP
Definition at line 40 of file kfileitem.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KFileItem::KFileItem (const \fBKIO::UDSEntry\fP & _entry, const \fBKURL\fP & _url, bool _determineMimeTypeOnDemand = \fCfalse\fP, bool _urlIsDirectory = \fCfalse\fP)"
.PP
Creates an item representing a file, from a UDSEntry. 
.PP
This is the preferred constructor when using \fBKIO::listDir()\fP.
.PP
\fBParameters:\fP
.RS 4
\fI_entry\fP the \fBKIO\fP entry used to get the file, contains info about it 
.br
\fI_url\fP the file url 
.br
\fI_determineMimeTypeOnDemand\fP specifies if the mimetype of the given URL should be determined immediately or on demand 
.br
\fI_urlIsDirectory\fP specifies if the url is just the directory of the fileitem and the filename from the UDSEntry should be used. 
.RE
.PP

.PP
Definition at line 54 of file kfileitem.cpp.
.PP
References init(), isLocalFile(), and readUDSEntry().
.SS "KFileItem::KFileItem (mode_t _mode, mode_t _permissions, const \fBKURL\fP & _url, bool _determineMimeTypeOnDemand = \fCfalse\fP)"
.PP
Creates an item representing a file, from all the necessary info for it. 
.PP
\fBParameters:\fP
.RS 4
\fI_mode\fP the file mode (according to stat() (e.g. S_IFDIR...) Set to KFileItem::Unknown if unknown. For local files, KFileItem will use stat(). 
.br
\fI_permissions\fP the access permissions If you set both the mode and the permissions, you save a ::stat() for local files. Set to KFileItem::Unknown if you don't know the mode or the permission. 
.br
\fI_url\fP the file url
.br
\fI_determineMimeTypeOnDemand\fP specify if the mimetype of the given URL should be determined immediately or on demand 
.RE
.PP

.PP
Definition at line 71 of file kfileitem.cpp.
.PP
References init().
.SS "KFileItem::KFileItem (const \fBKURL\fP & url, const \fBQString\fP & mimeType, mode_t mode)"
.PP
Creates an item representing a file, for which the mimetype is already known. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP the file url 
.br
\fImimeType\fP the name of the file's mimetype 
.br
\fImode\fP the mode (S_IFDIR...) 
.RE
.PP

.PP
Definition at line 88 of file kfileitem.cpp.
.PP
References init(), and KMimeType::mimeType().
.SS "KFileItem::KFileItem (const \fBKFileItem\fP & item)"
.PP
Copy constructor. 
.PP
Note that extra-data set via \fBsetExtraData()\fP is not deeply copied -- just the pointers are copied. 
.PP
Definition at line 107 of file kfileitem.cpp.
.PP
References assign().
.SS "KFileItem::~\fBKFileItem\fP ()\fC [virtual]\fP"
.PP
Destructs the KFileItem. 
.PP
Extra data set via \fBsetExtraData()\fP is not deleted. 
.PP
Definition at line 119 of file kfileitem.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KFileItem::refresh ()"
.PP
Throw away and re-read (for local files) all information about the file. 
.PP
This is called when the _file_ changes. 
.PP
Definition at line 250 of file kfileitem.cpp.
.PP
References init().
.SS "void KFileItem::refreshMimeType ()"
.PP
Re-reads mimetype information. 
.PP
This is called when the mimetype database changes. 
.PP
Definition at line 267 of file kfileitem.cpp.
.PP
References init().
.SS "const \fBKURL\fP& KFileItem::url () const\fC [inline]\fP"
.PP
Returns the url of the file. 
.PP
\fBReturns:\fP
.RS 4
the url of the file 
.RE
.PP

.PP
Definition at line 112 of file kfileitem.h.
.PP
Referenced by determineMimeType(), iconName(), init(), KDirOperator::insertNewFiles(), KPropertiesDialog::KPropertiesDialog(), metaInfo(), mimeComment(), mostLocalURL(), KFileTreeViewItem::path(), pixmap(), run(), setURL(), and KFileTreeViewItem::url().
.SS "void KFileItem::setURL (const \fBKURL\fP & url)"
.PP
Sets the item's URL. 
.PP
Do not call unless you know what you are doing! (used for example when an item got renamed). 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP the item's URL 
.RE
.PP

.PP
Definition at line 273 of file kfileitem.cpp.
.PP
References KURL::fileName(), setName(), and url().
.SS "void KFileItem::setName (const \fBQString\fP & name)"
.PP
Sets the item's name (i.e. 
.PP
the filename). This is automatically done by setURL, to set the name from the URL's fileName(). This method is provided for some special cases like relative paths as names (KFindPart) 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the item's name 
.RE
.PP

.PP
Definition at line 279 of file kfileitem.cpp.
.PP
References KIO::decodeFileName(), and name().
.PP
Referenced by setURL().
.SS "mode_t KFileItem::permissions () const\fC [inline]\fP"
.PP
Returns the permissions of the file (stat.st_mode containing only permissions). 
.PP
\fBReturns:\fP
.RS 4
the permissions of the file 
.RE
.PP

.PP
Definition at line 133 of file kfileitem.h.
.PP
Referenced by KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin().
.SS "\fBQString\fP KFileItem::permissionsString () const"
.PP
Returns the access permissions for the file as a string. 
.PP
\fBReturns:\fP
.RS 4
the access persmission as string 
.RE
.PP

.PP
Definition at line 880 of file kfileitem.cpp.
.PP
References QString::isNull(), and parsePermissions().
.PP
Referenced by KFileListViewItem::init().
.SS "mode_t KFileItem::mode () const\fC [inline]\fP"
.PP
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...). 
.PP
\fBReturns:\fP
.RS 4
the file type 
.RE
.PP

.PP
Definition at line 145 of file kfileitem.h.
.PP
Referenced by acceptsDrops(), init(), and KFilePropsPlugin::KFilePropsPlugin().
.SS "\fBQString\fP KFileItem::user () const"
.PP
Returns the owner of the file. 
.PP
\fBReturns:\fP
.RS 4
the file's owner 
.RE
.PP

.PP
Definition at line 391 of file kfileitem.cpp.
.PP
References QString::fromLocal8Bit(), QString::isEmpty(), KURL::path(), and user().
.PP
Referenced by getToolTipText(), KFileListViewItem::init(), KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), and user().
.SS "\fBQString\fP KFileItem::group () const"
.PP
Returns the group of the file. 
.PP
\fBReturns:\fP
.RS 4
the file's group 
.RE
.PP

.PP
Definition at line 406 of file kfileitem.cpp.
.PP
References QString::fromLocal8Bit(), group(), QString::isEmpty(), KURL::path(), and QString::sprintf().
.PP
Referenced by getToolTipText(), group(), KFileListViewItem::init(), and KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin().
.SS "bool KFileItem::isLink () const\fC [inline]\fP"
.PP
Returns true if this item represents a link in the UNIX sense of a link. 
.PP
\fBReturns:\fP
.RS 4
true if the file is a link 
.RE
.PP

.PP
Definition at line 164 of file kfileitem.h.
.PP
Referenced by KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), KFilePropsPlugin::KFilePropsPlugin(), and parsePermissions().
.SS "bool KFileItem::isDir () const"
.PP
Returns true if this item represents a directory. 
.PP
\fBReturns:\fP
.RS 4
true if the item is a directory 
.RE
.PP

.PP
Definition at line 606 of file kfileitem.cpp.
.PP
References endl(), and kdDebug().
.PP
Referenced by KDirOperator::insertNewFiles(), KFileTreeViewItem::isDir(), KDirLister::itemsForDir(), KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), KFilePropsPlugin::KFilePropsPlugin(), KDirLister::matchesFilter(), parsePermissions(), KDirOperator::prepareCompletionObjects(), KFileDialog::setSelection(), and KFileIconView::setSorting().
.SS "bool KFileItem::isFile () const\fC [inline]\fP"
.PP
Returns true if this item represents a file (and not a a directory). 
.PP
\fBReturns:\fP
.RS 4
true if the item is a file 
.RE
.PP

.PP
Definition at line 176 of file kfileitem.h.
.SS "bool KFileItem::isReadable () const"
.PP
Checks whether the file or directory is readable. 
.PP
In some cases (remote files), we may return true even though it can't be read. 
.PP
\fBReturns:\fP
.RS 4
true if the file can be read - more precisely, false if we know for sure it can't 
.RE
.PP

.PP
Definition at line 556 of file kfileitem.cpp.
.PP
References KURL::path().
.PP
Referenced by overlays().
.SS "bool KFileItem::isWritable () const"
.PP
Checks whether the file or directory is writable. 
.PP
In some cases (remote files), we may return true even though it can't be written to. 
.PP
\fBReturns:\fP
.RS 4
true if the file or directory can be written to - more precisely, false if we know for sure it can't 
.RE
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 577 of file kfileitem.cpp.
.PP
References KURL::path().
.PP
Referenced by acceptsDrops().
.SS "bool KFileItem::isHidden () const"
.PP
Checks whether the file is hidden. 
.PP
\fBReturns:\fP
.RS 4
true if the file is hidden. 
.RE
.PP

.PP
Definition at line 598 of file kfileitem.cpp.
.PP
References KURL::fileName(), and KURL::isEmpty().
.PP
Referenced by overlays().
.SS "\fBQString\fP KFileItem::linkDest () const"
.PP
Returns the link destination if \fBisLink()\fP == true. 
.PP
\fBReturns:\fP
.RS 4
the link destination. QString::null if the item is not a link 
.RE
.PP

.PP
Definition at line 285 of file kfileitem.cpp.
.PP
References QValueList::begin(), QFile::decodeName(), QValueList::end(), and KURL::path().
.PP
Referenced by getStatusBarInfo(), getToolTipText(), KFilePropsPlugin::KFilePropsPlugin(), and run().
.SS "\fBQString\fP KFileItem::localPath () const"
.PP
Returns the local path if \fBisLocalFile()\fP == true or the \fBKIO\fP item has a UDS_LOCAL_PATH atom. 
.PP
\fBReturns:\fP
.RS 4
the item local path, or QString::null if not known 
.RE
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 306 of file kfileitem.cpp.
.PP
References QValueList::begin(), QValueList::end(), and KURL::path().
.PP
Referenced by mostLocalURL(), and KPropertiesDialog::showDialog().
.SS "\fBKIO::filesize_t\fP KFileItem::size () const"
.PP
Returns the size of the file, if known. 
.PP
\fBReturns:\fP
.RS 4
the file size, or 0 if not known 
.RE
.PP

.PP
Definition at line 325 of file kfileitem.cpp.
.PP
References QValueList::begin(), QValueList::end(), and KURL::path().
.PP
Referenced by cmp(), getStatusBarInfo(), getToolTipText(), KFileListViewItem::init(), KFilePropsPlugin::KFilePropsPlugin(), and KFileIconView::setSorting().
.SS "time_t KFileItem::time (unsigned int which) const"
.PP
Requests the modification, access or creation time, depending on \fCwhich\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIwhich\fP UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or even UDS_CREATION_TIME 
.RE
.PP
\fBReturns:\fP
.RS 4
the time asked for, (time_t)0 if not available 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtimeString()\fP 
.RE
.PP

.PP
Definition at line 347 of file kfileitem.cpp.
.PP
References QValueList::begin(), QValueList::end(), and KURL::path().
.PP
Referenced by cmp(), KFilePropsPlugin::KFilePropsPlugin(), KFileIconView::setSorting(), and timeString().
.SS "\fBQString\fP KFileItem::timeString (unsigned int which = \fCKIO::UDS_MODIFICATION_TIME\fP) const"
.PP
Requests the modification, access or creation time as a string, depending on \fCwhich\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIwhich\fP UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or even UDS_CREATION_TIME 
.RE
.PP
\fBReturns:\fP
.RS 4
a formatted string of the requested time. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtime\fP 
.RE
.PP

.PP
Definition at line 922 of file kfileitem.cpp.
.PP
References KLocale::formatDateTime(), KGlobal::locale(), QDateTime::setTime_t(), and time().
.PP
Referenced by getToolTipText(), and KFileListViewItem::init().
.SS "bool KFileItem::isLocalFile () const\fC [inline]\fP"
.PP
Returns true if the file is a local file. 
.PP
\fBReturns:\fP
.RS 4
true if the file is local, false otherwise 
.RE
.PP

.PP
Definition at line 242 of file kfileitem.h.
.PP
Referenced by KFileItem().
.SS "const \fBQString\fP& KFileItem::text () const\fC [inline]\fP"
.PP
Returns the text of the file item. 
.PP
It's not exactly the filename since some decoding happens ('%2F'->'/'). 
.PP
\fBReturns:\fP
.RS 4
the text of the file item 
.RE
.PP

.PP
Definition at line 249 of file kfileitem.h.
.PP
Referenced by getStatusBarInfo(), getToolTipText(), KFileListViewItem::init(), KDirLister::matchesFilter(), and KFileIconView::setSorting().
.SS "const \fBQString\fP& KFileItem::name (bool lowerCase = \fCfalse\fP) const\fC [inline]\fP"
.PP
Return the name of the file item (without a path). 
.PP
Similar to \fBtext()\fP, but unencoded, i.e. the original name. 
.PP
\fBParameters:\fP
.RS 4
\fIlowerCase\fP if true, the name will be returned in lower case, which is useful to speed up sorting by name, case insensitively. 
.RE
.PP
\fBReturns:\fP
.RS 4
the file's name 
.RE
.PP

.PP
Definition at line 258 of file kfileitem.h.
.PP
References QString::lower().
.PP
Referenced by KFilePropsPlugin::KFilePropsPlugin(), KFileDialog::multiSelectionChanged(), KDirOperator::prepareCompletionObjects(), KFileView::setCurrentItem(), and setName().
.SS "\fBQString\fP KFileItem::mimetype () const"
.PP
Returns the mimetype of the file item. 
.PP
If \fC_determineMimeTypeOnDemand\fP was used in the constructor, this will determine the mimetype first. Equivalent to \fBdetermineMimeType()\fP->\fBname()\fP 
.PP
\fBReturns:\fP
.RS 4
the mime type of the file 
.RE
.PP

.PP
Definition at line 427 of file kfileitem.cpp.
.PP
References determineMimeType().
.PP
Referenced by acceptsDrops(), cmp(), KFilePropsPlugin::KFilePropsPlugin(), KDirLister::matchesMimeFilter(), and metaInfo().
.SS "\fBKMimeType::Ptr\fP KFileItem::determineMimeType ()"
.PP
Returns the mimetype of the file item. 
.PP
If _determineMimeTypeOnDemand was used in the constructor, this will determine the mimetype first. 
.PP
\fBReturns:\fP
.RS 4
the mime type 
.RE
.PP

.PP
Definition at line 433 of file kfileitem.cpp.
.PP
References KMimeType::findByURL(), mostLocalURL(), and url().
.PP
Referenced by assign(), getStatusBarInfo(), iconName(), mimeComment(), and mimetype().
.SS "\fBKMimeType::Ptr\fP KFileItem::mimeTypePtr () const\fC [inline]\fP"
.PP
Returns the currently known mimetype of the file item. 
.PP
This will not try to determine the mimetype if unknown. 
.PP
\fBReturns:\fP
.RS 4
the known mime type 
.RE
.PP

.PP
Definition at line 288 of file kfileitem.h.
.SS "\fBQString\fP KFileItem::mimeComment ()"
.PP
Returns the descriptive comment for this mime type, or the mime type itself if none is present. 
.PP
\fBReturns:\fP
.RS 4
the mime type description, or the mime type itself 
.RE
.PP

.PP
Definition at line 456 of file kfileitem.cpp.
.PP
References determineMimeType(), QString::isEmpty(), mostLocalURL(), and url().
.PP
Referenced by getStatusBarInfo(), getToolTipText(), and KFilePropsPlugin::KFilePropsPlugin().
.SS "\fBQString\fP KFileItem::iconName ()"
.PP
Returns the full path name to the icon that represents this mime type. 
.PP
\fBReturns:\fP
.RS 4
iconName the name of the file's icon 
.RE
.PP

.PP
Definition at line 471 of file kfileitem.cpp.
.PP
References determineMimeType(), mostLocalURL(), and url().
.SS "\fBQPixmap\fP KFileItem::pixmap (int _size, int _state = \fC0\fP) const"
.PP
Returns a pixmap representing the file. 
.PP
\fBParameters:\fP
.RS 4
\fI_size\fP Size for the pixmap in pixels. Zero will return the globally configured default size. 
.br
\fI_state\fP The state of the icon: \fBKIcon::DefaultState\fP, \fBKIcon::ActiveState\fP or \fBKIcon::DisabledState\fP. 
.RE
.PP
\fBReturns:\fP
.RS 4
the pixmap 
.RE
.PP

.PP
Definition at line 510 of file kfileitem.cpp.
.PP
References endl(), KURL::fileName(), KMimeType::findByURL(), QString::isEmpty(), QPixmap::isNull(), kdWarning(), QString::left(), QString::length(), KMimeType::mimeType(), mostLocalURL(), overlays(), KURL::path(), QString::right(), KURL::setPath(), KGlobal::staticQString(), and url().
.PP
Referenced by KFileListViewItem::init(), and KFileDetailView::updateView().
.SS "int KFileItem::overlays () const"
.PP
Returns the overlays (bitfield of \fBKIcon\fP::*Overlay flags) that are used for this item's pixmap. 
.PP
Overlays are used to show for example, whether a file can be modified. 
.PP
\fBReturns:\fP
.RS 4
the overlays of the pixmap 
.RE
.PP

.PP
Definition at line 482 of file kfileitem.cpp.
.PP
References KURL::fileName(), KNFSShare::instance(), KNFSShare::isDirectoryShared(), isHidden(), isReadable(), KURL::path(), and QString::right().
.PP
Referenced by pixmap().
.SS "\fBQString\fP KFileItem::getStatusBarInfo ()"
.PP
Returns the string to be displayed in the statusbar, e.g. 
.PP
when the mouse is over this item 
.PP
\fBReturns:\fP
.RS 4
the status bar information 
.RE
.PP

.PP
Definition at line 645 of file kfileitem.cpp.
.PP
References QString::arg(), determineMimeType(), QString::isEmpty(), linkDest(), mimeComment(), size(), and text().
.SS "\fBQString\fP KFileItem::getToolTipText (int maxcount = \fC6\fP)"
.PP
Returns the string to be displayed in the tool tip when the mouse is over this item. 
.PP
This may load a plugin to determine additional information specific to the mimetype of the file.
.PP
\fBParameters:\fP
.RS 4
\fImaxcount\fP the maximum number of entries shown 
.RE
.PP
\fBReturns:\fP
.RS 4
the tool tip string 
.RE
.PP

.PP
Definition at line 681 of file kfileitem.cpp.
.PP
References QString::append(), QString::arg(), KFileMetaInfoItem::attributes(), QStyleSheet::escape(), group(), QString::isEmpty(), KFileMetaInfo::isEmpty(), KFileMetaInfoItem::isValid(), KFileMetaInfo::isValid(), KFileMetaInfo::item(), QString::length(), linkDest(), metaInfo(), mimeComment(), parsePermissions(), KFileMetaInfo::preferredKeys(), size(), KFileMetaInfoItem::string(), text(), timeString(), KFileMetaInfoItem::translatedKey(), QString::truncate(), and user().
.SS "bool KFileItem::acceptsDrops ()"
.PP
Returns true if files can be dropped over this item. 
.PP
Contrary to popular belief, not only dirs will return true :) Executables, .desktop files, will do so as well. 
.PP
\fBReturns:\fP
.RS 4
true if you can drop files over the item 
.RE
.PP

.PP
Definition at line 624 of file kfileitem.cpp.
.PP
References isWritable(), mimetype(), mode(), and KURL::path().
.SS "void KFileItem::run ()"
.PP
Let's 'KRun' this file ! (e.g. 
.PP
when file is clicked or double-clicked or return is pressed) 
.PP
Definition at line 758 of file kfileitem.cpp.
.PP
References linkDest(), mostLocalURL(), and url().
.SS "const \fBKIO::UDSEntry\fP& KFileItem::entry () const\fC [inline]\fP"
.PP
Returns the UDS entry. 
.PP
Used by the tree view to access all details by position. 
.PP
\fBReturns:\fP
.RS 4
the UDS entry 
.RE
.PP

.PP
Definition at line 359 of file kfileitem.h.
.SS "bool KFileItem::isMarked () const\fC [inline]\fP"
.PP
Used when updating a directory. 
.PP
marked == seen when refreshing. 
.PP
\fBReturns:\fP
.RS 4
true if the file item is marked 
.RE
.PP

.PP
Definition at line 365 of file kfileitem.h.
.SS "void KFileItem::mark ()\fC [inline]\fP"
.PP
Marks the item. 
.PP
\fBSee also:\fP
.RS 4
\fBisMarked()\fP 
.RE
.PP

.PP
Definition at line 370 of file kfileitem.h.
.SS "void KFileItem::unmark ()\fC [inline]\fP"
.PP
Unmarks the item. 
.PP
\fBSee also:\fP
.RS 4
\fBisMarked()\fP 
.RE
.PP

.PP
Definition at line 375 of file kfileitem.h.
.SS "bool KFileItem::cmp (const \fBKFileItem\fP & item)"
.PP
Somewhat like a comparison operator, but more explicit. 
.PP
\fBParameters:\fP
.RS 4
\fIitem\fP the item to compare 
.RE
.PP
\fBReturns:\fP
.RS 4
true if all values are equal 
.RE
.PP

.PP
Definition at line 770 of file kfileitem.cpp.
.PP
References mimetype(), size(), and time().
.SS "void KFileItem::setExtraData (const void * key, void * value)\fC [virtual]\fP"
.PP
This allows to associate some 'extra' data to a KFileItem. 
.PP
As one KFileItem can be used by several objects (often views) which all need to add some data, you have to use a key to reference your extra data within the KFileItem.
.PP
That way a KFileItem can hold and provide access to all those views separately.
.PP
I.e. a \fBKFileIconView\fP that associates a \fBKFileIconViewItem\fP (an item suitable for use with \fBQIconView\fP) does
.PP
.PP
.nf
 kfileItem->setExtraData( this, iconViewItem );
.fi
.PP
.PP
and can later access the iconViewItem by doing
.PP
.PP
.nf
 KFileIconViewItem *iconViewItem = static_cast<KFileIconViewItem*>( kfileItem->extraData( this ));
.fi
.PP
.PP
This is usually more efficient then having every view associate data to items by using a separate \fBQDict\fP or \fBQMap\fP.
.PP
Note: you have to remove and destroy the data you associated yourself when you don't need it anymore!
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the extra data 
.br
\fIvalue\fP the value of the extra data 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBextraData\fP 
.PP
\fBremoveExtraData\fP 
.RE
.PP

.PP
Definition at line 851 of file kfileitem.cpp.
.PP
References QMap::replace().
.SS "const void * KFileItem::extraData (const void * key) const\fC [virtual]\fP"
.PP
Retrieves the extra data with the given \fCkey\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the extra data 
.RE
.PP
\fBReturns:\fP
.RS 4
the extra data associated to an item with \fCkey\fP via setExtraData. 0L if nothing was associated with \fCkey\fP. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBextraData\fP 
.RE
.PP

.PP
Definition at line 859 of file kfileitem.cpp.
.PP
References QMapConstIterator::data(), QMap::end(), and QMap::find().
.PP
Referenced by KFileDetailView::ensureItemVisible(), KFileTreeView::findItem(), and KFileTreeBranch::findTVIByURL().
.SS "void * KFileItem::extraData (const void * key)\fC [virtual]\fP"
.PP
Retrieves the extra data with the given \fCkey\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the extra data 
.RE
.PP
\fBReturns:\fP
.RS 4
the extra data associated to an item with \fCkey\fP via setExtraData. 0L if nothing was associated with \fCkey\fP. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBextraData\fP 
.RE
.PP

.PP
Definition at line 867 of file kfileitem.cpp.
.PP
References QMapIterator::data(), QMap::end(), and QMap::find().
.SS "void KFileItem::removeExtraData (const void * key)\fC [virtual]\fP"
.PP
Removes the extra data associated with an item via \fCkey\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key of the extra data to remove 
.RE
.PP

.PP
Definition at line 875 of file kfileitem.cpp.
.PP
References QMap::remove().
.SS "void KFileItem::setMetaInfo (const \fBKFileMetaInfo\fP & info)"
.PP
Sets the metainfo of this item to \fCinfo\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIinfo\fP the new meta info 
.RE
.PP

.PP
Definition at line 929 of file kfileitem.cpp.
.PP
Referenced by KFileMetaPropsPlugin::KFileMetaPropsPlugin().
.SS "const \fBKFileMetaInfo\fP & KFileItem::metaInfo (bool autoget = \fCtrue\fP, int what = \fCKFileMetaInfo::Fastest\fP) const"
.PP
Returns the metainfo of this item. 
.PP
\fBParameters:\fP
.RS 4
\fIautoget\fP if true, the metainfo will automatically be created 
.br
\fIwhat\fP ignored 
.RE
.PP

.PP
Definition at line 934 of file kfileitem.cpp.
.PP
References KFileMetaInfo::isValid(), mimetype(), mostLocalURL(), KGlobalSettings::showFilePreview(), and url().
.PP
Referenced by getToolTipText(), and KFileMetaPropsPlugin::KFileMetaPropsPlugin().
.SS "void KFileItem::assign (const \fBKFileItem\fP & item)"
.PP
Somewhat like an assignment operator, but more explicit. 
.PP
Note: extra-data set with \fBsetExtraData()\fP is not copied, so be careful what you do!
.PP
\fBParameters:\fP
.RS 4
\fIitem\fP the item to copy 
.RE
.PP

.PP
Definition at line 785 of file kfileitem.cpp.
.PP
References determineMimeType().
.PP
Referenced by KFileItem(), and operator=().
.SS "void KFileItem::setUDSEntry (const \fBKIO::UDSEntry\fP & entry, const \fBKURL\fP & url, bool determineMimeTypeOnDemand = \fCfalse\fP, bool urlIsDirectory = \fCfalse\fP)"
.PP
Reinitialize KFileItem with a new UDSEntry. 
.PP
Note: extra-data set with \fBsetExtraData()\fP is not changed or deleted, so be careful what you do!
.PP
KDirListerCache uses it to save new/delete calls by updating existing items that are otherwise not needed anymore.
.PP
\fBParameters:\fP
.RS 4
\fIentry\fP the UDSEntry to assign to this KFileItem 
.br
\fIurl\fP the file url 
.br
\fIdetermineMimeTypeOnDemand\fP specifies if the mimetype of the given URL should be determined immediately or on demand 
.br
\fIurlIsDirectory\fP specifies if the url is just the directory of the fileitem and the filename from the UDSEntry should be used. 
.RE
.PP
\fBSince:\fP
.RS 4
3.4.1 
.RE
.PP

.PP
Definition at line 824 of file kfileitem.cpp.
.PP
References init(), and readUDSEntry().
.SS "\fBKFileItem\fP & KFileItem::operator= (const \fBKFileItem\fP &)"
.PP
Assignment operator, calls \fBassign()\fP. 
.PP
Definition at line 113 of file kfileitem.cpp.
.PP
References assign().
.SS "\fBKURL\fP KFileItem::mostLocalURL (bool & local) const"
.PP
Tries to give a local URL for this file item if possible. 
.PP
The given boolean indicates if the returned url is local or not. 
.PP
Definition at line 948 of file kfileitem.cpp.
.PP
References QString::isEmpty(), localPath(), KURL::setPath(), and url().
.PP
Referenced by determineMimeType(), iconName(), init(), metaInfo(), mimeComment(), pixmap(), and run().
.SS "void KFileItem::init (bool _determineMimeTypeOnDemand)\fC [protected]\fP"
.PP
Computes the text, mode, and mimetype from the UDSEntry Called by constructor, but can be called again later. 
.PP
Definition at line 124 of file kfileitem.cpp.
.PP
References QFile::encodeName(), KMimeType::findByURL(), KURL::isEmpty(), KURL::isLocalFile(), mode(), mostLocalURL(), KURL::path(), and url().
.PP
Referenced by KFileItem(), refresh(), refreshMimeType(), and setUDSEntry().
.SS "void KFileItem::readUDSEntry (bool _urlIsDirectory)\fC [protected]\fP"
.PP
Extracts the data from the UDSEntry member and updates the KFileItem accordingly. 
.PP
\fBSince:\fP
.RS 4
3.4.1 
.RE
.PP

.PP
Definition at line 186 of file kfileitem.cpp.
.PP
References KURL::addPath(), QValueList::begin(), KIO::decodeFileName(), QValueList::end(), QString::isEmpty(), KURL::isLocalFile(), KMimeType::mimeType(), and KGlobal::staticQString().
.PP
Referenced by KFileItem(), and setUDSEntry().
.SS "\fBQString\fP KFileItem::parsePermissions (mode_t perm) const\fC [protected]\fP"
.PP
Parses the given permission set and provides it for access(). 
.PP
Definition at line 888 of file kfileitem.cpp.
.PP
References QString::fromLatin1(), isDir(), and isLink().
.PP
Referenced by getToolTipText(), and permissionsString().

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