/** * @author Felix Morgner (felix.morgner@gmail.com) * @copyright Copyright (c) 2025 * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef LIBADWAITAMM_SPIN_ROW_HPP #define LIBADWAITAMM_SPIN_ROW_HPP #include "adwaitamm/actionrow.hpp" #include "adwaitamm/helpers/gobj_mixin.hpp" #include #include #include #include #include #include #include #define _ADWAITA_INSIDE #include #undef _ADWAITA_INSIDE using AdwSpinRow = struct _AdwSpinRow; namespace Adwaita { struct SpinRow final : ActionRow, helpers::gobj_mixin { using BaseObjectType = AdwSpinRow; using BaseClassType = AdwSpinRowClass; using CppObjectType = struct SpinRow; using CppClassType = struct SpinRow_Class; using helpers::gobj_mixin::gobj; using helpers::gobj_mixin::gobj_copy; #pragma mark - Special Member Functions SpinRow(Gtk::Adjustment & adjustment, double climb_rate, unsigned int digits); SpinRow(double min, double max, double step); SpinRow(SpinRow const & other) = delete; SpinRow(SpinRow && other) noexcept = default; auto operator=(SpinRow const & other) noexcept -> SpinRow & = delete; auto operator=(SpinRow && other) noexcept -> SpinRow & = default; #pragma mark - GObject Support auto static get_type() -> GType; auto static get_base_type() -> GType; #pragma mark - Functions auto configure(Gtk::Adjustment & adjustment, double climb_rate, unsigned int digits) -> void; auto update() -> void; #pragma mark - Getters [[nodiscard]] auto get_adjustment() const -> Glib::RefPtr; [[nodiscard]] auto get_climb_rate() const -> double; [[nodiscard]] auto get_digits() const -> unsigned int; [[nodiscard]] auto get_numeric() const -> bool; [[nodiscard]] auto get_snap_to_ticks() const -> bool; [[nodiscard]] auto get_update_policy() const -> Gtk::SpinButton::UpdatePolicy; [[nodiscard]] auto get_value() const -> double; [[nodiscard]] auto get_wrap() const -> bool; #pragma mark - Setters auto set_adjustment(Gtk::Adjustment & value) -> void; auto set_climb_rate(double value) -> void; auto set_digits(unsigned int value) -> void; auto set_numeric(bool value) -> void; auto set_range(double min, double max) -> void; auto set_snap_to_ticks(bool value) -> void; auto set_update_policy(Gtk::SpinButton::UpdatePolicy value) -> void; auto set_value(double value) -> void; auto set_wrap(bool value) -> void; #pragma mark - Properties [[nodiscard]] auto property_adjustment() -> Glib::PropertyProxy>; [[nodiscard]] auto property_adjustment() const -> Glib::PropertyProxy_ReadOnly>; [[nodiscard]] auto property_climb_rate() -> Glib::PropertyProxy; [[nodiscard]] auto property_climb_rate() const -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_digits() -> Glib::PropertyProxy; [[nodiscard]] auto property_digits() const -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_numeric() -> Glib::PropertyProxy; [[nodiscard]] auto property_numeric() const -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_snap_to_ticks() -> Glib::PropertyProxy; [[nodiscard]] auto property_snap_to_ticks() const -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_update_policy() -> Glib::PropertyProxy; [[nodiscard]] auto property_update_policy() const -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_value() -> Glib::PropertyProxy; [[nodiscard]] auto property_value() const -> Glib::PropertyProxy_ReadOnly; [[nodiscard]] auto property_wrap() -> Glib::PropertyProxy; [[nodiscard]] auto property_wrap() const -> Glib::PropertyProxy_ReadOnly; #pragma mark - Signals auto signal_input() -> Glib::SignalProxy; auto signal_output() -> Glib::SignalProxy; auto signal_wrapped() -> Glib::SignalProxy; protected: friend SpinRow_Class; #pragma mark - Internal Constructors explicit SpinRow(Glib::ConstructParams const & params); explicit SpinRow(BaseObjectType * gobj); }; } // namespace Adwaita namespace Glib { auto wrap(AdwSpinRow * object, bool copy = false) -> Adwaita::SpinRow *; } // namespace Glib #endif