/*
* kimgio.h -- Declaration of interface to the KDE Image IO library.
* Sirtaj Singh Kang , 23 Sep 1998.
*
* $Id: kimageio_h.html 203394 2003-01-28 18:16:22Z ctennis $
*
* This library is distributed under the conditions of the GNU LGPL.
*/
#ifndef SSK_KIMGIO_H
#define SSK_KIMGIO_H
#include
/**
* Interface to the KDE Image IO plugin architecture.
*
* This library allows KDE applications to read and write images in a
* variety of formats, transparently via the @ref QImage and @ref QPixmap load
* and save methods.
*
* The image processing backends are written as image handlers compatible
* with the @ref QImageIO handler format. The backends are loaded on demand
* when a particular format is requested. Each format can be identified
* by a unique type id string.
*
* @sect Formats
*
* Currently supported formats include:
* @li JPEG
* @li XV
* @li EPS
* @li NETPBM
* @li PNG
* @li TIFF
* @li KRL
*
* @sect Usage
*
* Simply call the @ref KImageIO::registerFormats() static method declared
* in kimgageio.h.
*
* @sect Example
*
*
#include
#include
int main( int argc, char **argv )
{
....
KImageIO::registerFormats();
... // start main program
}
*
*
* @see KImageIO, QPixmap, QImage, QImageIO
* @author Sirtaj Singh Kang
* @version $Id: kimageio_h.html 203394 2003-01-28 18:16:22Z ctennis $
*/
class KImageIO
{
public:
/**
* Possible image file access modes.
*
* Used in various KImageIO static function.
**/
enum Mode { Reading, Writing };
/**
* Registers all KImageIO supported formats.
*/
static void registerFormats();
/**
* Checks if a special type is supported for writing.
* @param the type id of the image type
* @return true if the image format can be written
*/
static bool canWrite(const QString& type);
/**
* Checks if a special type is supported for reading.
* @param the type id of the image type
* @return true if the image format can be read
*/
static bool canRead(const QString& type);
/**
* Returns a list of all KImageIO supported formats.
*
* @param mode Tells whether to retrieve modes that can be read or written.
* @return a list of the type ids
*/
static QStringList types(Mode mode = Writing);
/**
* Returns a list of patterns of all KImageIO supported formats.
*
* These patterns can be passed to @ref KFileDialog::getOpenFileName()
* or @ref KFileDialog::getSaveFileName(), for example.
*
* @param mode Tells whether to retrieve modes that can be read or written.
*/
static QString pattern(Mode mode = Reading);
/**
* Returns the suffix of an image type.
* @param type the type id of the file format
* @return the suffix of the file format or QString::null if it does not
* exist
*/
static QString suffix(const QString& type);
/**
* Returns the type of a MIME type.
* @param mimeType the MIME type to search
* @return type id of the MIME type or QString::null if the MIME type
* is not supported
* @since 3.1
*/
static QString typeForMime(const QString& mimeType);
/**
* Returns the type of given filename.
* @param filename the filename to check
* @return if the file name's suffix is known the type id of the
* file type, otherwise QString::null
*/
static QString type(const QString& filename);
/**
* Returns a list of MIME types for all KImageIO supported formats.
*
* @param mode Tells whether to retrieve modes that can be read or written.
* @return a list if MIME types of the supported formats
*/
static QStringList mimeTypes( Mode _mode = Writing );
/**
* Test to see whether a MIME type is supported to reading/writing.
* @param _mimeType the MIME type to check
* @param _mode Tells whether to check for reading or writing capabilities
* @return true if the type is supported
**/
static bool isSupported( const QString& _mimeType, Mode _mode = Writing );
/**
* Returns the MIME type of @p _filename.
* @param _filename the filename to check
* @return the MIME type of the file, or QString::null
**/
static QString mimeType( const QString& _filename );
};
#endif
Generated by: caleb on tcdevel on Tue Jan 28 12:54:15 2003, using kdoc $. |