| 1 | // Copyright (C) 2018 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTEXTUREFILEREADER_H |
| 5 | #define QTEXTUREFILEREADER_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include "qtexturefiledata_p.h" |
| 19 | #include <QString> |
| 20 | #include <QFileInfo> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QIODevice; |
| 25 | class QTextureFileHandler; |
| 26 | |
| 27 | class Q_GUI_EXPORT QTextureFileReader |
| 28 | { |
| 29 | public: |
| 30 | QTextureFileReader(QIODevice *device, const QString &fileName = QString()); //### drop this logname thing? |
| 31 | ~QTextureFileReader(); |
| 32 | |
| 33 | bool canRead(); |
| 34 | QTextureFileData read(); |
| 35 | |
| 36 | // TBD access function to params |
| 37 | // TBD ask for identified fmt |
| 38 | |
| 39 | static QList<QByteArray> supportedFileFormats(); |
| 40 | |
| 41 | private: |
| 42 | bool init(); |
| 43 | QIODevice *m_device = nullptr; |
| 44 | QString m_fileName; |
| 45 | QTextureFileHandler *m_handler = nullptr; |
| 46 | bool checked = false; |
| 47 | }; |
| 48 | |
| 49 | QT_END_NAMESPACE |
| 50 | |
| 51 | |
| 52 | #endif // QTEXTUREFILEREADER_H |
| 53 |
