aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/utils/asset.h
blob: 408131fa57b844036ba5ad8d8b455178b5f284b7 (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
43
44
45
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

namespace QmlDesigner {

class Asset
{
public:
    enum Type { Unknown, Image, FragmentShader, Font, Audio, Video, Texture3D, Effect, Shader };

    Asset(const QString &filePath);

    static const QStringList &supportedImageSuffixes();
    static const QStringList &supportedFragmentShaderSuffixes();
    static const QStringList &supportedShaderSuffixes();
    static const QStringList &supportedFontSuffixes();
    static const QStringList &supportedAudioSuffixes();
    static const QStringList &supportedVideoSuffixes();
    static const QStringList &supportedTexture3DSuffixes();
    static const QStringList &supportedEffectMakerSuffixes();
    static const QSet<QString> &supportedSuffixes();

    const QString suffix() const;
    const QString id() const;
    bool hasSuffix() const;

    Type type() const;
    bool isImage() const;
    bool isFragmentShader() const;
    bool isShader() const;
    bool isFont() const;
    bool isAudio() const;
    bool isVideo() const;
    bool isTexture3D() const;
    bool isEffect() const;
    bool isSupported() const;

private:
    QString m_filePath;
    QString m_suffix;
};

} // namespace QmlDesigner