2 * kimageio.h -- Declaration of interface to the KDE Image IO library.
3 * Copyright (c) 1998 Sirtaj Singh Kang <taj@kde.org>
5 * This library is distributed under the conditions of the GNU LGPL.
11 #include <QtCore/QStringList>
12 #include <QtCore/QString>
14 #include <kio/kio_export.h>
17 * Methods to get information about image format names and
18 * the corresponding mime type. Also, you can get information about supported
19 * image types without loading all the imageformat plugins.
21 * The image processing backends are written as image handlers compatible
22 * with the QImageIOHandler format. The backends are Qt imageformat plugins.
23 * Each format can be identified by a unique type id string.
27 * Currently supported formats include:
28 * @li BMP \<read\> \<write\>
29 * @li EPS \<read\> \<write\>
34 * @li JP2 \<read\> \<write\>
35 * @li JPEG \<read\> \<write\>
36 * @li NETPBM \<read\> \<write\>
37 * @li PCX \<read\> \<write\>
38 * @li PNG \<read\> \<write, only with newer libraries\>
39 * @li TGA \<read\> \<write\>
41 * @li XBM \<read\> \<write\>
42 * @li XPM \<read\> \<write\>
43 * @li XV \<read\> \<write\>
49 * Possible image file access modes.
51 * Used in various KImageIO static function.
53 enum Mode
{ Reading
, Writing
};
56 * Returns a list of patterns of all KImageIO supported formats.
58 * These patterns can be passed to KFileDialog::getOpenFileName()
59 * or KFileDialog::getSaveFileName(), for example.
61 * @param mode Tells whether to retrieve modes that can be read or written.
62 * @return a space-separated list of file globs that describe the
65 KIO_EXPORT QString
pattern(Mode mode
= Reading
);
68 * Returns the type of a MIME type.
69 * @param mimeType the MIME type to search
70 * @return type id(s) of the MIME type or QStringList() if the MIME type
73 KIO_EXPORT QStringList
typeForMime(const QString
& mimeType
);
75 * Returns a list of all KImageIO supported formats.
77 * @param mode Tells whether to retrieve modes that can be read or written.
78 * @return a list of the type ids
80 KIO_EXPORT QStringList
types(Mode mode
= Writing
);
83 * Returns a list of MIME types for all KImageIO supported formats.
85 * @param mode Tells whether to retrieve modes that can be read or written.
86 * @return a list if MIME types of the supported formats
88 KIO_EXPORT QStringList
mimeTypes( Mode mode
= Writing
);
91 * Test to see whether a MIME type is supported to reading/writing.
92 * @param _mimeType the MIME type to check
93 * @param _mode Tells whether to check for reading or writing capabilities
94 * @return true if the type is supported
96 KIO_EXPORT
bool isSupported( const QString
& mimeType
, Mode mode
= Writing
);