blob: a291db0ecdcf6c1914488f1e1e00ad365165329b [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
Biswapriyo Nath36880b32025-03-05 09:13:41 +000029#include <stdint.h>
Dan Albert494ed552016-09-23 15:57:45 -070030#include <sys/cdefs.h>
31
Mathias Agopiane1c61d32012-03-23 14:19:36 -070032#include <android/asset_manager.h>
33
Elliott Hughesc2fcafc2018-06-18 12:28:46 -070034#if !defined(__INTRODUCED_IN)
35#define __INTRODUCED_IN(__api_level) /* nothing */
36#endif
37
Mathias Agopiane1c61d32012-03-23 14:19:36 -070038#ifdef __cplusplus
39extern "C" {
40#endif
41
42struct AConfiguration;
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070043/**
44 * {@link AConfiguration} is an opaque type used to get and set
45 * various subsystem configurations.
46 *
47 * A {@link AConfiguration} pointer can be obtained using:
48 * - AConfiguration_new()
49 * - AConfiguration_fromAssetManager()
50 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070051typedef struct AConfiguration AConfiguration;
52
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070053
54/**
55 * Define flags and constants for various subsystem configurations.
56 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070057enum {
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070058 /** Orientation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070059 ACONFIGURATION_ORIENTATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070060 /**
61 * Orientation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000062 * <a href="/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070063 * resource qualifier.
64 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070065 ACONFIGURATION_ORIENTATION_PORT = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070066 /**
67 * Orientation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000068 * <a href="/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070069 * resource qualifier.
70 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070071 ACONFIGURATION_ORIENTATION_LAND = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070072 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070073 ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
74
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070075 /** Touchscreen: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070076 ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070077 /**
78 * Touchscreen: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000079 * <a href="/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070080 * resource qualifier.
81 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070082 ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070083 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070084 ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070085 /**
86 * Touchscreen: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000087 * <a href="/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070088 * resource qualifier.
89 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070090 ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003,
91
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070092 /** Density: default density. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070093 ACONFIGURATION_DENSITY_DEFAULT = 0,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070094 /**
95 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +000096 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070097 * resource qualifier.
98 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070099 ACONFIGURATION_DENSITY_LOW = 120,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700100 /**
101 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000102 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700103 * resource qualifier.
104 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700105 ACONFIGURATION_DENSITY_MEDIUM = 160,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700106 /**
107 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000108 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700109 * resource qualifier.
110 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700111 ACONFIGURATION_DENSITY_TV = 213,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700112 /**
113 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000114 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700115 * resource qualifier.
116 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700117 ACONFIGURATION_DENSITY_HIGH = 240,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700118 /**
119 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000120 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700121 * resource qualifier.
122 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700123 ACONFIGURATION_DENSITY_XHIGH = 320,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700124 /**
125 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000126 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700127 * resource qualifier.
128 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700129 ACONFIGURATION_DENSITY_XXHIGH = 480,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700130 /**
131 * Density: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000132 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700133 * resource qualifier.
134 */
Dianne Hackborn6303d062013-02-12 15:36:31 -0800135 ACONFIGURATION_DENSITY_XXXHIGH = 640,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700136 /** Density: any density. */
Adam Lesinski16d08a52014-08-22 22:23:08 -0700137 ACONFIGURATION_DENSITY_ANY = 0xfffe,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700138 /** Density: no density specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700139 ACONFIGURATION_DENSITY_NONE = 0xffff,
140
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700141 /** Keyboard: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700142 ACONFIGURATION_KEYBOARD_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700143 /**
144 * Keyboard: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000145 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700146 * resource qualifier.
147 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700148 ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700149 /**
150 * Keyboard: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000151 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700152 * resource qualifier.
153 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700154 ACONFIGURATION_KEYBOARD_QWERTY = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700155 /**
156 * Keyboard: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000157 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700158 * resource qualifier.
159 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700160 ACONFIGURATION_KEYBOARD_12KEY = 0x0003,
161
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700162 /** Navigation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700163 ACONFIGURATION_NAVIGATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700164 /**
165 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000166 * <a href="@/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700167 * resource qualifier.
168 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700169 ACONFIGURATION_NAVIGATION_NONAV = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700170 /**
171 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000172 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700173 * resource qualifier.
174 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700175 ACONFIGURATION_NAVIGATION_DPAD = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700176 /**
177 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000178 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700179 * resource qualifier.
180 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700181 ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700182 /**
183 * Navigation: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000184 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700185 * resource qualifier.
186 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700187 ACONFIGURATION_NAVIGATION_WHEEL = 0x0004,
188
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700189 /** Keyboard availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700190 ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700191 /**
192 * Keyboard availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000193 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keysexposed</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700194 * resource qualifier.
195 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700196 ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700197 /**
198 * Keyboard availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000199 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyshidden</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700200 * resource qualifier.
201 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700202 ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700203 /**
204 * Keyboard availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000205 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyssoft</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700206 * resource qualifier.
207 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700208 ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
209
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700210 /** Navigation availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700211 ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700212 /**
213 * Navigation availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000214 * <a href="/guide/topics/resources/providing-resources.html#NavAvailQualifier">navexposed</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700215 * resource qualifier.
216 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700217 ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700218 /**
219 * Navigation availability: value corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000220 * <a href="/guide/topics/resources/providing-resources.html#NavAvailQualifier">navhidden</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700221 * resource qualifier.
222 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700223 ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
224
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700225 /** Screen size: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700226 ACONFIGURATION_SCREENSIZE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700227 /**
228 * Screen size: value indicating the screen is at least
229 * approximately 320x426 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000230 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">small</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700231 * resource qualifier.
232 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700233 ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700234 /**
235 * Screen size: value indicating the screen is at least
236 * approximately 320x470 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000237 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">normal</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700238 * resource qualifier.
239 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700240 ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700241 /**
242 * Screen size: value indicating the screen is at least
243 * approximately 480x640 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000244 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">large</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700245 * resource qualifier.
246 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700247 ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700248 /**
249 * Screen size: value indicating the screen is at least
250 * approximately 720x960 dp units, corresponding to the
Nick Cook7a732122020-06-03 22:55:05 +0000251 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">xlarge</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700252 * resource qualifier.
253 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700254 ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
255
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700256 /** Screen layout: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700257 ACONFIGURATION_SCREENLONG_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700258 /**
259 * Screen layout: value that corresponds to the
Nick Cook7a732122020-06-03 22:55:05 +0000260 * <a href="/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">notlong</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700261 * resource qualifier.
262 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700263 ACONFIGURATION_SCREENLONG_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700264 /**
265 * Screen layout: value that corresponds to the
Nick Cook7a732122020-06-03 22:55:05 +0000266 * <a href="/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">long</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700267 * resource qualifier.
268 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700269 ACONFIGURATION_SCREENLONG_YES = 0x2,
270
Adam Lesinski7eb14592015-05-14 14:28:32 -0700271 ACONFIGURATION_SCREENROUND_ANY = 0x00,
272 ACONFIGURATION_SCREENROUND_NO = 0x1,
273 ACONFIGURATION_SCREENROUND_YES = 0x2,
274
Romain Guya2310b92017-01-18 16:36:21 -0800275 /** Wide color gamut: not specified. */
276 ACONFIGURATION_WIDE_COLOR_GAMUT_ANY = 0x00,
277 /**
278 * Wide color gamut: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000279 * <a href="/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">no
Romain Guya2310b92017-01-18 16:36:21 -0800280 * nowidecg</a> resource qualifier specified.
281 */
282 ACONFIGURATION_WIDE_COLOR_GAMUT_NO = 0x1,
283 /**
284 * Wide color gamut: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000285 * <a href="/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">
Romain Guya2310b92017-01-18 16:36:21 -0800286 * widecg</a> resource qualifier specified.
287 */
288 ACONFIGURATION_WIDE_COLOR_GAMUT_YES = 0x2,
289
290 /** HDR: not specified. */
291 ACONFIGURATION_HDR_ANY = 0x00,
292 /**
293 * HDR: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000294 * <a href="/guide/topics/resources/providing-resources.html#HDRQualifier">
Romain Guya2310b92017-01-18 16:36:21 -0800295 * lowdr</a> resource qualifier specified.
296 */
297 ACONFIGURATION_HDR_NO = 0x1,
298 /**
299 * HDR: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000300 * <a href="/guide/topics/resources/providing-resources.html#HDRQualifier">
Romain Guya2310b92017-01-18 16:36:21 -0800301 * highdr</a> resource qualifier specified.
302 */
303 ACONFIGURATION_HDR_YES = 0x2,
304
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700305 /** UI mode: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700306 ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700307 /**
308 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000309 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">no
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700310 * UI mode type</a> resource qualifier specified.
311 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700312 ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700313 /**
314 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000315 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">desk</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700316 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700317 ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700318 /**
319 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000320 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">car</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700321 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700322 ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700323 /**
324 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000325 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">television</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700326 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700327 ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700328 /**
329 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000330 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">appliance</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700331 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700332 ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700333 /**
334 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000335 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">watch</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700336 */
John Spurlockad98ad02014-04-03 16:39:17 -0400337 ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
Zak Cohena62fb162016-12-09 15:06:02 -0800338 /**
339 * UI mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000340 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">vr</a> resource qualifier specified.
Zak Cohena62fb162016-12-09 15:06:02 -0800341 */
342 ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET = 0x07,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700343
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700344 /** UI night mode: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700345 ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700346 /**
347 * UI night mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000348 * <a href="/guide/topics/resources/providing-resources.html#NightQualifier">notnight</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700349 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700350 ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700351 /**
352 * UI night mode: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000353 * <a href="/guide/topics/resources/providing-resources.html#NightQualifier">night</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700354 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700355 ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
356
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700357 /** Screen width DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700358 ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
359
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700360 /** Screen height DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700361 ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
362
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700363 /** Smallest screen width DPI: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700364 ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
365
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700366 /** Layout direction: not specified. */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700367 ACONFIGURATION_LAYOUTDIR_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700368 /**
369 * Layout direction: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000370 * <a href="/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldltr</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700371 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700372 ACONFIGURATION_LAYOUTDIR_LTR = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700373 /**
374 * Layout direction: value that corresponds to
Nick Cook7a732122020-06-03 22:55:05 +0000375 * <a href="/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldrtl</a> resource qualifier specified.
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700376 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700377 ACONFIGURATION_LAYOUTDIR_RTL = 0x02,
378
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700379 /**
380 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000381 * <a href="/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700382 * configuration.
383 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700384 ACONFIGURATION_MCC = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700385 /**
386 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000387 * <a href="/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700388 * configuration.
389 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700390 ACONFIGURATION_MNC = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700391 /**
392 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000393 * <a href="/guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700394 * configuration.
395 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700396 ACONFIGURATION_LOCALE = 0x0004,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700397 /**
398 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000399 * <a href="/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700400 * configuration.
401 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700402 ACONFIGURATION_TOUCHSCREEN = 0x0008,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700403 /**
404 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000405 * <a href="/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700406 * configuration.
407 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700408 ACONFIGURATION_KEYBOARD = 0x0010,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700409 /**
410 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000411 * <a href="/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700412 * configuration.
413 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700414 ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700415 /**
416 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000417 * <a href="/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700418 * configuration.
419 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700420 ACONFIGURATION_NAVIGATION = 0x0040,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700421 /**
422 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000423 * <a href="/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700424 * configuration.
425 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700426 ACONFIGURATION_ORIENTATION = 0x0080,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700427 /**
428 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000429 * <a href="/guide/topics/resources/providing-resources.html#DensityQualifier">density</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700430 * configuration.
431 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700432 ACONFIGURATION_DENSITY = 0x0100,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700433 /**
434 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000435 * <a href="/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700436 * configuration.
437 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700438 ACONFIGURATION_SCREEN_SIZE = 0x0200,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700439 /**
440 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000441 * <a href="/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700442 * configuration.
443 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700444 ACONFIGURATION_VERSION = 0x0400,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700445 /**
446 * Bit mask for screen layout configuration.
447 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700448 ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700449 /**
450 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000451 * <a href="/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700452 * configuration.
453 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700454 ACONFIGURATION_UI_MODE = 0x1000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700455 /**
456 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000457 * <a href="/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700458 * configuration.
459 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700460 ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700461 /**
462 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000463 * <a href="/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700464 * configuration.
465 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700466 ACONFIGURATION_LAYOUTDIR = 0x4000,
Adam Lesinski7eb14592015-05-14 14:28:32 -0700467 ACONFIGURATION_SCREEN_ROUND = 0x8000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700468 /**
Romain Guya2310b92017-01-18 16:36:21 -0800469 * Bit mask for
Nick Cook7a732122020-06-03 22:55:05 +0000470 * <a href="/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">wide color gamut</a>
471 * and <a href="/guide/topics/resources/providing-resources.html#HDRQualifier">HDR</a> configurations.
Romain Guya2310b92017-01-18 16:36:21 -0800472 */
Romain Guy3119ff02017-01-23 16:58:08 -0800473 ACONFIGURATION_COLOR_MODE = 0x10000,
Romain Guya2310b92017-01-18 16:36:21 -0800474 /**
Yurii Zubrytskyi0e4f1772023-01-04 08:45:03 -0800475 * Bit mask for
476 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">grammatical gender</a>
477 * configuration.
478 */
479 ACONFIGURATION_GRAMMATICAL_GENDER = 0x20000,
480 /**
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700481 * Constant used to to represent MNC (Mobile Network Code) zero.
482 * 0 cannot be used, since it is used to represent an undefined MNC.
483 */
Johan Redestig8df483c2013-05-30 08:30:42 +0200484 ACONFIGURATION_MNC_ZERO = 0xffff,
Yurii Zubrytskyi0e4f1772023-01-04 08:45:03 -0800485
486 /**
487 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: not specified.
488 */
489 ACONFIGURATION_GRAMMATICAL_GENDER_ANY = 0,
490
491 /**
492 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: neuter.
493 */
494 ACONFIGURATION_GRAMMATICAL_GENDER_NEUTER = 1,
495
496 /**
497 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: feminine.
498 */
499 ACONFIGURATION_GRAMMATICAL_GENDER_FEMININE = 2,
500
501 /**
502 * <a href="/guide/topics/resources/providing-resources.html#GrammaticalInflectionQualifier">Grammatical gender</a>: masculine.
503 */
504 ACONFIGURATION_GRAMMATICAL_GENDER_MASCULINE = 3,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700505};
506
507/**
508 * Create a new AConfiguration, initialized with no values set.
509 */
510AConfiguration* AConfiguration_new();
511
512/**
513 * Free an AConfiguration that was previously created with
514 * AConfiguration_new().
515 */
516void AConfiguration_delete(AConfiguration* config);
517
518/**
519 * Create and return a new AConfiguration based on the current configuration in
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700520 * use in the given {@link AAssetManager}.
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700521 */
522void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am);
523
524/**
525 * Copy the contents of 'src' to 'dest'.
526 */
527void AConfiguration_copy(AConfiguration* dest, AConfiguration* src);
528
529/**
530 * Return the current MCC set in the configuration. 0 if not set.
531 */
532int32_t AConfiguration_getMcc(AConfiguration* config);
533
534/**
535 * Set the current MCC in the configuration. 0 to clear.
536 */
537void AConfiguration_setMcc(AConfiguration* config, int32_t mcc);
538
539/**
540 * Return the current MNC set in the configuration. 0 if not set.
541 */
542int32_t AConfiguration_getMnc(AConfiguration* config);
543
544/**
545 * Set the current MNC in the configuration. 0 to clear.
546 */
547void AConfiguration_setMnc(AConfiguration* config, int32_t mnc);
548
549/**
550 * Return the current language code set in the configuration. The output will
551 * be filled with an array of two characters. They are not 0-terminated. If
552 * a language is not set, they will be 0.
553 */
554void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage);
555
556/**
557 * Set the current language code in the configuration, from the first two
558 * characters in the string.
559 */
560void AConfiguration_setLanguage(AConfiguration* config, const char* language);
561
562/**
563 * Return the current country code set in the configuration. The output will
564 * be filled with an array of two characters. They are not 0-terminated. If
565 * a country is not set, they will be 0.
566 */
567void AConfiguration_getCountry(AConfiguration* config, char* outCountry);
568
569/**
570 * Set the current country code in the configuration, from the first two
571 * characters in the string.
572 */
573void AConfiguration_setCountry(AConfiguration* config, const char* country);
574
575/**
576 * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
577 */
578int32_t AConfiguration_getOrientation(AConfiguration* config);
579
580/**
581 * Set the current orientation in the configuration.
582 */
583void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation);
584
585/**
586 * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
587 */
588int32_t AConfiguration_getTouchscreen(AConfiguration* config);
589
590/**
591 * Set the current touchscreen in the configuration.
592 */
593void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen);
594
595/**
596 * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
597 */
598int32_t AConfiguration_getDensity(AConfiguration* config);
599
600/**
601 * Set the current density in the configuration.
602 */
603void AConfiguration_setDensity(AConfiguration* config, int32_t density);
604
605/**
606 * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
607 */
608int32_t AConfiguration_getKeyboard(AConfiguration* config);
609
610/**
611 * Set the current keyboard in the configuration.
612 */
613void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard);
614
615/**
616 * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
617 */
618int32_t AConfiguration_getNavigation(AConfiguration* config);
619
620/**
621 * Set the current navigation in the configuration.
622 */
623void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation);
624
625/**
626 * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
627 */
628int32_t AConfiguration_getKeysHidden(AConfiguration* config);
629
630/**
631 * Set the current keys hidden in the configuration.
632 */
633void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden);
634
635/**
636 * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
637 */
638int32_t AConfiguration_getNavHidden(AConfiguration* config);
639
640/**
641 * Set the current nav hidden in the configuration.
642 */
643void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden);
644
645/**
646 * Return the current SDK (API) version set in the configuration.
647 */
648int32_t AConfiguration_getSdkVersion(AConfiguration* config);
649
650/**
651 * Set the current SDK version in the configuration.
652 */
653void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion);
654
655/**
656 * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
657 */
658int32_t AConfiguration_getScreenSize(AConfiguration* config);
659
660/**
661 * Set the current screen size in the configuration.
662 */
663void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize);
664
665/**
666 * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
667 */
668int32_t AConfiguration_getScreenLong(AConfiguration* config);
669
670/**
671 * Set the current screen long in the configuration.
672 */
673void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong);
674
675/**
Adam Lesinski7eb14592015-05-14 14:28:32 -0700676 * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.
Elliott Hughesba80a0f2019-12-18 15:13:40 -0800677 *
678 * Available since API level 30.
Adam Lesinski7eb14592015-05-14 14:28:32 -0700679 */
Elliott Hughesba80a0f2019-12-18 15:13:40 -0800680int32_t AConfiguration_getScreenRound(AConfiguration* config) __INTRODUCED_IN(30);
Adam Lesinski7eb14592015-05-14 14:28:32 -0700681
682/**
683 * Set the current screen round in the configuration.
684 */
685void AConfiguration_setScreenRound(AConfiguration* config, int32_t screenRound);
686
687/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700688 * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
689 */
690int32_t AConfiguration_getUiModeType(AConfiguration* config);
691
692/**
693 * Set the current UI mode type in the configuration.
694 */
695void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType);
696
697/**
698 * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
699 */
700int32_t AConfiguration_getUiModeNight(AConfiguration* config);
701
702/**
703 * Set the current UI mode night in the configuration.
704 */
705void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
706
707/**
708 * Return the current configuration screen width in dp units, or
709 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
710 */
Elliott Hughes05565472019-10-29 08:59:39 -0700711int32_t AConfiguration_getScreenWidthDp(AConfiguration* config);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700712
713/**
714 * Set the configuration's current screen width in dp units.
715 */
Elliott Hughes05565472019-10-29 08:59:39 -0700716void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700717
718/**
719 * Return the current configuration screen height in dp units, or
720 * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
721 */
Elliott Hughes05565472019-10-29 08:59:39 -0700722int32_t AConfiguration_getScreenHeightDp(AConfiguration* config);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700723
724/**
725 * Set the configuration's current screen width in dp units.
726 */
Elliott Hughes05565472019-10-29 08:59:39 -0700727void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700728
729/**
730 * Return the configuration's smallest screen width in dp units, or
731 * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
732 */
Elliott Hughes05565472019-10-29 08:59:39 -0700733int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700734
735/**
736 * Set the configuration's smallest screen width in dp units.
737 */
Elliott Hughes05565472019-10-29 08:59:39 -0700738void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700739
740/**
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700741 * Return the configuration's layout direction, or
742 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
Elliott Hughes05565472019-10-29 08:59:39 -0700743 *
744 * Available since API level 17.
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700745 */
Elliott Hughesc2fcafc2018-06-18 12:28:46 -0700746int32_t AConfiguration_getLayoutDirection(AConfiguration* config) __INTRODUCED_IN(17);
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700747
748/**
749 * Set the configuration's layout direction.
Elliott Hughes05565472019-10-29 08:59:39 -0700750 *
751 * Available since API level 17.
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700752 */
Elliott Hughesc2fcafc2018-06-18 12:28:46 -0700753void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value) __INTRODUCED_IN(17);
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700754
755/**
Yurii Zubrytskyi0e4f1772023-01-04 08:45:03 -0800756 * Return the configuration's grammatical gender, or ACONFIGURATION_GRAMMATICAL_GENDER_ANY if
757 * not set.
758 *
759 * Available since API level 34.
760 */
761int32_t AConfiguration_getGrammaticalGender(AConfiguration* config)
762 __INTRODUCED_IN(__ANDROID_API_U__);
763
764/**
765 * Set the configuration's grammatical gender to one of the
766 * ACONFIGURATION_GRAMMATICAL_GENDER_* constants.
767 *
768 * Available since API level 34.
769 */
770void AConfiguration_setGrammaticalGender(AConfiguration* config, int32_t value)
771 __INTRODUCED_IN(__ANDROID_API_U__);
772
773/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700774 * Perform a diff between two configurations. Returns a bit mask of
775 * ACONFIGURATION_* constants, each bit set meaning that configuration element
776 * is different between them.
777 */
778int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2);
779
780/**
781 * Determine whether 'base' is a valid configuration for use within the
782 * environment 'requested'. Returns 0 if there are any values in 'base'
783 * that conflict with 'requested'. Returns 1 if it does not conflict.
784 */
785int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested);
786
787/**
788 * Determine whether the configuration in 'test' is better than the existing
789 * configuration in 'base'. If 'requested' is non-NULL, this decision is based
790 * on the overall configuration given there. If it is NULL, this decision is
791 * simply based on which configuration is more specific. Returns non-0 if
792 * 'test' is better than 'base'.
793 *
794 * This assumes you have already filtered the configurations with
795 * AConfiguration_match().
796 */
797int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test,
798 AConfiguration* requested);
799
800#ifdef __cplusplus
801};
802#endif
803
804#endif // ANDROID_CONFIGURATION_H
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700805
806/** @} */