Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
fontsearch.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 <QVector>
19
#include <QString>
20
21
#include "
../db_autoport.h
"
22
23
class
FontsDB
;
24
class
FontDBEntry
;
25
class
QQmlEngine;
26
39
class
DB_AUTOPORT
FontSearch
:
public
QObject
40
{
41
Q_OBJECT
42
Q_PROPERTY(
int
fontCount READ
getFontCount
NOTIFY fontCountChanged STORED
false
)
43
44
signals:
45
void
fontCountChanged();
46
47
public
:
48
FontSearch
();
49
50
Q_INVOKABLE
FontSearch
*
startOver
();
51
Q_INVOKABLE
FontSearch
*
clear
();
52
53
// Sets results to the UNION of the selected categories — an entry is kept if
54
// it matches ANY enabled trait (OR, not AND). Nothing enabled → empty.
55
Q_INVOKABLE
FontSearch
*
keepAnyOf
(
bool
normal,
bool
control,
bool
picture,
56
bool
singleChar,
bool
multiChar,
bool
variable);
57
Q_INVOKABLE
FontSearch
*
andShorthand
();
58
Q_INVOKABLE
FontSearch
*
notShorthand
();
59
Q_INVOKABLE
FontSearch
*
andNormal
();
60
Q_INVOKABLE
FontSearch
*
notNormal
();
61
Q_INVOKABLE
FontSearch
*
andControl
();
62
Q_INVOKABLE
FontSearch
*
notControl
();
63
Q_INVOKABLE
FontSearch
*
andPicture
();
64
Q_INVOKABLE
FontSearch
*
notPicture
();
65
Q_INVOKABLE
FontSearch
*
andSingleChar
();
66
Q_INVOKABLE
FontSearch
*
notSingleChar
();
67
Q_INVOKABLE
FontSearch
*
andMultiChar
();
68
Q_INVOKABLE
FontSearch
*
notMultiChar
();
69
Q_INVOKABLE
FontSearch
*
andVariable
();
70
Q_INVOKABLE
FontSearch
*
notVariable
();
71
72
// QML Interface
73
const
QVector<FontDBEntry*>
getFonts
()
const
;
74
int
getFontCount
()
const
;
75
Q_INVOKABLE
const
FontDBEntry
*
fontAt
(
const
int
ind)
const
;
76
77
public
slots:
78
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
79
80
private
slots:
81
void
qmlRegister()
const
;
82
83
private
:
84
QVector<FontDBEntry*> results;
85
};
FontSearch::andVariable
FontSearch * andVariable()
Keep only variable glyphs.
Definition
fontsearch.cpp:217
FontSearch::notNormal
FontSearch * notNormal()
Drop normal glyphs.
Definition
fontsearch.cpp:118
FontSearch::notSingleChar
FontSearch * notSingleChar()
Drop single-char glyphs.
Definition
fontsearch.cpp:184
FontSearch::andPicture
FontSearch * andPicture()
Keep only picture glyphs.
Definition
fontsearch.cpp:151
FontSearch::notShorthand
FontSearch * notShorthand()
Drop shorthand glyphs. Returns this.
Definition
fontsearch.cpp:96
FontSearch::andControl
FontSearch * andControl()
Keep only control glyphs.
Definition
fontsearch.cpp:129
FontSearch::getFontCount
int getFontCount() const
Result count (backs fontCount).
Definition
fontsearch.cpp:244
FontSearch::startOver
FontSearch * startOver()
Reset to all glyphs. Returns this.
Definition
fontsearch.cpp:37
FontSearch::keepAnyOf
FontSearch * keepAnyOf(bool normal, bool control, bool picture, bool singleChar, bool multiChar, bool variable)
OR-union filter (see note). Returns this.
Definition
fontsearch.cpp:60
FontSearch::andNormal
FontSearch * andNormal()
Keep only normal glyphs.
Definition
fontsearch.cpp:107
FontSearch::andMultiChar
FontSearch * andMultiChar()
Keep only multi-char glyphs.
Definition
fontsearch.cpp:195
FontSearch::fontAt
const FontDBEntry * fontAt(const int ind) const
Result ind (for QML).
Definition
fontsearch.cpp:249
FontSearch::getFonts
const QVector< FontDBEntry * > getFonts() const
The current result set.
Definition
fontsearch.cpp:239
FontSearch::notMultiChar
FontSearch * notMultiChar()
Drop multi-char glyphs.
Definition
fontsearch.cpp:206
FontSearch::notPicture
FontSearch * notPicture()
Drop picture glyphs.
Definition
fontsearch.cpp:162
FontSearch::FontSearch
FontSearch()
Start with all glyphs in the result set.
Definition
fontsearch.cpp:31
FontSearch::clear
FontSearch * clear()
Empty the result set. Returns this.
Definition
fontsearch.cpp:52
FontSearch::andShorthand
FontSearch * andShorthand()
Keep only shorthand glyphs. Returns this.
Definition
fontsearch.cpp:85
FontSearch::andSingleChar
FontSearch * andSingleChar()
Keep only single-char glyphs.
Definition
fontsearch.cpp:173
FontSearch::notVariable
FontSearch * notVariable()
Drop variable glyphs.
Definition
fontsearch.cpp:228
FontSearch::notControl
FontSearch * notControl()
Drop control glyphs.
Definition
fontsearch.cpp:140
FontSearch::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
fontsearch.cpp:254
FontsDB
The font database – the in-game character set and the text codec.
Definition
fontsdb.h:50
db_autoport.h
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
DB_AUTOPORT
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
db_autoport.h:37
FontDBEntry
One in-game font character: its code, output text, and classification flags.
Definition
fontdbentry.h:43
projects
db
src
pse-db
util
fontsearch.h
Generated by
1.17.0