adw-avatar.h 1.82 KB
Newer Older
Julian Sparber's avatar
Julian Sparber committed
1
2
3
/*
 * Copyright (C) 2020 Purism SPC
 *
4
 * SPDX-License-Identifier: LGPL-2.1-or-later
Julian Sparber's avatar
Julian Sparber committed
5
6
7
8
 */

#pragma once

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
9
10
#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)
#error "Only <adwaita.h> can be included directly."
Julian Sparber's avatar
Julian Sparber committed
11
12
#endif

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
13
#include "adw-version.h"
14

Julian Sparber's avatar
Julian Sparber committed
15
16
17
18
#include <gtk/gtk.h>

G_BEGIN_DECLS

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
19
#define ADW_TYPE_AVATAR (adw_avatar_get_type())
Julian Sparber's avatar
Julian Sparber committed
20

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
21
22
ADW_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (AdwAvatar, adw_avatar, ADW, AVATAR, GtkWidget)
Julian Sparber's avatar
Julian Sparber committed
23

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
24
ADW_AVAILABLE_IN_ALL
25
26
GtkWidget *adw_avatar_new (int         size,
                           const char *text,
27
                           gboolean    show_initials) G_GNUC_WARN_UNUSED_RESULT;
28

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
29
ADW_AVAILABLE_IN_ALL
30
const char *adw_avatar_get_icon_name (AdwAvatar  *self);
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
31
ADW_AVAILABLE_IN_ALL
32
33
34
void        adw_avatar_set_icon_name (AdwAvatar  *self,
                                      const char *icon_name);

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
35
ADW_AVAILABLE_IN_ALL
36
const char *adw_avatar_get_text (AdwAvatar  *self);
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
37
ADW_AVAILABLE_IN_ALL
38
39
40
void        adw_avatar_set_text (AdwAvatar  *self,
                                 const char *text);

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
41
ADW_AVAILABLE_IN_ALL
42
gboolean adw_avatar_get_show_initials (AdwAvatar *self);
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
43
ADW_AVAILABLE_IN_ALL
44
45
46
void     adw_avatar_set_show_initials (AdwAvatar *self,
                                       gboolean   show_initials);

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
47
ADW_AVAILABLE_IN_ALL
48
49
50
51
GdkPaintable *adw_avatar_get_custom_image (AdwAvatar    *self);
ADW_AVAILABLE_IN_ALL
void          adw_avatar_set_custom_image (AdwAvatar    *self,
                                           GdkPaintable *custom_image);
52

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
53
ADW_AVAILABLE_IN_ALL
54
int  adw_avatar_get_size (AdwAvatar *self);
Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
55
ADW_AVAILABLE_IN_ALL
56
57
58
void adw_avatar_set_size (AdwAvatar *self,
                          int        size);

Alexander Mikhaylenko's avatar
Alexander Mikhaylenko committed
59
ADW_AVAILABLE_IN_ALL
60
61
GdkTexture *adw_avatar_draw_to_texture (AdwAvatar *self,
                                        int        scale_factor) G_GNUC_WARN_UNUSED_RESULT;
Julian Sparber's avatar
Julian Sparber committed
62
63

G_END_DECLS