• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kio

KFileMetaInfoItem Class Reference

A meta information item about a file. More...

#include <kfilemetainfo.h>

List of all members.


Public Types

typedef
KFileMimeTypeInfo::Attributes 
Attributes
typedef KFileMimeTypeInfo::Hint Hint
typedef KFileMimeTypeInfo::Unit Unit

Public Member Functions

uint attributes () const
uint hint () const
bool isEditable () const
bool isModified () const
bool isRemoved () const
bool isValid () const
QString key () const
 KFileMetaInfoItem ()
 KFileMetaInfoItem (const KFileMetaInfoItem &item)
 KFileMetaInfoItem (const KFileMimeTypeInfo::ItemInfo *mti, const QString &key, const QVariant &value)
const KFileMetaInfoItem & operator= (const KFileMetaInfoItem &item)
QString prefix () const
bool setValue (const QVariant &value)
QString string (bool mangle=true) const
QString suffix () const
QString translatedKey () const
QVariant::Type type () const
uint unit () const
const QVariant & value () const
 ~KFileMetaInfoItem ()

Protected Member Functions

void deref ()
void ref ()
void setAdded ()
void setRemoved ()

Protected Attributes

Data * d

Friends

KIO_EXPORT friend QDataStream & operator<< (QDataStream &s, const KFileMetaInfoItem &)
KIO_EXPORT friend QDataStream & operator>> (QDataStream &s, KFileMetaInfoGroup &)
KIO_EXPORT friend QDataStream & operator>> (QDataStream &s, KFileMetaInfoItem &)

Detailed Description

A meta information item about a file.

This is one item of the meta information about a file (see KFileMetaInfo).

Definition at line 496 of file kfilemetainfo.h.


Member Typedef Documentation

typedef KFileMimeTypeInfo::Attributes KFileMetaInfoItem::Attributes

Definition at line 502 of file kfilemetainfo.h.

typedef KFileMimeTypeInfo::Hint KFileMetaInfoItem::Hint

Definition at line 499 of file kfilemetainfo.h.

typedef KFileMimeTypeInfo::Unit KFileMetaInfoItem::Unit

Definition at line 501 of file kfilemetainfo.h.


Constructor & Destructor Documentation

KFileMetaInfoItem::KFileMetaInfoItem ( const KFileMimeTypeInfo::ItemInfo *  mti,
const QString &  key,
const QVariant &  value 
)

For internal use only.

You usually don't need to use this constructor yourself. Let KFileMetaInfo do it for you.

Definition at line 96 of file kfilemetainfo.cpp.

KFileMetaInfoItem::KFileMetaInfoItem ( const KFileMetaInfoItem &  item  ) 

Copy constructor.

Definition at line 102 of file kfilemetainfo.cpp.

KFileMetaInfoItem::KFileMetaInfoItem (  ) 

Default constructor.

This creates an "invalid" item

Definition at line 109 of file kfilemetainfo.cpp.

KFileMetaInfoItem::~KFileMetaInfoItem (  ) 

Definition at line 114 of file kfilemetainfo.cpp.


Member Function Documentation

uint KFileMetaInfoItem::attributes (  )  const

Returns the attributes for this item.

See KFileMimeTypeInfo::Attributes.

Returns:
the attributes

Definition at line 222 of file kfilemetainfo.cpp.

void KFileMetaInfoItem::deref (  )  [protected]

Definition at line 255 of file kfilemetainfo.cpp.

uint KFileMetaInfoItem::hint (  )  const

Returns the hint for this item.

See KFileMimeTypeInfo::Hint.

Returns:
the hint

Definition at line 217 of file kfilemetainfo.cpp.

bool KFileMetaInfoItem::isEditable (  )  const

You can query if the application can edit the item and write it back to the file with this method.

Note:
This doesn't ensure that you have write access to the file and that enough space is available.
Returns:
true if the item's value can be changed, false if not

Definition at line 227 of file kfilemetainfo.cpp.

bool KFileMetaInfoItem::isModified (  )  const

If you change an item, it is marked as "dirty".

On the next KFileMetaInfo::applyChanges() , the change will be written to the file. With this method, you can ask if this item is dirty.

Returns:
true if the item contains changes that have not yet been written back into the file. Removing or adding an item counts as such a change

Definition at line 202 of file kfilemetainfo.cpp.

bool KFileMetaInfoItem::isRemoved (  )  const

If you remove an item, it is only marked for removal for the file.

On the next KFileMetaInfo::applyChanges() , it will be removed from the file. With this method, you can ask if the item is marked for removal.

Returns:
true if the item was removed, false if not

Definition at line 160 of file kfilemetainfo.cpp.

bool KFileMetaInfoItem::isValid (  )  const

Return true if the item is valid, i.e.

if it contains data, false if it's invalid (created with the default constructor and not been assigned anything), or if KFileMetaInfoGroup::item() didn't find your requested item).

Returns:
true if valid, false if invalid

Definition at line 232 of file kfilemetainfo.cpp.

QString KFileMetaInfoItem::key (  )  const

Returns the key of the item.

Returns:
the key of this item

Definition at line 165 of file kfilemetainfo.cpp.

const KFileMetaInfoItem & KFileMetaInfoItem::operator= ( const KFileMetaInfoItem &  item  ) 

The assignment operator, so you can do:.

    KFileMetaInfoItem item = info.item("Title");

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 120 of file kfilemetainfo.cpp.

QString KFileMetaInfoItem::prefix (  )  const

This method returns a translated prefix to be displayed before the value.

Think e.g. of the $ in $30

Returns:
the prefix

Definition at line 207 of file kfilemetainfo.cpp.

void KFileMetaInfoItem::ref (  )  [protected]

Definition at line 250 of file kfilemetainfo.cpp.

void KFileMetaInfoItem::setAdded (  )  [protected]

Definition at line 240 of file kfilemetainfo.cpp.

void KFileMetaInfoItem::setRemoved (  )  [protected]

Definition at line 245 of file kfilemetainfo.cpp.

bool KFileMetaInfoItem::setValue ( const QVariant &  value  ) 

Changes the value of the item.

Parameters:
value the new value
Returns:
true if successful, false otherwise

Definition at line 134 of file kfilemetainfo.cpp.

QString KFileMetaInfoItem::string ( bool  mangle = true  )  const

Returns a string containing the value, if possible.

If not, QString::null is returned.

Parameters:
mangle if true, the string will already contain prefix and suffix
Returns:
the value string, or QString::null if not possible

Definition at line 187 of file kfilemetainfo.cpp.

QString KFileMetaInfoItem::suffix (  )  const

This method returns a translated suffix to be displayed after the value.

Think of the kbps in 128kbps

Returns:
the suffix

Definition at line 212 of file kfilemetainfo.cpp.

QString KFileMetaInfoItem::translatedKey (  )  const

Returns a translation of the key for displaying to the user.

If the plugin provides translation to the key, it's also in the user's language

Returns:
the translated key

Definition at line 170 of file kfilemetainfo.cpp.

QVariant::Type KFileMetaInfoItem::type (  )  const

Return the type of the item.

Returns:
the type of the item

Definition at line 192 of file kfilemetainfo.cpp.

uint KFileMetaInfoItem::unit (  )  const

Returns the unit for this item.

See KFileMimeTypeInfo::Unit.

Returns:
the unit
Since:
3.2

Definition at line 197 of file kfilemetainfo.cpp.

const QVariant & KFileMetaInfoItem::value (  )  const

Returns the value of the item.

Returns:
the value of the item.

Definition at line 182 of file kfilemetainfo.cpp.


Friends And Related Function Documentation

KIO_EXPORT friend QDataStream& operator<< ( QDataStream &  s,
const KFileMetaInfoItem &   
) [friend]

Definition at line 1708 of file kfilemetainfo.cpp.

KIO_EXPORT friend QDataStream& operator>> ( QDataStream &  s,
KFileMetaInfoGroup &   
) [friend]

Definition at line 1778 of file kfilemetainfo.cpp.

KIO_EXPORT friend QDataStream& operator>> ( QDataStream &  s,
KFileMetaInfoItem &   
) [friend]

Definition at line 1728 of file kfilemetainfo.cpp.


Member Data Documentation

Data* KFileMetaInfoItem::d [protected]

Definition at line 675 of file kfilemetainfo.h.


The documentation for this class was generated from the following files:
  • kfilemetainfo.h
  • kfilemetainfo.cpp

kio

Skip menu "kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal