blob: 46c7dfeceb58172554b8d0bca198ce3c69888806 [file] [log] [blame]
Mathias Agopiane1c61d32012-03-23 14:19:36 -07001/*
Nick Cook7a732122020-06-03 22:55:05 +00002 * Copyright (C) 2010 The Android Open Source Project.
Mathias Agopiane1c61d32012-03-23 14:19:36 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070017/**
18 * @addtogroup Configuration
19 * @{
20 */
21
22/**
23 * @file configuration.h
24 */
25
Mathias Agopiane1c61d32012-03-23 14:19:36 -070026#ifndef ANDROID_CONFIGURATION_H
27#define ANDROID_CONFIGURATION_H
28
Dan Albert494ed552016-09-23 15:57:45 -070029#include <sys/cdefs.h>
30
Mathias Agopiane1c61d32012-03-23 14:19:36 -070031#include <android/asset_manager.h>
32
Elliott Hughesc2fcafc2018-06-18 12:28:46 -070033#if !defined(__INTRODUCED_IN)
34#define __INTRODUCED_IN(__api_level) /* nothing */
35#endif
36
Mathias Agopiane1c61d32012-03-23 14:19:36 -070037#ifdef __cplusplus
38extern "C" {
39#endif
40
41struct AConfiguration;
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070042/**
43 * {@link AConfiguration} is an opaque type used to get and set
44 * various subsystem configurations.
45 *
46 * A {@link AConfiguration} pointer can be obtained using:
47 * - AConfiguration_new()
48 * - AConfiguration_fromAssetManager()
49 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070050typedef struct AConfiguration AConfiguration;
51
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070052
53/**
54 * Define flags and constants for various subsystem configurations.
55 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070056enum {
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070057 /** Orientation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070058 ACONFIGURATION_ORIENTATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070059 /**
60 * Orientation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000061 * <a href="/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070062 * resource qualifier.
63 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070064 ACONFIGURATION_ORIENTATION_PORT = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070065 /**
66 * Orientation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000067 * <a href="/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070068 * resource qualifier.
69 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070070 ACONFIGURATION_ORIENTATION_LAND = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070071 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070072 ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
73
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070074 /** Touchscreen: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070075 ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070076 /**
77 * Touchscreen: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000078 * <a href="/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070079 * resource qualifier.
80 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070081 ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070082 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070083 ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070084 /**
85 * Touchscreen: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000086 * <a href="/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070087 * resource qualifier.
88 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070089 ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003,
90
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070091 /** Density: default density. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070092 ACONFIGURATION_DENSITY_DEFAULT = 0,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070093 /**
94 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000095 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070096 * resource qualifier.
97 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070098 ACONFIGURATION_DENSITY_LOW = 120,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070099 /**
100 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000101 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700102 * resource qualifier.
103 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700104 ACONFIGURATION_DENSITY_MEDIUM = 160,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700105 /**
106 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000107 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700108 * resource qualifier.
109 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700110 ACONFIGURATION_DENSITY_TV = 213,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700111 /**
112 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000113 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700114 * resource qualifier.
115 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700116 ACONFIGURATION_DENSITY_HIGH = 240,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700117 /**
118 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000119 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700120 * resource qualifier.
121 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700122 ACONFIGURATION_DENSITY_XHIGH = 320,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700123 /**
124 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000125 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700126 * resource qualifier.
127 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700128 ACONFIGURATION_DENSITY_XXHIGH = 480,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700129 /**
130 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000131 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700132 * resource qualifier.
133 */
Dianne Hackborn6303d062013-02-12 15:36:31 -0800134 ACONFIGURATION_DENSITY_XXXHIGH = 640,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700135 /** Density: any density. */
Adam Lesinski16d08a52014-08-22 22:23:08 -0700136 ACONFIGURATION_DENSITY_ANY = 0xfffe,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700137 /** Density: no density specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700138 ACONFIGURATION_DENSITY_NONE = 0xffff,
139
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700140 /** Keyboard: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700141 ACONFIGURATION_KEYBOARD_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700142 /**
143 * Keyboard: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000144 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700145 * resource qualifier.
146 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700147 ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700148 /**
149 * Keyboard: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000150 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700151 * resource qualifier.
152 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700153 ACONFIGURATION_KEYBOARD_QWERTY = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700154 /**
155 * Keyboard: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000156 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700157 * resource qualifier.
158 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700159 ACONFIGURATION_KEYBOARD_12KEY = 0x0003,
160
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700161 /** Navigation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700162 ACONFIGURATION_NAVIGATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700163 /**
164 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000165 * <a href="@/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700166 * resource qualifier.
167 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700168 ACONFIGURATION_NAVIGATION_NONAV = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700169 /**
170 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000171 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700172 * resource qualifier.
173 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700174 ACONFIGURATION_NAVIGATION_DPAD = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700175 /**
176 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000177 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700178 * resource qualifier.
179 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700180 ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700181 /**
182 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000183 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700184 * resource qualifier.
185 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700186 ACONFIGURATION_NAVIGATION_WHEEL = 0x0004,
187
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700188 /** Keyboard availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700189 ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700190 /**
191 * Keyboard availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000192 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keysexposed</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700193 * resource qualifier.
194 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700195 ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700196 /**
197 * Keyboard availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000198 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyshidden</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700199 * resource qualifier.
200 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700201 ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700202 /**
203 * Keyboard availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000204 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyssoft</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700205 * resource qualifier.
206 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700207 ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
208
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700209 /** Navigation availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700210 ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700211 /**
212 * Navigation availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000213 * <a href="/guide/topics/resources/providing-resources.html#NavAvailQualifier">navexposed</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700214 * resource qualifier.
215 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700216 ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700217 /**
218 * Navigation availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000219 * <a href="/guide/topics/resources/providing-resources.html#NavAvailQualifier">navhidden</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700220 * resource qualifier.
221 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700222 ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
223
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700224 /** Screen size: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700225 ACONFIGURATION_SCREENSIZE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700226 /**
227 * Screen size: value indicating the screen is at least
228 * approximately 320x426 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000229 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">small</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700230 * resource qualifier.
231 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700232 ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700233 /**
234 * Screen size: value indicating the screen is at least
235 * approximately 320x470 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000236 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">normal</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700237 * resource qualifier.
238 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700239 ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700240 /**
241 * Screen size: value indicating the screen is at least
242 * approximately 480x640 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000243 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">large</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700244 * resource qualifier.
245 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700246 ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700247 /**
248 * Screen size: value indicating the screen is at least
249 * approximately 720x960 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000250 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">xlarge</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700251 * resource qualifier.
252 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700253 ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
254
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700255 /** Screen layout: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700256 ACONFIGURATION_SCREENLONG_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700257 /**
258 * Screen layout: value that corresponds to the
Nick Cook7a732122020-06-03 22:55:05 +0000259 * <a href="/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">notlong</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700260 * resource qualifier.
261 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700262 ACONFIGURATION_SCREENLONG_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700263 /**
264 * Screen layout: value that corresponds to the
Nick Cook7a732122020-06-03 22:55:05 +0000265 * <a href="/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">long</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700266 * resource qualifier.
267 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700268 ACONFIGURATION_SCREENLONG_YES = 0x2,
269
Adam Lesinski7eb14592015-05-14 14:28:32 -0700270 ACONFIGURATION_SCREENROUND_ANY = 0x00,
271 ACONFIGURATION_SCREENROUND_NO = 0x1,
272 ACONFIGURATION_SCREENROUND_YES = 0x2,
273
Romain Guya2310b92017-01-18 16:36:21 -0800274 /** Wide color gamut: not specified. */
275 ACONFIGURATION_WIDE_COLOR_GAMUT_ANY = 0x00,
276 /**
277 * Wide color gamut: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000278 * <a href="/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">no
Romain Guya2310b92017-01-18 16:36:21 -0800279 * nowidecg</a> resource qualifier specified.
280 */
281 ACONFIGURATION_WIDE_COLOR_GAMUT_NO = 0x1,
282 /**
283 * Wide color gamut: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000284 * <a href="/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">
Romain Guya2310b92017-01-18 16:36:21 -0800285 * widecg</a> resource qualifier specified.
286 */
287 ACONFIGURATION_WIDE_COLOR_GAMUT_YES = 0x2,
288
289 /** HDR: not specified. */
290 ACONFIGURATION_HDR_ANY = 0x00,
291 /**
292 * HDR: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000293 * <a href="/guide/topics/resources/providing-resources.html#HDRQualifier">
Romain Guya2310b92017-01-18 16:36:21 -0800294 * lowdr</a> resource qualifier specified.
295 */
296 ACONFIGURATION_HDR_NO = 0x1,
297 /**
298 * HDR: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000299 * <a href="/guide/topics/resources/providing-resources.html#HDRQualifier">
Romain Guya2310b92017-01-18 16:36:21 -0800300 * highdr</a> resource qualifier specified.
301 */
302 ACONFIGURATION_HDR_YES = 0x2,
303
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700304 /** UI mode: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700305 ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700306 /**
307 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000308 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">no
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700309 * UI mode type</a> resource qualifier specified.
310 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700311 ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700312 /**
313 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000314 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">desk</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700315 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700316 ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700317 /**
318 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000319 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">car</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700320 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700321 ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700322 /**
323 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000324 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">television</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700325 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700326 ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700327 /**
328 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000329 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">appliance</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700330 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700331 ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700332 /**
333 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000334 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">watch</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700335 */
John Spurlockad98ad02014-04-03 16:39:17 -0400336 ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
Zak Cohena62fb162016-12-09 15:06:02 -0800337 /**
338 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000339 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">vr</a> resource qualifier specified.
Zak Cohena62fb162016-12-09 15:06:02 -0800340 */
341 ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET = 0x07,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700342
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700343 /** UI night mode: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700344 ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700345 /**
346 * UI night mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000347 * <a href="/guide/topics/resources/providing-resources.html#NightQualifier">notnight</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700348 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700349 ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700350 /**
351 * UI night mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000352 * <a href="/guide/topics/resources/providing-resources.html#NightQualifier">night</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700353 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700354 ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
355
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700356 /** Screen width DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700357 ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
358
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700359 /** Screen height DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700360 ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
361
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700362 /** Smallest screen width DPI: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700363 ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
364
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700365 /** Layout direction: not specified. */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700366 ACONFIGURATION_LAYOUTDIR_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700367 /**
368 * Layout direction: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000369 * <a href="/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldltr</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700370 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700371 ACONFIGURATION_LAYOUTDIR_LTR = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700372 /**
373 * Layout direction: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000374 * <a href="/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldrtl</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700375 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700376 ACONFIGURATION_LAYOUTDIR_RTL = 0x02,
377
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700378 /**
379 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000380 * <a href="/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700381 * configuration.
382 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700383 ACONFIGURATION_MCC = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700384 /**
385 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000386 * <a href="/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700387 * configuration.
388 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700389 ACONFIGURATION_MNC = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700390 /**
391 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000392 * <a href="/guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700393 * configuration.
394 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700395 ACONFIGURATION_LOCALE = 0x0004,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700396 /**
397 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000398 * <a href="/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700399 * configuration.
400 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700401 ACONFIGURATION_TOUCHSCREEN = 0x0008,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700402 /**
403 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000404 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700405 * configuration.
406 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700407 ACONFIGURATION_KEYBOARD = 0x0010,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700408 /**
409 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000410 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700411 * configuration.
412 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700413 ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700414 /**
415 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000416 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700417 * configuration.
418 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700419 ACONFIGURATION_NAVIGATION = 0x0040,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700420 /**
421 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000422 * <a href="/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700423 * configuration.
424 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700425 ACONFIGURATION_ORIENTATION = 0x0080,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700426 /**
427 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000428 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">density</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700429 * configuration.
430 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700431 ACONFIGURATION_DENSITY = 0x0100,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700432 /**
433 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000434 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700435 * configuration.
436 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700437 ACONFIGURATION_SCREEN_SIZE = 0x0200,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700438 /**
439 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000440 * <a href="/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700441 * configuration.
442 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700443 ACONFIGURATION_VERSION = 0x0400,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700444 /**
445 * Bit mask for screen layout configuration.
446 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700447 ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700448 /**
449 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000450 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700451 * configuration.
452 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700453 ACONFIGURATION_UI_MODE = 0x1000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700454 /**
455 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000456 * <a href="/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700457 * configuration.
458 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700459 ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700460 /**
461 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000462 * <a href="/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700463 * configuration.
464 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700465 ACONFIGURATION_LAYOUTDIR = 0x4000,
Adam Lesinski7eb14592015-05-14 14:28:32 -0700466 ACONFIGURATION_SCREEN_ROUND = 0x8000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700467 /**
Romain Guya2310b92017-01-18 16:36:21 -0800468 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000469 * <a href="/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">wide color gamut</a>
470 * and <a href="/guide/topics/resources/providing-resources.html#HDRQualifier">HDR</a> configurations.
Romain Guya2310b92017-01-18 16:36:21 -0800471 */
Romain Guy3119ff02017-01-23 16:58:08 -0800472 ACONFIGURATION_COLOR_MODE = 0x10000,
Romain Guya2310b92017-01-18 16:36:21 -0800473 /**
Yurii Zubrytskyi0e4f1772023-01-04 08:45:03 -0800474 * Bit mask for
475 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">grammatical gender</a>
476 * configuration.
477 */
478 ACONFIGURATION_GRAMMATICAL_GENDER = 0x20000,
479 /**
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700480 * Constant used to to represent MNC (Mobile Network Code) zero.
481 * 0 cannot be used, since it is used to represent an undefined MNC.
482 */
Johan Redestig8df483c2013-05-30 08:30:42 +0200483 ACONFIGURATION_MNC_ZERO = 0xffff,
Yurii Zubrytskyi0e4f1772023-01-04 08:45:03 -0800484
485 /**
486 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: not specified.
487 */
488 ACONFIGURATION_GRAMMATICAL_GENDER_ANY = 0,
489
490 /**
491 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: neuter.
492 */
493 ACONFIGURATION_GRAMMATICAL_GENDER_NEUTER = 1,
494
495 /**
496 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: feminine.
497 */
498 ACONFIGURATION_GRAMMATICAL_GENDER_FEMININE = 2,
499
500 /**
501 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: masculine.
502 */
503 ACONFIGURATION_GRAMMATICAL_GENDER_MASCULINE = 3,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700504};
505
506/**
507 * Create a new AConfiguration, initialized with no values set.
508 */
509AConfiguration* AConfiguration_new();
510
511/**
512 * Free an AConfiguration that was previously created with
513 * AConfiguration_new().
514 */
515void AConfiguration_delete(AConfiguration* config);
516
517/**
518 * Create and return a new AConfiguration based on the current configuration in
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700519 * use in the given {@link AAssetManager}.
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700520 */
521void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am);
522
523/**
524 * Copy the contents of 'src' to 'dest'.
525 */
526void AConfiguration_copy(AConfiguration* dest, AConfiguration* src);
527
528/**
529 * Return the current MCC set in the configuration. 0 if not set.
530 */
531int32_t AConfiguration_getMcc(AConfiguration* config);
532
533/**
534 * Set the current MCC in the configuration. 0 to clear.
535 */
536void AConfiguration_setMcc(AConfiguration* config, int32_t mcc);
537
538/**
539 * Return the current MNC set in the configuration. 0 if not set.
540 */
541int32_t AConfiguration_getMnc(AConfiguration* config);
542
543/**
544 * Set the current MNC in the configuration. 0 to clear.
545 */
546void AConfiguration_setMnc(AConfiguration* config, int32_t mnc);
547
548/**
549 * Return the current language code set in the configuration. The output will
550 * be filled with an array of two characters. They are not 0-terminated. If
551 * a language is not set, they will be 0.
552 */
553void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage);
554
555/**
556 * Set the current language code in the configuration, from the first two
557 * characters in the string.
558 */
559void AConfiguration_setLanguage(AConfiguration* config, const char* language);
560
561/**
562 * Return the current country code set in the configuration. The output will
563 * be filled with an array of two characters. They are not 0-terminated. If
564 * a country is not set, they will be 0.
565 */
566void AConfiguration_getCountry(AConfiguration* config, char* outCountry);
567
568/**
569 * Set the current country code in the configuration, from the first two
570 * characters in the string.
571 */
572void AConfiguration_setCountry(AConfiguration* config, const char* country);
573
574/**
575 * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
576 */
577int32_t AConfiguration_getOrientation(AConfiguration* config);
578
579/**
580 * Set the current orientation in the configuration.
581 */
582void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation);
583
584/**
585 * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
586 */
587int32_t AConfiguration_getTouchscreen(AConfiguration* config);
588
589/**
590 * Set the current touchscreen in the configuration.
591 */
592void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen);
593
594/**
595 * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
596 */
597int32_t AConfiguration_getDensity(AConfiguration* config);
598
599/**
600 * Set the current density in the configuration.
601 */
602void AConfiguration_setDensity(AConfiguration* config, int32_t density);
603
604/**
605 * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
606 */
607int32_t AConfiguration_getKeyboard(AConfiguration* config);
608
609/**
610 * Set the current keyboard in the configuration.
611 */
612void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard);
613
614/**
615 * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
616 */
617int32_t AConfiguration_getNavigation(AConfiguration* config);
618
619/**
620 * Set the current navigation in the configuration.
621 */
622void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation);
623
624/**
625 * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
626 */
627int32_t AConfiguration_getKeysHidden(AConfiguration* config);
628
629/**
630 * Set the current keys hidden in the configuration.
631 */
632void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden);
633
634/**
635 * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
636 */
637int32_t AConfiguration_getNavHidden(AConfiguration* config);
638
639/**
640 * Set the current nav hidden in the configuration.
641 */
642void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden);
643
644/**
645 * Return the current SDK (API) version set in the configuration.
646 */
647int32_t AConfiguration_getSdkVersion(AConfiguration* config);
648
649/**
650 * Set the current SDK version in the configuration.
651 */
652void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion);
653
654/**
655 * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
656 */
657int32_t AConfiguration_getScreenSize(AConfiguration* config);
658
659/**
660 * Set the current screen size in the configuration.
661 */
662void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize);
663
664/**
665 * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
666 */
667int32_t AConfiguration_getScreenLong(AConfiguration* config);
668
669/**
670 * Set the current screen long in the configuration.
671 */
672void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong);
673
674/**
Adam Lesinski7eb14592015-05-14 14:28:32 -0700675 * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.
Elliott Hughesba80a0f2019-12-18 15:13:40 -0800676 *
677 * Available since API level 30.
Adam Lesinski7eb14592015-05-14 14:28:32 -0700678 */
Elliott Hughesba80a0f2019-12-18 15:13:40 -0800679int32_t AConfiguration_getScreenRound(AConfiguration* config) __INTRODUCED_IN(30);
Adam Lesinski7eb14592015-05-14 14:28:32 -0700680
681/**
682 * Set the current screen round in the configuration.
683 */
684void AConfiguration_setScreenRound(AConfiguration* config, int32_t screenRound);
685
686/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700687 * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
688 */
689int32_t AConfiguration_getUiModeType(AConfiguration* config);
690
691/**
692 * Set the current UI mode type in the configuration.
693 */
694void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType);
695
696/**
697 * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
698 */
699int32_t AConfiguration_getUiModeNight(AConfiguration* config);
700
701/**
702 * Set the current UI mode night in the configuration.
703 */
704void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
705
706/**
707 * Return the current configuration screen width in dp units, or
708 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
709 */
Elliott Hughes05565472019-10-29 08:59:39 -0700710int32_t AConfiguration_getScreenWidthDp(AConfiguration* config);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700711
712/**
713 * Set the configuration's current screen width in dp units.
714 */
Elliott Hughes05565472019-10-29 08:59:39 -0700715void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700716
717/**
718 * Return the current configuration screen height in dp units, or
719 * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
720 */
Elliott Hughes05565472019-10-29 08:59:39 -0700721int32_t AConfiguration_getScreenHeightDp(AConfiguration* config);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700722
723/**
724 * Set the configuration's current screen width in dp units.
725 */
Elliott Hughes05565472019-10-29 08:59:39 -0700726void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700727
728/**
729 * Return the configuration's smallest screen width in dp units, or
730 * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
731 */
Elliott Hughes05565472019-10-29 08:59:39 -0700732int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700733
734/**
735 * Set the configuration's smallest screen width in dp units.
736 */
Elliott Hughes05565472019-10-29 08:59:39 -0700737void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700738
739/**
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700740 * Return the configuration's layout direction, or
741 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
Elliott Hughes05565472019-10-29 08:59:39 -0700742 *
743 * Available since API level 17.
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700744 */
Elliott Hughesc2fcafc2018-06-18 12:28:46 -0700745int32_t AConfiguration_getLayoutDirection(AConfiguration* config) __INTRODUCED_IN(17);
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700746
747/**
748 * Set the configuration's layout direction.
Elliott Hughes05565472019-10-29 08:59:39 -0700749 *
750 * Available since API level 17.
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700751 */
Elliott Hughesc2fcafc2018-06-18 12:28:46 -0700752void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value) __INTRODUCED_IN(17);
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700753
754/**
Yurii Zubrytskyi0e4f1772023-01-04 08:45:03 -0800755 * Return the configuration's grammatical gender, or ACONFIGURATION_GRAMMATICAL_GENDER_ANY if
756 * not set.
757 *
758 * Available since API level 34.
759 */
760int32_t AConfiguration_getGrammaticalGender(AConfiguration* config)
761 __INTRODUCED_IN(__ANDROID_API_U__);
762
763/**
764 * Set the configuration's grammatical gender to one of the
765 * ACONFIGURATION_GRAMMATICAL_GENDER_* constants.
766 *
767 * Available since API level 34.
768 */
769void AConfiguration_setGrammaticalGender(AConfiguration* config, int32_t value)
770 __INTRODUCED_IN(__ANDROID_API_U__);
771
772/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700773 * Perform a diff between two configurations. Returns a bit mask of
774 * ACONFIGURATION_* constants, each bit set meaning that configuration element
775 * is different between them.
776 */
777int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2);
778
779/**
780 * Determine whether 'base' is a valid configuration for use within the
781 * environment 'requested'. Returns 0 if there are any values in 'base'
782 * that conflict with 'requested'. Returns 1 if it does not conflict.
783 */
784int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested);
785
786/**
787 * Determine whether the configuration in 'test' is better than the existing
788 * configuration in 'base'. If 'requested' is non-NULL, this decision is based
789 * on the overall configuration given there. If it is NULL, this decision is
790 * simply based on which configuration is more specific. Returns non-0 if
791 * 'test' is better than 'base'.
792 *
793 * This assumes you have already filtered the configurations with
794 * AConfiguration_match().
795 */
796int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test,
797 AConfiguration* requested);
798
799#ifdef __cplusplus
800};
801#endif
802
803#endif // ANDROID_CONFIGURATION_H
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700804
805/** @} */