• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
KFileMetaInfoItem Class Reference

#include <tdefilemetainfo.h>

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

Data * d
 

Friends

class KFileMetaInfoGroup
 
TDEIO_EXPORT friend TQDataStream & operator>> (TQDataStream &s, KFileMetaInfoItem &)
 
TDEIO_EXPORT friend TQDataStream & operator>> (TQDataStream &s, KFileMetaInfoGroup &)
 
TDEIO_EXPORT friend TQDataStream & operator<< (TQDataStream &s, const 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 tdefilemetainfo.h.

Constructor & Destructor Documentation

◆ KFileMetaInfoItem() [1/2]

KFileMetaInfoItem::KFileMetaInfoItem ( const KFileMetaInfoItem &  item)

Copy constructor.

Definition at line 102 of file tdefilemetainfo.cpp.

◆ KFileMetaInfoItem() [2/2]

KFileMetaInfoItem::KFileMetaInfoItem ( )

Default constructor.

This creates an "invalid" item

Definition at line 109 of file tdefilemetainfo.cpp.

Member Function Documentation

◆ attributes()

uint KFileMetaInfoItem::attributes ( ) const

Returns the attributes for this item.

See KFileMimeTypeInfo::Attributes.

Returns
the attributes

Definition at line 222 of file tdefilemetainfo.cpp.

◆ hint()

uint KFileMetaInfoItem::hint ( ) const

Returns the hint for this item.

See KFileMimeTypeInfo::Hint.

Returns
the hint

Definition at line 217 of file tdefilemetainfo.cpp.

◆ isEditable()

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 tdefilemetainfo.cpp.

◆ isModified()

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 tdefilemetainfo.cpp.

◆ isRemoved()

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 tdefilemetainfo.cpp.

◆ isValid()

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 tdefilemetainfo.cpp.

◆ key()

TQString KFileMetaInfoItem::key ( ) const

Returns the key of the item.

Returns
the key of this item

Definition at line 165 of file tdefilemetainfo.cpp.

◆ operator=()

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

The assignment operator, so you can do:

KFileMetaInfoItem item = info.item("Title");
KFileMetaInfoItem
A meta information item about a file.
Definition: tdefilemetainfo.h:497

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 119 of file tdefilemetainfo.cpp.

◆ prefix()

TQString 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 tdefilemetainfo.cpp.

◆ setValue()

bool KFileMetaInfoItem::setValue ( const TQVariant &  value)

Changes the value of the item.

Parameters
valuethe new value
Returns
true if successful, false otherwise

Definition at line 134 of file tdefilemetainfo.cpp.

◆ string()

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

Returns a string containing the value, if possible.

If not, TQString::null is returned.

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

Definition at line 187 of file tdefilemetainfo.cpp.

◆ suffix()

TQString 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 tdefilemetainfo.cpp.

◆ translatedKey()

TQString 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 tdefilemetainfo.cpp.

◆ type()

TQVariant::Type KFileMetaInfoItem::type ( ) const

Return the type of the item.

Returns
the type of the item

Definition at line 192 of file tdefilemetainfo.cpp.

◆ unit()

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 tdefilemetainfo.cpp.

◆ value()

const TQVariant & KFileMetaInfoItem::value ( ) const

Returns the value of the item.

Returns
the value of the item.

Definition at line 182 of file tdefilemetainfo.cpp.


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

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.