1 /* 2 * ico.h - kimgio import filter for MS Windows .ico files 3 * 4 * Distributed under the terms of the LGPL 5 * Copyright (c) 2000 Malte Starostik <malte@kde.org> 6 * 7 */ 8 9 // You can use QImageIO::setParameters() to request a specific 10 // Icon out of an .ico file: 11 // 12 // Options consist of a name=value pair and are separated by a semicolon. 13 // Available options are: 14 // size=<size> select the icon that most closely matches <size> (pixels) 15 // default: 32 16 // colors=<num> select the icon that has <num> colors (or comes closest) 17 // default: 1 << display depth or 0 (RGB) if display depth > 8 18 // index=<index> select the indexth icon from the file. If this option 19 // is present, the size and colors options will be ignored. 20 // default: none 21 // If both size and colors are given, size takes precedence. 22 // 23 // The old format is still supported: 24 // the parameters consist of a single string in the form 25 // "<size>[:<colors>]" which correspond to the options above 26 // 27 // If an icon was returned (i.e. the file is valid and the index option 28 // if present was not out of range), the icon's index within the .ico 29 // file is returned in the text tag "X-Index" of the image. 30 // If the icon is in fact a cursor, its hotspot coordinates are returned 31 // in the text tags "X-HotspotX" and "X-HotspotY". 32 33 #ifndef _ICOHANDLER_H_ 34 #define _ICOHANDLER_H_ 35 36 #include <QtGui/QImageIOPlugin> 37 38 class ICOHandler : public QImageIOHandler 39 { 40 public: 41 ICOHandler(); 42 43 bool canRead() const; 44 bool read(QImage *image); 45 bool write(const QImage &image); 46 47 QByteArray name() const; 48 49 static bool canRead(QIODevice *device); 50 }; 51 52 #endif 53