1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.gui.imagereader;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.bytearray;
19 import qt.core.coreapplication;
20 import qt.core.iodevice;
21 import qt.core.list;
22 import qt.core.rect;
23 import qt.core.size;
24 import qt.core.string;
25 import qt.core.stringlist;
26 import qt.gui.color;
27 import qt.gui.image;
28 import qt.gui.imageiohandler;
29 import qt.helpers;
30 
31 /+ class QColor;
32 class QIODevice;
33 class QRect;
34 class QSize;
35 class QStringList; +/
36 
37 extern(C++, class) struct QImageReaderPrivate;
38 extern(C++, class) struct /+ Q_GUI_EXPORT +/ QImageReader
39 {
40     /+ Q_DECLARE_TR_FUNCTIONS(QImageReader) +/
41 public:pragma(inline, true) static QString tr(const(char)* sourceText, const(char)* disambiguation=null, int n=-1){return QCoreApplication.translate("QImageReader",sourceText,disambiguation,n);} mixin(QT_DECLARE_DEPRECATED_TR_FUNCTIONS(q{QImageReader}));private:public:
42     enum ImageReaderError {
43         UnknownError,
44         FileNotFoundError,
45         DeviceError,
46         UnsupportedFormatError,
47         InvalidDataError
48     }
49 
50     @disable this();
51     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
52     ref typeof(this) rawConstructor();
53     static typeof(this) create()
54     {
55         typeof(this) r = typeof(this).init;
56         r.rawConstructor();
57         return r;
58     }
59 
60     /+ explicit +/this(QIODevice device, ref const(QByteArray) format = globalInitVar!QByteArray);
61     /+ explicit +/this(ref const(QString) fileName, ref const(QByteArray) format = globalInitVar!QByteArray);
62     ~this();
63 
64     void setFormat(ref const(QByteArray) format);
65     QByteArray format() const;
66 
67     void setAutoDetectImageFormat(bool enabled);
68     bool autoDetectImageFormat() const;
69 
70     void setDecideFormatFromContent(bool ignored);
71     bool decideFormatFromContent() const;
72 
73     void setDevice(QIODevice device);
74     QIODevice device() const;
75 
76     void setFileName(ref const(QString) fileName);
77     QString fileName() const;
78 
79     QSize size() const;
80 
81     QImage.Format imageFormat() const;
82 
83     QStringList textKeys() const;
84     QString text(ref const(QString) key) const;
85 
86     void setClipRect(ref const(QRect) rect);
87     QRect clipRect() const;
88 
89     void setScaledSize(ref const(QSize) size);
90     QSize scaledSize() const;
91 
92     void setQuality(int quality);
93     int quality() const;
94 
95     void setScaledClipRect(ref const(QRect) rect);
96     QRect scaledClipRect() const;
97 
98     void setBackgroundColor(ref const(QColor) color);
99     QColor backgroundColor() const;
100 
101     bool supportsAnimation() const;
102 
103     QImageIOHandler.Transformations transformation() const;
104 
105     void setAutoTransform(bool enabled);
106     bool autoTransform() const;
107 
108 /+ #if QT_DEPRECATED_SINCE(5, 15) +/
109     /+ QT_DEPRECATED_VERSION_X_5_15("Use QColorSpace instead") +/
110         void setGamma(float gamma);
111     /+ QT_DEPRECATED_VERSION_X_5_15("Use QColorSpace instead") +/
112         float gamma() const;
113 /+ #endif +/
114 
115     QByteArray subType() const;
116     QList!(QByteArray) supportedSubTypes() const;
117 
118     bool canRead() const;
119     QImage read();
120     bool read(QImage* image);
121 
122     bool jumpToNextImage();
123     bool jumpToImage(int imageNumber);
124     int loopCount() const;
125     int imageCount() const;
126     int nextImageDelay() const;
127     int currentImageNumber() const;
128     QRect currentImageRect() const;
129 
130     ImageReaderError error() const;
131     QString errorString() const;
132 
133     bool supportsOption(QImageIOHandler.ImageOption option) const;
134 
135     static QByteArray imageFormat(ref const(QString) fileName);
136     static QByteArray imageFormat(QIODevice device);
137     static QList!(QByteArray) supportedImageFormats();
138     static QList!(QByteArray) supportedMimeTypes();
139     static QList!(QByteArray) imageFormatsForMimeType(ref const(QByteArray) mimeType);
140 
141 private:
142     /+ Q_DISABLE_COPY(QImageReader) +/
143 @disable this(this);
144 /+this(ref const(QImageReader));+//+ref QImageReader operator =(ref const(QImageReader));+/    QImageReaderPrivate* d;
145 }
146