QmlMaterial 0.1.0
Loading...
Searching...
No Matches
material_shapes.hpp
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtQml/qqmlregistration.h>
5#include <array>
6#include <memory>
7#include "qml_material/shape/rounded_polygon.hpp"
8
9namespace qml_material
10{
11
12class QML_MATERIAL_API MaterialShape : public QObject {
13 Q_OBJECT
14 QML_ELEMENT
15 QML_UNCREATABLE("MaterialShape provides named shape values")
16public:
17 enum Type
18 {
19 None = -1,
20 Circle,
21 Square,
22 Slanted,
23 Arch,
24 Fan,
25 Arrow,
26 SemiCircle,
27 Oval,
28 Pill,
29 Triangle,
30 Diamond,
31 ClamShell,
32 Pentagon,
33 Gem,
34 Sunny,
35 VerySunny,
36 Cookie4Sided,
37 Cookie6Sided,
38 Cookie7Sided,
39 Cookie9Sided,
40 Cookie12Sided,
41 Ghostish,
42 Clover4Leaf,
43 Clover8Leaf,
44 Burst,
45 SoftBurst,
46 Boom,
47 SoftBoom,
48 Flower,
49 Puffy,
50 PuffyDiamond,
51 PixelCircle,
52 PixelTriangle,
53 Bun,
54 Heart
55 };
56 Q_ENUM(Type)
57};
58
59class QML_MATERIAL_API MaterialShapes {
60public:
61 static constexpr int count = 35;
62 static bool isValid(MaterialShape::Type shape);
63 static const RoundedPolygon& polygon(MaterialShape::Type shape, bool radial = false);
64 static std::shared_ptr<const Morph> morph(MaterialShape::Type from, MaterialShape::Type to,
65 bool radial = false);
66 static const std::array<MaterialShape::Type, 7>& loadingSequence();
67};
68
69} // namespace qml_material