blob: 287865eba1d539c86fdf1250f83c2e30c3a0af9e [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
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700264 /** UI mode: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700265 ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700266 /**
267 * UI mode: value that corresponds to
268 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">no
269 * UI mode type</a> resource qualifier specified.
270 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700271 ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700272 /**
273 * UI mode: value that corresponds to
274 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">desk</a> resource qualifier specified.
275 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700276 ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700277 /**
278 * UI mode: value that corresponds to
279 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">car</a> resource qualifier specified.
280 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700281 ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700282 /**
283 * UI mode: value that corresponds to
284 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">television</a> resource qualifier specified.
285 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700286 ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700287 /**
288 * UI mode: value that corresponds to
289 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">appliance</a> resource qualifier specified.
290 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700291 ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700292 /**
293 * UI mode: value that corresponds to
294 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">watch</a> resource qualifier specified.
295 */
John Spurlockad98ad02014-04-03 16:39:17 -0400296 ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700297
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700298 /** UI night mode: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700299 ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700300 /**
301 * UI night mode: value that corresponds to
302 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">notnight</a> resource qualifier specified.
303 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700304 ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700305 /**
306 * UI night mode: value that corresponds to
307 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NightQualifier">night</a> resource qualifier specified.
308 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700309 ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
310
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700311 /** Screen width DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700312 ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
313
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700314 /** Screen height DPI: not specified. */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700315 ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
316
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700317 /** Smallest screen width DPI: not specified.*/
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700318 ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
319
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700320 /** Layout direction: not specified. */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700321 ACONFIGURATION_LAYOUTDIR_ANY = 0x00,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700322 /**
323 * Layout direction: value that corresponds to
324 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldltr</a> resource qualifier specified.
325 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700326 ACONFIGURATION_LAYOUTDIR_LTR = 0x01,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700327 /**
328 * Layout direction: value that corresponds to
329 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">ldrtl</a> resource qualifier specified.
330 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700331 ACONFIGURATION_LAYOUTDIR_RTL = 0x02,
332
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700333 /**
334 * Bit mask for
335 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a>
336 * configuration.
337 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700338 ACONFIGURATION_MCC = 0x0001,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700339 /**
340 * Bit mask for
341 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a>
342 * configuration.
343 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700344 ACONFIGURATION_MNC = 0x0002,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700345 /**
346 * Bit mask for
347 * <a href="{@docRoot}guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a>
348 * configuration.
349 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700350 ACONFIGURATION_LOCALE = 0x0004,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700351 /**
352 * Bit mask for
353 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a>
354 * configuration.
355 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700356 ACONFIGURATION_TOUCHSCREEN = 0x0008,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700357 /**
358 * Bit mask for
359 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a>
360 * configuration.
361 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700362 ACONFIGURATION_KEYBOARD = 0x0010,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700363 /**
364 * Bit mask for
365 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a>
366 * configuration.
367 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700368 ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700369 /**
370 * Bit mask for
371 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a>
372 * configuration.
373 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700374 ACONFIGURATION_NAVIGATION = 0x0040,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700375 /**
376 * Bit mask for
377 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a>
378 * configuration.
379 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700380 ACONFIGURATION_ORIENTATION = 0x0080,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700381 /**
382 * Bit mask for
383 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">density</a>
384 * configuration.
385 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700386 ACONFIGURATION_DENSITY = 0x0100,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700387 /**
388 * Bit mask for
389 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a>
390 * configuration.
391 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700392 ACONFIGURATION_SCREEN_SIZE = 0x0200,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700393 /**
394 * Bit mask for
395 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a>
396 * configuration.
397 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700398 ACONFIGURATION_VERSION = 0x0400,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700399 /**
400 * Bit mask for screen layout configuration.
401 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700402 ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700403 /**
404 * Bit mask for
405 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a>
406 * configuration.
407 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700408 ACONFIGURATION_UI_MODE = 0x1000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700409 /**
410 * Bit mask for
411 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a>
412 * configuration.
413 */
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700414 ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700415 /**
416 * Bit mask for
417 * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a>
418 * configuration.
419 */
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700420 ACONFIGURATION_LAYOUTDIR = 0x4000,
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700421 /**
422 * Constant used to to represent MNC (Mobile Network Code) zero.
423 * 0 cannot be used, since it is used to represent an undefined MNC.
424 */
Johan Redestig8df483c2013-05-30 08:30:42 +0200425 ACONFIGURATION_MNC_ZERO = 0xffff,
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700426};
427
428/**
429 * Create a new AConfiguration, initialized with no values set.
430 */
431AConfiguration* AConfiguration_new();
432
433/**
434 * Free an AConfiguration that was previously created with
435 * AConfiguration_new().
436 */
437void AConfiguration_delete(AConfiguration* config);
438
439/**
440 * Create and return a new AConfiguration based on the current configuration in
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700441 * use in the given {@link AAssetManager}.
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700442 */
443void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am);
444
445/**
446 * Copy the contents of 'src' to 'dest'.
447 */
448void AConfiguration_copy(AConfiguration* dest, AConfiguration* src);
449
450/**
451 * Return the current MCC set in the configuration. 0 if not set.
452 */
453int32_t AConfiguration_getMcc(AConfiguration* config);
454
455/**
456 * Set the current MCC in the configuration. 0 to clear.
457 */
458void AConfiguration_setMcc(AConfiguration* config, int32_t mcc);
459
460/**
461 * Return the current MNC set in the configuration. 0 if not set.
462 */
463int32_t AConfiguration_getMnc(AConfiguration* config);
464
465/**
466 * Set the current MNC in the configuration. 0 to clear.
467 */
468void AConfiguration_setMnc(AConfiguration* config, int32_t mnc);
469
470/**
471 * Return the current language code set in the configuration. The output will
472 * be filled with an array of two characters. They are not 0-terminated. If
473 * a language is not set, they will be 0.
474 */
475void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage);
476
477/**
478 * Set the current language code in the configuration, from the first two
479 * characters in the string.
480 */
481void AConfiguration_setLanguage(AConfiguration* config, const char* language);
482
483/**
484 * Return the current country code set in the configuration. The output will
485 * be filled with an array of two characters. They are not 0-terminated. If
486 * a country is not set, they will be 0.
487 */
488void AConfiguration_getCountry(AConfiguration* config, char* outCountry);
489
490/**
491 * Set the current country code in the configuration, from the first two
492 * characters in the string.
493 */
494void AConfiguration_setCountry(AConfiguration* config, const char* country);
495
496/**
497 * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
498 */
499int32_t AConfiguration_getOrientation(AConfiguration* config);
500
501/**
502 * Set the current orientation in the configuration.
503 */
504void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation);
505
506/**
507 * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
508 */
509int32_t AConfiguration_getTouchscreen(AConfiguration* config);
510
511/**
512 * Set the current touchscreen in the configuration.
513 */
514void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen);
515
516/**
517 * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
518 */
519int32_t AConfiguration_getDensity(AConfiguration* config);
520
521/**
522 * Set the current density in the configuration.
523 */
524void AConfiguration_setDensity(AConfiguration* config, int32_t density);
525
526/**
527 * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
528 */
529int32_t AConfiguration_getKeyboard(AConfiguration* config);
530
531/**
532 * Set the current keyboard in the configuration.
533 */
534void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard);
535
536/**
537 * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
538 */
539int32_t AConfiguration_getNavigation(AConfiguration* config);
540
541/**
542 * Set the current navigation in the configuration.
543 */
544void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation);
545
546/**
547 * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
548 */
549int32_t AConfiguration_getKeysHidden(AConfiguration* config);
550
551/**
552 * Set the current keys hidden in the configuration.
553 */
554void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden);
555
556/**
557 * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
558 */
559int32_t AConfiguration_getNavHidden(AConfiguration* config);
560
561/**
562 * Set the current nav hidden in the configuration.
563 */
564void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden);
565
566/**
567 * Return the current SDK (API) version set in the configuration.
568 */
569int32_t AConfiguration_getSdkVersion(AConfiguration* config);
570
571/**
572 * Set the current SDK version in the configuration.
573 */
574void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion);
575
576/**
577 * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
578 */
579int32_t AConfiguration_getScreenSize(AConfiguration* config);
580
581/**
582 * Set the current screen size in the configuration.
583 */
584void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize);
585
586/**
587 * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
588 */
589int32_t AConfiguration_getScreenLong(AConfiguration* config);
590
591/**
592 * Set the current screen long in the configuration.
593 */
594void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong);
595
596/**
597 * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
598 */
599int32_t AConfiguration_getUiModeType(AConfiguration* config);
600
601/**
602 * Set the current UI mode type in the configuration.
603 */
604void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType);
605
606/**
607 * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
608 */
609int32_t AConfiguration_getUiModeNight(AConfiguration* config);
610
611/**
612 * Set the current UI mode night in the configuration.
613 */
614void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
615
616/**
617 * Return the current configuration screen width in dp units, or
618 * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
619 */
620int32_t AConfiguration_getScreenWidthDp(AConfiguration* config);
621
622/**
623 * Set the configuration's current screen width in dp units.
624 */
625void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value);
626
627/**
628 * Return the current configuration screen height in dp units, or
629 * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
630 */
631int32_t AConfiguration_getScreenHeightDp(AConfiguration* config);
632
633/**
634 * Set the configuration's current screen width in dp units.
635 */
636void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value);
637
638/**
639 * Return the configuration's smallest screen width in dp units, or
640 * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
641 */
642int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config);
643
644/**
645 * Set the configuration's smallest screen width in dp units.
646 */
647void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value);
648
649/**
Fabrice Di Meglio8855e6f2012-06-20 15:47:21 -0700650 * Return the configuration's layout direction, or
651 * ACONFIGURATION_LAYOUTDIR_ANY if not set.
652 */
653int32_t AConfiguration_getLayoutDirection(AConfiguration* config);
654
655/**
656 * Set the configuration's layout direction.
657 */
658void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value);
659
660/**
Mathias Agopiane1c61d32012-03-23 14:19:36 -0700661 * Perform a diff between two configurations. Returns a bit mask of
662 * ACONFIGURATION_* constants, each bit set meaning that configuration element
663 * is different between them.
664 */
665int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2);
666
667/**
668 * Determine whether 'base' is a valid configuration for use within the
669 * environment 'requested'. Returns 0 if there are any values in 'base'
670 * that conflict with 'requested'. Returns 1 if it does not conflict.
671 */
672int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested);
673
674/**
675 * Determine whether the configuration in 'test' is better than the existing
676 * configuration in 'base'. If 'requested' is non-NULL, this decision is based
677 * on the overall configuration given there. If it is NULL, this decision is
678 * simply based on which configuration is more specific. Returns non-0 if
679 * 'test' is better than 'base'.
680 *
681 * This assumes you have already filtered the configurations with
682 * AConfiguration_match().
683 */
684int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test,
685 AConfiguration* requested);
686
687#ifdef __cplusplus
688};
689#endif
690
691#endif // ANDROID_CONFIGURATION_H
Johan Euphrosinebf6d5e02015-03-27 17:15:43 -0700692
693/** @} */