summaryrefslogtreecommitdiff
path: root/adw/include/adwaitamm/dialog.hpp
blob: 44dde25196d6e4ff432a52015cc32dc9c190e454 (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
#ifndef LIBADWAITAMM_DIALOG_HPP
#define LIBADWAITAMM_DIALOG_HPP

#include "adwaitamm/breakpoint.hpp"
#include "helpers/gobj_mixin.hpp"

#include <glibmm/class.h>
#include <glibmm/object.h>
#include <glibmm/objectbase.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>

#include <gtkmm/shortcutmanager.h>
#include <gtkmm/widget.h>

#include <glib-object.h>

using AdwDialog = struct _AdwDialog;
using AdwDialogClass = struct _AdwDialogClass;

namespace Adwaita
{
  struct Dialog_Class;

  struct Dialog : Gtk::Widget,
                  Gtk::ShortcutManager,
                  helpers::gobj_mixin<Dialog, AdwDialog>
  {
    struct Class : Glib::Class
    {
      using BaseClassParent = GtkWidgetClass;
      using BaseClassType = AdwDialogClass;
      using BaseObjectType = AdwDialog;
      using CppClassParent = struct Gtk::Widget_Class;
      using CppObjectType = Dialog;

      auto init() -> Glib::Class const &;
      auto static class_init_function(void * gclass, void * data) -> void;
      auto static wrap_new(GObject * object) -> Glib::ObjectBase *;
    };

    using BaseObjectType = Class::BaseObjectType;
    using BaseClassType = Class::BaseClassType;
    using CppObjectType = Class::CppObjectType;
    using CppClassType = Class;

    using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj;
    using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy;

    explicit Dialog();
    Dialog(Dialog const & other) = delete;
    Dialog(Dialog && other) noexcept = default;

    auto operator=(Dialog const & other) noexcept -> Dialog & = delete;
    auto operator=(Dialog && other) noexcept -> Dialog & = default;

    auto static get_type() -> GType;
    auto static get_base_type() -> GType;

    auto add_breakpoint(Glib::RefPtr<Breakpoint> const & breakpoint) -> void;
    auto close() -> void;
    auto force_close() -> void;
    auto get_can_close() const -> bool;
    auto get_child() const -> Gtk::Widget *;
    auto get_content_height() const -> int;
    auto get_content_width() const -> int;
    auto get_current_breakpoint() const -> Glib::RefPtr<Breakpoint>;
    auto get_default_widget() const -> Gtk::Widget *;
    auto get_focus() const -> Gtk::Widget *;
    auto present(Gtk::Widget * parent) -> void;
    auto set_title(Glib::ustring const & str) -> void;

  protected:
    explicit Dialog(Glib::ConstructParams const & params);
    explicit Dialog(BaseObjectType * gobj);
  };
}  // namespace Adwaita

namespace Glib
{
  auto wrap(AdwDialog * object, bool copy = false) -> Adwaita::Dialog *;
}  // namespace Glib

#endif