| 1 | // Copyright (C) 2017 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 QTEXTUREFILEHANDLER_P_H |
| 5 | #define QTEXTUREFILEHANDLER_P_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 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | class QTextureFileHandler |
| 23 | { |
| 24 | public: |
| 25 | QTextureFileHandler(QIODevice *device, const QByteArray &logName = QByteArray()) |
| 26 | : m_device(device) |
| 27 | { |
| 28 | m_logName = !logName.isEmpty() ? logName : QByteArrayLiteral("(unknown)" ); |
| 29 | } |
| 30 | virtual ~QTextureFileHandler(); |
| 31 | |
| 32 | virtual QTextureFileData read() = 0; |
| 33 | QIODevice *device() const { return m_device; } |
| 34 | QByteArray logName() const { return m_logName; } |
| 35 | |
| 36 | private: |
| 37 | QIODevice *m_device = nullptr; |
| 38 | QByteArray m_logName; |
| 39 | }; |
| 40 | |
| 41 | QT_END_NAMESPACE |
| 42 | |
| 43 | #endif // QTEXTUREFILEHANDLER_P_H |
| 44 | |