summaryrefslogtreecommitdiff
path: root/gtk/gtkfontdialogbutton.h
blob: ce040e0421bd1a4b851420ea451777257dc83860 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 * GTK - The GIMP Toolkit
 * Copyright (C) 2022 Red Hat, Inc.
 * All rights reserved.
 *
 * This Library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This Library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#include <gtk/gtkbutton.h>
#include <gtk/gtkfontdialog.h>

G_BEGIN_DECLS

#define GTK_TYPE_FONT_DIALOG_BUTTON (gtk_font_dialog_button_get_type ())

GDK_AVAILABLE_IN_4_10
G_DECLARE_FINAL_TYPE (GtkFontDialogButton, gtk_font_dialog_button, GTK, FONT_DIALOG_BUTTON, GtkWidget)

GDK_AVAILABLE_IN_4_10
GtkWidget *      gtk_font_dialog_button_new              (GtkFontDialog       *dialog);

GDK_AVAILABLE_IN_4_10
GtkFontDialog *  gtk_font_dialog_button_get_dialog       (GtkFontDialogButton *self);

GDK_AVAILABLE_IN_4_10
void             gtk_font_dialog_button_set_dialog       (GtkFontDialogButton *self,
                                                          GtkFontDialog       *dialog);

/**
 * GtkFontLevel:
 * @GTK_FONT_LEVEL_FAMILY: Select a font family
 * @GTK_FONT_LEVEL_FACE: Select a font face (i.e. a family and a style)
 * @GTK_FONT_LEVEL_FONT: Select a font (i.e. a face with a size, and possibly font variations)
 * @GTK_FONT_LEVEL_FEATURES: Select a font and font features
 *
 * The level of granularity for the font selection.
 *
 * Depending on this value, the `PangoFontDescription` that
 * is returned by [method@Gtk.FontDialogButton.get_font_desc]
 * will have more or less fields set.
 *
 * Since: 4.10
 */
typedef enum
{
  GTK_FONT_LEVEL_FAMILY,
  GTK_FONT_LEVEL_FACE,
  GTK_FONT_LEVEL_FONT,
  GTK_FONT_LEVEL_FEATURES
} GtkFontLevel;

GDK_AVAILABLE_IN_4_10
GtkFontLevel     gtk_font_dialog_button_get_level        (GtkFontDialogButton *self);

GDK_AVAILABLE_IN_4_10
void             gtk_font_dialog_button_set_level        (GtkFontDialogButton *self,
                                                          GtkFontLevel         level);

GDK_AVAILABLE_IN_4_10
PangoFontDescription *
                 gtk_font_dialog_button_get_font_desc    (GtkFontDialogButton *self);

GDK_AVAILABLE_IN_4_10
void             gtk_font_dialog_button_set_font_desc    (GtkFontDialogButton        *self,
                                                          const PangoFontDescription *font_desc);

GDK_AVAILABLE_IN_4_10
const char *     gtk_font_dialog_button_get_font_features
                                                         (GtkFontDialogButton *self);

GDK_AVAILABLE_IN_4_10
void             gtk_font_dialog_button_set_font_features
                                                         (GtkFontDialogButton  *self,
                                                          const char           *font_features);

GDK_AVAILABLE_IN_4_10
PangoLanguage *  gtk_font_dialog_button_get_language     (GtkFontDialogButton *self);

GDK_AVAILABLE_IN_4_10
void             gtk_font_dialog_button_set_language     (GtkFontDialogButton  *self,
                                                          PangoLanguage        *language);

GDK_AVAILABLE_IN_4_10
gboolean         gtk_font_dialog_button_get_use_font     (GtkFontDialogButton *self);

GDK_AVAILABLE_IN_4_10
void             gtk_font_dialog_button_set_use_font     (GtkFontDialogButton  *self,
                                                          gboolean              use_font);

GDK_AVAILABLE_IN_4_10
gboolean         gtk_font_dialog_button_get_use_size     (GtkFontDialogButton *self);

GDK_AVAILABLE_IN_4_10
void             gtk_font_dialog_button_set_use_size     (GtkFontDialogButton  *self,
                                                          gboolean              use_size);

G_END_DECLS