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

#ifndef QT_WAYLAND_XDG_SESSION_MANAGEMENT_V1
#define QT_WAYLAND_XDG_SESSION_MANAGEMENT_V1

#include <QtWaylandClient/private/wayland-xdg-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_XDG_SESSION_MANAGEMENT_V1_EXPORT)
#  if defined(QT_SHARED) && !defined(QT_STATIC)
#    if defined(QT_BUILD_WAYLANDCLIENT_LIB)
#      define Q_WAYLAND_CLIENT_XDG_SESSION_MANAGEMENT_V1_EXPORT Q_DECL_EXPORT
#    else
#      define Q_WAYLAND_CLIENT_XDG_SESSION_MANAGEMENT_V1_EXPORT Q_DECL_IMPORT
#    endif
#  else
#    define Q_WAYLAND_CLIENT_XDG_SESSION_MANAGEMENT_V1_EXPORT
#  endif
#endif

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

        virtual ~xdg_session_manager_v1();

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

        struct ::xdg_session_manager_v1 *object() { return m_xdg_session_manager_v1; }
        const struct ::xdg_session_manager_v1 *object() const { return m_xdg_session_manager_v1; }
        static xdg_session_manager_v1 *fromObject(struct ::xdg_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
            error_invalid_session_id = 2, // invalid session identifier
        };

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

        void destroy();
        struct ::xdg_session_v1 *get_session(uint32_t reason, const QString &session_id);

    private:
        struct ::xdg_session_manager_v1 *m_xdg_session_manager_v1;
    };

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

        virtual ~xdg_session_v1();

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

        struct ::xdg_session_v1 *object() { return m_xdg_session_v1; }
        const struct ::xdg_session_v1 *object() const { return m_xdg_session_v1; }
        static xdg_session_v1 *fromObject(struct ::xdg_session_v1 *object);

        bool isInitialized() const;

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

        enum error {
            error_name_in_use = 1, // toplevel name is already in use
            error_already_mapped = 2, // toplevel was already mapped when restored
            error_invalid_name = 3, // provided toplevel name is invalid
        };

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

    protected:
        virtual void xdg_session_v1_created(const QString &session_id);
        virtual void xdg_session_v1_restored();
        virtual void xdg_session_v1_replaced();

    private:
        void init_listener();
        static const struct xdg_session_v1_listener m_xdg_session_v1_listener;
        static void handle_created(
            void *data,
            struct ::xdg_session_v1 *object,
            const char *session_id);
        static void handle_restored(
            void *data,
            struct ::xdg_session_v1 *object);
        static void handle_replaced(
            void *data,
            struct ::xdg_session_v1 *object);
        struct ::xdg_session_v1 *m_xdg_session_v1;
    };

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

        virtual ~xdg_toplevel_session_v1();

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

        struct ::xdg_toplevel_session_v1 *object() { return m_xdg_toplevel_session_v1; }
        const struct ::xdg_toplevel_session_v1 *object() const { return m_xdg_toplevel_session_v1; }
        static xdg_toplevel_session_v1 *fromObject(struct ::xdg_toplevel_session_v1 *object);

        bool isInitialized() const;

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

        void destroy();
        void rename(const QString &name);

    protected:
        virtual void xdg_toplevel_session_v1_restored();

    private:
        void init_listener();
        static const struct xdg_toplevel_session_v1_listener m_xdg_toplevel_session_v1_listener;
        static void handle_restored(
            void *data,
            struct ::xdg_toplevel_session_v1 *object);
        struct ::xdg_toplevel_session_v1 *m_xdg_toplevel_session_v1;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
