Flutter Engine
The Flutter Engine
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
10G_BEGIN_DECLS
11
12G_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 */
21typedef enum {
22 // NOLINTBEGIN(readability-identifier-naming)
25 // NOLINTEND(readability-identifier-naming)
27
28/**
29 * FlColorScheme:
30 * @FL_COLOR_SCHEME_LIGHT: Prefer light theme.
31 * @FL_COLOR_SCHEME_DARK: Prefer dark theme.
32 *
33 * Available color schemes.
34 */
35typedef enum {
36 // NOLINTBEGIN(readability-identifier-naming)
39 // NOLINTEND(readability-identifier-naming)
41
42/**
43 * FlSettings:
44 * #FlSettings is and object that provides desktop settings.
45 */
47 GTypeInterface parent;
50 gboolean (*get_enable_animations)(FlSettings* settings);
51 gboolean (*get_high_contrast)(FlSettings* settings);
52 gdouble (*get_text_scaling_factor)(FlSettings* settings);
53};
54
55/**
56 * fl_settings_new:
57 *
58 * Creates a new settings instance.
59 *
60 * Returns: a new #FlSettings.
61 */
62FlSettings* fl_settings_new();
63
64/**
65 * fl_settings_get_clock_format:
66 * @settings: an #FlSettings.
67 *
68 * Whether the clock displays in 24-hour or 12-hour format.
69 *
70 * This corresponds to `org.gnome.desktop.interface.clock-format` in GNOME.
71 *
72 * Returns: an #FlClockFormat.
73 */
75
76/**
77 * fl_settings_get_color_scheme:
78 * @settings: an #FlSettings.
79 *
80 * The preferred color scheme for the user interface.
81 *
82 * This corresponds to `org.gnome.desktop.interface.color-scheme` in GNOME.
83 *
84 * Returns: an #FlColorScheme.
85 */
87
88/**
89 * fl_settings_get_enable_animations:
90 * @settings: an #FlSettings.
91 *
92 * Whether animations should be enabled.
93 *
94 * This corresponds to `org.gnome.desktop.interface.enable-animations` in GNOME.
95 *
96 * Returns: %TRUE if animations are enabled.
97 */
99
100/**
101 * fl_settings_get_high_contrast:
102 * @settings: an #FlSettings.
103 *
104 * Whether to use high contrast theme.
105 *
106 * This corresponds to `org.gnome.desktop.a11y.interface.high-contrast` in
107 * GNOME.
108 *
109 * Returns: %TRUE if high contrast is used.
110 */
111gboolean fl_settings_get_high_contrast(FlSettings* settings);
112
113/**
114 * fl_settings_get_text_scaling_factor:
115 * @settings: an #FlSettings.
116 *
117 * Factor used to enlarge or reduce text display, without changing font size.
118 *
119 * This corresponds to `org.gnome.desktop.interface.text-scaling-factor` in
120 * GNOME.
121 *
122 * Returns: a floating point number.
123 */
125
126/**
127 * fl_settings_emit_changed:
128 * @settings: an #FlSettings.
129 *
130 * Emits the "changed" signal. Used by FlSettings implementations to notify when
131 * the desktop settings have changed.
132 */
133void fl_settings_emit_changed(FlSettings* settings);
134
135G_END_DECLS
136
137#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_SETTINGS_H_
G_DECLARE_INTERFACE(FlKeyResponder, fl_key_responder, FL, KEY_RESPONDER, GObject)
FlColorScheme
Definition: fl_settings.h:35
@ FL_COLOR_SCHEME_DARK
Definition: fl_settings.h:38
@ FL_COLOR_SCHEME_LIGHT
Definition: fl_settings.h:37
void fl_settings_emit_changed(FlSettings *settings)
Definition: fl_settings.cc:50
gboolean fl_settings_get_enable_animations(FlSettings *settings)
Definition: fl_settings.cc:38
FlClockFormat
Definition: fl_settings.h:21
@ FL_CLOCK_FORMAT_12H
Definition: fl_settings.h:23
@ FL_CLOCK_FORMAT_24H
Definition: fl_settings.h:24
FlClockFormat fl_settings_get_clock_format(FlSettings *settings)
Definition: fl_settings.cc:30
FlColorScheme fl_settings_get_color_scheme(FlSettings *settings)
Definition: fl_settings.cc:34
gboolean fl_settings_get_high_contrast(FlSettings *settings)
Definition: fl_settings.cc:42
FlSettings * fl_settings_new()
Definition: fl_settings.cc:55
gdouble fl_settings_get_text_scaling_factor(FlSettings *settings)
Definition: fl_settings.cc:46
GTypeInterface parent
Definition: fl_settings.h:47
gdouble(* get_text_scaling_factor)(FlSettings *settings)
Definition: fl_settings.h:52
gboolean(* get_high_contrast)(FlSettings *settings)
Definition: fl_settings.h:51
gboolean(* get_enable_animations)(FlSettings *settings)
Definition: fl_settings.h:50
FlColorScheme(* get_color_scheme)(FlSettings *settings)
Definition: fl_settings.h:49
FlClockFormat(* get_clock_format)(FlSettings *settings)
Definition: fl_settings.h:48