From c45004b73bb045328a724d1d860df6d1515af6d4 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 23 May 2025 13:51:10 +0200 Subject: lib: split out header files --- lib/include/turnsmm/turn-order.hpp | 89 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 lib/include/turnsmm/turn-order.hpp (limited to 'lib/include/turnsmm/turn-order.hpp') diff --git a/lib/include/turnsmm/turn-order.hpp b/lib/include/turnsmm/turn-order.hpp new file mode 100644 index 0000000..5b8deb9 --- /dev/null +++ b/lib/include/turnsmm/turn-order.hpp @@ -0,0 +1,89 @@ +/* + * SPDX-FileCopyrightText: 2025 Felix Morgner + * SPDX-License-Identifier: LGPL-2.1-only + */ + +#ifndef TURNSMM_TURN_ORDER_HPP +#define TURNSMM_TURN_ORDER_HPP + +#include "turns-turn-order.h" +#include "turnsmm/participant.hpp" + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +namespace Turns +{ + + class TurnOrder final : public Glib::Object, + public Gio::ListModel + { + public: + using BaseClassType = TurnsTurnOrderClass; + using BaseObjectType = TurnsTurnOrder; + using CppClassType = class TurnOrder_Class; + using CppObjectType = TurnOrder; + + enum struct SortMode : guint + { + Descending, + Ascending, + }; + + auto static get_base_type() -> GType; + auto static get_type() -> GType; + + TurnOrder(); + + [[nodiscard]] auto gobj() noexcept -> BaseObjectType *; + [[nodiscard]] auto gobj() const -> BaseObjectType const *; + [[nodiscard]] auto gobj_copy() noexcept -> BaseObjectType *; + + auto add(Glib::RefPtr const & participant) noexcept -> void; + auto clear() noexcept -> void; + auto remove_at(guint position) noexcept -> void; + + [[nodiscard]] auto get_empty() const noexcept -> bool; + [[nodiscard]] auto get_participant_count() const noexcept -> std::size_t; + [[nodiscard]] auto get_running() const noexcept -> bool; + [[nodiscard]] auto get_sort_mode() const noexcept -> SortMode; + + auto set_sort_mode(SortMode value) noexcept -> void; + + [[nodiscard]] auto property_empty() const noexcept -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_participant_count() const noexcept -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_running() const noexcept -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_sort_mode() noexcept -> Glib::PropertyProxy; + [[nodiscard]] auto property_sort_mode() const noexcept -> Glib::PropertyProxy_ReadOnly; + + protected: + friend TurnOrder_Class; + + explicit TurnOrder(BaseObjectType * gobj); + }; + +} // namespace Turns + +namespace Glib +{ + template<> + class Value : public Glib ::Value_Enum + { + public: + auto static value_type() -> GType; + }; + + auto wrap(TurnsTurnOrder * object, bool copy = false) -> Glib::RefPtr; +} // namespace Glib + +#endif \ No newline at end of file -- cgit v1.2.3