summaryrefslogtreecommitdiff
path: root/adw/include/adwaitamm/dialog.hpp
blob: de6af0c1a2d8e4c34f4f7018442d11cf4f1cadff (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
/**
 * @author Felix Morgner (felix.morgner@gmail.com)
 * @copyright Copyright (c) 2025
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#ifndef LIBADWAITAMM_DIALOG_HPP
#define LIBADWAITAMM_DIALOG_HPP

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

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

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

#include <glib-object.h>

#define _ADWAITA_INSIDE
#include <adw-dialog.h>
#undef _ADWAITA_INSIDE

namespace Adwaita
{
  struct Dialog : Gtk::Widget,
                  Gtk::ShortcutManager,
                  helpers::gobj_mixin<Dialog, AdwDialog>
  {

    using BaseObjectType = AdwDialog;
    using BaseClassType = AdwDialogClass;
    using CppObjectType = Dialog;
    using CppClassType = struct Dialog_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:
    friend Dialog_Class;

    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