/******************************************************************************
 * QSkinny - Copyright (C) The authors
 *           SPDX-License-Identifier: BSD-3-Clause
 *****************************************************************************/

#ifndef QSK_GRAPHIC_IMAGE_PROVIDER_H
#define QSK_GRAPHIC_IMAGE_PROVIDER_H

#include "QskGlobal.h"
#include <qquickimageprovider.h>

class QskGraphic;

class QSK_EXPORT QskGraphicImageProvider : public QQuickImageProvider
{
  public:
    QskGraphicImageProvider( const QString& providerId, ImageType );
    ~QskGraphicImageProvider() override;

    QImage requestImage( const QString& id,
        QSize* size, const QSize& requestedSize ) override;

    QPixmap requestPixmap( const QString& id,
        QSize* size, const QSize& requestedSize ) override;

    QQuickTextureFactory* requestTexture( const QString& id,
        QSize* size, const QSize& requestedSize ) override;

    QString graphicProviderId() const;

  protected:
    const QskGraphic* requestGraphic( const QString& id ) const;

  private:
    Q_DISABLE_COPY( QskGraphicImageProvider )

    const QString m_providerId;
};

#endif
