// This file was generated by qtwaylandscanner
// source file is xx-session-management-v1.xml

#ifndef QT_WAYLAND_XX_SESSION_MANAGEMENT_V1
#define QT_WAYLAND_XX_SESSION_MANAGEMENT_V1

#include <QtWaylandClient/private/wayland-xx-session-management-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_XX_SESSION_MANAGEMENT_V1_EXPORT)
#  if defined(QT_SHARED) && !defined(QT_STATIC)
#    if defined(QT_BUILD_WAYLANDCLIENT_LIB)
#      define Q_WAYLAND_CLIENT_XX_SESSION_MANAGEMENT_V1_EXPORT Q_DECL_EXPORT
#    else
#      define Q_WAYLAND_CLIENT_XX_SESSION_MANAGEMENT_V1_EXPORT Q_DECL_IMPORT
#    endif
#  else
#    define Q_WAYLAND_CLIENT_XX_SESSION_MANAGEMENT_V1_EXPORT
#  endif
#endif

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

        virtual ~xx_session_manager_v1();

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

        struct ::xx_session_manager_v1 *object() { return m_xx_session_manager_v1; }
        const struct ::xx_session_manager_v1 *object() const { return m_xx_session_manager_v1; }
        static xx_session_manager_v1 *fromObject(struct ::xx_session_manager_v1 *object);

        bool isInitialized() const;

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

        enum error {
            error_in_use = 1, // a requested session is already in use
        };

        enum reason {
            reason_launch = 1,
            reason_recover = 2,
            reason_session_restore = 3,
        };

        void destroy();
        struct ::xx_session_v1 *get_session(uint32_t reason, const QString &session);

    private:
        struct ::xx_session_manager_v1 *m_xx_session_manager_v1;
    };

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

        virtual ~xx_session_v1();

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

        struct ::xx_session_v1 *object() { return m_xx_session_v1; }
        const struct ::xx_session_v1 *object() const { return m_xx_session_v1; }
        static xx_session_v1 *fromObject(struct ::xx_session_v1 *object);

        bool isInitialized() const;

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

        enum error {
            error_invalid_restore = 1, // restore cannot be performed after initial toplevel commit
            error_name_in_use = 2, // toplevel name is already in used
            error_already_mapped = 3, // toplevel was already mapped when restored
        };

        void destroy();
        void remove();
        struct ::xx_toplevel_session_v1 *add_toplevel(struct ::xdg_toplevel *toplevel, const QString &name);
        struct ::xx_toplevel_session_v1 *restore_toplevel(struct ::xdg_toplevel *toplevel, const QString &name);

    protected:
        virtual void xx_session_v1_created(const QString &id);
        virtual void xx_session_v1_restored();
        virtual void xx_session_v1_replaced();

    private:
        void init_listener();
        static const struct xx_session_v1_listener m_xx_session_v1_listener;
        static void handle_created(
            void *data,
            struct ::xx_session_v1 *object,
            const char *id);
        static void handle_restored(
            void *data,
            struct ::xx_session_v1 *object);
        static void handle_replaced(
            void *data,
            struct ::xx_session_v1 *object);
        struct ::xx_session_v1 *m_xx_session_v1;
    };

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

        virtual ~xx_toplevel_session_v1();

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

        struct ::xx_toplevel_session_v1 *object() { return m_xx_toplevel_session_v1; }
        const struct ::xx_toplevel_session_v1 *object() const { return m_xx_toplevel_session_v1; }
        static xx_toplevel_session_v1 *fromObject(struct ::xx_toplevel_session_v1 *object);

        bool isInitialized() const;

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

        void destroy();
        void remove();

    protected:
        virtual void xx_toplevel_session_v1_restored(struct ::xdg_toplevel *surface);

    private:
        void init_listener();
        static const struct xx_toplevel_session_v1_listener m_xx_toplevel_session_v1_listener;
        static void handle_restored(
            void *data,
            struct ::xx_toplevel_session_v1 *object,
            struct ::xdg_toplevel *surface);
        struct ::xx_toplevel_session_v1 *m_xx_toplevel_session_v1;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
