summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformfileiconengine.h
blob: bd9be21e25283c65158d38433d3485a62b753bca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QANDROIDPLATFORMFILEICONENGINE_H
#define QANDROIDPLATFORMFILEICONENGINE_H

#include <QtCore/qjnitypes.h>

#include <QtGui/qpixmap.h>
#include <QtGui/private/qabstractfileiconengine_p.h>
#include "qandroidplatformiconengine.h"

#ifndef QT_NO_ICON

QT_BEGIN_NAMESPACE

Q_DECLARE_JNI_CLASS(Drawable, "android/graphics/drawable/Drawable")

class QAndroidPlatformFileIconEngine : public QAbstractFileIconEngine
{
public:
    explicit QAndroidPlatformFileIconEngine(const QFileInfo &info, QPlatformTheme::IconOptions opts);
    ~QAndroidPlatformFileIconEngine();

    QList<QSize> availableSizes(QIcon::Mode = QIcon::Normal, QIcon::State = QIcon::Off) override
    { return {{16, 16}, {24, 24}, {48, 48}, {128, 128}}; }

    bool isNull() override;

protected:
    QPixmap filePixmap(const QSize &size, QIcon::Mode, QIcon::State) override;

private:
    std::optional<QtJniTypes::Drawable> m_drawable;
    QPixmap m_pixmap;
};

QT_END_NAMESPACE

#endif // QT_NO_ICON

#endif // QANDROIDPLATFORMFILEICONENGINE_H