#include <kmimetype.h>
Inheritance diagram for KMimeType:

Public Types | |
| typedef KSharedPtr< KMimeType > | Ptr |
| typedef QValueList< Ptr > | List |
Public Methods | |
| KMimeType (const QString &_fullpath, const QString &_type, const QString &_icon, const QString &_comment, const QStringList &_patterns) | |
| KMimeType (const QString &_fullpath) | |
| KMimeType (KDesktopFile *config) | |
| virtual QString | icon (const QString &, bool) const |
| virtual QString | icon (const KURL &, bool) const |
| virtual QPixmap | pixmap (KIcon::Group _group, int _force_size=0, int _state=0, QString *_path=0L) const |
| virtual QPixmap | pixmap (const KURL &_url, KIcon::Group _group, int _force_size=0, int _state=0, QString *_path=0L) const |
| QString | comment () const |
| virtual QString | comment (const QString &, bool) const |
| virtual QString | comment (const KURL &, bool) const |
| const QStringList & | patterns () const |
| virtual void | load (QDataStream &) |
| virtual void | save (QDataStream &) |
| virtual QVariant | property (const QString &_name) const |
| virtual QStringList | propertyNames () const |
Static Public Methods | |
| QPixmap | pixmapForURL (const KURL &_url, mode_t _mode=0, KIcon::Group _group=KIcon::Desktop, int _force_size=0, int _state=0, QString *_path=0L) |
| QString | iconForURL (const KURL &_url, mode_t _mode=0) |
| QString | favIconForURL (const KURL &url) |
| Ptr | mimeType (const QString &_name) |
| Ptr | findByURL (const KURL &_url, mode_t _mode=0, bool _is_local_file=false, bool _fast_mode=false) |
| Ptr | findByPath (const QString &path, mode_t mode=0, bool fast_mode=false) |
| Ptr | findByContent (const QByteArray &data, int *accuracy=0) |
| Ptr | findByFileContent (const QString &fileName, int *accuracy=0) |
| List | allMimeTypes () |
| const QString & | defaultMimeType () |
Protected Methods | |
| void | init (KDesktopFile *) |
| virtual void | virtual_hook (int id, void *data) |
Static Protected Methods | |
| void | errorMissingMimeType (const QString &_type) |
| void | buildDefaultType () |
| void | checkEssentialMimeTypes () |
Static Protected Attributes | |
| bool | s_bChecked |
The starting point you need is often the static methods. See also KServiceType.
Definition at line 43 of file kmimetype.h.
|
||||||||||||||||||||||||
|
Constructor. You may pass in arguments to create a mimetype with specific properties. |
|
|
Construct a mimetype and take all information from a config file. |
|
|
Construct a mimetype and take all information from a desktop file. |
|
|
Get all the mimetypes. Useful for showing the list of available mimetypes. More memory consuming than the ones above, don't use unless really necessary. |
|
|
This function makes sure that the default mime type exists. |
|
|
This function makes sure that vital mime types are installed. |
|
||||||||||||
|
This function differs from the above only in that a KURL may be provided instead of a QString for convenience. Reimplemented in KFolderType, and KDEDesktopMimeType. Definition at line 178 of file kmimetype.h. |
|
||||||||||||
|
The arguments are unused, but provided so that KMimeType derived classes can use them.
Reimplemented in KFolderType, and KDEDesktopMimeType. Definition at line 172 of file kmimetype.h. |
|
|
Reimplemented from KServiceType. Definition at line 164 of file kmimetype.h. |
|
|
|
|
|
Signal a missing mime type |
|
|
|
|
||||||||||||
|
Tries to find out the MIME type of a data chunk by looking for certain magic numbers and characteristic strings in it. Returns application/octet-stream of the type can not be found this way. If accuracy is not a null pointer, *accuracy is set to the accuracy of the match (which is in the range 0..100). |
|
||||||||||||
|
Tries to find out the MIME type of a file by looking for certain magic numbers and characteristic strings in it. This function is similar to the previous one. Note that the file name is not used for determining the file type, it is just used for loading the file's contents. If accuracy is not a null pointer, *accuracy is set to the accuracy of the match (which is in the range 0..100). |
|
||||||||||||||||
|
Same as findByURL but for local files only - convenience method. Equivalent to KURL u; u.setPath(path); return findByURL( u, mode, true, fast_mode ); |
|
||||||||||||||||||||
|
This function looks at mode_t first. If that does not help it looks at the extension. This is fine for FTP, FILE, TAR and friends, but is not for HTTP ( cgi scripts! ). You should use KRun instead, but this function returns immediately while KRun is async. If no extension matches, then KMimeMagic is used if the URL a local file or "application/octet-stream" is returned otherwise.
|
|
||||||||||||
|
This function differs from the above only in that a KURL may be provided instead of a QString for convenience. Reimplemented in KFolderType, and KDEDesktopMimeType. Definition at line 93 of file kmimetype.h. |
|
||||||||||||
|
Return the filename of the icon associated with the mimetype. The arguments are unused, but provided so that KMimeType-derived classes can use them (e.g. KFolderType uses the URL to return one out of 2 icons)
Reimplemented in KFolderType, and KDEDesktopMimeType. Definition at line 87 of file kmimetype.h. |
|
||||||||||||
|
The same functionality as pixmapForURL, but this method returns the name of the icon to load. You'll have to use KIconLoader to load the pixmap for it. The advantage of this method is that you can store the result, and then use it later on for any kind of size. |
|
|
Load the mimetype from a stream. Reimplemented from KServiceType. |
|
|
Retrieve a pointer to the mime type 0L is never returned. Very important: Don't store the result in a KMimeType* !
|
|
|
Retrieve the list of patterns associated with the MIME Type. Definition at line 183 of file kmimetype.h. |
|
||||||||||||||||||||||||
|
Find the pixmap for a given file of this mimetype. Convenience method that uses icon(), but also locates and load the pixmap.
Reimplemented in KDEDesktopMimeType. |
|
||||||||||||||||||||
|
Use this function only if you don't have a special URL for which you search a pixmap. This function is useful to find out, which icon is usually chosen for a certain mime type. Since no URL is passed, it is impossible to obey icon hints in desktop entries for example.
Reimplemented in KDEDesktopMimeType. Referenced by KDEDesktopMimeType::pixmap(). |
|
||||||||||||||||||||||||||||
|
Convenience method to find the pixmap for a URL Call this one when you don't know the mimetype.
|
|
|
Save the mimetype to a stream. Reimplemented from KServiceType. |
|
|
Returns Definition at line 303 of file kmimetype.h. |
1.2.18