// 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_PAGEBLOCK
#define LQTG_TYPE_PAGEBLOCK

#include "telegramtypeobject.h"

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

#include <QDataStream>

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

class LIBQTELEGRAMSHARED_EXPORT PageBlock : public TelegramTypeObject
{
public:
    enum PageBlockClassType {
        typePageBlockUnsupported = 0x13567e8a,
        typePageBlockTitle = 0x70abc3fd,
        typePageBlockSubtitle = 0x8ffa9a1f,
        typePageBlockAuthorDate = 0xbaafe5e0,
        typePageBlockHeader = 0xbfd064ec,
        typePageBlockSubheader = 0xf12bb6e1,
        typePageBlockParagraph = 0x467a0766,
        typePageBlockPreformatted = 0xc070d93e,
        typePageBlockFooter = 0x48870999,
        typePageBlockDivider = 0xdb20b188,
        typePageBlockAnchor = 0xce0d37b0,
        typePageBlockList = 0x3a58c7f4,
        typePageBlockBlockquote = 0x263d7c26,
        typePageBlockPullquote = 0x4f4456d3,
        typePageBlockPhoto = 0xe9c69982,
        typePageBlockVideo = 0xd9d71866,
        typePageBlockCover = 0x39f23300,
        typePageBlockEmbed = 0xcde200d1,
        typePageBlockEmbedPost = 0x292c7be9,
        typePageBlockCollage = 0x8b31c4f,
        typePageBlockSlideshow = 0x130c8963,
        typePageBlockChannel = 0xef1751b5,
        typePageBlockAudio = 0x31b81a7f
    };

    PageBlock(PageBlockClassType classType = typePageBlockUnsupported, InboundPkt *in = 0);
    PageBlock(InboundPkt *in);
    PageBlock(const Null&);
    PageBlock(const PageBlock &another);
    virtual ~PageBlock();

    void setAllowScrolling(bool allowScrolling);
    bool allowScrolling() const;

    void setAudioId(qint64 audioId);
    qint64 audioId() const;

    void setAuthorString(const QString &authorString);
    QString authorString() const;

    void setAuthorRichText(const RichText &authorRichText);
    RichText authorRichText() const;

    void setAuthorPhotoId(qint64 authorPhotoId);
    qint64 authorPhotoId() const;

    void setAutoplay(bool autoplay);
    bool autoplay() const;

    void setBlocks(const QList<PageBlock> &blocks);
    QList<PageBlock> blocks() const;

    void setCaption(const RichText &caption);
    RichText caption() const;

    void setChannel(const Chat &channel);
    Chat channel() const;

    void setCover(const PageBlock &cover);
    PageBlock cover() const;

    void setDate(qint32 date);
    qint32 date() const;

    void setFlags(qint32 flags);
    qint32 flags() const;

    void setFullWidth(bool fullWidth);
    bool fullWidth() const;

    void setH(qint32 h);
    qint32 h() const;

    void setHtml(const QString &html);
    QString html() const;

    void setItemsVectorPageBlock(const QList<PageBlock> &itemsVectorPageBlock);
    QList<PageBlock> itemsVectorPageBlock() const;

    void setItemsVectorRichText(const QList<RichText> &itemsVectorRichText);
    QList<RichText> itemsVectorRichText() const;

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

    void setLoop(bool loop);
    bool loop() const;

    void setName(const QString &name);
    QString name() const;

    void setOrdered(bool ordered);
    bool ordered() const;

    void setPhotoId(qint64 photoId);
    qint64 photoId() const;

    void setPosterPhotoId(qint64 posterPhotoId);
    qint64 posterPhotoId() const;

    void setPublishedDate(qint32 publishedDate);
    qint32 publishedDate() const;

    void setText(const RichText &text);
    RichText text() const;

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

    void setVideoId(qint64 videoId);
    qint64 videoId() const;

    void setW(qint32 w);
    qint32 w() const;

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

    void setClassType(PageBlockClassType classType);
    PageBlockClassType classType() const;

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

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

    bool operator ==(const PageBlock &b) const;
    PageBlock &operator =(const PageBlock &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:
    qint64 m_audioId;
    QString m_authorString;
    RichText m_authorRichText;
    qint64 m_authorPhotoId;
    QList<PageBlock> m_blocks;
    RichText m_caption;
    Chat m_channel;
    PageBlock *m_cover;
    qint32 m_date;
    qint32 m_flags;
    qint32 m_h;
    QString m_html;
    QList<PageBlock> m_itemsVectorPageBlock;
    QList<RichText> m_itemsVectorRichText;
    QString m_language;
    QString m_name;
    bool m_ordered;
    qint64 m_photoId;
    qint64 m_posterPhotoId;
    qint32 m_publishedDate;
    RichText m_text;
    QString m_url;
    qint64 m_videoId;
    qint32 m_w;
    qint64 m_webpageId;
    PageBlockClassType m_classType;
};

Q_DECLARE_METATYPE(PageBlock)

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

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

#endif // LQTG_TYPE_PAGEBLOCK
