// This file was generated by qtwaylandscanner
// source file is text-input-unstable-v3.xml

#ifndef QT_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V3
#define QT_WAYLAND_SERVER_TEXT_INPUT_UNSTABLE_V3

#include "wayland-server-core.h"
#include "wayland-text-input-unstable-v3-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  zwp_text_input_v3
    {
    public:
        zwp_text_input_v3(struct ::wl_client *client, int id, int version);
        zwp_text_input_v3(struct ::wl_display *display, int version);
        zwp_text_input_v3(struct ::wl_resource *resource);
        zwp_text_input_v3();

        virtual ~zwp_text_input_v3();

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

            zwp_text_input_v3 *zwp_text_input_v3_object;
            zwp_text_input_v3 *object() { return zwp_text_input_v3_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 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
            content_hint_on_screen_input_provided = 0x400, // an on-screen way to fill in the input is already provided by the client
            content_hint_no_emoji = 0x800, // prefer not offering emoji support
            content_hint_preedit_shown = 0x1000, // the text input will display preedit text in place
        };

        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 error {
            error_invalid_action = 0, // an invalid or duplicate action was specified
        };

        enum action {
            action_none = 0, // no action
            action_submit = 1, // the action is submitted
        };

        enum preedit_hint {
            preedit_hint_whole = 1, // simple pre-edit text style, typically underlined
            preedit_hint_selection = 2, // hint for a selected piece of text, e.g. per-character navigation and composition
            preedit_hint_prediction = 3, // predicted text, not typed by the user
            preedit_hint_prefix = 4, // prefixed text not being currently edited, e.g. prior to a 'selection' section
            preedit_hint_suffix = 5, // suffixed text not being currently edited, e.g. after a 'selection' section
            preedit_hint_spelling_error = 6, // spelling error
            preedit_hint_compose_error = 7, // wrong composition, e.g. user input that can not be transliterated
        };

        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_action(uint32_t action, uint32_t serial);
        void send_action(struct ::wl_resource *resource, uint32_t action, uint32_t serial);
        void send_language(const QString &language);
        void send_language(struct ::wl_resource *resource, const QString &language);
        void send_preedit_hint(uint32_t start, uint32_t end, uint32_t hint);
        void send_preedit_hint(struct ::wl_resource *resource, uint32_t start, uint32_t end, uint32_t hint);

    protected:
        virtual Resource *zwp_text_input_v3_allocate();

        virtual void zwp_text_input_v3_destroy_global();

        virtual void zwp_text_input_v3_bind_resource(Resource *resource);
        virtual void zwp_text_input_v3_destroy_resource(Resource *resource);

        virtual void zwp_text_input_v3_destroy(Resource *resource);
        virtual void zwp_text_input_v3_enable(Resource *resource);
        virtual void zwp_text_input_v3_disable(Resource *resource);
        virtual void zwp_text_input_v3_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor);
        virtual void zwp_text_input_v3_set_text_change_cause(Resource *resource, uint32_t cause);
        virtual void zwp_text_input_v3_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose);
        virtual void zwp_text_input_v3_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height);
        virtual void zwp_text_input_v3_commit(Resource *resource);
        virtual void zwp_text_input_v3_set_available_actions(Resource *resource, wl_array *available_actions);
        virtual void zwp_text_input_v3_show_input_panel(Resource *resource);
        virtual void zwp_text_input_v3_hide_input_panel(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 ::zwp_text_input_v3_interface m_zwp_text_input_v3_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);
        static void handle_set_available_actions(
            ::wl_client *client,
            struct wl_resource *resource,
            wl_array *available_actions);
        static void handle_show_input_panel(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_hide_input_panel(
            ::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 {
            zwp_text_input_v3 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

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

        virtual ~zwp_text_input_manager_v3();

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

            zwp_text_input_manager_v3 *zwp_text_input_manager_v3_object;
            zwp_text_input_manager_v3 *object() { return zwp_text_input_manager_v3_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 *zwp_text_input_manager_v3_allocate();

        virtual void zwp_text_input_manager_v3_destroy_global();

        virtual void zwp_text_input_manager_v3_bind_resource(Resource *resource);
        virtual void zwp_text_input_manager_v3_destroy_resource(Resource *resource);

        virtual void zwp_text_input_manager_v3_destroy(Resource *resource);
        virtual void zwp_text_input_manager_v3_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);
        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 ::zwp_text_input_manager_v3_interface m_zwp_text_input_manager_v3_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 ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            zwp_text_input_manager_v3 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
