org.kde.koala
public class KFileMetaInfo extends Object implements QtSupport
UNKNOWN: Meta Information about a file This is the class for objects that hold meta information about a file. The information is kept in form of a system of key/value pairs. See also KFileMetaInfoItem. This information is retrieved from the file through a plugin system, and this class is the main interface to it. If you want to write your own plugin, have a look at KFilePlugin. There are basically two different kinds of meta information: Fixed ones that the plugin knows about (e.g. an mp3 id3v1 tag has a well defined fixed list of fields), and variable keys that exist in mimetypes that support their own key/value system (comments in png files are of this type). Almost every file has fixed keys, but some also have variable keys. The groups and the What enum are not yet supported, but already added to the interface so that adding support doesn't break compatibility. @brief Meta Information about a file
Field Summary | |
---|---|
static int | ContentInfo |
static int | DontCare |
static int | Everything |
static int | ExtenedAttr |
static int | Fastest
This is used to specify what a KFileMetaInfo object should read, so
you can specify if you want to read "expensive" items or not. |
static int | Preferred |
static int | TechnicalInfo |
static int | Thumbnail |
Constructor Summary | |
---|---|
protected | KFileMetaInfo(Class dummy) |
KFileMetaInfo(String path, String mimeType, int what)
The constructor.
creating a KFileMetaInfo item through this will autoload the plugin
belonging to the mimetype and try to get meta information about
the specified file.
| |
KFileMetaInfo(String path, String mimeType) | |
KFileMetaInfo(String path) | |
KFileMetaInfo(KURL url, String mimeType, int what)
Another constructor
Similar to the above, but takes a URL so that meta-data may be retrieved
over other protocols (ftp, etc.) | |
KFileMetaInfo(KURL url, String mimeType) | |
KFileMetaInfo(KURL url) | |
KFileMetaInfo()
Default constructor. | |
KFileMetaInfo(KFileMetaInfo original)
Copy constructor. |
Method Summary | |
---|---|
boolean | addGroup(String name)
Try to add the specified group. |
protected KFileMetaInfoGroup | appendGroup(String name) |
boolean | applyChanges()
This method writes all pending changes of the meta info back to the file.
|
boolean | contains(String key)
Checks whether an item with the given key exists. |
boolean | containsGroup(String key)
Checks whether a group with the given key exists. |
protected void | deref() |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
ArrayList | editableGroups()
Returns the list of groups that you can add or remove from the file. |
protected void | finalize() Deletes the wrapped C++ instance |
KFileMetaInfoGroup | group(String key)
Returns the KFileMetaInfoGroup with the given key. |
ArrayList | groups()
Returns a list of all groups. |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | isEmpty()
Returns false if the object contains data, true if it's empty. |
boolean | isValid()
Returns true if the item is valid, i.e. if actually represents the info
about a file, false if the object is uninitialized. |
KFileMetaInfoItem | item(String key)
Returns the KFileMetaInfoItem with the given key. |
String | mimeType()
Returns the mime type of file. |
KFileMetaInfoGroup | op_at(String key)
Returns the KFileMetaInfoGroup with the given key. |
String | path()
Returns the path of file - or null if file is non-local |
ArrayList | preferredGroups()
Returns a list of the preferred groups. |
ArrayList | preferredKeys()
Returns a list of all preferred keys. |
protected void | ref() |
ArrayList | removedGroups()
Returns a list of removed groups. |
boolean | removeGroup(String name)
Remove the specified group. |
KFileMetaInfoItem | saveItem(String key, String preferredGroup, boolean createGroup)
Saves the item with the given key. |
KFileMetaInfoItem | saveItem(String key, String preferredGroup) |
KFileMetaInfoItem | saveItem(String key) |
ArrayList | supportedGroups()
Returns a list of all supported groups. |
ArrayList | supportedKeys()
Returns a list of supported keys. |
KURL | url()
Returns the url of file |
QVariant | value(String key)
Returns the value with the given key. |
UNKNOWN: This is used to specify what a KFileMetaInfo object should read, so you can specify if you want to read "expensive" items or not.
Parameters: path The file name. This must be the path to a local file. mimeType The name of the file's mimetype. If ommited, the mimetype is autodetected what one or more of the What enum values. It gives some hint to the plugin what information is desired. The plugin may still return more items.
UNKNOWN: This version will nly work for ocal (file:/) files. The constructor.
UNKNOWN: Another constructor
UNKNOWN: Default constructor.
UNKNOWN: Copy constructor.
Parameters: name the name of the group to add
Returns: true if successful, false if not
UNKNOWN: that all non-variable items that belong to this group are automatically added as empty item. Try to add the specified group.
Returns: true if successful, false if not
UNKNOWN: This method writes all pending changes of the meta info back to the file.
key
exists.Parameters: key the key to check
Returns: whether an item for this key
exists.
UNKNOWN: Checks whether an item with the given key
exists.
key
exists.Parameters: key the key to check
Returns: whether a group with this name exists.
UNKNOWN: Checks whether a group with the given key
exists.
Returns: the groups can be added or removed
UNKNOWN: Returns the list of groups that you can add or remove from the file.
key.
Parameters: key the key of the item
Returns: the group. Invalid if there is no group with the given key.
UNKNOWN: Returns the KFileMetaInfoGroup with the given key.
Returns: the keys of the groups that the file has.
UNKNOWN: Returns a list of all groups.
Returns: true if empty, false otherwise
UNKNOWN: Returns false if the object contains data, true if it's empty.
Returns: true if valid, false otherwise
UNKNOWN: Returns true if the item is valid, i.
key.
Parameters: key the key of the item
Returns: the item. Invalid if there is no item with the given key.
UNKNOWN: Returns the KFileMetaInfoItem with the given key.
Returns: the file's mime type
UNKNOWN: Returns the mime type of file.
key.
Parameters: key the key of the item
Returns: the group. Invalid if there is no group with the given key.
UNKNOWN: Returns the KFileMetaInfoGroup with the given key.
Returns: the file's path - or null if file is non-local
UNKNOWN: Returns the path of file - or String.null if file is non-local
Returns: the keys of the preferred groups that the file has.
UNKNOWN: Returns a list of the preferred groups.
Returns: a list of all preferred keys.
UNKNOWN: Returns a list of all preferred keys.
Returns: a pointer to the plugin that belogs to this object's mimetype. It will be auto-loaded if it's currently not loaded
UNKNOWN:
Returns: a list of removed groups.
UNKNOWN: Returns a list of removed groups.
Parameters: name the name of the group to remove
Returns: true if successful, false if not
UNKNOWN: Remove the specified group.
key.
Parameters: key the key of the item preferredGroup the preferred group, or null createGroup true to create the group if necessary
Returns: the saved item
UNKNOWN: Saves the item with the given key.
Returns: the supported keys of the groups that the file has.
UNKNOWN: Returns a list of all supported groups.
Returns: a list of supported keys
UNKNOWN: Returns a list of supported keys.
Returns: the file's url
UNKNOWN: Returns the url of file
key.
Parameters: key the key to retrieve
Returns: the value. Invalid if it does not exist
UNKNOWN: Returns the value with the given key.