// 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_DIALOG
#define LQTG_TYPE_DIALOG

#include "telegramtypeobject.h"

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

#include <QDataStream>

#include "draftmessage.h"
#include <QtGlobal>
#include "peernotifysettings.h"
#include "peer.h"

class LIBQTELEGRAMSHARED_EXPORT Dialog : public TelegramTypeObject
{
public:
    enum DialogClassType {
        typeDialog = 0x66ffba14
    };

    Dialog(DialogClassType classType = typeDialog, InboundPkt *in = 0);
    Dialog(InboundPkt *in);
    Dialog(const Null&);
    Dialog(const Dialog &another);
    virtual ~Dialog();

    void setDraft(const DraftMessage &draft);
    DraftMessage draft() const;

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

    void setNotifySettings(const PeerNotifySettings &notifySettings);
    PeerNotifySettings notifySettings() const;

    void setPeer(const Peer &peer);
    Peer peer() const;

    void setPinned(bool pinned);
    bool pinned() const;

    void setPts(qint32 pts);
    qint32 pts() const;

    void setReadInboxMaxId(qint32 readInboxMaxId);
    qint32 readInboxMaxId() const;

    void setReadOutboxMaxId(qint32 readOutboxMaxId);
    qint32 readOutboxMaxId() const;

    void setTopMessage(qint32 topMessage);
    qint32 topMessage() const;

    void setUnreadCount(qint32 unreadCount);
    qint32 unreadCount() const;

    void setClassType(DialogClassType classType);
    DialogClassType classType() const;

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

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

    bool operator ==(const Dialog &b) const;
    Dialog &operator =(const Dialog &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:
    DraftMessage m_draft;
    qint32 m_flags;
    PeerNotifySettings m_notifySettings;
    Peer m_peer;
    qint32 m_pts;
    qint32 m_readInboxMaxId;
    qint32 m_readOutboxMaxId;
    qint32 m_topMessage;
    qint32 m_unreadCount;
    DialogClassType m_classType;
};

Q_DECLARE_METATYPE(Dialog)

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

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

#endif // LQTG_TYPE_DIALOG
