// This file was generated by qtwaylandscanner
// source file is /build/qt6-wayland/src/qtwayland-everywhere-src-6.5.3/src/compositor/../3rdparty/protocol/text-input-unstable-v4-wip.xml

#ifndef QT_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V4_WIP
#define QT_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V4_WIP

#include "wayland-server-core.h"
#include <QtWaylandCompositor/private/wayland-text-input-unstable-v4-wip-server-protocol.h>
#include <QByteArray>
#include <QMultiMap>
#include <QString>

#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")
#if !defined(Q_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V4_WIP_EXPORT)
#  if defined(QT_SHARED) && !defined(QT_STATIC)
#    if defined(QT_BUILD_WAYLANDCOMPOSITOR_LIB)
#      define Q_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V4_WIP_EXPORT Q_DECL_EXPORT
#    else
#      define Q_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V4_WIP_EXPORT Q_DECL_IMPORT
#    endif
#  else
#    define Q_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V4_WIP_EXPORT
#  endif
#endif

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

        virtual ~zwp_text_input_v4();

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

            zwp_text_input_v4 *zwp_text_input_v4_object;
            zwp_text_input_v4 *object() { return zwp_text_input_v4_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, uint32_t 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, uint32_t id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t 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 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 change_cause {
            change_cause_input_method = 0, // input method caused the change
            change_cause_other = 1, // something else than the input method caused the change
        };

        enum content_hint {
            content_hint_none = 0x0, // no special behavior
            content_hint_completion = 0x1, // suggest word completions
            content_hint_spellcheck = 0x2, // suggest word corrections
            content_hint_auto_capitalization = 0x4, // switch to uppercase letters at the start of a sentence
            content_hint_lowercase = 0x8, // prefer lowercase letters
            content_hint_uppercase = 0x10, // prefer uppercase letters
            content_hint_titlecase = 0x20, // prefer casing for titles and headings (can be language dependent)
            content_hint_hidden_text = 0x40, // characters should be hidden
            content_hint_sensitive_data = 0x80, // typed text should not be stored
            content_hint_latin = 0x100, // just Latin characters should be entered
            content_hint_multiline = 0x200, // the text input is multiline
        };

        enum content_purpose {
            content_purpose_normal = 0, // default input, allowing all characters
            content_purpose_alpha = 1, // allow only alphabetic characters
            content_purpose_digits = 2, // allow only digits
            content_purpose_number = 3, // input a number (including decimal separator and sign)
            content_purpose_phone = 4, // input a phone number
            content_purpose_url = 5, // input an URL
            content_purpose_email = 6, // input an email address
            content_purpose_name = 7, // input a name of a person
            content_purpose_password = 8, // input a password (combine with sensitive_data hint)
            content_purpose_pin = 9, // input is a numeric password (combine with sensitive_data hint)
            content_purpose_date = 10, // input a date
            content_purpose_time = 11, // input a time
            content_purpose_datetime = 12, // input a date and time
            content_purpose_terminal = 13, // input for a terminal
        };

        enum commit_mode {
            commit_mode_clear = 0, // pre-edit text is cleared
            commit_mode_commit = 1, // pre-edit text is committed
        };

        void send_enter(struct ::wl_resource *surface);
        void send_enter(struct ::wl_resource *resource, struct ::wl_resource *surface);
        void send_leave(struct ::wl_resource *surface);
        void send_leave(struct ::wl_resource *resource, struct ::wl_resource *surface);
        void send_preedit_string(const QString &text, int32_t cursor_begin, int32_t cursor_end);
        void send_preedit_string(struct ::wl_resource *resource, const QString &text, int32_t cursor_begin, int32_t cursor_end);
        void send_commit_string(const QString &text);
        void send_commit_string(struct ::wl_resource *resource, const QString &text);
        void send_delete_surrounding_text(uint32_t before_length, uint32_t after_length);
        void send_delete_surrounding_text(struct ::wl_resource *resource, uint32_t before_length, uint32_t after_length);
        void send_done(uint32_t serial);
        void send_done(struct ::wl_resource *resource, uint32_t serial);
        void send_preedit_commit_mode(uint32_t mode);
        void send_preedit_commit_mode(struct ::wl_resource *resource, uint32_t mode);

    protected:
        virtual Resource *zwp_text_input_v4_allocate();

        virtual void zwp_text_input_v4_bind_resource(Resource *resource);
        virtual void zwp_text_input_v4_destroy_resource(Resource *resource);

        virtual void zwp_text_input_v4_destroy(Resource *resource);
        virtual void zwp_text_input_v4_enable(Resource *resource);
        virtual void zwp_text_input_v4_disable(Resource *resource);
        virtual void zwp_text_input_v4_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor);
        virtual void zwp_text_input_v4_set_text_change_cause(Resource *resource, uint32_t cause);
        virtual void zwp_text_input_v4_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose);
        virtual void zwp_text_input_v4_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height);
        virtual void zwp_text_input_v4_commit(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);

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

        static const struct ::zwp_text_input_v4_interface m_zwp_text_input_v4_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_enable(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_disable(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_surrounding_text(
            ::wl_client *client,
            struct wl_resource *resource,
            const char *text,
            int32_t cursor,
            int32_t anchor);
        static void handle_set_text_change_cause(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t cause);
        static void handle_set_content_type(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t hint,
            uint32_t purpose);
        static void handle_set_cursor_rectangle(
            ::wl_client *client,
            struct wl_resource *resource,
            int32_t x,
            int32_t y,
            int32_t width,
            int32_t height);
        static void handle_commit(
            ::wl_client *client,
            struct wl_resource *resource);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct DisplayDestroyedListener : ::wl_listener {
            zwp_text_input_v4 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

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

        virtual ~zwp_text_input_manager_v4();

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

            zwp_text_input_manager_v4 *zwp_text_input_manager_v4_object;
            zwp_text_input_manager_v4 *object() { return zwp_text_input_manager_v4_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, uint32_t 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, uint32_t id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t 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 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 *zwp_text_input_manager_v4_allocate();

        virtual void zwp_text_input_manager_v4_bind_resource(Resource *resource);
        virtual void zwp_text_input_manager_v4_destroy_resource(Resource *resource);

        virtual void zwp_text_input_manager_v4_destroy(Resource *resource);
        virtual void zwp_text_input_manager_v4_get_text_input(Resource *resource, uint32_t id, struct ::wl_resource *seat);

    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);

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

        static const struct ::zwp_text_input_manager_v4_interface m_zwp_text_input_manager_v4_interface;

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

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct DisplayDestroyedListener : ::wl_listener {
            zwp_text_input_manager_v4 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
