// This file was generated by qtwaylandscanner
// source file is wlr-data-control-unstable-v1.xml

#ifndef QT_WAYLAND_SERVER_WLR_DATA_CONTROL_UNSTABLE_V1
#define QT_WAYLAND_SERVER_WLR_DATA_CONTROL_UNSTABLE_V1

#include "wayland-server-core.h"
#include "wayland-wlr-data-control-unstable-v1-server-protocol.h"
#include <QByteArray>
#include <QMultiMap>
#include <QString>

#include <unistd.h>

#ifndef WAYLAND_VERSION_CHECK
#define WAYLAND_VERSION_CHECK(major, minor, micro) \
    ((WAYLAND_VERSION_MAJOR > (major)) || \
    (WAYLAND_VERSION_MAJOR == (major) && WAYLAND_VERSION_MINOR > (minor)) || \
    (WAYLAND_VERSION_MAJOR == (major) && WAYLAND_VERSION_MINOR == (minor) && WAYLAND_VERSION_MICRO >= (micro)))
#endif

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

namespace QtWaylandServer {
    class  zwlr_data_control_manager_v1
    {
    public:
        zwlr_data_control_manager_v1(struct ::wl_client *client, int id, int version);
        zwlr_data_control_manager_v1(struct ::wl_display *display, int version);
        zwlr_data_control_manager_v1(struct ::wl_resource *resource);
        zwlr_data_control_manager_v1();

        virtual ~zwlr_data_control_manager_v1();

        class Resource
        {
        public:
            Resource() : zwlr_data_control_manager_v1_object(nullptr), handle(nullptr) {}
            virtual ~Resource() {}

            zwlr_data_control_manager_v1 *zwlr_data_control_manager_v1_object;
            zwlr_data_control_manager_v1 *object() { return zwlr_data_control_manager_v1_object; } 
            struct ::wl_resource *handle;

            struct ::wl_client *client() const { return wl_resource_get_client(handle); }
            int version() const { return wl_resource_get_version(handle); }

            static Resource *fromResource(struct ::wl_resource *resource);
        };

        void init(struct ::wl_client *client, int id, int version);
        void init(struct ::wl_display *display, int version);
        void init(struct ::wl_resource *resource);

        Resource *add(struct ::wl_client *client, int version);
        Resource *add(struct ::wl_client *client, int id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int id, int version);

        Resource *resource() { return m_resource; }
        const Resource *resource() const { return m_resource; }

        QMultiMap<struct ::wl_client*, Resource*> resourceMap() { return m_resource_map; }
        const QMultiMap<struct ::wl_client*, Resource*> resourceMap() const { return m_resource_map; }

        bool isGlobalRemoved() const { return m_globalRemovedEvent; }
        void globalRemove();

        bool isGlobal() const { return m_global != nullptr; }
        bool isResource() const { return m_resource != nullptr; }

        static const struct ::wl_interface *interface();
        static QByteArray interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


    protected:
        virtual Resource *zwlr_data_control_manager_v1_allocate();

        virtual void zwlr_data_control_manager_v1_destroy_global();

        virtual void zwlr_data_control_manager_v1_bind_resource(Resource *resource);
        virtual void zwlr_data_control_manager_v1_destroy_resource(Resource *resource);

        virtual void zwlr_data_control_manager_v1_create_data_source(Resource *resource, uint32_t id);
        virtual void zwlr_data_control_manager_v1_get_data_device(Resource *resource, uint32_t id, struct ::wl_resource *seat);
        virtual void zwlr_data_control_manager_v1_destroy(Resource *resource);

    private:
        static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);
        static void destroy_func(struct ::wl_resource *client_resource);
        static void display_destroy_func(struct ::wl_listener *listener, void *data);
        static int deferred_destroy_global_func(void *data);

        Resource *bind(struct ::wl_client *client, uint32_t id, int version);
        Resource *bind(struct ::wl_resource *handle);

        static const struct ::zwlr_data_control_manager_v1_interface m_zwlr_data_control_manager_v1_interface;

        static void handle_create_data_source(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id);
        static void handle_get_data_device(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id,
            struct ::wl_resource *seat);
        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            zwlr_data_control_manager_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

    class  zwlr_data_control_device_v1
    {
    public:
        zwlr_data_control_device_v1(struct ::wl_client *client, int id, int version);
        zwlr_data_control_device_v1(struct ::wl_display *display, int version);
        zwlr_data_control_device_v1(struct ::wl_resource *resource);
        zwlr_data_control_device_v1();

        virtual ~zwlr_data_control_device_v1();

        class Resource
        {
        public:
            Resource() : zwlr_data_control_device_v1_object(nullptr), handle(nullptr) {}
            virtual ~Resource() {}

            zwlr_data_control_device_v1 *zwlr_data_control_device_v1_object;
            zwlr_data_control_device_v1 *object() { return zwlr_data_control_device_v1_object; } 
            struct ::wl_resource *handle;

            struct ::wl_client *client() const { return wl_resource_get_client(handle); }
            int version() const { return wl_resource_get_version(handle); }

            static Resource *fromResource(struct ::wl_resource *resource);
        };

        void init(struct ::wl_client *client, int id, int version);
        void init(struct ::wl_display *display, int version);
        void init(struct ::wl_resource *resource);

        Resource *add(struct ::wl_client *client, int version);
        Resource *add(struct ::wl_client *client, int id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int id, int version);

        Resource *resource() { return m_resource; }
        const Resource *resource() const { return m_resource; }

        QMultiMap<struct ::wl_client*, Resource*> resourceMap() { return m_resource_map; }
        const QMultiMap<struct ::wl_client*, Resource*> resourceMap() const { return m_resource_map; }

        bool isGlobalRemoved() const { return m_globalRemovedEvent; }
        void globalRemove();

        bool isGlobal() const { return m_global != nullptr; }
        bool isResource() const { return m_resource != nullptr; }

        static const struct ::wl_interface *interface();
        static QByteArray interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        enum error {
            error_used_source = 1, // source given to set_selection or set_primary_selection was already used before
        };

        void send_data_offer(struct ::wl_resource *id);
        void send_data_offer(struct ::wl_resource *resource, struct ::wl_resource *id);
        void send_selection(struct ::wl_resource *id);
        void send_selection(struct ::wl_resource *resource, struct ::wl_resource *id);
        void send_finished();
        void send_finished(struct ::wl_resource *resource);
        void send_primary_selection(struct ::wl_resource *id);
        void send_primary_selection(struct ::wl_resource *resource, struct ::wl_resource *id);

    protected:
        virtual Resource *zwlr_data_control_device_v1_allocate();

        virtual void zwlr_data_control_device_v1_destroy_global();

        virtual void zwlr_data_control_device_v1_bind_resource(Resource *resource);
        virtual void zwlr_data_control_device_v1_destroy_resource(Resource *resource);

        virtual void zwlr_data_control_device_v1_set_selection(Resource *resource, struct ::wl_resource *source);
        virtual void zwlr_data_control_device_v1_destroy(Resource *resource);
        virtual void zwlr_data_control_device_v1_set_primary_selection(Resource *resource, struct ::wl_resource *source);

    private:
        static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);
        static void destroy_func(struct ::wl_resource *client_resource);
        static void display_destroy_func(struct ::wl_listener *listener, void *data);
        static int deferred_destroy_global_func(void *data);

        Resource *bind(struct ::wl_client *client, uint32_t id, int version);
        Resource *bind(struct ::wl_resource *handle);

        static const struct ::zwlr_data_control_device_v1_interface m_zwlr_data_control_device_v1_interface;

        static void handle_set_selection(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *source);
        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_primary_selection(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *source);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            zwlr_data_control_device_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

    class  zwlr_data_control_source_v1
    {
    public:
        zwlr_data_control_source_v1(struct ::wl_client *client, int id, int version);
        zwlr_data_control_source_v1(struct ::wl_display *display, int version);
        zwlr_data_control_source_v1(struct ::wl_resource *resource);
        zwlr_data_control_source_v1();

        virtual ~zwlr_data_control_source_v1();

        class Resource
        {
        public:
            Resource() : zwlr_data_control_source_v1_object(nullptr), handle(nullptr) {}
            virtual ~Resource() {}

            zwlr_data_control_source_v1 *zwlr_data_control_source_v1_object;
            zwlr_data_control_source_v1 *object() { return zwlr_data_control_source_v1_object; } 
            struct ::wl_resource *handle;

            struct ::wl_client *client() const { return wl_resource_get_client(handle); }
            int version() const { return wl_resource_get_version(handle); }

            static Resource *fromResource(struct ::wl_resource *resource);
        };

        void init(struct ::wl_client *client, int id, int version);
        void init(struct ::wl_display *display, int version);
        void init(struct ::wl_resource *resource);

        Resource *add(struct ::wl_client *client, int version);
        Resource *add(struct ::wl_client *client, int id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int id, int version);

        Resource *resource() { return m_resource; }
        const Resource *resource() const { return m_resource; }

        QMultiMap<struct ::wl_client*, Resource*> resourceMap() { return m_resource_map; }
        const QMultiMap<struct ::wl_client*, Resource*> resourceMap() const { return m_resource_map; }

        bool isGlobalRemoved() const { return m_globalRemovedEvent; }
        void globalRemove();

        bool isGlobal() const { return m_global != nullptr; }
        bool isResource() const { return m_resource != nullptr; }

        static const struct ::wl_interface *interface();
        static QByteArray interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        enum error {
            error_invalid_offer = 1, // offer sent after wlr_data_control_device.set_selection
        };

        void send_send(const QString &mime_type, int32_t fd);
        void send_send(struct ::wl_resource *resource, const QString &mime_type, int32_t fd);
        void send_cancelled();
        void send_cancelled(struct ::wl_resource *resource);

    protected:
        virtual Resource *zwlr_data_control_source_v1_allocate();

        virtual void zwlr_data_control_source_v1_destroy_global();

        virtual void zwlr_data_control_source_v1_bind_resource(Resource *resource);
        virtual void zwlr_data_control_source_v1_destroy_resource(Resource *resource);

        virtual void zwlr_data_control_source_v1_offer(Resource *resource, const QString &mime_type);
        virtual void zwlr_data_control_source_v1_destroy(Resource *resource);

    private:
        static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);
        static void destroy_func(struct ::wl_resource *client_resource);
        static void display_destroy_func(struct ::wl_listener *listener, void *data);
        static int deferred_destroy_global_func(void *data);

        Resource *bind(struct ::wl_client *client, uint32_t id, int version);
        Resource *bind(struct ::wl_resource *handle);

        static const struct ::zwlr_data_control_source_v1_interface m_zwlr_data_control_source_v1_interface;

        static void handle_offer(
            ::wl_client *client,
            struct wl_resource *resource,
            const char *mime_type);
        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            zwlr_data_control_source_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

    class  zwlr_data_control_offer_v1
    {
    public:
        zwlr_data_control_offer_v1(struct ::wl_client *client, int id, int version);
        zwlr_data_control_offer_v1(struct ::wl_display *display, int version);
        zwlr_data_control_offer_v1(struct ::wl_resource *resource);
        zwlr_data_control_offer_v1();

        virtual ~zwlr_data_control_offer_v1();

        class Resource
        {
        public:
            Resource() : zwlr_data_control_offer_v1_object(nullptr), handle(nullptr) {}
            virtual ~Resource() {}

            zwlr_data_control_offer_v1 *zwlr_data_control_offer_v1_object;
            zwlr_data_control_offer_v1 *object() { return zwlr_data_control_offer_v1_object; } 
            struct ::wl_resource *handle;

            struct ::wl_client *client() const { return wl_resource_get_client(handle); }
            int version() const { return wl_resource_get_version(handle); }

            static Resource *fromResource(struct ::wl_resource *resource);
        };

        void init(struct ::wl_client *client, int id, int version);
        void init(struct ::wl_display *display, int version);
        void init(struct ::wl_resource *resource);

        Resource *add(struct ::wl_client *client, int version);
        Resource *add(struct ::wl_client *client, int id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int id, int version);

        Resource *resource() { return m_resource; }
        const Resource *resource() const { return m_resource; }

        QMultiMap<struct ::wl_client*, Resource*> resourceMap() { return m_resource_map; }
        const QMultiMap<struct ::wl_client*, Resource*> resourceMap() const { return m_resource_map; }

        bool isGlobalRemoved() const { return m_globalRemovedEvent; }
        void globalRemove();

        bool isGlobal() const { return m_global != nullptr; }
        bool isResource() const { return m_resource != nullptr; }

        static const struct ::wl_interface *interface();
        static QByteArray interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        void send_offer(const QString &mime_type);
        void send_offer(struct ::wl_resource *resource, const QString &mime_type);

    protected:
        virtual Resource *zwlr_data_control_offer_v1_allocate();

        virtual void zwlr_data_control_offer_v1_destroy_global();

        virtual void zwlr_data_control_offer_v1_bind_resource(Resource *resource);
        virtual void zwlr_data_control_offer_v1_destroy_resource(Resource *resource);

        virtual void zwlr_data_control_offer_v1_receive(Resource *resource, const QString &mime_type, int32_t fd);
        virtual void zwlr_data_control_offer_v1_destroy(Resource *resource);

    private:
        static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);
        static void destroy_func(struct ::wl_resource *client_resource);
        static void display_destroy_func(struct ::wl_listener *listener, void *data);
        static int deferred_destroy_global_func(void *data);

        Resource *bind(struct ::wl_client *client, uint32_t id, int version);
        Resource *bind(struct ::wl_resource *handle);

        static const struct ::zwlr_data_control_offer_v1_interface m_zwlr_data_control_offer_v1_interface;

        static void handle_receive(
            ::wl_client *client,
            struct wl_resource *resource,
            const char *mime_type,
            int32_t fd);
        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            zwlr_data_control_offer_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
