// This file generated by libqtelegram-code-generator.
// You can download it from: https://github.com/Aseman-Land/libqtelegram-code-generator
// DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

#ifndef LQTG_TYPE_RICHTEXT
#define LQTG_TYPE_RICHTEXT

#include "telegramtypeobject.h"

#include <QMetaType>
#include <QVariant>
#include "../coretypes.h"

#include <QDataStream>

#include <QString>
#include "richtext.h"
#include <QList>
#include <QtGlobal>

class LIBQTELEGRAMSHARED_EXPORT RichText : public TelegramTypeObject
{
public:
    enum RichTextClassType {
        typeTextEmpty = 0xdc3d824f,
        typeTextPlain = 0x744694e0,
        typeTextBold = 0x6724abc4,
        typeTextItalic = 0xd912a59c,
        typeTextUnderline = 0xc12622c4,
        typeTextStrike = 0x9bf8bb95,
        typeTextFixed = 0x6c3f19b9,
        typeTextUrl = 0x3c2884c1,
        typeTextEmail = 0xde5a0dd6,
        typeTextConcat = 0x7e6260d7
    };

    RichText(RichTextClassType classType = typeTextEmpty, InboundPkt *in = 0);
    RichText(InboundPkt *in);
    RichText(const Null&);
    RichText(const RichText &another);
    virtual ~RichText();

    void setEmail(const QString &email);
    QString email() const;

    void setTextString(const QString &textString);
    QString textString() const;

    void setTextRich(const RichText &textRich);
    RichText textRich() const;

    void setTexts(const QList<RichText> &texts);
    QList<RichText> texts() const;

    void setUrl(const QString &url);
    QString url() const;

    void setWebpageId(qint64 webpageId);
    qint64 webpageId() const;

    void setClassType(RichTextClassType classType);
    RichTextClassType classType() const;

    bool fetch(InboundPkt *in);
    bool push(OutboundPkt *out) const;

    QMap<QString, QVariant> toMap() const;
    static RichText fromMap(const QMap<QString, QVariant> &map);
    static RichText fromJson(const QString &json);

    bool operator ==(const RichText &b) const;
    RichText &operator =(const RichText &b);

    bool operator==(bool stt) const { return isNull() != stt; }
    bool operator!=(bool stt) const { return !operator ==(stt); }

    QByteArray getHash(QCryptographicHash::Algorithm alg = QCryptographicHash::Md5) const;

private:
    QString m_email;
    QString m_textString;
    RichText *m_textRich;
    QList<RichText> m_texts;
    QString m_url;
    qint64 m_webpageId;
    RichTextClassType m_classType;
};

Q_DECLARE_METATYPE(RichText)

QDataStream LIBQTELEGRAMSHARED_EXPORT &operator<<(QDataStream &stream, const RichText &item);
QDataStream LIBQTELEGRAMSHARED_EXPORT &operator>>(QDataStream &stream, RichText &item);

QDebug LIBQTELEGRAMSHARED_EXPORT operator<<(QDebug debug,  const RichText &item);

#endif // LQTG_TYPE_RICHTEXT
