6 #ifndef SWIFT_MISC_NETWORK_USER_H
7 #define SWIFT_MISC_NETWORK_USER_H
22 namespace swift::misc::network
35 IndexEmail = CPropertyIndexRef::GlobalIndexCUser,
55 CUser(
const QString &
id,
const QString &realname,
const QString &email =
"",
const QString &password =
"",
62 void setRealName(
const QString &realname);
68 void setPassword(
const QString &pw);
71 bool isValid()
const {
return !isNull(); }
74 bool isNull()
const {
return m_realname.isEmpty() && m_id.isEmpty(); }
77 bool hasCredentials()
const {
return this->isValid() && !m_password.isEmpty(); }
83 bool hasId()
const {
return !m_id.isEmpty(); }
95 bool hasValidHomeBase()
const;
98 bool hasValidOrEmptyHomeBase()
const;
101 QString getRealNameAndHomeBase(
const QString &separator = QString(
" "))
const;
104 QString getRealNameAndId()
const;
110 const QString &
getEmail()
const {
return m_email; }
113 void setEmail(
const QString &email);
119 const QString &
getId()
const {
return m_id; }
122 QString get7DigitId()
const;
125 int getIntegerId()
const;
128 bool hasNumericId()
const;
131 void setId(
const QString &
id);
158 void synchronizeData(
CUser &otherUser);
161 void updateMissingParts(
const CUser &otherUser);
164 static bool isValidVatsimId(
const QString &
id);
167 static QString beautifyRealName(
const QString &realName);
170 QString convertToQString(
bool i18n =
false)
const;
174 void deriveHomeBaseFromCallsign();
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
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 encapsulating information of airport ICAO data.
Value object encapsulating information of a callsign.
ColumnIndex
Base class enums.
Value object encapsulating information of a user.
const aviation::CAirportIcaoCode & getHomeBase() const
Homebase.
const QString & getPassword() const
Get password.
bool hasRealName() const
Valid real name?
const QString & getRealName() const
Get full name.
bool isValid() const
Valid user object?
bool hasValidEmail() const
Valid email?
const QString & getId() const
Get id.
const aviation::CCallsign & getCallsign() const
Get associated callsign.
void setHomeBase(const aviation::CAirportIcaoCode &homebase)
Set homebase.
CUser()=default
Default constructor.
bool hasId() const
Valid id?
bool hasHomeBase() const
Has home base?
CIcons::IconIndex toIcon() const
As icon, not implemented by all classes.
bool hasValidVatsimId() const
Has a valid VATSIM id?
const QString & getEmail() const
Get email.
bool hasCredentials() const
Valid credentials?
static bool isValidVatsimId(const QString &id)
Valid VATSIM id.
bool hasCallsign() const
Has associated callsign?
#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 ...