#ifndef QT_WAYLAND_XDG_DECORATION_UNSTABLE_V1
#define QT_WAYLAND_XDG_DECORATION_UNSTABLE_V1

#include "wayland-xdg-decoration-unstable-v1-client-protocol.h"
#include <QByteArray>
#include <QString>

struct wl_registry;

QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers")

namespace QtWayland {
    class  zxdg_decoration_manager_v1
    {
    public:
        zxdg_decoration_manager_v1(struct ::wl_registry *registry, int id, int version);
        zxdg_decoration_manager_v1(struct ::zxdg_decoration_manager_v1 *object);
        zxdg_decoration_manager_v1();

        virtual ~zxdg_decoration_manager_v1();

        void init(struct ::wl_registry *registry, int id, int version);
        void init(struct ::zxdg_decoration_manager_v1 *object);

        struct ::zxdg_decoration_manager_v1 *object() { return m_zxdg_decoration_manager_v1; }
        const struct ::zxdg_decoration_manager_v1 *object() const { return m_zxdg_decoration_manager_v1; }
        static zxdg_decoration_manager_v1 *fromObject(struct ::zxdg_decoration_manager_v1 *object);

        bool isInitialized() const;

        static const struct ::wl_interface *interface();

        void destroy();
        struct ::zxdg_toplevel_decoration_v1 *get_toplevel_decoration(struct ::xdg_toplevel *toplevel);

    private:
        struct ::zxdg_decoration_manager_v1 *m_zxdg_decoration_manager_v1;
    };

    class  zxdg_toplevel_decoration_v1
    {
    public:
        zxdg_toplevel_decoration_v1(struct ::wl_registry *registry, int id, int version);
        zxdg_toplevel_decoration_v1(struct ::zxdg_toplevel_decoration_v1 *object);
        zxdg_toplevel_decoration_v1();

        virtual ~zxdg_toplevel_decoration_v1();

        void init(struct ::wl_registry *registry, int id, int version);
        void init(struct ::zxdg_toplevel_decoration_v1 *object);

        struct ::zxdg_toplevel_decoration_v1 *object() { return m_zxdg_toplevel_decoration_v1; }
        const struct ::zxdg_toplevel_decoration_v1 *object() const { return m_zxdg_toplevel_decoration_v1; }
        static zxdg_toplevel_decoration_v1 *fromObject(struct ::zxdg_toplevel_decoration_v1 *object);

        bool isInitialized() const;

        static const struct ::wl_interface *interface();

        enum error {
            error_unconfigured_buffer = 0, // xdg_toplevel has a buffer attached before configure
            error_already_constructed = 1, // xdg_toplevel already has a decoration object
            error_orphaned = 2 // xdg_toplevel destroyed before the decoration object
        };

        enum mode {
            mode_client_side = 1, // no server-side window decoration
            mode_server_side = 2 // server-side window decoration
        };

        void destroy();
        void set_mode(uint32_t mode);
        void unset_mode();

    protected:
        virtual void zxdg_toplevel_decoration_v1_configure(uint32_t mode);

    private:
        void init_listener();
        static const struct zxdg_toplevel_decoration_v1_listener m_zxdg_toplevel_decoration_v1_listener;
        static void handle_configure(
            void *data,
            struct ::zxdg_toplevel_decoration_v1 *object,
            uint32_t mode);
        struct ::zxdg_toplevel_decoration_v1 *m_zxdg_toplevel_decoration_v1;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
