/*
 * AUTOGENERATED - DO NOT EDIT
 *
 * This file is generated from ext-workspace-v1.xml by mir_wayland_generator
 */

#ifndef MIR_FRONTEND_WAYLAND_EXT_WORKSPACE_V1_XML_WRAPPER
#define MIR_FRONTEND_WAYLAND_EXT_WORKSPACE_V1_XML_WRAPPER

#include <optional>

#include "mir/fd.h"
#include <wayland-server-core.h>

#include "mir/wayland/resource.h"
#include "mir/wayland/global.h"

namespace mir
{
namespace wayland
{

class ExtWorkspaceManagerV1;
class ExtWorkspaceGroupHandleV1;
class ExtWorkspaceHandleV1;

class ExtWorkspaceManagerV1 : public Resource
{
public:
    static char const constexpr* interface_name = "ext_workspace_manager_v1";

    static ExtWorkspaceManagerV1* from(struct wl_resource*);

    ExtWorkspaceManagerV1(struct wl_resource* resource, Version<1>);
    virtual ~ExtWorkspaceManagerV1();

    void send_workspace_group_event(struct wl_resource* workspace_group) const;
    void send_workspace_event(struct wl_resource* workspace) const;
    void send_done_event() const;
    void send_finished_event() const;

    void destroy_and_delete() const;

    struct Opcode
    {
        static uint32_t const workspace_group = 0;
        static uint32_t const workspace = 1;
        static uint32_t const done = 2;
        static uint32_t const finished = 3;
    };

    struct Thunks;

    static bool is_instance(wl_resource* resource);

    class Global : public wayland::Global
    {
    public:
        Global(wl_display* display, Version<1>);

        auto interface_name() const -> char const* override;

    private:
        virtual void bind(wl_resource* new_ext_workspace_manager_v1) = 0;
        friend ExtWorkspaceManagerV1::Thunks;
    };

private:
    virtual void commit() = 0;
    virtual void stop() = 0;
};

class ExtWorkspaceGroupHandleV1 : public Resource
{
public:
    static char const constexpr* interface_name = "ext_workspace_group_handle_v1";

    static ExtWorkspaceGroupHandleV1* from(struct wl_resource*);

    ExtWorkspaceGroupHandleV1(ExtWorkspaceManagerV1 const& parent);
    virtual ~ExtWorkspaceGroupHandleV1();

    void send_capabilities_event(uint32_t capabilities) const;
    void send_output_enter_event(struct wl_resource* output) const;
    void send_output_leave_event(struct wl_resource* output) const;
    void send_workspace_enter_event(struct wl_resource* workspace) const;
    void send_workspace_leave_event(struct wl_resource* workspace) const;
    void send_removed_event() const;

    struct GroupCapabilities
    {
        static uint32_t const create_workspace = 1;
    };

    struct Opcode
    {
        static uint32_t const capabilities = 0;
        static uint32_t const output_enter = 1;
        static uint32_t const output_leave = 2;
        static uint32_t const workspace_enter = 3;
        static uint32_t const workspace_leave = 4;
        static uint32_t const removed = 5;
    };

    struct Thunks;

    static bool is_instance(wl_resource* resource);

private:
    virtual void create_workspace(std::string const& workspace) = 0;
    virtual void destroy() {}
};

class ExtWorkspaceHandleV1 : public Resource
{
public:
    static char const constexpr* interface_name = "ext_workspace_handle_v1";

    static ExtWorkspaceHandleV1* from(struct wl_resource*);

    ExtWorkspaceHandleV1(ExtWorkspaceManagerV1 const& parent);
    virtual ~ExtWorkspaceHandleV1();

    void send_id_event(std::string const& id) const;
    void send_name_event(std::string const& name) const;
    void send_coordinates_event(struct wl_array* coordinates) const;
    void send_state_event(uint32_t state) const;
    void send_capabilities_event(uint32_t capabilities) const;
    void send_removed_event() const;

    struct State
    {
        static uint32_t const active = 1;
        static uint32_t const urgent = 2;
        static uint32_t const hidden = 4;
    };

    struct WorkspaceCapabilities
    {
        static uint32_t const activate = 1;
        static uint32_t const deactivate = 2;
        static uint32_t const remove = 4;
        static uint32_t const assign = 8;
    };

    struct Opcode
    {
        static uint32_t const id = 0;
        static uint32_t const name = 1;
        static uint32_t const coordinates = 2;
        static uint32_t const state = 3;
        static uint32_t const capabilities = 4;
        static uint32_t const removed = 5;
    };

    struct Thunks;

    static bool is_instance(wl_resource* resource);

private:
    virtual void destroy() {}
    virtual void activate() = 0;
    virtual void deactivate() = 0;
    virtual void assign(struct wl_resource* workspace_group) = 0;
    virtual void remove() = 0;
};

}
}

#endif // MIR_FRONTEND_WAYLAND_EXT_WORKSPACE_V1_XML_WRAPPER
