6 #ifndef SWIFT_MISC_AVIATION_AIRCRAFTCATEGORY_H
7 #define SWIFT_MISC_AVIATION_AIRCRAFTCATEGORY_H
24 namespace swift::misc::aviation
35 IndexName = CPropertyIndexRef::GlobalIndexCAircraftCategory,
38 IndexLevelStringAndName,
39 IndexLevelStringAndPath,
48 CAircraftCategory(
const QString &name,
const QString &description,
const QString &path,
bool assignable);
51 const QString &
getName()
const {
return m_name; }
54 void setName(
const QString &name) { m_name = name.trimmed(); }
57 QString getNameDbKey()
const;
63 bool matchesName(
const QString &name, Qt::CaseSensitivity cs)
const;
69 void setDescription(
const QString &description) { m_description = description.trimmed(); }
72 const QString &
getPath()
const {
return m_path; }
75 void setLevel(
int l1,
int l2,
int l3);
78 bool isLevel(
int l1,
int l2,
int l3)
const;
81 bool isLevel(
const QList<int> &level)
const;
87 QList<int> getLevel()
const;
96 bool isFirstLevel()
const;
102 QString getLevelString()
const;
105 QString getLevelAndName()
const;
108 QString getLevelAndPath()
const;
111 bool matchesPath(
const QString &path, Qt::CaseSensitivity cs);
114 bool matchesLevel(
int l1,
int l2 = 0,
int l3 = 0)
const;
117 bool matchesLevel(
const QList<int> &level)
const;
135 QString convertToQString(
bool i18n =
false)
const;
153 static CAircraftCategory fromDatabaseJson(
const QJsonObject &json,
const QString &prefix = QString());
157 QString m_description;
159 bool m_assignable =
true;
Non-owning reference to a CPropertyIndex with a subset of its features.
Status messages, e.g. from Core -> GUI.
Mix of the most commonly used mixin classes.
Value object for aircraft categories.
int getSecondLevel() const
Second level.
void setAssignable(bool assignable)
Mark/set assignable.
void setDescription(const QString &description)
Set description.
bool isAssignable() const
Assignable?
const QString & getPath() const
Path.
const QString & getDescription() const
Description.
ColumnIndex
Properties by index.
CAircraftCategory()=default
Default constructor.
int getFirstLevel() const
First level.
const QString & getName() const
Get name.
void setName(const QString &name)
Set name.
Class from which a derived class can inherit datastore-related functions.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...