blob: 628733231ab9e95ebd6bb0cbc108bfb0551726f7 [file] [log] [blame]
Mathias Agopiane1c61d32012-03-23 14:19:36 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
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
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37struct AConfiguration;
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070038/**
39 * {@link AConfiguration} is an opaque type used to get and set
40 * various subsystem configurations.
41 *
42 * A {@link AConfiguration} pointer can be obtained using:
43 * - AConfiguration_new()
44 * - AConfiguration_fromAssetManager()
45 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070046typedef struct AConfiguration AConfiguration;
47
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070048
49/**
50 * Define flags and constants for various subsystem configurations.
51 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070052enum {
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070053 /** Orientation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070054 ACONFIGURATION_ORIENTATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070055 /**
56 * Orientation: value corresponding to the
57 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a>
58 * resource qualifier.
59 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070060 ACONFIGURATION_ORIENTATION_PORT = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070061 /**
62 * Orientation: value corresponding to the
63 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a>
64 * resource qualifier.
65 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070066 ACONFIGURATION_ORIENTATION_LAND = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070067 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070068 ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
69
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070070 /** Touchscreen: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070071 ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070072 /**
73 * Touchscreen: value corresponding to the
74 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a>
75 * resource qualifier.
76 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070077 ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070078 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070079 ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070080 /**
81 * Touchscreen: value corresponding to the
82 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a>
83 * resource qualifier.
84 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070085 ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003,
86
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070087 /** Density: default density. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070088 ACONFIGURATION_DENSITY_DEFAULT = 0,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070089 /**
90 * Density: value corresponding to the
91 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a>
92 * resource qualifier.
93 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070094 ACONFIGURATION_DENSITY_LOW = 120,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070095 /**
96 * Density: value corresponding to the
97 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a>
98 * resource qualifier.
99 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700100 ACONFIGURATION_DENSITY_MEDIUM = 160,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700101 /**
102 * Density: value corresponding to the
103 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a>
104 * resource qualifier.
105 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700106 ACONFIGURATION_DENSITY_TV = 213,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700107 /**
108 * Density: value corresponding to the
109 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a>
110 * resource qualifier.
111 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700112 ACONFIGURATION_DENSITY_HIGH = 240,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700113 /**
114 * Density: value corresponding to the
115 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a>
116 * resource qualifier.
117 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700118 ACONFIGURATION_DENSITY_XHIGH = 320,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700119 /**
120 * Density: value corresponding to the
121 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a>
122 * resource qualifier.
123 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700124 ACONFIGURATION_DENSITY_XXHIGH = 480,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700125 /**
126 * Density: value corresponding to the
127 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a>
128 * resource qualifier.
129 */
Dianne Hackborn6303d062013-02-12 15:36:31 -0800130 ACONFIGURATION_DENSITY_XXXHIGH = 640,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700131 /** Density: any density. */
Adam Lesinski16d08a52014-08-22 22:23:08 -0700132 ACONFIGURATION_DENSITY_ANY = 0xfffe,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700133 /** Density: no density specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700134 ACONFIGURATION_DENSITY_NONE = 0xffff,
135
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700136 /** Keyboard: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700137 ACONFIGURATION_KEYBOARD_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700138 /**
139 * Keyboard: value corresponding to the
140 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a>
141 * resource qualifier.
142 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700143 ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700144 /**
145 * Keyboard: value corresponding to the
146 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a>
147 * resource qualifier.
148 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700149 ACONFIGURATION_KEYBOARD_QWERTY = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700150 /**
151 * Keyboard: value corresponding to the
152 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a>
153 * resource qualifier.
154 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700155 ACONFIGURATION_KEYBOARD_12KEY = 0x0003,
156
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700157 /** Navigation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700158 ACONFIGURATION_NAVIGATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700159 /**
160 * Navigation: value corresponding to the
161 * <a href="@@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a>
162 * resource qualifier.
163 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700164 ACONFIGURATION_NAVIGATION_NONAV = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700165 /**
166 * Navigation: value corresponding to the
167 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a>
168 * resource qualifier.
169 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700170 ACONFIGURATION_NAVIGATION_DPAD = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700171 /**
172 * Navigation: value corresponding to the
173 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a>
174 * resource qualifier.
175 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700176 ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700177 /**
178 * Navigation: value corresponding to the
179 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a>
180 * resource qualifier.
181 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700182 ACONFIGURATION_NAVIGATION_WHEEL = 0x0004,
183
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700184 /** Keyboard availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700185 ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700186 /**
187 * Keyboard availability: value corresponding to the
188 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keysexposed</a>
189 * resource qualifier.
190 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700191 ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700192 /**
193 * Keyboard availability: value corresponding to the
194 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyshidden</a>
195 * resource qualifier.
196 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700197 ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700198 /**
199 * Keyboard availability: value corresponding to the
200 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyssoft</a>
201 * resource qualifier.
202 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700203 ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
204
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700205 /** Navigation availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700206 ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700207 /**
208 * Navigation availability: value corresponding to the
209 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navexposed</a>
210 * resource qualifier.
211 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700212 ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700213 /**
214 * Navigation availability: value corresponding to the
215 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navhidden</a>
216 * resource qualifier.
217 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700218 ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
219
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700220 /** Screen size: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700221 ACONFIGURATION_SCREENSIZE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700222 /**
223 * Screen size: value indicating the screen is at least
224 * approximately 320x426 dp units, corresponding to the
225 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">small</a>
226 * resource qualifier.
227 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700228 ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700229 /**
230 * Screen size: value indicating the screen is at least
231 * approximately 320x470 dp units, corresponding to the
232 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">normal</a>
233 * resource qualifier.
234 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700235 ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700236 /**
237 * Screen size: value indicating the screen is at least
238 * approximately 480x640 dp units, corresponding to the
239 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">large</a>
240 * resource qualifier.
241 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700242 ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700243 /**
244 * Screen size: value indicating the screen is at least
245 * approximately 720x960 dp units, corresponding to the
246 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">xlarge</a>
247 * resource qualifier.
248 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700249 ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
250
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700251 /** Screen layout: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700252 ACONFIGURATION_SCREENLONG_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700253 /**
254 * Screen layout: value that corresponds to the
255 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">notlong</a>
256 * resource qualifier.
257 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700258 ACONFIGURATION_SCREENLONG_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700259 /**
260 * Screen layout: value that corresponds to the
261 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">long</a>
262 * resource qualifier.
263 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700264 ACONFIGURATION_SCREENLONG_YES = 0x2,
265
Adam Lesinski7eb14592015-05-14 14:28:32 -0700266 ACONFIGURATION_SCREENROUND_ANY = 0x00,
267 ACONFIGURATION_SCREENROUND_NO = 0x1,
268 ACONFIGURATION_SCREENROUND_YES = 0x2,
269
Romain Guya2310b92017-01-18 16:36:21 -0800270 /** Wide color gamut: not specified. */
271 ACONFIGURATION_WIDE_COLOR_GAMUT_ANY = 0x00,
272 /**
273 * Wide color gamut: value that corresponds to
274 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">no
275 * nowidecg</a> resource qualifier specified.
276 */
277 ACONFIGURATION_WIDE_COLOR_GAMUT_NO = 0x1,
278 /**
279 * Wide color gamut: value that corresponds to
280 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">
281 * widecg</a> resource qualifier specified.
282 */
283 ACONFIGURATION_WIDE_COLOR_GAMUT_YES = 0x2,
284
285 /** HDR: not specified. */
286 ACONFIGURATION_HDR_ANY = 0x00,
287 /**
288 * HDR: value that corresponds to
289 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">
290 * lowdr</a> resource qualifier specified.
291 */
292 ACONFIGURATION_HDR_NO = 0x1,
293 /**
294 * HDR: value that corresponds to
295 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">
296 * highdr</a> resource qualifier specified.
297 */
298 ACONFIGURATION_HDR_YES = 0x2,
299
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700300 /** UI mode: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700301 ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700302 /**
303 * UI mode: value that corresponds to
304 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">no
305 * UI mode type</a> resource qualifier specified.
306 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700307 ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700308 /**
309 * UI mode: value that corresponds to
310 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">desk</a> resource qualifier specified.
311 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700312 ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700313 /**
314 * UI mode: value that corresponds to
315 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">car</a> resource qualifier specified.
316 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700317 ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700318 /**
319 * UI mode: value that corresponds to
320 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">television</a> resource qualifier specified.
321 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700322 ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700323 /**
324 * UI mode: value that corresponds to
325 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">appliance</a> resource qualifier specified.
326 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700327 ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700328 /**
329 * UI mode: value that corresponds to
330 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">watch</a> resource qualifier specified.
331 */
John Spurlockad98ad02014-04-03 16:39:17 -0400332 ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
Zak Cohena62fb162016-12-09 15:06:02 -0800333 /**
334 * UI mode: value that corresponds to
335 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">vr</a> resource qualifier specified.
336 */
337 ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET = 0x07,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700338
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700339 /** UI night mode: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700340 ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700341 /**
342 * UI night mode: value that corresponds to
343 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">notnight</a> resource qualifier specified.
344 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700345 ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700346 /**
347 * UI night mode: value that corresponds to
348 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">night</a> resource qualifier specified.
349 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700350 ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
351
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700352 /** Screen width DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700353 ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
354
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700355 /** Screen height DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700356 ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
357
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700358 /** Smallest screen width DPI: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700359 ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
360
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700361 /** Layout direction: not specified. */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700362 ACONFIGURATION_LAYOUTDIR_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700363 /**
364 * Layout direction: value that corresponds to
365 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldltr</a> resource qualifier specified.
366 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700367 ACONFIGURATION_LAYOUTDIR_LTR = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700368 /**
369 * Layout direction: value that corresponds to
370 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldrtl</a> resource qualifier specified.
371 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700372 ACONFIGURATION_LAYOUTDIR_RTL = 0x02,
373
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700374 /**
375 * Bit mask for
376 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a>
377 * configuration.
378 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700379 ACONFIGURATION_MCC = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700380 /**
381 * Bit mask for
382 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a>
383 * configuration.
384 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700385 ACONFIGURATION_MNC = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700386 /**
387 * Bit mask for
388 * <a href="{@docRoot}guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a>
389 * configuration.
390 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700391 ACONFIGURATION_LOCALE = 0x0004,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700392 /**
393 * Bit mask for
394 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a>
395 * configuration.
396 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700397 ACONFIGURATION_TOUCHSCREEN = 0x0008,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700398 /**
399 * Bit mask for
400 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a>
401 * configuration.
402 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700403 ACONFIGURATION_KEYBOARD = 0x0010,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700404 /**
405 * Bit mask for
406 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a>
407 * configuration.
408 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700409 ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700410 /**
411 * Bit mask for
412 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a>
413 * configuration.
414 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700415 ACONFIGURATION_NAVIGATION = 0x0040,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700416 /**
417 * Bit mask for
418 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a>
419 * configuration.
420 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700421 ACONFIGURATION_ORIENTATION = 0x0080,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700422 /**
423 * Bit mask for
424 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">density</a>
425 * configuration.
426 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700427 ACONFIGURATION_DENSITY = 0x0100,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700428 /**
429 * Bit mask for
430 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a>
431 * configuration.
432 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700433 ACONFIGURATION_SCREEN_SIZE = 0x0200,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700434 /**
435 * Bit mask for
436 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a>
437 * configuration.
438 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700439 ACONFIGURATION_VERSION = 0x0400,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700440 /**
441 * Bit mask for screen layout configuration.
442 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700443 ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700444 /**
445 * Bit mask for
446 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a>
447 * configuration.
448 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700449 ACONFIGURATION_UI_MODE = 0x1000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700450 /**
451 * Bit mask for
452 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a>
453 * configuration.
454 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700455 ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700456 /**
457 * Bit mask for
458 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
459 * configuration.
460 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700461 ACONFIGURATION_LAYOUTDIR = 0x4000,
Adam Lesinski7eb14592015-05-14 14:28:32 -0700462 ACONFIGURATION_SCREEN_ROUND = 0x8000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700463 /**
Romain Guya2310b92017-01-18 16:36:21 -0800464 * Bit mask for
465 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#WideColorGamutQualifier">wide color gamut</a>
466 * and <a href="@dacRoot/guide/topics/resources/providing-resources.html#HDRQualifier">HDR</a> configurations.
467 */
Romain Guy3119ff02017-01-23 16:58:08 -0800468 ACONFIGURATION_COLOR_MODE = 0x10000,
Romain Guya2310b92017-01-18 16:36:21 -0800469 /**
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700470 * Constant used to to represent MNC (Mobile Network Code) zero.
471 * 0 cannot be used, since it is used to represent an undefined MNC.
472 */
Johan Redestig8df483c2013-05-30 08:30:42 +0200473 ACONFIGURATION_MNC_ZERO = 0xffff,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700474};
475
476/**
477 * Create a new AConfiguration, initialized with no values set.
478 */
479AConfiguration* AConfiguration_new();
480
481/**
482 * Free an AConfiguration that was previously created with
483 * AConfiguration_new().
484 */
485void AConfiguration_delete(AConfiguration* config);
486
487/**
488 * Create and return a new AConfiguration based on the current configuration in
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700489 * use in the given {@link AAssetManager}.
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700490 */
491void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am);
492
493/**
494 * Copy the contents of 'src' to 'dest'.
495 */
496void AConfiguration_copy(AConfiguration* dest, AConfiguration* src);
497
498/**
499 * Return the current MCC set in the configuration. 0 if not set.
500 */
501int32_t AConfiguration_getMcc(AConfiguration* config);
502
503/**
504 * Set the current MCC in the configuration. 0 to clear.
505 */
506void AConfiguration_setMcc(AConfiguration* config, int32_t mcc);
507
508/**
509 * Return the current MNC set in the configuration. 0 if not set.
510 */
511int32_t AConfiguration_getMnc(AConfiguration* config);
512
513/**
514 * Set the current MNC in the configuration. 0 to clear.
515 */
516void AConfiguration_setMnc(AConfiguration* config, int32_t mnc);
517
518/**
519 * Return the current language code set in the configuration. The output will
520 * be filled with an array of two characters. They are not 0-terminated. If
521 * a language is not set, they will be 0.
522 */
523void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage);
524
525/**
526 * Set the current language code in the configuration, from the first two
527 * characters in the string.
528 */
529void AConfiguration_setLanguage(AConfiguration* config, const char* language);
530
531/**
532 * Return the current country code set in the configuration. The output will
533 * be filled with an array of two characters. They are not 0-terminated. If
534 * a country is not set, they will be 0.
535 */
536void AConfiguration_getCountry(AConfiguration* config, char* outCountry);
537
538/**
539 * Set the current country code in the configuration, from the first two
540 * characters in the string.
541 */
542void AConfiguration_setCountry(AConfiguration* config, const char* country);
543
544/**
545 * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
546 */
547int32_t AConfiguration_getOrientation(AConfiguration* config);
548
549/**
550 * Set the current orientation in the configuration.
551 */
552void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation);
553
554/**
555 * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
556 */
557int32_t AConfiguration_getTouchscreen(AConfiguration* config);
558
559/**
560 * Set the current touchscreen in the configuration.
561 */
562void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen);
563
564/**
565 * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
566 */
567int32_t AConfiguration_getDensity(AConfiguration* config);
568
569/**
570 * Set the current density in the configuration.
571 */
572void AConfiguration_setDensity(AConfiguration* config, int32_t density);
573
574/**
575 * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
576 */
577int32_t AConfiguration_getKeyboard(AConfiguration* config);
578
579/**
580 * Set the current keyboard in the configuration.
581 */
582void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard);
583
584/**
585 * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
586 */
587int32_t AConfiguration_getNavigation(AConfiguration* config);
588
589/**
590 * Set the current navigation in the configuration.
591 */
592void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation);
593
594/**
595 * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
596 */
597int32_t AConfiguration_getKeysHidden(AConfiguration* config);
598
599/**
600 * Set the current keys hidden in the configuration.
601 */
602void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden);
603
604/**
605 * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
606 */
607int32_t AConfiguration_getNavHidden(AConfiguration* config);
608
609/**
610 * Set the current nav hidden in the configuration.
611 */
612void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden);
613
614/**
615 * Return the current SDK (API) version set in the configuration.
616 */
617int32_t AConfiguration_getSdkVersion(AConfiguration* config);
618
619/**
620 * Set the current SDK version in the configuration.
621 */
622void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion);
623
624/**
625 * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
626 */
627int32_t AConfiguration_getScreenSize(AConfiguration* config);
628
629/**
630 * Set the current screen size in the configuration.
631 */
632void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize);
633
634/**
635 * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
636 */
637int32_t AConfiguration_getScreenLong(AConfiguration* config);
638
639/**
640 * Set the current screen long in the configuration.
641 */
642void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong);
643
644/**
Adam Lesinski7eb14592015-05-14 14:28:32 -0700645 * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.
646 */
647int32_t AConfiguration_getScreenRound(AConfiguration* config);
648
649/**
650 * Set the current screen round in the configuration.
651 */
652void AConfiguration_setScreenRound(AConfiguration* config, int32_t screenRound);
653
654/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700655 * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
656 */
657int32_t AConfiguration_getUiModeType(AConfiguration* config);
658
659/**
660 * Set the current UI mode type in the configuration.
661 */
662void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType);
663
664/**
665 * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
666 */
667int32_t AConfiguration_getUiModeNight(AConfiguration* config);
668
669/**
670 * Set the current UI mode night in the configuration.
671 */
672void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
673
Dan Albert494ed552016-09-23 15:57:45 -0700674#if __ANDROID_API__ >= 13
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700675/**
676 * Return the current configuration screen width in dp units, or
677 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
678 */
679int32_t AConfiguration_getScreenWidthDp(AConfiguration* config);
680
681/**
682 * Set the configuration's current screen width in dp units.
683 */
684void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value);
685
686/**
687 * Return the current configuration screen height in dp units, or
688 * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
689 */
690int32_t AConfiguration_getScreenHeightDp(AConfiguration* config);
691
692/**
693 * Set the configuration's current screen width in dp units.
694 */
695void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value);
696
697/**
698 * Return the configuration's smallest screen width in dp units, or
699 * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
700 */
701int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
702
703/**
704 * Set the configuration's smallest screen width in dp units.
705 */
706void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
Dan Albert494ed552016-09-23 15:57:45 -0700707#endif /* __ANDROID_API__ >= 13 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700708
Dan Albert494ed552016-09-23 15:57:45 -0700709#if __ANDROID_API__ >= 17
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700710/**
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700711 * Return the configuration's layout direction, or
712 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
713 */
714int32_t AConfiguration_getLayoutDirection(AConfiguration* config);
715
716/**
717 * Set the configuration's layout direction.
718 */
719void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value);
Dan Albert494ed552016-09-23 15:57:45 -0700720#endif /* __ANDROID_API__ >= 17 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700721
722/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700723 * Perform a diff between two configurations. Returns a bit mask of
724 * ACONFIGURATION_* constants, each bit set meaning that configuration element
725 * is different between them.
726 */
727int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2);
728
729/**
730 * Determine whether 'base' is a valid configuration for use within the
731 * environment 'requested'. Returns 0 if there are any values in 'base'
732 * that conflict with 'requested'. Returns 1 if it does not conflict.
733 */
734int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested);
735
736/**
737 * Determine whether the configuration in 'test' is better than the existing
738 * configuration in 'base'. If 'requested' is non-NULL, this decision is based
739 * on the overall configuration given there. If it is NULL, this decision is
740 * simply based on which configuration is more specific. Returns non-0 if
741 * 'test' is better than 'base'.
742 *
743 * This assumes you have already filtered the configurations with
744 * AConfiguration_match().
745 */
746int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test,
747 AConfiguration* requested);
748
749#ifdef __cplusplus
750};
751#endif
752
753#endif // ANDROID_CONFIGURATION_H
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700754
755/** @} */