From 673e58ca36421bb560d4e04277b6b58ce6e0db6f Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 29 Apr 2025 12:30:21 +0200 Subject: adw: implement ToolbarView --- include/adwaitamm/toolbarview.hpp | 100 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 include/adwaitamm/toolbarview.hpp (limited to 'include/adwaitamm/toolbarview.hpp') diff --git a/include/adwaitamm/toolbarview.hpp b/include/adwaitamm/toolbarview.hpp new file mode 100644 index 0000000..d64ee44 --- /dev/null +++ b/include/adwaitamm/toolbarview.hpp @@ -0,0 +1,100 @@ +/** + * @author Felix Morgner (felix.morgner@gmail.com) + * @copyright Copyright (c) 2025 + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef LIBADWAITAMM_TOOLBAR_VIEW_HPP +#define LIBADWAITAMM_TOOLBAR_VIEW_HPP + +#include "adwaitamm/enums.hpp" +#include "helpers/gobj_mixin.hpp" + +#include +#include + +#include + +#include + +#define _ADWAITA_INSIDE +#include +#undef _ADWAITA_INSIDE + +namespace Adwaita +{ + struct ToolbarView final : Gtk::Widget, + helpers::gobj_mixin + { + + using BaseObjectType = AdwToolbarView; + using BaseClassType = AdwToolbarViewClass; + using CppObjectType = ToolbarView; + using CppClassType = struct ToolbarView_Class; + + using helpers::gobj_mixin::gobj; + using helpers::gobj_mixin::gobj_copy; + + ToolbarView(); + ToolbarView(ToolbarView const & other) = delete; + ToolbarView(ToolbarView && other) noexcept = default; + + auto operator=(ToolbarView const & other) noexcept -> ToolbarView & = delete; + auto operator=(ToolbarView && other) noexcept -> ToolbarView & = default; + + auto static get_type() -> GType; + auto static get_base_type() -> GType; + + auto add_bottom_bar(Gtk::Widget & widget) -> void; + auto add_top_bar(Gtk::Widget & widget) -> void; + auto remove(Gtk::Widget & widget) -> void; + + [[nodiscard]] auto get_bottom_bar_height() const -> int; + [[nodiscard]] auto get_bottom_bar_style() const -> ToolbarStyle; + [[nodiscard]] auto get_content() const -> Gtk::Widget *; + [[nodiscard]] auto get_extend_content_to_bottom_edge() const -> bool; + [[nodiscard]] auto get_extend_content_to_top_edge() const -> bool; + [[nodiscard]] auto get_reveal_bottom_bars() const -> bool; + [[nodiscard]] auto get_reveal_top_bars() const -> bool; + [[nodiscard]] auto get_top_bar_height() const -> int; + [[nodiscard]] auto get_top_bar_style() const -> ToolbarStyle; + + auto set_bottom_bar_style(ToolbarStyle value) -> void; + auto set_content(Gtk::Widget & value) -> void; + auto set_extend_content_to_bottom_edge(bool value) -> void; + auto set_extend_content_to_top_edge(bool value) -> void; + auto set_reveal_bottom_bars(bool value) -> void; + auto set_reveal_top_bars(bool value) -> void; + auto set_top_bar_style(ToolbarStyle value) -> void; + + [[nodiscard]] auto property_bottom_bar_height() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_bottom_bar_style() -> Glib::PropertyProxy; + [[nodiscard]] auto property_bottom_bar_style() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_content() -> Glib::PropertyProxy; + [[nodiscard]] auto property_content() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_extend_content_to_bottom_edge() -> Glib::PropertyProxy; + [[nodiscard]] auto property_extend_content_to_bottom_edge() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_extend_content_to_top_edge() -> Glib::PropertyProxy; + [[nodiscard]] auto property_extend_content_to_top_edge() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_reveal_bottom_bars() -> Glib::PropertyProxy; + [[nodiscard]] auto property_reveal_bottom_bars() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_reveal_top_bars() -> Glib::PropertyProxy; + [[nodiscard]] auto property_reveal_top_bars() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_top_bar_height() const -> Glib::PropertyProxy_ReadOnly; + [[nodiscard]] auto property_top_bar_style() -> Glib::PropertyProxy; + [[nodiscard]] auto property_top_bar_style() const -> Glib::PropertyProxy_ReadOnly; + + protected: + friend ToolbarView_Class; + + explicit ToolbarView(Glib::ConstructParams const & params); + explicit ToolbarView(BaseObjectType * gobj); + }; +} // namespace Adwaita + +namespace Glib +{ + auto wrap(AdwToolbarView * object, bool copy = false) -> Adwaita::ToolbarView *; +} // namespace Glib + +#endif \ No newline at end of file -- cgit v1.2.3