// 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_MESSAGEENTITY
#define LQTG_TYPE_MESSAGEENTITY

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include <QString>
#include <QtGlobal>
#include "inputuser.h"

class LIBQTELEGRAMSHARED_EXPORT MessageEntity : public TelegramTypeObject
{
public:
    enum MessageEntityClassType {
        typeMessageEntityUnknown = 0xbb92ba95,
        typeMessageEntityMention = 0xfa04579d,
        typeMessageEntityHashtag = 0x6f635b0d,
        typeMessageEntityBotCommand = 0x6cef8ac7,
        typeMessageEntityUrl = 0x6ed02538,
        typeMessageEntityEmail = 0x64e475c2,
        typeMessageEntityBold = 0xbd610bc9,
        typeMessageEntityItalic = 0x826f8b60,
        typeMessageEntityCode = 0x28a20571,
        typeMessageEntityPre = 0x73924be0,
        typeMessageEntityTextUrl = 0x76a6d327,
        typeMessageEntityMentionName = 0x352dca58,
        typeInputMessageEntityMentionName = 0x208e68c9
    };

    MessageEntity(MessageEntityClassType classType = typeMessageEntityUnknown, InboundPkt *in = 0);
    MessageEntity(InboundPkt *in);
    MessageEntity(const Null&);
    MessageEntity(const MessageEntity &another);
    virtual ~MessageEntity();

    void setLanguage(const QString &language);
    QString language() const;

    void setLength(qint32 length);
    qint32 length() const;

    void setOffset(qint32 offset);
    qint32 offset() const;

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

    void setUserIdInputUser(const InputUser &userIdInputUser);
    InputUser userIdInputUser() const;

    void setUserIdInt(qint32 userIdInt);
    qint32 userIdInt() const;

    void setClassType(MessageEntityClassType classType);
    MessageEntityClassType classType() const;

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

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

    bool operator ==(const MessageEntity &b) const;
    MessageEntity &operator =(const MessageEntity &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_language;
    qint32 m_length;
    qint32 m_offset;
    QString m_url;
    InputUser m_userIdInputUser;
    qint32 m_userIdInt;
    MessageEntityClassType m_classType;
};

Q_DECLARE_METATYPE(MessageEntity)

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

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

#endif // LQTG_TYPE_MESSAGEENTITY
