summaryrefslogtreecommitdiffstats
path: root/src/qmlandroid/graphics/qqmlandroidcolor_p.h
blob: 5ee08c8e5435e711e5bed06a1d8a047237e7d99f (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
46
47
48
49
50
51
52
53
54
#ifndef QQMLANDROIDCOLOR_P_H
#define QQMLANDROIDCOLOR_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtCore/qobject.h>
#include <QtQml/qqmlengine.h>

QT_BEGIN_NAMESPACE

class QQmlAndroidColor : public QObject
{
    Q_OBJECT
    Q_ENUMS(Constants)

public:
    enum Constants {
        BLACK       = 0xFF000000,
        DKGRAY      = 0xFF444444,
        GRAY        = 0xFF888888,
        LTGRAY      = 0xFFCCCCCC,
        WHITE       = 0xFFFFFFFF,
        RED         = 0xFFFF0000,
        GREEN       = 0xFF00FF00,
        BLUE        = 0xFF0000FF,
        YELLOW      = 0xFFFFFF00,
        CYAN        = 0xFF00FFFF,
        MAGENTA     = 0xFFFF00FF,
        TRANSPARENT = 0
    };

    Q_INVOKABLE static int alpha(int color);
    Q_INVOKABLE static int argb(int alpha, int red, int green, int blue);
    Q_INVOKABLE static int blue(int color);
    Q_INVOKABLE static int green(int color);
    Q_INVOKABLE static int red(int color);
    Q_INVOKABLE static int rgb(int red, int green, int blue);
    Q_INVOKABLE static int name(const QString &name);

    static QObject *provider(QQmlEngine *engine, QJSEngine *scriptEngine);
};

QT_END_NAMESPACE

#endif // QQMLANDROIDCOLOR_P_H