| Flutter Linux Embedder |

fl_settings.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
7
8 #include <glib-object.h>
9
10 G_BEGIN_DECLS
11
12 G_DECLARE_INTERFACE(FlSettings, fl_settings, FL, SETTINGS, GObject)
13
14 /**
15 * FlClockFormat:
16 * @FL_CLOCK_FORMAT_12H: 12-hour clock format.
17 * @FL_CLOCK_FORMAT_24H: 24-hour clock format.
18 *
19 * Available clock formats.
20 */
21 typedef enum {
22 FL_CLOCK_FORMAT_12H,
23 FL_CLOCK_FORMAT_24H,
24 } FlClockFormat;
25
26 /**
27 * FlColorScheme:
28 * @FL_COLOR_SCHEME_LIGHT: Prefer light theme.
29 * @FL_COLOR_SCHEME_DARK: Prefer dark theme.
30 *
31 * Available color schemes.
32 */
33 typedef enum {
34 FL_COLOR_SCHEME_LIGHT,
35 FL_COLOR_SCHEME_DARK,
36 } FlColorScheme;
37
38 /**
39 * FlSettings:
40 * #FlSettings is and object that provides desktop settings.
41 */
42 struct _FlSettingsInterface {
43 GTypeInterface parent;
44 FlClockFormat (*get_clock_format)(FlSettings* settings);
45 FlColorScheme (*get_color_scheme)(FlSettings* settings);
46 gboolean (*get_enable_animations)(FlSettings* settings);
47 gboolean (*get_high_contrast)(FlSettings* settings);
48 gdouble (*get_text_scaling_factor)(FlSettings* settings);
49 };
50
51 /**
52 * fl_settings_new:
53 *
54 * Creates a new settings instance.
55 *
56 * Returns: a new #FlSettings.
57 */
58 FlSettings* fl_settings_new();
59
60 /**
61 * fl_settings_get_clock_format:
62 * @settings: an #FlSettings.
63 *
64 * Whether the clock displays in 24-hour or 12-hour format.
65 *
66 * This corresponds to `org.gnome.desktop.interface.clock-format` in GNOME.
67 *
68 * Returns: an #FlClockFormat.
69 */
70 FlClockFormat fl_settings_get_clock_format(FlSettings* settings);
71
72 /**
73 * fl_settings_get_color_scheme:
74 * @settings: an #FlSettings.
75 *
76 * The preferred color scheme for the user interface.
77 *
78 * This corresponds to `org.gnome.desktop.interface.color-scheme` in GNOME.
79 *
80 * Returns: an #FlColorScheme.
81 */
82 FlColorScheme fl_settings_get_color_scheme(FlSettings* settings);
83
84 /**
85 * fl_settings_get_enable_animations:
86 * @settings: an #FlSettings.
87 *
88 * Whether animations should be enabled.
89 *
90 * This corresponds to `org.gnome.desktop.interface.enable-animations` in GNOME.
91 *
92 * Returns: %TRUE if animations are enabled.
93 */
94 gboolean fl_settings_get_enable_animations(FlSettings* settings);
95
96 /**
97 * fl_settings_get_high_contrast:
98 * @settings: an #FlSettings.
99 *
100 * Whether to use high contrast theme.
101 *
102 * This corresponds to `org.gnome.desktop.a11y.interface.high-contrast` in
103 * GNOME.
104 *
105 * Returns: %TRUE if high contrast is used.
106 */
107 gboolean fl_settings_get_high_contrast(FlSettings* settings);
108
109 /**
110 * fl_settings_get_text_scaling_factor:
111 * @settings: an #FlSettings.
112 *
113 * Factor used to enlarge or reduce text display, without changing font size.
114 *
115 * This corresponds to `org.gnome.desktop.interface.text-scaling-factor` in
116 * GNOME.
117 *
118 * Returns: a floating point number.
119 */
120 gdouble fl_settings_get_text_scaling_factor(FlSettings* settings);
121
122 /**
123 * fl_settings_emit_changed:
124 * @settings: an #FlSettings.
125 *
126 * Emits the "changed" signal. Used by FlSettings implementations to notify when
127 * the desktop settings have changed.
128 */
129 void fl_settings_emit_changed(FlSettings* settings);
130
131 G_END_DECLS
132
133 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
FL
FL
Definition: fl_binary_messenger.cc:27
G_DECLARE_INTERFACE
G_BEGIN_DECLS G_DECLARE_INTERFACE(FlRenderable, fl_renderable, FL, RENDERABLE, GObject)
FlColorScheme
FlColorScheme
Definition: fl_settings.h:33
FL_COLOR_SCHEME_DARK
@ FL_COLOR_SCHEME_DARK
Definition: fl_settings.h:35
FL_COLOR_SCHEME_LIGHT
@ FL_COLOR_SCHEME_LIGHT
Definition: fl_settings.h:34
fl_settings_emit_changed
void fl_settings_emit_changed(FlSettings *settings)
Definition: fl_settings.cc:50
fl_settings_get_enable_animations
gboolean fl_settings_get_enable_animations(FlSettings *settings)
Definition: fl_settings.cc:38
FlClockFormat
FlClockFormat
Definition: fl_settings.h:21
FL_CLOCK_FORMAT_12H
@ FL_CLOCK_FORMAT_12H
Definition: fl_settings.h:22
FL_CLOCK_FORMAT_24H
@ FL_CLOCK_FORMAT_24H
Definition: fl_settings.h:23
fl_settings_get_clock_format
FlClockFormat fl_settings_get_clock_format(FlSettings *settings)
Definition: fl_settings.cc:30
fl_settings_get_color_scheme
FlColorScheme fl_settings_get_color_scheme(FlSettings *settings)
Definition: fl_settings.cc:34
fl_settings_get_high_contrast
gboolean fl_settings_get_high_contrast(FlSettings *settings)
Definition: fl_settings.cc:42
fl_settings_new
FlSettings * fl_settings_new()
Definition: fl_settings.cc:55
fl_settings_get_text_scaling_factor
gdouble fl_settings_get_text_scaling_factor(FlSettings *settings)
Definition: fl_settings.cc:46
_FlSettingsInterface
Definition: fl_settings.h:42
_FlSettingsInterface::parent
GTypeInterface parent
Definition: fl_settings.h:43
_FlSettingsInterface::get_text_scaling_factor
gdouble(* get_text_scaling_factor)(FlSettings *settings)
Definition: fl_settings.h:48
_FlSettingsInterface::get_high_contrast
gboolean(* get_high_contrast)(FlSettings *settings)
Definition: fl_settings.h:47
_FlSettingsInterface::get_enable_animations
gboolean(* get_enable_animations)(FlSettings *settings)
Definition: fl_settings.h:46
_FlSettingsInterface::get_color_scheme
FlColorScheme(* get_color_scheme)(FlSettings *settings)
Definition: fl_settings.h:45
_FlSettingsInterface::get_clock_format
FlClockFormat(* get_clock_format)(FlSettings *settings)
Definition: fl_settings.h:44