aboutsummaryrefslogtreecommitdiff
path: root/include/adwaitamm/toolbarview.hpp
blob: d64ee446d453bffb58d6c91b7f1e536a1b319cf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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