Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
abstractrandomstring.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
20
#include "
../db_autoport.h
"
21
22
class
QQmlEngine;
23
35
class
DB_AUTOPORT
AbstractRandomString
:
public
QObject
36
{
37
Q_OBJECT
38
Q_PROPERTY(
int
getStoreSize
READ
getStoreSize
STORED
false
NOTIFY listChanged)
39
40
signals:
41
// Sort of an exception, the DB is almost entirely read-only but this is an
42
// exception of some moving parts in the DB
43
void
listChanged();
44
45
public
:
46
const
QVector<QString>
getStore
()
const
;
47
int
getStoreSize
()
const
;
48
Q_INVOKABLE
const
QString
getStoreAt
(
const
int
ind)
const
;
49
50
Q_INVOKABLE QString
randomExample
();
51
52
public
slots:
53
// QML accessible methods
54
void
load
();
55
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
56
57
protected
slots:
58
virtual
void
qmlRegister
()
const
= 0;
59
60
protected
:
62
AbstractRandomString
(
const
QString
fileName
);
63
QVector<QString>
store
;
64
const
QString
fileName
;
65
};
AbstractRandomString::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
abstractrandomstring.cpp:49
AbstractRandomString::getStore
const QVector< QString > getStore() const
All strings.
Definition
abstractrandomstring.cpp:60
AbstractRandomString::randomExample
QString randomExample()
A random string from the list.
Definition
abstractrandomstring.cpp:80
AbstractRandomString::AbstractRandomString
AbstractRandomString(const QString fileName)
Definition
abstractrandomstring.cpp:54
AbstractRandomString::getStoreSize
int getStoreSize() const
String count.
Definition
abstractrandomstring.cpp:65
AbstractRandomString::getStoreAt
const QString getStoreAt(const int ind) const
String at ind (for QML).
Definition
abstractrandomstring.cpp:70
AbstractRandomString::fileName
const QString fileName
Asset path (set by the subclass).
Definition
abstractrandomstring.h:64
AbstractRandomString::load
void load()
Load the strings from fileName.
Definition
abstractrandomstring.cpp:32
AbstractRandomString::store
QVector< QString > store
The loaded strings.
Definition
abstractrandomstring.h:63
AbstractRandomString::qmlRegister
virtual void qmlRegister() const =0
Subclass registers its concrete type with QML.
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
projects
db
src
pse-db
entries
abstractrandomstring.h
Generated by
1.17.0