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

#ifndef QT_WAYLAND_TEXT_INPUT_UNSTABLE_V1
#define QT_WAYLAND_TEXT_INPUT_UNSTABLE_V1

#include <QtWaylandClient/private/wayland-text-input-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")
QT_WARNING_DISABLE_CLANG("-Wmissing-field-initializers")
#if !defined(Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V1_EXPORT)
#  if defined(QT_SHARED) && !defined(QT_STATIC)
#    if defined(QT_BUILD_WAYLANDCLIENT_LIB)
#      define Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V1_EXPORT Q_DECL_EXPORT
#    else
#      define Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V1_EXPORT Q_DECL_IMPORT
#    endif
#  else
#    define Q_WAYLAND_CLIENT_TEXT_INPUT_UNSTABLE_V1_EXPORT
#  endif
#endif

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

        virtual ~zwp_text_input_v1();

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

        struct ::zwp_text_input_v1 *object() { return m_zwp_text_input_v1; }
        const struct ::zwp_text_input_v1 *object() const { return m_zwp_text_input_v1; }
        static zwp_text_input_v1 *fromObject(struct ::zwp_text_input_v1 *object);

        bool isInitialized() const;

        uint32_t version() const;
        static const struct ::wl_interface *interface();

        enum content_hint {
            content_hint_none = 0x0, // no special behaviour
            content_hint_default = 0x7, // auto completion, correction and capitalization
            content_hint_password = 0xc0, // hidden and sensitive text
            content_hint_auto_completion = 0x1, // suggest word completions
            content_hint_auto_correction = 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 password or sensitive_data hint)
            content_purpose_date = 9, // input a date
            content_purpose_time = 10, // input a time
            content_purpose_datetime = 11, // input a date and time
            content_purpose_terminal = 12, // input for a terminal
        };

        enum preedit_style {
            preedit_style_default = 0, // default style for composing text
            preedit_style_none = 1, // style should be the same as in non-composing text
            preedit_style_active = 2,
            preedit_style_inactive = 3,
            preedit_style_highlight = 4,
            preedit_style_underline = 5,
            preedit_style_selection = 6,
            preedit_style_incorrect = 7,
        };

        enum text_direction {
            text_direction_auto = 0, // automatic text direction based on text and language
            text_direction_ltr = 1, // left-to-right
            text_direction_rtl = 2, // right-to-left
        };

        void activate(struct ::wl_seat *seat, struct ::wl_surface *surface);
        void deactivate(struct ::wl_seat *seat);
        void show_input_panel();
        void hide_input_panel();
        void reset();
        void set_surrounding_text(const QString &text, uint32_t cursor, uint32_t anchor);
        void set_content_type(uint32_t hint, uint32_t purpose);
        void set_cursor_rectangle(int32_t x, int32_t y, int32_t width, int32_t height);
        void set_preferred_language(const QString &language);
        void commit_state(uint32_t serial);
        void invoke_action(uint32_t button, uint32_t index);

    protected:
        virtual void zwp_text_input_v1_enter(struct ::wl_surface *surface);
        virtual void zwp_text_input_v1_leave();
        virtual void zwp_text_input_v1_modifiers_map(wl_array *map);
        virtual void zwp_text_input_v1_input_panel_state(uint32_t state);
        virtual void zwp_text_input_v1_preedit_string(uint32_t serial, const QString &text, const QString &commit);
        virtual void zwp_text_input_v1_preedit_styling(uint32_t index, uint32_t length, uint32_t style);
        virtual void zwp_text_input_v1_preedit_cursor(int32_t index);
        virtual void zwp_text_input_v1_commit_string(uint32_t serial, const QString &text);
        virtual void zwp_text_input_v1_cursor_position(int32_t index, int32_t anchor);
        virtual void zwp_text_input_v1_delete_surrounding_text(int32_t index, uint32_t length);
        virtual void zwp_text_input_v1_keysym(uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers);
        virtual void zwp_text_input_v1_language(uint32_t serial, const QString &language);
        virtual void zwp_text_input_v1_text_direction(uint32_t serial, uint32_t direction);

    private:
        void init_listener();
        static const struct zwp_text_input_v1_listener m_zwp_text_input_v1_listener;
        static void handle_enter(
            void *data,
            struct ::zwp_text_input_v1 *object,
            struct ::wl_surface *surface);
        static void handle_leave(
            void *data,
            struct ::zwp_text_input_v1 *object);
        static void handle_modifiers_map(
            void *data,
            struct ::zwp_text_input_v1 *object,
            wl_array *map);
        static void handle_input_panel_state(
            void *data,
            struct ::zwp_text_input_v1 *object,
            uint32_t state);
        static void handle_preedit_string(
            void *data,
            struct ::zwp_text_input_v1 *object,
            uint32_t serial,
            const char *text,
            const char *commit);
        static void handle_preedit_styling(
            void *data,
            struct ::zwp_text_input_v1 *object,
            uint32_t index,
            uint32_t length,
            uint32_t style);
        static void handle_preedit_cursor(
            void *data,
            struct ::zwp_text_input_v1 *object,
            int32_t index);
        static void handle_commit_string(
            void *data,
            struct ::zwp_text_input_v1 *object,
            uint32_t serial,
            const char *text);
        static void handle_cursor_position(
            void *data,
            struct ::zwp_text_input_v1 *object,
            int32_t index,
            int32_t anchor);
        static void handle_delete_surrounding_text(
            void *data,
            struct ::zwp_text_input_v1 *object,
            int32_t index,
            uint32_t length);
        static void handle_keysym(
            void *data,
            struct ::zwp_text_input_v1 *object,
            uint32_t serial,
            uint32_t time,
            uint32_t sym,
            uint32_t state,
            uint32_t modifiers);
        static void handle_language(
            void *data,
            struct ::zwp_text_input_v1 *object,
            uint32_t serial,
            const char *language);
        static void handle_text_direction(
            void *data,
            struct ::zwp_text_input_v1 *object,
            uint32_t serial,
            uint32_t direction);
        struct ::zwp_text_input_v1 *m_zwp_text_input_v1;
    };

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

        virtual ~zwp_text_input_manager_v1();

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

        struct ::zwp_text_input_manager_v1 *object() { return m_zwp_text_input_manager_v1; }
        const struct ::zwp_text_input_manager_v1 *object() const { return m_zwp_text_input_manager_v1; }
        static zwp_text_input_manager_v1 *fromObject(struct ::zwp_text_input_manager_v1 *object);

        bool isInitialized() const;

        uint32_t version() const;
        static const struct ::wl_interface *interface();

        struct ::zwp_text_input_v1 *create_text_input();

    private:
        struct ::zwp_text_input_manager_v1 *m_zwp_text_input_manager_v1;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
