Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
fontdbentry.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Twilight
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15*/
16#pragma once
17#include <QObject>
18#include <QString>
19#include <QJsonValue>
20
21#include "../db_autoport.h"
22
23class QQmlEngine;
24class FontsDB;
25
26// With amazing help of Quicktype!!!
27// https://app.quicktype.io
28
29// There are 255 font options although most of them are "invalid" and thus
30// use the tilemap.
31
43struct DB_AUTOPORT FontDBEntry : public QObject {
44 Q_OBJECT
45 Q_PROPERTY(int ind READ getInd CONSTANT)
46 Q_PROPERTY(QString name READ getName CONSTANT)
47 Q_PROPERTY(bool shorthand READ getShorthand CONSTANT)
48 Q_PROPERTY(bool picture READ getPicture CONSTANT)
49 Q_PROPERTY(int length READ getLength CONSTANT)
50 Q_PROPERTY(QString alias READ getAlias CONSTANT)
51 Q_PROPERTY(QString tip READ getTip CONSTANT)
52 Q_PROPERTY(bool control READ getControl CONSTANT)
53 Q_PROPERTY(bool multiChar READ getMultiChar CONSTANT)
54 Q_PROPERTY(bool variable READ getVariable CONSTANT)
55 Q_PROPERTY(bool singleChar READ getSingleChar CONSTANT)
56 Q_PROPERTY(bool normal READ getNormal CONSTANT)
57
58public:
59 int getInd() const;
60 const QString getName() const;
61 bool getShorthand() const;
62 bool getPicture() const;
63 int getLength() const;
64 const QString getAlias() const;
65 const QString getTip() const;
66 bool getControl() const;
67 bool getMultiChar() const;
68 bool getVariable() const;
69 bool getSingleChar() const;
70 bool getNormal() const;
71
72public slots:
73 void qmlProtect(const QQmlEngine* const engine) const;
74
75protected:
76 FontDBEntry();
77 FontDBEntry(const QJsonValue& data);
78 void qmlRegister() const;
79
80 // Optional values are only present when true, so we simplify things
81 // and mark then false unless they're present skipping dealing with variant
82
83 int ind = 0; // Font Code
84 QString name = ""; // Font Output
85 bool shorthand = false; // Is Font Output shorthand for longer output?
86 bool picture = false; // Does this use the tilemap and not the font
87 int length = 0; // Font output length or potentially maximum length
88 QString alias = ""; // Alternate font display name
89 QString tip = ""; // Font details
90 bool control = false; // Is this a control character
91 bool multiChar = false; // Does this output a length greater than 1
92 bool variable = false; // Does this output a variable
93 bool singleChar = false; // Does this output a single char
94 bool normal = false; // Would this be an in-game accessible font char
95
96 friend class FontsDB;
97 friend class FontSearch; // reads filter fields in deepLink
98};
The font database – the in-game character set and the text codec.
Definition fontsdb.h:50
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition db_autoport.h:37
bool singleChar
Definition fontdbentry.h:93
bool getPicture() const
void qmlRegister() const
Register with QML.
const QString getTip() const
int getInd() const
< Font code.
bool getControl() const
QString alias
Definition fontdbentry.h:88
QString name
Definition fontdbentry.h:84
const QString getName() const
int getLength() const
friend class FontsDB
Definition fontdbentry.h:96
bool getNormal() const
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
bool getSingleChar() const
bool getMultiChar() const
FontDBEntry()
Empty entry (built by FontsDB).
friend class FontSearch
Definition fontdbentry.h:97
bool getVariable() const
const QString getAlias() const
QString tip
Definition fontdbentry.h:89
bool getShorthand() const