diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-29 12:30:21 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-29 12:32:34 +0200 |
| commit | 673e58ca36421bb560d4e04277b6b58ce6e0db6f (patch) | |
| tree | 4688e5b25a4bceac10c38a9ef0dc966d8f5131c2 /include/adwaitamm/toolbarview.hpp | |
| parent | 68b3389d282284a59329c9c6a6603c7045a2db72 (diff) | |
| download | libadwaitamm-673e58ca36421bb560d4e04277b6b58ce6e0db6f.tar.xz libadwaitamm-673e58ca36421bb560d4e04277b6b58ce6e0db6f.zip | |
adw: implement ToolbarView
Diffstat (limited to 'include/adwaitamm/toolbarview.hpp')
| -rw-r--r-- | include/adwaitamm/toolbarview.hpp | 100 |
1 files changed, 100 insertions, 0 deletions
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 <glibmm/object.h> +#include <glibmm/propertyproxy.h> + +#include <gtkmm/widget.h> + +#include <glib-object.h> + +#define _ADWAITA_INSIDE +#include <adw-toolbar-view.h> +#undef _ADWAITA_INSIDE + +namespace Adwaita +{ + struct ToolbarView final : Gtk::Widget, + helpers::gobj_mixin<ToolbarView, AdwToolbarView> + { + + using BaseObjectType = AdwToolbarView; + using BaseClassType = AdwToolbarViewClass; + using CppObjectType = ToolbarView; + using CppClassType = struct ToolbarView_Class; + + using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; + using helpers::gobj_mixin<CppObjectType, BaseObjectType>::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<int>; + [[nodiscard]] auto property_bottom_bar_style() -> Glib::PropertyProxy<ToolbarStyle>; + [[nodiscard]] auto property_bottom_bar_style() const -> Glib::PropertyProxy_ReadOnly<ToolbarStyle>; + [[nodiscard]] auto property_content() -> Glib::PropertyProxy<Gtk::Widget *>; + [[nodiscard]] auto property_content() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>; + [[nodiscard]] auto property_extend_content_to_bottom_edge() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_extend_content_to_bottom_edge() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_extend_content_to_top_edge() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_extend_content_to_top_edge() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_reveal_bottom_bars() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_reveal_bottom_bars() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_reveal_top_bars() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_reveal_top_bars() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_top_bar_height() const -> Glib::PropertyProxy_ReadOnly<int>; + [[nodiscard]] auto property_top_bar_style() -> Glib::PropertyProxy<ToolbarStyle>; + [[nodiscard]] auto property_top_bar_style() const -> Glib::PropertyProxy_ReadOnly<ToolbarStyle>; + + 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 |
