|
|
This is one item of the meta information about a file (see KFileMetaInfo).
typedef KFileMimeTypeInfo::Hint Hint | Hint |
typedef KFileMimeTypeInfo::Unit Unit | Unit |
typedef KFileMimeTypeInfo::Attributes Attributes | Attributes |
KFileMetaInfoItem ( const KFileMimeTypeInfo::ItemInfo* mti,
const QString& key, const QVariant& value)
| KFileMetaInfoItem |
You usually don't need to use this constructor yourself. Let KFileMetaInfo do it for you.
KFileMetaInfoItem ( const KFileMetaInfoItem & item )
| KFileMetaInfoItem |
Copy onstructor
const KFileMetaInfoItem& operator= (const KFileMetaInfoItem & item )
| operator= |
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
KFileMetaInfoItem ()
| KFileMetaInfoItem |
Default constructor. This creates an "invalid" item
~KFileMetaInfoItem ()
| ~KFileMetaInfoItem |
QString key ()
| key |
[const]
Returns: the key of this item
QString translatedKey ()
| 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
const QVariant& value ()
| value |
[const]
Returns: the value of the item.
QString string ( bool mangle = true )
| string |
[const]
Returns: a string containing the value, if possible. If not,
QString::null is returned.
if mangle
is true, the string will already contain prefix and
suffix
bool setValue ( const QVariant& value )
| setValue |
changes the value of the item
QVariant::Type type ()
| type |
[const]
convenience method. It does the same as value()->type()
Returns: the type of the item
bool isEditable ()
| isEditable |
[const]
You can query if the application can edit the item and write it back to the file with this method. Note that 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
bool isRemoved ()
| 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
bool isModified ()
| 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
QString prefix ()
| prefix |
[const]
This method returns a translated prefix to be displayed before the value. Think e.g. of the $ in $30
Returns: the prefix
QString suffix ()
| suffix |
[const]
This method returns a translated suffix to be displayed after the value. Think of the kbps in 128kbps *
Returns: the suffix
uint hint ()
| hint |
[const]
Returns: the hint for this item. See KFileMimeTypeInfo::Hint
uint unit ()
| unit |
[const]
Returns: the unit for this item. See KFileMimeTypeInfo::Unit
uint attributes ()
| attributes |
[const]
Returns: the atttributes for this item. See KFileMimeTypeInfo::Attributes
bool isValid ()
| isValid |
[const]
Returns: 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)
friend QDataStream& operator >> (QDataStream& s, KFileMetaInfoItem& )
| operator >> |
friend QDataStream& operator >> (QDataStream& s, KFileMetaInfoGroup& )
| operator >> |
friend QDataStream& operator << (QDataStream& s, const KFileMetaInfoItem& )
| operator << |
friend class KFileMetaInfoGroup | KFileMetaInfoGroup |
void setAdded ()
| setAdded |
[protected]
void setRemoved ()
| setRemoved |
[protected]
void ref ()
| ref |
[protected]
void deref ()
| deref |
[protected]
Data * d | d |
[protected]
Generated by: caleb on tcdevel on Tue Jan 28 12:54:15 2003, using kdoc $. |