Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
flydbentry.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
23struct MapDBEntry;
24class QQmlEngine;
25class FlyDB;
26
27// Qt 6 requires complete types for Q_PROPERTY pointers, OR this macro:
28
37struct DB_AUTOPORT FlyDBEntry : public QObject {
38 Q_OBJECT
39 Q_PROPERTY(QString getName READ getName CONSTANT)
40 Q_PROPERTY(int getInd READ getInd CONSTANT)
41 Q_PROPERTY(MapDBEntry* getToMap READ getToMap CONSTANT)
42
43public:
44 QString getName() const;
45 int getInd() const;
46 MapDBEntry* getToMap() const;
47
48public slots:
49 void qmlProtect(const QQmlEngine* const engine) const;
50
51protected:
52 FlyDBEntry();
53 FlyDBEntry(QJsonValue& data);
54 void deepLink();
55 void qmlRegister() const;
56
57 QString name = "";
58 int ind = 0;
59 MapDBEntry* toMap = nullptr;
60
61 friend class FlyDB;
62};
The fly-destinations database – where Fly can take you, keyed by name.
Definition flydb.h:38
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
int getInd() const
QString getName() const
< Destination name.
void qmlRegister() const
Register with QML.
friend class FlyDB
The owning DB constructs/populates these entries.
Definition flydbentry.h:61
QString name
Backing field (read via getName()).
Definition flydbentry.h:57
int ind
Backing field (read via getInd()).
Definition flydbentry.h:58
MapDBEntry * toMap
Backing field (read via getToMap()).
Definition flydbentry.h:59
MapDBEntry * getToMap() const
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
void deepLink()
Resolve the destination map.
FlyDBEntry()
Empty entry (built by FlyDB).
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56