org.kde.koala
Class KFileMetaInfoGroup

java.lang.Object
  extended by org.kde.koala.KFileMetaInfoGroup
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KFileMetaInfoGroup
extends java.lang.Object
implements org.kde.qt.QtSupport


Constructor Summary
  KFileMetaInfoGroup()
          Default constructor.
protected KFileMetaInfoGroup(java.lang.Class dummy)
           
  KFileMetaInfoGroup(KFileMetaInfoGroup original)
          Copy constructor
 
Method Summary
 KFileMetaInfoItem addItem(java.lang.String key)
          Add an item to the info.
protected  KFileMetaInfoItem appendItem(java.lang.String key, org.kde.qt.QVariant value)
           
 int attributes()
          Returns the attributes of this item.
 boolean contains(java.lang.String key)
          Checks whether an item with the given key exists.
protected  void deref()
           
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 boolean isEmpty()
          Returns false if the object contains data, true if it's empty.
 boolean isModified()
          Returns true if an item as added or removed from the group.
 boolean isValid()
          Returns true if the item is valid, i.e.
 KFileMetaInfoItem item(int hint)
          Returns the item with the given hint.
 KFileMetaInfoItem item(java.lang.String key)
          This method searches for the specified item.
 java.util.ArrayList keys()
          Returns a list of all keys.
 java.lang.String name()
          The name of this group.
 KFileMetaInfoItem op_at(java.lang.String key)
          Operator for convenience.
 java.util.ArrayList preferredKeys()
          Returns a list of all keys in preference order.
protected  void ref()
           
 java.util.ArrayList removedItems()
          Returns a list of all removed items.
 boolean removeItem(java.lang.String key)
          Remove this item from the meta info of the file.
protected  void setAdded()
           
 java.util.ArrayList supportedKeys()
          Use this method to get a list of keys in the specified group that the plugin knows about.
 boolean supportsVariableKeys()
          Returns true if this group supports adding or removing arbitrary keys, false if not.
 java.lang.String translatedName()
          The translated name of this group.
 org.kde.qt.QVariant value(java.lang.String key)
          Convenience function.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KFileMetaInfoGroup

protected KFileMetaInfoGroup(java.lang.Class dummy)

KFileMetaInfoGroup

public KFileMetaInfoGroup(KFileMetaInfoGroup original)
Copy constructor


KFileMetaInfoGroup

public KFileMetaInfoGroup()
Default constructor. This creates an "invalid" item

Method Detail

isValid

public boolean isValid()
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).

Returns:
true if valid, false if invalid

isEmpty

public boolean isEmpty()
Returns false if the object contains data, true if it's empty. An empty group is a group with no items (amazing, isn't it?).

Returns:
true if empty, false otherwise

isModified

public boolean isModified()
Returns true if an item as added or removed from the group.

Returns:
true if an item was added or removed from the group, otherwise false.

op_at

public KFileMetaInfoItem op_at(java.lang.String key)
Operator for convenience. It does the same as item(), but you cannot specify a group to search in


item

public KFileMetaInfoItem item(java.lang.String key)
This method searches for the specified item.

Parameters:
key - the key of the item to search
Returns:
the specified item if found, an invalid item, if not

item

public KFileMetaInfoItem item(int hint)
Returns the item with the given hint.

Parameters:
hint - the hint of the item
Returns:
the item with the specified hint

value

public org.kde.qt.QVariant value(java.lang.String key)
Convenience function. Returns the value of the specified key. It does the same as item(key).value().

Parameters:
key - the key of the item to search
Returns:
the value with the given key

supportedKeys

public java.util.ArrayList supportedKeys()
Use this method to get a list of keys in the specified group that the plugin knows about. No variable keys. For a group that doesn't support variable keys, all keys that this group may have are returned. For a group that does support them, the non-variable ones are returned. See KFileMetaInfo about variable keys

Returns:
the list of keys supported for this mimetype

supportsVariableKeys

public boolean supportsVariableKeys()
Returns true if this group supports adding or removing arbitrary keys, false if not.

Returns:
true is variable keys are supported, false otherwise

contains

public boolean contains(java.lang.String key)
Checks whether an item with the given key exists.

Returns:
true if an item for this key exists.

keys

public java.util.ArrayList keys()
Returns a list of all keys.

Returns:
a list of all keys in the order they were inserted.

preferredKeys

public java.util.ArrayList preferredKeys()
Returns a list of all keys in preference order.

Returns:
a list of all keys in preference order.

addItem

public KFileMetaInfoItem addItem(java.lang.String key)
Add an item to the info. This is only possible if the specified key is in the supportedKeys list and not yet defined or if the group supports variable keys.

Parameters:
key - the key of the item
Returns:
the KFileMetaInfoItem for the given key

removeItem

public boolean removeItem(java.lang.String key)
Remove this item from the meta info of the file. You cannot query KFileMetaInfo for a removed object, but you can query for a list of removed items with removedItems() if you need to. If you re-add it, its value will be cleared.

Parameters:
key - the key of the removed item
Returns:
true if successful, false otherwise

removedItems

public java.util.ArrayList removedItems()
Returns a list of all removed items.

Returns:
a list of all removed items

name

public java.lang.String name()
The name of this group.

Returns:
the name of this group

translatedName

public java.lang.String translatedName()
The translated name of this group.

Returns:
the translated name of this group

attributes

public int attributes()
Returns the attributes of this item.

Returns:
the attributes

setAdded

protected void setAdded()

appendItem

protected KFileMetaInfoItem appendItem(java.lang.String key,
                                       org.kde.qt.QVariant value)

ref

protected void ref()

deref

protected void deref()

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?