1/*
2* kimageio.h -- Declaration of interface to the KDE Image IO library.
3* Copyright (c) 1998 Sirtaj Singh Kang <taj@kde.org>
4*
5* This library is distributed under the conditions of the GNU LGPL.
6*/
7
8#ifndef KIO_KIMAGEIO_H
9#define KIO_KIMAGEIO_H
10
11#include <QtCore/QStringList>
12#include <QtCore/QString>
13
14#include <kio/kio_export.h>
15
16/**
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.
20 *
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.
24 *
25 * \b Formats:
26 *
27 * Currently supported formats include:
28 * @li BMP \<read\> \<write\>
29 * @li EPS \<read\> \<write\>
30 * @li EXR \<read\>
31 * @li G3 \<read\>
32 * @li GIF \<read\>
33 * @li ICO \<read\>
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\>
40 * @li TIFF \<read\>
41 * @li XBM \<read\> \<write\>
42 * @li XPM \<read\> \<write\>
43 * @li XV \<read\> \<write\>
44 *
45 */
46namespace KImageIO
47{
48 /**
49 * Possible image file access modes.
50 *
51 * Used in various KImageIO static function.
52 **/
53 enum Mode { Reading, Writing };
54
55 /**
56 * Returns a list of patterns of all KImageIO supported formats.
57 *
58 * These patterns can be passed to KFileDialog::getOpenFileName()
59 * or KFileDialog::getSaveFileName(), for example.
60 *
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
63 * supported formats
64 */
65 KIO_EXPORT QString pattern(Mode mode = Reading);
66
67 /**
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
71 * is not supported
72 */
73 KIO_EXPORT QStringList typeForMime(const QString& mimeType);
74 /**
75 * Returns a list of all KImageIO supported formats.
76 *
77 * @param mode Tells whether to retrieve modes that can be read or written.
78 * @return a list of the type ids
79 */
80 KIO_EXPORT QStringList types(Mode mode = Writing);
81
82 /**
83 * Returns a list of MIME types for all KImageIO supported formats.
84 *
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
87 */
88 KIO_EXPORT QStringList mimeTypes( Mode mode = Writing );
89
90 /**
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
95 **/
96 KIO_EXPORT bool isSupported( const QString& mimeType, Mode mode = Writing );
97}
98
99
100#endif
101