blob: 81f71a92cb05e2081b7a5d2adf5311201f3ac137 [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
29#include <android/asset_manager.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35struct AConfiguration;
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070036/**
37 * {@link AConfiguration} is an opaque type used to get and set
38 * various subsystem configurations.
39 *
40 * A {@link AConfiguration} pointer can be obtained using:
41 * - AConfiguration_new()
42 * - AConfiguration_fromAssetManager()
43 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070044typedef struct AConfiguration AConfiguration;
45
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070046
47/**
48 * Define flags and constants for various subsystem configurations.
49 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070050enum {
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070051 /** Orientation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070052 ACONFIGURATION_ORIENTATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070053 /**
54 * Orientation: value corresponding to the
55 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a>
56 * resource qualifier.
57 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070058 ACONFIGURATION_ORIENTATION_PORT = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070059 /**
60 * Orientation: value corresponding to the
61 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a>
62 * resource qualifier.
63 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070064 ACONFIGURATION_ORIENTATION_LAND = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070065 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070066 ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
67
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070068 /** Touchscreen: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070069 ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070070 /**
71 * Touchscreen: value corresponding to the
72 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a>
73 * resource qualifier.
74 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070075 ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070076 /** @deprecated Not currently supported or used. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070077 ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070078 /**
79 * Touchscreen: value corresponding to the
80 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a>
81 * resource qualifier.
82 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070083 ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003,
84
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070085 /** Density: default density. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070086 ACONFIGURATION_DENSITY_DEFAULT = 0,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070087 /**
88 * Density: value corresponding to the
89 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a>
90 * resource qualifier.
91 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070092 ACONFIGURATION_DENSITY_LOW = 120,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070093 /**
94 * Density: value corresponding to the
95 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a>
96 * resource qualifier.
97 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -070098 ACONFIGURATION_DENSITY_MEDIUM = 160,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -070099 /**
100 * Density: value corresponding to the
101 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a>
102 * resource qualifier.
103 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700104 ACONFIGURATION_DENSITY_TV = 213,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700105 /**
106 * Density: value corresponding to the
107 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a>
108 * resource qualifier.
109 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700110 ACONFIGURATION_DENSITY_HIGH = 240,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700111 /**
112 * Density: value corresponding to the
113 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a>
114 * resource qualifier.
115 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700116 ACONFIGURATION_DENSITY_XHIGH = 320,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700117 /**
118 * Density: value corresponding to the
119 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a>
120 * resource qualifier.
121 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700122 ACONFIGURATION_DENSITY_XXHIGH = 480,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700123 /**
124 * Density: value corresponding to the
125 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a>
126 * resource qualifier.
127 */
Dianne Hackborn6303d062013-02-12 15:36:31 -0800128 ACONFIGURATION_DENSITY_XXXHIGH = 640,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700129 /** Density: any density. */
Adam Lesinski16d08a52014-08-22 22:23:08 -0700130 ACONFIGURATION_DENSITY_ANY = 0xfffe,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700131 /** Density: no density specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700132 ACONFIGURATION_DENSITY_NONE = 0xffff,
133
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700134 /** Keyboard: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700135 ACONFIGURATION_KEYBOARD_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700136 /**
137 * Keyboard: value corresponding to the
138 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a>
139 * resource qualifier.
140 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700141 ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700142 /**
143 * Keyboard: value corresponding to the
144 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a>
145 * resource qualifier.
146 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700147 ACONFIGURATION_KEYBOARD_QWERTY = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700148 /**
149 * Keyboard: value corresponding to the
150 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a>
151 * resource qualifier.
152 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700153 ACONFIGURATION_KEYBOARD_12KEY = 0x0003,
154
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700155 /** Navigation: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700156 ACONFIGURATION_NAVIGATION_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700157 /**
158 * Navigation: value corresponding to the
159 * <a href="@@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a>
160 * resource qualifier.
161 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700162 ACONFIGURATION_NAVIGATION_NONAV = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700163 /**
164 * Navigation: value corresponding to the
165 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a>
166 * resource qualifier.
167 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700168 ACONFIGURATION_NAVIGATION_DPAD = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700169 /**
170 * Navigation: value corresponding to the
171 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a>
172 * resource qualifier.
173 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700174 ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700175 /**
176 * Navigation: value corresponding to the
177 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a>
178 * resource qualifier.
179 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700180 ACONFIGURATION_NAVIGATION_WHEEL = 0x0004,
181
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700182 /** Keyboard availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700183 ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700184 /**
185 * Keyboard availability: value corresponding to the
186 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keysexposed</a>
187 * resource qualifier.
188 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700189 ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700190 /**
191 * Keyboard availability: value corresponding to the
192 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyshidden</a>
193 * resource qualifier.
194 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700195 ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700196 /**
197 * Keyboard availability: value corresponding to the
198 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyssoft</a>
199 * resource qualifier.
200 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700201 ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
202
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700203 /** Navigation availability: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700204 ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700205 /**
206 * Navigation availability: value corresponding to the
207 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navexposed</a>
208 * resource qualifier.
209 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700210 ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700211 /**
212 * Navigation availability: value corresponding to the
213 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavAvailQualifier">navhidden</a>
214 * resource qualifier.
215 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700216 ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
217
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700218 /** Screen size: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700219 ACONFIGURATION_SCREENSIZE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700220 /**
221 * Screen size: value indicating the screen is at least
222 * approximately 320x426 dp units, corresponding to the
223 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">small</a>
224 * resource qualifier.
225 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700226 ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700227 /**
228 * Screen size: value indicating the screen is at least
229 * approximately 320x470 dp units, corresponding to the
230 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">normal</a>
231 * resource qualifier.
232 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700233 ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700234 /**
235 * Screen size: value indicating the screen is at least
236 * approximately 480x640 dp units, corresponding to the
237 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">large</a>
238 * resource qualifier.
239 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700240 ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700241 /**
242 * Screen size: value indicating the screen is at least
243 * approximately 720x960 dp units, corresponding to the
244 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">xlarge</a>
245 * resource qualifier.
246 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700247 ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
248
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700249 /** Screen layout: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700250 ACONFIGURATION_SCREENLONG_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700251 /**
252 * Screen layout: value that corresponds to the
253 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">notlong</a>
254 * resource qualifier.
255 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700256 ACONFIGURATION_SCREENLONG_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700257 /**
258 * Screen layout: value that corresponds to the
259 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenAspectQualifier">long</a>
260 * resource qualifier.
261 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700262 ACONFIGURATION_SCREENLONG_YES = 0x2,
263
Adam Lesinski7eb14592015-05-14 14:28:32 -0700264 ACONFIGURATION_SCREENROUND_ANY = 0x00,
265 ACONFIGURATION_SCREENROUND_NO = 0x1,
266 ACONFIGURATION_SCREENROUND_YES = 0x2,
267
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700268 /** UI mode: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700269 ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700270 /**
271 * UI mode: value that corresponds to
272 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">no
273 * UI mode type</a> resource qualifier specified.
274 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700275 ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700276 /**
277 * UI mode: value that corresponds to
278 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">desk</a> resource qualifier specified.
279 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700280 ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700281 /**
282 * UI mode: value that corresponds to
283 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">car</a> resource qualifier specified.
284 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700285 ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700286 /**
287 * UI mode: value that corresponds to
288 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">television</a> resource qualifier specified.
289 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700290 ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700291 /**
292 * UI mode: value that corresponds to
293 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">appliance</a> resource qualifier specified.
294 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700295 ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700296 /**
297 * UI mode: value that corresponds to
298 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">watch</a> resource qualifier specified.
299 */
John Spurlockad98ad02014-04-03 16:39:17 -0400300 ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700301
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700302 /** UI night mode: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700303 ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700304 /**
305 * UI night mode: value that corresponds to
306 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">notnight</a> resource qualifier specified.
307 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700308 ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700309 /**
310 * UI night mode: value that corresponds to
311 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">night</a> resource qualifier specified.
312 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700313 ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
314
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700315 /** Screen width DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700316 ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
317
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700318 /** Screen height DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700319 ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
320
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700321 /** Smallest screen width DPI: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700322 ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
323
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700324 /** Layout direction: not specified. */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700325 ACONFIGURATION_LAYOUTDIR_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700326 /**
327 * Layout direction: value that corresponds to
328 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldltr</a> resource qualifier specified.
329 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700330 ACONFIGURATION_LAYOUTDIR_LTR = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700331 /**
332 * Layout direction: value that corresponds to
333 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldrtl</a> resource qualifier specified.
334 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700335 ACONFIGURATION_LAYOUTDIR_RTL = 0x02,
336
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700337 /**
338 * Bit mask for
339 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a>
340 * configuration.
341 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700342 ACONFIGURATION_MCC = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700343 /**
344 * Bit mask for
345 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a>
346 * configuration.
347 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700348 ACONFIGURATION_MNC = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700349 /**
350 * Bit mask for
351 * <a href="{@docRoot}guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a>
352 * configuration.
353 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700354 ACONFIGURATION_LOCALE = 0x0004,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700355 /**
356 * Bit mask for
357 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a>
358 * configuration.
359 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700360 ACONFIGURATION_TOUCHSCREEN = 0x0008,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700361 /**
362 * Bit mask for
363 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a>
364 * configuration.
365 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700366 ACONFIGURATION_KEYBOARD = 0x0010,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700367 /**
368 * Bit mask for
369 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a>
370 * configuration.
371 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700372 ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700373 /**
374 * Bit mask for
375 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a>
376 * configuration.
377 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700378 ACONFIGURATION_NAVIGATION = 0x0040,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700379 /**
380 * Bit mask for
381 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a>
382 * configuration.
383 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700384 ACONFIGURATION_ORIENTATION = 0x0080,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700385 /**
386 * Bit mask for
387 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">density</a>
388 * configuration.
389 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700390 ACONFIGURATION_DENSITY = 0x0100,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700391 /**
392 * Bit mask for
393 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a>
394 * configuration.
395 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700396 ACONFIGURATION_SCREEN_SIZE = 0x0200,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700397 /**
398 * Bit mask for
399 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a>
400 * configuration.
401 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700402 ACONFIGURATION_VERSION = 0x0400,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700403 /**
404 * Bit mask for screen layout configuration.
405 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700406 ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700407 /**
408 * Bit mask for
409 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a>
410 * configuration.
411 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700412 ACONFIGURATION_UI_MODE = 0x1000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700413 /**
414 * Bit mask for
415 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a>
416 * configuration.
417 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700418 ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700419 /**
420 * Bit mask for
421 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
422 * configuration.
423 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700424 ACONFIGURATION_LAYOUTDIR = 0x4000,
Adam Lesinski7eb14592015-05-14 14:28:32 -0700425 ACONFIGURATION_SCREEN_ROUND = 0x8000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700426 /**
427 * Constant used to to represent MNC (Mobile Network Code) zero.
428 * 0 cannot be used, since it is used to represent an undefined MNC.
429 */
Johan Redestig8df483c2013-05-30 08:30:42 +0200430 ACONFIGURATION_MNC_ZERO = 0xffff,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700431};
432
433/**
434 * Create a new AConfiguration, initialized with no values set.
435 */
436AConfiguration* AConfiguration_new();
437
438/**
439 * Free an AConfiguration that was previously created with
440 * AConfiguration_new().
441 */
442void AConfiguration_delete(AConfiguration* config);
443
444/**
445 * Create and return a new AConfiguration based on the current configuration in
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700446 * use in the given {@link AAssetManager}.
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700447 */
448void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am);
449
450/**
451 * Copy the contents of 'src' to 'dest'.
452 */
453void AConfiguration_copy(AConfiguration* dest, AConfiguration* src);
454
455/**
456 * Return the current MCC set in the configuration. 0 if not set.
457 */
458int32_t AConfiguration_getMcc(AConfiguration* config);
459
460/**
461 * Set the current MCC in the configuration. 0 to clear.
462 */
463void AConfiguration_setMcc(AConfiguration* config, int32_t mcc);
464
465/**
466 * Return the current MNC set in the configuration. 0 if not set.
467 */
468int32_t AConfiguration_getMnc(AConfiguration* config);
469
470/**
471 * Set the current MNC in the configuration. 0 to clear.
472 */
473void AConfiguration_setMnc(AConfiguration* config, int32_t mnc);
474
475/**
476 * Return the current language code set in the configuration. The output will
477 * be filled with an array of two characters. They are not 0-terminated. If
478 * a language is not set, they will be 0.
479 */
480void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage);
481
482/**
483 * Set the current language code in the configuration, from the first two
484 * characters in the string.
485 */
486void AConfiguration_setLanguage(AConfiguration* config, const char* language);
487
488/**
489 * Return the current country code set in the configuration. The output will
490 * be filled with an array of two characters. They are not 0-terminated. If
491 * a country is not set, they will be 0.
492 */
493void AConfiguration_getCountry(AConfiguration* config, char* outCountry);
494
495/**
496 * Set the current country code in the configuration, from the first two
497 * characters in the string.
498 */
499void AConfiguration_setCountry(AConfiguration* config, const char* country);
500
501/**
502 * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
503 */
504int32_t AConfiguration_getOrientation(AConfiguration* config);
505
506/**
507 * Set the current orientation in the configuration.
508 */
509void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation);
510
511/**
512 * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
513 */
514int32_t AConfiguration_getTouchscreen(AConfiguration* config);
515
516/**
517 * Set the current touchscreen in the configuration.
518 */
519void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen);
520
521/**
522 * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
523 */
524int32_t AConfiguration_getDensity(AConfiguration* config);
525
526/**
527 * Set the current density in the configuration.
528 */
529void AConfiguration_setDensity(AConfiguration* config, int32_t density);
530
531/**
532 * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
533 */
534int32_t AConfiguration_getKeyboard(AConfiguration* config);
535
536/**
537 * Set the current keyboard in the configuration.
538 */
539void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard);
540
541/**
542 * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
543 */
544int32_t AConfiguration_getNavigation(AConfiguration* config);
545
546/**
547 * Set the current navigation in the configuration.
548 */
549void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation);
550
551/**
552 * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
553 */
554int32_t AConfiguration_getKeysHidden(AConfiguration* config);
555
556/**
557 * Set the current keys hidden in the configuration.
558 */
559void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden);
560
561/**
562 * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
563 */
564int32_t AConfiguration_getNavHidden(AConfiguration* config);
565
566/**
567 * Set the current nav hidden in the configuration.
568 */
569void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden);
570
571/**
572 * Return the current SDK (API) version set in the configuration.
573 */
574int32_t AConfiguration_getSdkVersion(AConfiguration* config);
575
576/**
577 * Set the current SDK version in the configuration.
578 */
579void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion);
580
581/**
582 * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
583 */
584int32_t AConfiguration_getScreenSize(AConfiguration* config);
585
586/**
587 * Set the current screen size in the configuration.
588 */
589void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize);
590
591/**
592 * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
593 */
594int32_t AConfiguration_getScreenLong(AConfiguration* config);
595
596/**
597 * Set the current screen long in the configuration.
598 */
599void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong);
600
601/**
Adam Lesinski7eb14592015-05-14 14:28:32 -0700602 * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.
603 */
604int32_t AConfiguration_getScreenRound(AConfiguration* config);
605
606/**
607 * Set the current screen round in the configuration.
608 */
609void AConfiguration_setScreenRound(AConfiguration* config, int32_t screenRound);
610
611/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700612 * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
613 */
614int32_t AConfiguration_getUiModeType(AConfiguration* config);
615
616/**
617 * Set the current UI mode type in the configuration.
618 */
619void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType);
620
621/**
622 * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
623 */
624int32_t AConfiguration_getUiModeNight(AConfiguration* config);
625
626/**
627 * Set the current UI mode night in the configuration.
628 */
629void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
630
631/**
632 * Return the current configuration screen width in dp units, or
633 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
634 */
635int32_t AConfiguration_getScreenWidthDp(AConfiguration* config);
636
637/**
638 * Set the configuration's current screen width in dp units.
639 */
640void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value);
641
642/**
643 * Return the current configuration screen height in dp units, or
644 * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
645 */
646int32_t AConfiguration_getScreenHeightDp(AConfiguration* config);
647
648/**
649 * Set the configuration's current screen width in dp units.
650 */
651void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value);
652
653/**
654 * Return the configuration's smallest screen width in dp units, or
655 * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
656 */
657int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
658
659/**
660 * Set the configuration's smallest screen width in dp units.
661 */
662void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
663
664/**
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700665 * Return the configuration's layout direction, or
666 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
667 */
668int32_t AConfiguration_getLayoutDirection(AConfiguration* config);
669
670/**
671 * Set the configuration's layout direction.
672 */
673void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value);
674
675/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700676 * Perform a diff between two configurations. Returns a bit mask of
677 * ACONFIGURATION_* constants, each bit set meaning that configuration element
678 * is different between them.
679 */
680int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2);
681
682/**
683 * Determine whether 'base' is a valid configuration for use within the
684 * environment 'requested'. Returns 0 if there are any values in 'base'
685 * that conflict with 'requested'. Returns 1 if it does not conflict.
686 */
687int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested);
688
689/**
690 * Determine whether the configuration in 'test' is better than the existing
691 * configuration in 'base'. If 'requested' is non-NULL, this decision is based
692 * on the overall configuration given there. If it is NULL, this decision is
693 * simply based on which configuration is more specific. Returns non-0 if
694 * 'test' is better than 'base'.
695 *
696 * This assumes you have already filtered the configurations with
697 * AConfiguration_match().
698 */
699int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test,
700 AConfiguration* requested);
701
702#ifdef __cplusplus
703};
704#endif
705
706#endif // ANDROID_CONFIGURATION_H
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700707
708/** @} */