File indexing completed on 2024-05-05 16:08:28

0001 /*
0002 * kimageio.h -- Declaration of interface to the KDE Image IO library.
0003 * Copyright (c) 1998 Sirtaj Singh Kang <taj@kde.org>
0004 *
0005 * This library is distributed under the conditions of the GNU LGPL.
0006 */
0007 
0008 #ifndef KIO_KIMAGEIO_H
0009 #define KIO_KIMAGEIO_H
0010 
0011 #include <QStringList>
0012 #include <QString>
0013 
0014 #include <kdelibs4support_export.h>
0015 
0016 /**
0017  * Methods to get information about image format names and
0018  * the corresponding mime type. Also, you can get information about supported
0019  * image types without loading all the imageformat plugins.
0020  *
0021  * The image processing backends are written as image handlers compatible
0022  * with the QImageIOHandler format. The backends are Qt imageformat plugins.
0023  * Each format can be identified by a unique type id string.
0024  *
0025  * \b Formats:
0026  *
0027  * Currently supported formats include:
0028  * @li BMP     \<read\> \<write\>
0029  * @li EPS     \<read\> \<write\>
0030  * @li EXR     \<read\>
0031  * @li G3      \<read\>
0032  * @li GIF     \<read\>
0033  * @li ICO     \<read\>
0034  * @li JP2     \<read\> \<write\>
0035  * @li JPEG    \<read\> \<write\>
0036  * @li NETPBM  \<read\> \<write\>
0037  * @li PCX     \<read\> \<write\>
0038  * @li PNG     \<read\> \<write, only with newer libraries\>
0039  * @li TGA     \<read\> \<write\>
0040  * @li TIFF    \<read\>
0041  * @li XBM     \<read\> \<write\>
0042  * @li XPM     \<read\> \<write\>
0043  * @li XV      \<read\> \<write\>
0044  *
0045  */
0046 namespace KImageIO
0047 {
0048 /**
0049  * Possible image file access modes.
0050  *
0051  * Used in various KImageIO static function.
0052  **/
0053 enum Mode { Reading, Writing };
0054 
0055 #if !defined(KDELIBS4SUPPORT_NO_DEPRECATED)
0056 /**
0057  * Returns a list of patterns of all KImageIO supported formats.
0058  *
0059  * These patterns can be passed to KFileDialog::getOpenFileName()
0060  * or KFileDialog::getSaveFileName(), for example.
0061  *
0062  * @param mode Tells whether to retrieve modes that can be read or written.
0063  * @return a space-separated list of file globs that describe the
0064  * supported formats
0065  * @deprecated since 5.0, use QIMageReader/QImageWriter::supportedMimeTypes() and
0066  * QFileDialog::setMimeTypeFilters() instead.
0067  */
0068 KDELIBS4SUPPORT_DEPRECATED_EXPORT QString pattern(Mode mode = Reading);
0069 #endif
0070 
0071 #if !defined(KDELIBS4SUPPORT_NO_DEPRECATED)
0072 /**
0073  * Returns the type of a MIME type.
0074  * @param mimeType the MIME type to search
0075  * @return type id(s) of the MIME type or QStringList() if the MIME type
0076  *         is not supported
0077  * @deprecated since 5.0, use QMimeType::suffixes() instead().
0078  */
0079 KDELIBS4SUPPORT_DEPRECATED_EXPORT QStringList typeForMime(const QString &mimeType);
0080 #endif
0081 
0082 #if !defined(KDELIBS4SUPPORT_NO_DEPRECATED)
0083 /**
0084  * Returns a list of all KImageIO supported formats.
0085  *
0086  * @param mode Tells whether to retrieve modes that can be read or written.
0087  * @return a list of the type ids
0088  * @deprecated since 5.0, use QImageReader/QImageWriter::supportedImageFormats() instead.
0089  */
0090 KDELIBS4SUPPORT_DEPRECATED_EXPORT QStringList types(Mode mode = Writing);
0091 #endif
0092 
0093 #if !defined(KDELIBS4SUPPORT_NO_DEPRECATED)
0094 /**
0095  *  Returns a list of MIME types for all KImageIO supported formats.
0096  *
0097  * @param mode Tells whether to retrieve modes that can be read or written.
0098  * @return a list if MIME types of the supported formats
0099  * @deprecated since 5.0, use QImageReader/QImageWriter::supportedMimeTypes() instead.
0100  */
0101 KDELIBS4SUPPORT_DEPRECATED_EXPORT QStringList mimeTypes(Mode mode = Writing);
0102 #endif
0103 
0104 #if !defined(KDELIBS4SUPPORT_NO_DEPRECATED)
0105 /**
0106  * Test to see whether a MIME type is supported to reading/writing.
0107  * @param _mimeType the MIME type to check
0108  * @param _mode Tells whether to check for reading or writing capabilities
0109  * @return true if the type is supported
0110  * @deprecated since 5.0, use QImageReader/QImageWriter::supportedMimeTypes() instead.
0111  **/
0112 KDELIBS4SUPPORT_DEPRECATED_EXPORT bool isSupported(const QString &mimeType, Mode mode = Writing);
0113 #endif
0114 }
0115 
0116 #endif