File indexing completed on 2024-06-09 08:45:12

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "libruqolacore_export.h"
0009 #include <QDateTime>
0010 #include <QDebug>
0011 
0012 class LIBRUQOLACORE_EXPORT ServerErrorInfo
0013 {
0014     Q_GADGET
0015 public:
0016     ServerErrorInfo();
0017     ~ServerErrorInfo();
0018 
0019     [[nodiscard]] QString accountName() const;
0020     void setAccountName(const QString &newAccountName);
0021 
0022     [[nodiscard]] QString message() const;
0023     void setMessage(const QString &newMessage);
0024 
0025     [[nodiscard]] QDateTime dateTime() const;
0026     void setDateTime(const QDateTime &newDateTime);
0027 
0028     [[nodiscard]] QString identifier() const;
0029 
0030     [[nodiscard]] QString dateTimeStr() const;
0031 
0032 private:
0033     LIBRUQOLACORE_NO_EXPORT void createUniqueIdentifier();
0034     static quint64 identifierId;
0035     QString mAccountName;
0036     QString mMessage;
0037     QDateTime mDateTime;
0038     QString mIdentifier;
0039     QString mDateTimeStr;
0040 };
0041 Q_DECLARE_TYPEINFO(ServerErrorInfo, Q_RELOCATABLE_TYPE);
0042 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const ServerErrorInfo &t);