ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
ff7tkQuickDataTypes.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 Chris Rizzitello <sithlord48@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <ff7tkquickdatatypes_export.h>
7 #include <QObject>
8 #include <QQmlEngine>
9 
10 #include <ff7tkInfo>
11 #include <FF7Text>
12 #include <FF7Item>
13 #include <FF7Materia>
14 
15 struct FF7TKQUICKDATATYPES_EXPORT Info
16 {
17  Q_GADGET
18  QML_SINGLETON
19  QML_FOREIGN(ff7tkInfo)
20  QML_NAMED_ELEMENT(FF7tkInfo)
21 };
22 
23 
24 struct FF7TKQUICKDATATYPES_EXPORT FF7TextSingleton
25 {
26  Q_GADGET
27  QML_SINGLETON
28  QML_FOREIGN(FF7Text)
29  QML_NAMED_ELEMENT(FF7Text)
30  public:
31  inline static FF7Text *s_singletonInstance = nullptr;
32  static FF7Text* create(QQmlEngine *, QJSEngine*) {
33  QQmlEngine::setObjectOwnership(FF7Text::get(), QQmlEngine::CppOwnership);
34  return FF7Text::get();
35  }
36 };
37 
38 struct FF7TKQUICKDATATYPES_EXPORT FF7ItemSingleton
39 {
40  Q_GADGET
41  QML_SINGLETON
42  QML_FOREIGN(FF7Item)
43  QML_NAMED_ELEMENT(FF7Item)
44  public:
45  inline static FF7Item *s_singletonInstance = nullptr;
46  static FF7Item* create(QQmlEngine *, QJSEngine*) {
47  QQmlEngine::setObjectOwnership(FF7Item::get(), QQmlEngine::CppOwnership);
48  return FF7Item::get();
49  }
50 };
51 
52 struct FF7TKQUICKDATATYPES_EXPORT FF7MateriaSingleton
53 {
54  Q_GADGET
55  QML_SINGLETON
56  QML_FOREIGN(FF7Materia)
57  QML_NAMED_ELEMENT(FF7Materia)
58  public:
59  inline static FF7Materia *s_singletonInstance = nullptr;
60  static FF7Materia* create(QQmlEngine *, QJSEngine*) {
61  QQmlEngine::setObjectOwnership(FF7Materia::get(), QQmlEngine::CppOwnership);
62  return FF7Materia::get();
63  }
64 };
FF7Item::get
static FF7Item * get()
Get the FF7Item Instance.
Definition: FF7Item.cpp:9
Info
Definition: ff7tkQuickDataTypes.h:15
FF7Text::get
static FF7Text * get()
Get the FF7Text Instance.
Definition: FF7Text.cpp:12
FF7MateriaSingleton
Definition: ff7tkQuickDataTypes.h:52
FF7MateriaSingleton::create
static FF7Materia * create(QQmlEngine *, QJSEngine *)
Definition: ff7tkQuickDataTypes.h:60
FF7Materia::get
static FF7Materia * get()
Get the FF7Materia Instance.
Definition: FF7Materia.h:399
FF7Materia
Definition: FF7Materia.h:19
FF7Text
Convert ff7text <-> pc string.
Definition: FF7Text.h:18
FF7ItemSingleton
Definition: ff7tkQuickDataTypes.h:38
FF7TextSingleton::create
static FF7Text * create(QQmlEngine *, QJSEngine *)
Definition: ff7tkQuickDataTypes.h:32
FF7ItemSingleton::create
static FF7Item * create(QQmlEngine *, QJSEngine *)
Definition: ff7tkQuickDataTypes.h:46
FF7TextSingleton
Definition: ff7tkQuickDataTypes.h:24
FF7Item
Information about items in FF7.
Definition: FF7Item.h:20