kio Library API Documentation

KFileMimeTypeInfo Class Reference

This class provides information about the capabilities that a KFilePlugin for a given mimetype has. More...

#include <kfilemetainfo.h>

List of all members.

Public Types

enum  Attributes {
  Addable = 1, Removable = 2, Modifiable = 4, Cummulative = 8,
  Averaged = 16, MultiLine = 32, SqueezeText = 64
}
 This enum is used to specify some attributes that an item can have, which fit neither in the Hint nor in the Unit enum. More...

enum  Hint {
  NoHint = 0, Name = 1, Author = 2, Description = 3,
  Width = 4, Height = 5, Size = 6, Bitrate = 7,
  Length = 8, Hidden = 9, Thumbnail = 10
}
 This enum is mainly for items that have a special meaning for some applications. More...

enum  Unit {
  NoUnit = 0, Seconds = 1, MilliSeconds = 2, BitsPerSecond = 3,
  Pixels = 4, Inches = 5, Centimeters = 6, Bytes = 7,
  FramesPerSecond = 8, DotsPerInch = 9, BitsPerPixel = 10, Hertz = 11,
  KiloBytes = 12
}
 This enum exists so that you can specify units for items, which you can usually use for integer items, so an application knows how to display it (e.g. More...


Public Member Functions

QValidatorcreateValidator (const QString &group, const QString &key, QObject *parent=0, const char *name=0) const
 Creates a validator for this item.

QStringList supportedGroups () const
 Returns the list of all groups that the plugin for this mimetype supports.

QStringList translatedGroups () const
 Same as the above function, but returns the strings to display to the user.

QStringList preferredGroups () const
 This returns the list of groups in the preferred order that's specified in the .desktop file.

QString mimeType () const
 Returns the mimetype to which this info belongs.

const GroupInfogroupInfo (const QString &group) const
 Get the group info for a specific group.

QStringList supportedKeys () const
 Return a list of all supported keys without looking for a specific group.

QStringList preferredKeys () const
 Return a list of all supported keys in preference order.

GroupInfoaddGroupInfo (const QString &name, const QString &translatedName)

Public Attributes

QString m_translatedName
QStringList m_supportedKeys
uint m_attr
QDict< ItemInfom_itemDict

Protected Member Functions

 KFileMimeTypeInfo (const QString &mimeType)

Protected Attributes

QDict< GroupInfom_groups
QString m_mimeType
QStringList m_preferredKeys
QStringList m_preferredGroups

Friends

class KFilePlugin
class KFileMetaInfoProvider


Detailed Description

This class provides information about the capabilities that a KFilePlugin for a given mimetype has.

It includes a list of metainfo groups and items together with their type, a prefix, suffix and some other information about how to use, display or edit the items.

Definition at line 47 of file kfilemetainfo.h.


Member Enumeration Documentation

enum KFileMimeTypeInfo::Attributes
 

This enum is used to specify some attributes that an item can have, which fit neither in the Hint nor in the Unit enum.

  • Addable The item or group can be added by a user
  • Removable It can be removed
  • Modifiable Its value can be edited (no meaning for a group)
  • Cummulative If an application wants to display information for more than one file, it may add up the values for this item (e.g. play time of an mp3 file)
  • Averaged Similar to Cummulative, but the average should be calculated instead of the sum
  • MultiLine This attribute says that a string item is likely to be more than one line long, so for editing, a widget capable for multline text should be used
  • SqueezeText If the text for this item is very long, it should be squeezed to the size of the widget where it's displayed
Enumeration values:
MultiLine 
Since:
3.1
SqueezeText 
Since:
3.1

Definition at line 77 of file kfilemetainfo.h.

enum KFileMimeTypeInfo::Hint
 

This enum is mainly for items that have a special meaning for some applications.

  • NoHint No hint
  • Name The name or title of the document
  • Author The one who created the contents of it
  • Description Some information about the document
  • Width A width in pixels
  • Height A height in pixels
  • Size A size in pixels (witdh and height)
  • Bitrate For media files
  • Length The length of the file, also for media files
  • Hidden The item is usually not shown to the user
  • Thumbnail The item is a thumbnail of the file

Definition at line 104 of file kfilemetainfo.h.

enum KFileMimeTypeInfo::Unit
 

This enum exists so that you can specify units for items, which you can usually use for integer items, so an application knows how to display it (e.g.

a time in seconds in a hh:mm:ss form). You can either use one of those units, or if you don't find one that fits, you can add it yourself using a prefix and/or suffix.

  • NoUnit None of the listed units
  • Seconds The item represents a time in seconds
  • MilliSeconds The item represents a time in milliseconds
  • BitsPerSecond A bit rate
  • Pixels For resolutions
  • Inches Sizes
  • Centimeters Sizes
  • Bytes Some data/file size in bytes
  • KiloBytes Some data/file size in kilobytes
  • FramesPerSecond A frame rate
  • DotsPerInch Resolution in DPI
  • BitsPerPixel A bit depth
  • Hertz Sample rates and similar
Enumeration values:
FramesPerSecond 
Since:
3.1
DotsPerInch 
Since:
3.1
BitsPerPixel 
Since:
3.1
Hertz 
Since:
3.1
KiloBytes 
Since:
3.1

Definition at line 139 of file kfilemetainfo.h.


Member Function Documentation

QValidator * KFileMimeTypeInfo::createValidator const QString group,
const QString key,
QObject parent = 0,
const char *  name = 0
const
 

Creates a validator for this item.

Make sure to supply a proper parent argument or delete the validator yourself.

Definition at line 1377 of file kfilemetainfo.cpp.

References KFilePlugin::createValidator(), KStdAccel::key(), mimeType(), and KStdAccel::name().

QStringList KFileMimeTypeInfo::supportedGroups  )  const
 

Returns the list of all groups that the plugin for this mimetype supports.

Returns:
the list of groups

Definition at line 1339 of file kfilemetainfo.cpp.

References QDictIterator::current().

QStringList KFileMimeTypeInfo::translatedGroups  )  const
 

Same as the above function, but returns the strings to display to the user.

Returns:
the list of groups

Definition at line 1349 of file kfilemetainfo.cpp.

References QDictIterator::current().

QStringList KFileMimeTypeInfo::preferredGroups  )  const [inline]
 

This returns the list of groups in the preferred order that's specified in the .desktop file.

Returns:
the list of groups

Definition at line 434 of file kfilemetainfo.h.

QString KFileMimeTypeInfo::mimeType  )  const [inline]
 

Returns the mimetype to which this info belongs.

Definition at line 442 of file kfilemetainfo.h.

Referenced by createValidator().

const KFileMimeTypeInfo::GroupInfo * KFileMimeTypeInfo::groupInfo const QString group  )  const
 

Get the group info for a specific group.

Returns:
a pointer to the info. Don't delete this object!

Definition at line 1326 of file kfilemetainfo.cpp.

References QDict< GroupInfo >::find().

QStringList KFileMimeTypeInfo::supportedKeys  )  const
 

Return a list of all supported keys without looking for a specific group.

Returns:
the list of keys

Definition at line 1359 of file kfilemetainfo.cpp.

References QDictIterator::current().

QStringList KFileMimeTypeInfo::preferredKeys  )  const [inline]
 

Return a list of all supported keys in preference order.

Returns:
the list of keys

Definition at line 468 of file kfilemetainfo.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:15:36 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001