From 72ab1fb4c1bf363f46470816d8b914a78ac493c4 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 24 May 2025 11:58:39 +0200 Subject: gui: restructure file layout and apply licenses --- gui/include/participant_editor.hpp | 87 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 gui/include/participant_editor.hpp (limited to 'gui/include/participant_editor.hpp') diff --git a/gui/include/participant_editor.hpp b/gui/include/participant_editor.hpp new file mode 100644 index 0000000..39b721c --- /dev/null +++ b/gui/include/participant_editor.hpp @@ -0,0 +1,87 @@ +/* + * SPDX-FileCopyrightText: 2025 Felix Morgner + * SPDX-License-Identifier: LGPL-2.1-only + */ + +#ifndef TURNS_UI_PARTICIPANT_EDITOR_HPP +#define TURNS_UI_PARTICIPANT_EDITOR_HPP + +#include "turns/core/disposition.hpp" +#include "turns/core/fwd.hpp" +#include "turns/core/participant.hpp" +#include "turns/ui/template_widget.hpp" + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +namespace turns::ui +{ + + struct ParticipantEditor : template_widget + { + using SignalFinishedType = sigc::signal; + + auto constexpr inline static children = std::array{ + "disposition", + "finish", + "name", + "priority", + }; + + explicit ParticipantEditor(Glib::RefPtr participant); + + [[nodiscard]] auto get_disposition() const -> core::Disposition; + [[nodiscard]] auto get_name() const -> Glib::ustring; + [[nodiscard]] auto get_participant() const -> Glib::RefPtr; + [[nodiscard]] auto get_priority() const -> double; + + auto set_disposition(core::Disposition value) -> void; + auto set_name(Glib::ustring const & value) -> void; + auto set_participant(Glib::RefPtr const & value) -> void; + auto set_priority(double value) -> void; + + [[nodiscard]] auto property_participant() -> Glib::PropertyProxy>; + [[nodiscard]] auto property_participant() const -> Glib::PropertyProxy_ReadOnly>; + + auto signal_finished() -> SignalFinishedType; + + private: + auto handle_finish_clicked() -> void; + auto handle_item_bind(Glib::RefPtr item) -> void; + auto handle_item_setup(Glib::RefPtr item) -> void; + auto handle_participant_changed() -> void; + + Adwaita::ComboRow * m_disposition; + Gtk::Button * m_finish; + Adwaita::EntryRow * m_name; + Adwaita::SpinRow * m_priority; + + Glib::RefPtr m_disposition_factory; + Glib::RefPtr m_disposition_model; + + Glib::Property> m_participant; + + SignalFinishedType m_signal_finished{}; + }; + +} // namespace turns::ui + +#endif \ No newline at end of file -- cgit v1.2.3