ContentInfo provides information about a content object, including its mime type, and a generic description and icon. More...
Public Member Functions | |
bool | isValid () const |
Determines whether this ContentInfo is valid or not. | |
QString | mimeType () const |
Returns the mime type of this content object. | |
QString | typeDescription () const |
Returns a one-line, localized description of the type of the content object. | |
QString | typeIcon () const |
Returns the name of an icon to represent the type of this content object. | |
ContentInfo (const ContentInfo &other) | |
ContentInfo & | operator= (const ContentInfo &other) |
Static Public Member Functions | |
static ContentInfo | forMime (const QString &mimeType) |
Returns information for the given mime type mimeType. | |
static ContentInfo | forTracker (const QString &trackerUri) |
Returns information for the Tracker object identified by tracker_uri. | |
static ContentInfo | forFile (const QUrl &file) |
Returns information for the file identified by url. | |
static ContentInfo | forData (const QByteArray &arr) |
Returns information for the given bytes. |
ContentInfo provides information about a content object, including its mime type, and a generic description and icon.
ContentInfo ContentInfo::forData | ( | const QByteArray & | bytes | ) | [static] |
Returns information for the given bytes.
The bytes are assumed to be the first few bytes of a content object, and its type is guessed from them.
ContentInfo ContentInfo::forFile | ( | const QUrl & | url | ) | [static] |
Returns information for the file identified by url.
The file does not need to exist. If it does, its content will be used to guess its type; otherwise only the filename will be used.
ContentInfo ContentInfo::forTracker | ( | const QString & | tracker_uri | ) | [static] |
Returns information for the Tracker object identified by tracker_uri.
bool ContentInfo::isValid | ( | ) | const |
Determines whether this ContentInfo is valid or not.
Invalid ContentInfo objects are returned when no information about a object could be found.
Invalid ContentInfo instances can still be accessed, but they will return empty strings for mimeType, typeDescription, and typeIcon.
QString ContentInfo::typeDescription | ( | ) | const |
Returns a one-line, localized description of the type of the content object.
QString ContentInfo::typeIcon | ( | ) | const |
Returns the name of an icon to represent the type of this content object.