Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 1 | /* |
| 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 Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 17 | /** |
| 18 | * @addtogroup Configuration |
| 19 | * @{ |
| 20 | */ |
| 21 | |
| 22 | /** |
| 23 | * @file configuration.h |
| 24 | */ |
| 25 | |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 26 | #ifndef ANDROID_CONFIGURATION_H |
| 27 | #define ANDROID_CONFIGURATION_H |
| 28 | |
Dan Albert | 494ed55 | 2016-09-23 15:57:45 -0700 | [diff] [blame] | 29 | #include <sys/cdefs.h> |
| 30 | |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 31 | #include <android/asset_manager.h> |
| 32 | |
| 33 | #ifdef __cplusplus |
| 34 | extern "C" { |
| 35 | #endif |
| 36 | |
| 37 | struct AConfiguration; |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 38 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 46 | typedef struct AConfiguration AConfiguration; |
| 47 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * Define flags and constants for various subsystem configurations. |
| 51 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 52 | enum { |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 53 | /** Orientation: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 54 | ACONFIGURATION_ORIENTATION_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 55 | /** |
| 56 | * Orientation: value corresponding to the |
| 57 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a> |
| 58 | * resource qualifier. |
| 59 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 60 | ACONFIGURATION_ORIENTATION_PORT = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 61 | /** |
| 62 | * Orientation: value corresponding to the |
| 63 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a> |
| 64 | * resource qualifier. |
| 65 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 66 | ACONFIGURATION_ORIENTATION_LAND = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 67 | /** @deprecated Not currently supported or used. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 68 | ACONFIGURATION_ORIENTATION_SQUARE = 0x0003, |
| 69 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 70 | /** Touchscreen: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 71 | ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 72 | /** |
| 73 | * Touchscreen: value corresponding to the |
| 74 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a> |
| 75 | * resource qualifier. |
| 76 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 77 | ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 78 | /** @deprecated Not currently supported or used. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 79 | ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 80 | /** |
| 81 | * Touchscreen: value corresponding to the |
| 82 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a> |
| 83 | * resource qualifier. |
| 84 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 85 | ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003, |
| 86 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 87 | /** Density: default density. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 88 | ACONFIGURATION_DENSITY_DEFAULT = 0, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 89 | /** |
| 90 | * Density: value corresponding to the |
| 91 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a> |
| 92 | * resource qualifier. |
| 93 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 94 | ACONFIGURATION_DENSITY_LOW = 120, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 95 | /** |
| 96 | * Density: value corresponding to the |
| 97 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a> |
| 98 | * resource qualifier. |
| 99 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 100 | ACONFIGURATION_DENSITY_MEDIUM = 160, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 101 | /** |
| 102 | * Density: value corresponding to the |
| 103 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a> |
| 104 | * resource qualifier. |
| 105 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 106 | ACONFIGURATION_DENSITY_TV = 213, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 107 | /** |
| 108 | * Density: value corresponding to the |
| 109 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a> |
| 110 | * resource qualifier. |
| 111 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 112 | ACONFIGURATION_DENSITY_HIGH = 240, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 113 | /** |
| 114 | * Density: value corresponding to the |
| 115 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a> |
| 116 | * resource qualifier. |
| 117 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 118 | ACONFIGURATION_DENSITY_XHIGH = 320, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 119 | /** |
| 120 | * Density: value corresponding to the |
| 121 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a> |
| 122 | * resource qualifier. |
| 123 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 124 | ACONFIGURATION_DENSITY_XXHIGH = 480, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 125 | /** |
| 126 | * Density: value corresponding to the |
| 127 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a> |
| 128 | * resource qualifier. |
| 129 | */ |
Dianne Hackborn | 6303d06 | 2013-02-12 15:36:31 -0800 | [diff] [blame] | 130 | ACONFIGURATION_DENSITY_XXXHIGH = 640, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 131 | /** Density: any density. */ |
Adam Lesinski | 16d08a5 | 2014-08-22 22:23:08 -0700 | [diff] [blame] | 132 | ACONFIGURATION_DENSITY_ANY = 0xfffe, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 133 | /** Density: no density specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 134 | ACONFIGURATION_DENSITY_NONE = 0xffff, |
| 135 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 136 | /** Keyboard: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 137 | ACONFIGURATION_KEYBOARD_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 138 | /** |
| 139 | * Keyboard: value corresponding to the |
| 140 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a> |
| 141 | * resource qualifier. |
| 142 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 143 | ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 144 | /** |
| 145 | * Keyboard: value corresponding to the |
| 146 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a> |
| 147 | * resource qualifier. |
| 148 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 149 | ACONFIGURATION_KEYBOARD_QWERTY = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 150 | /** |
| 151 | * Keyboard: value corresponding to the |
| 152 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a> |
| 153 | * resource qualifier. |
| 154 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 155 | ACONFIGURATION_KEYBOARD_12KEY = 0x0003, |
| 156 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 157 | /** Navigation: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 158 | ACONFIGURATION_NAVIGATION_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 159 | /** |
| 160 | * Navigation: value corresponding to the |
| 161 | * <a href="@@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a> |
| 162 | * resource qualifier. |
| 163 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 164 | ACONFIGURATION_NAVIGATION_NONAV = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 165 | /** |
| 166 | * Navigation: value corresponding to the |
| 167 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a> |
| 168 | * resource qualifier. |
| 169 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 170 | ACONFIGURATION_NAVIGATION_DPAD = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 171 | /** |
| 172 | * Navigation: value corresponding to the |
| 173 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a> |
| 174 | * resource qualifier. |
| 175 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 176 | ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 177 | /** |
| 178 | * Navigation: value corresponding to the |
| 179 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a> |
| 180 | * resource qualifier. |
| 181 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 182 | ACONFIGURATION_NAVIGATION_WHEEL = 0x0004, |
| 183 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 184 | /** Keyboard availability: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 185 | ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 186 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 191 | ACONFIGURATION_KEYSHIDDEN_NO = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 192 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 197 | ACONFIGURATION_KEYSHIDDEN_YES = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 198 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 203 | ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003, |
| 204 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 205 | /** Navigation availability: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 206 | ACONFIGURATION_NAVHIDDEN_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 207 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 212 | ACONFIGURATION_NAVHIDDEN_NO = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 213 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 218 | ACONFIGURATION_NAVHIDDEN_YES = 0x0002, |
| 219 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 220 | /** Screen size: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 221 | ACONFIGURATION_SCREENSIZE_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 222 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 228 | ACONFIGURATION_SCREENSIZE_SMALL = 0x01, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 229 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 235 | ACONFIGURATION_SCREENSIZE_NORMAL = 0x02, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 236 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 242 | ACONFIGURATION_SCREENSIZE_LARGE = 0x03, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 243 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 249 | ACONFIGURATION_SCREENSIZE_XLARGE = 0x04, |
| 250 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 251 | /** Screen layout: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 252 | ACONFIGURATION_SCREENLONG_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 253 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 258 | ACONFIGURATION_SCREENLONG_NO = 0x1, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 259 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 264 | ACONFIGURATION_SCREENLONG_YES = 0x2, |
| 265 | |
Adam Lesinski | 7eb1459 | 2015-05-14 14:28:32 -0700 | [diff] [blame] | 266 | ACONFIGURATION_SCREENROUND_ANY = 0x00, |
| 267 | ACONFIGURATION_SCREENROUND_NO = 0x1, |
| 268 | ACONFIGURATION_SCREENROUND_YES = 0x2, |
| 269 | |
Romain Guy | a2310b9 | 2017-01-18 16:36:21 -0800 | [diff] [blame^] | 270 | /** 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 Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 300 | /** UI mode: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 301 | ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 302 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 307 | ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 308 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 312 | ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 313 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 317 | ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 318 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 322 | ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 323 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 327 | ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 328 | /** |
| 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 Spurlock | ad98ad0 | 2014-04-03 16:39:17 -0400 | [diff] [blame] | 332 | ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06, |
Zak Cohen | a62fb16 | 2016-12-09 15:06:02 -0800 | [diff] [blame] | 333 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 338 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 339 | /** UI night mode: not specified.*/ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 340 | ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 341 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 345 | ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 346 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 350 | ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2, |
| 351 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 352 | /** Screen width DPI: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 353 | ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000, |
| 354 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 355 | /** Screen height DPI: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 356 | ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000, |
| 357 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 358 | /** Smallest screen width DPI: not specified.*/ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 359 | ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000, |
| 360 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 361 | /** Layout direction: not specified. */ |
Fabrice Di Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 362 | ACONFIGURATION_LAYOUTDIR_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 363 | /** |
| 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 Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 367 | ACONFIGURATION_LAYOUTDIR_LTR = 0x01, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 368 | /** |
| 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 Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 372 | ACONFIGURATION_LAYOUTDIR_RTL = 0x02, |
| 373 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 374 | /** |
| 375 | * Bit mask for |
| 376 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a> |
| 377 | * configuration. |
| 378 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 379 | ACONFIGURATION_MCC = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 380 | /** |
| 381 | * Bit mask for |
| 382 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a> |
| 383 | * configuration. |
| 384 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 385 | ACONFIGURATION_MNC = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 386 | /** |
| 387 | * Bit mask for |
| 388 | * <a href="{@docRoot}guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a> |
| 389 | * configuration. |
| 390 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 391 | ACONFIGURATION_LOCALE = 0x0004, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 392 | /** |
| 393 | * Bit mask for |
| 394 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a> |
| 395 | * configuration. |
| 396 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 397 | ACONFIGURATION_TOUCHSCREEN = 0x0008, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 398 | /** |
| 399 | * Bit mask for |
| 400 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a> |
| 401 | * configuration. |
| 402 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 403 | ACONFIGURATION_KEYBOARD = 0x0010, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 404 | /** |
| 405 | * Bit mask for |
| 406 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a> |
| 407 | * configuration. |
| 408 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 409 | ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 410 | /** |
| 411 | * Bit mask for |
| 412 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a> |
| 413 | * configuration. |
| 414 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 415 | ACONFIGURATION_NAVIGATION = 0x0040, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 416 | /** |
| 417 | * Bit mask for |
| 418 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a> |
| 419 | * configuration. |
| 420 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 421 | ACONFIGURATION_ORIENTATION = 0x0080, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 422 | /** |
| 423 | * Bit mask for |
| 424 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">density</a> |
| 425 | * configuration. |
| 426 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 427 | ACONFIGURATION_DENSITY = 0x0100, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 428 | /** |
| 429 | * Bit mask for |
| 430 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a> |
| 431 | * configuration. |
| 432 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 433 | ACONFIGURATION_SCREEN_SIZE = 0x0200, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 434 | /** |
| 435 | * Bit mask for |
| 436 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a> |
| 437 | * configuration. |
| 438 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 439 | ACONFIGURATION_VERSION = 0x0400, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 440 | /** |
| 441 | * Bit mask for screen layout configuration. |
| 442 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 443 | ACONFIGURATION_SCREEN_LAYOUT = 0x0800, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 444 | /** |
| 445 | * Bit mask for |
| 446 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a> |
| 447 | * configuration. |
| 448 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 449 | ACONFIGURATION_UI_MODE = 0x1000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 450 | /** |
| 451 | * Bit mask for |
| 452 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a> |
| 453 | * configuration. |
| 454 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 455 | ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 456 | /** |
| 457 | * Bit mask for |
| 458 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a> |
| 459 | * configuration. |
| 460 | */ |
Fabrice Di Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 461 | ACONFIGURATION_LAYOUTDIR = 0x4000, |
Adam Lesinski | 7eb1459 | 2015-05-14 14:28:32 -0700 | [diff] [blame] | 462 | ACONFIGURATION_SCREEN_ROUND = 0x8000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 463 | /** |
Romain Guy | a2310b9 | 2017-01-18 16:36:21 -0800 | [diff] [blame^] | 464 | * 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 | */ |
| 468 | ACONFIGURATION_COLORIMETRY = 0x10000, |
| 469 | /** |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 470 | * 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 Redestig | 8df483c | 2013-05-30 08:30:42 +0200 | [diff] [blame] | 473 | ACONFIGURATION_MNC_ZERO = 0xffff, |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 474 | }; |
| 475 | |
| 476 | /** |
| 477 | * Create a new AConfiguration, initialized with no values set. |
| 478 | */ |
| 479 | AConfiguration* AConfiguration_new(); |
| 480 | |
| 481 | /** |
| 482 | * Free an AConfiguration that was previously created with |
| 483 | * AConfiguration_new(). |
| 484 | */ |
| 485 | void AConfiguration_delete(AConfiguration* config); |
| 486 | |
| 487 | /** |
| 488 | * Create and return a new AConfiguration based on the current configuration in |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 489 | * use in the given {@link AAssetManager}. |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 490 | */ |
| 491 | void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am); |
| 492 | |
| 493 | /** |
| 494 | * Copy the contents of 'src' to 'dest'. |
| 495 | */ |
| 496 | void AConfiguration_copy(AConfiguration* dest, AConfiguration* src); |
| 497 | |
| 498 | /** |
| 499 | * Return the current MCC set in the configuration. 0 if not set. |
| 500 | */ |
| 501 | int32_t AConfiguration_getMcc(AConfiguration* config); |
| 502 | |
| 503 | /** |
| 504 | * Set the current MCC in the configuration. 0 to clear. |
| 505 | */ |
| 506 | void AConfiguration_setMcc(AConfiguration* config, int32_t mcc); |
| 507 | |
| 508 | /** |
| 509 | * Return the current MNC set in the configuration. 0 if not set. |
| 510 | */ |
| 511 | int32_t AConfiguration_getMnc(AConfiguration* config); |
| 512 | |
| 513 | /** |
| 514 | * Set the current MNC in the configuration. 0 to clear. |
| 515 | */ |
| 516 | void 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 | */ |
| 523 | void 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 | */ |
| 529 | void 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 | */ |
| 536 | void 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 | */ |
| 542 | void AConfiguration_setCountry(AConfiguration* config, const char* country); |
| 543 | |
| 544 | /** |
| 545 | * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration. |
| 546 | */ |
| 547 | int32_t AConfiguration_getOrientation(AConfiguration* config); |
| 548 | |
| 549 | /** |
| 550 | * Set the current orientation in the configuration. |
| 551 | */ |
| 552 | void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation); |
| 553 | |
| 554 | /** |
| 555 | * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration. |
| 556 | */ |
| 557 | int32_t AConfiguration_getTouchscreen(AConfiguration* config); |
| 558 | |
| 559 | /** |
| 560 | * Set the current touchscreen in the configuration. |
| 561 | */ |
| 562 | void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen); |
| 563 | |
| 564 | /** |
| 565 | * Return the current ACONFIGURATION_DENSITY_* set in the configuration. |
| 566 | */ |
| 567 | int32_t AConfiguration_getDensity(AConfiguration* config); |
| 568 | |
| 569 | /** |
| 570 | * Set the current density in the configuration. |
| 571 | */ |
| 572 | void AConfiguration_setDensity(AConfiguration* config, int32_t density); |
| 573 | |
| 574 | /** |
| 575 | * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration. |
| 576 | */ |
| 577 | int32_t AConfiguration_getKeyboard(AConfiguration* config); |
| 578 | |
| 579 | /** |
| 580 | * Set the current keyboard in the configuration. |
| 581 | */ |
| 582 | void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard); |
| 583 | |
| 584 | /** |
| 585 | * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration. |
| 586 | */ |
| 587 | int32_t AConfiguration_getNavigation(AConfiguration* config); |
| 588 | |
| 589 | /** |
| 590 | * Set the current navigation in the configuration. |
| 591 | */ |
| 592 | void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation); |
| 593 | |
| 594 | /** |
| 595 | * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration. |
| 596 | */ |
| 597 | int32_t AConfiguration_getKeysHidden(AConfiguration* config); |
| 598 | |
| 599 | /** |
| 600 | * Set the current keys hidden in the configuration. |
| 601 | */ |
| 602 | void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden); |
| 603 | |
| 604 | /** |
| 605 | * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration. |
| 606 | */ |
| 607 | int32_t AConfiguration_getNavHidden(AConfiguration* config); |
| 608 | |
| 609 | /** |
| 610 | * Set the current nav hidden in the configuration. |
| 611 | */ |
| 612 | void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden); |
| 613 | |
| 614 | /** |
| 615 | * Return the current SDK (API) version set in the configuration. |
| 616 | */ |
| 617 | int32_t AConfiguration_getSdkVersion(AConfiguration* config); |
| 618 | |
| 619 | /** |
| 620 | * Set the current SDK version in the configuration. |
| 621 | */ |
| 622 | void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion); |
| 623 | |
| 624 | /** |
| 625 | * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration. |
| 626 | */ |
| 627 | int32_t AConfiguration_getScreenSize(AConfiguration* config); |
| 628 | |
| 629 | /** |
| 630 | * Set the current screen size in the configuration. |
| 631 | */ |
| 632 | void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize); |
| 633 | |
| 634 | /** |
| 635 | * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration. |
| 636 | */ |
| 637 | int32_t AConfiguration_getScreenLong(AConfiguration* config); |
| 638 | |
| 639 | /** |
| 640 | * Set the current screen long in the configuration. |
| 641 | */ |
| 642 | void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong); |
| 643 | |
| 644 | /** |
Adam Lesinski | 7eb1459 | 2015-05-14 14:28:32 -0700 | [diff] [blame] | 645 | * Return the current ACONFIGURATION_SCREENROUND_* set in the configuration. |
| 646 | */ |
| 647 | int32_t AConfiguration_getScreenRound(AConfiguration* config); |
| 648 | |
| 649 | /** |
| 650 | * Set the current screen round in the configuration. |
| 651 | */ |
| 652 | void AConfiguration_setScreenRound(AConfiguration* config, int32_t screenRound); |
| 653 | |
| 654 | /** |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 655 | * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration. |
| 656 | */ |
| 657 | int32_t AConfiguration_getUiModeType(AConfiguration* config); |
| 658 | |
| 659 | /** |
| 660 | * Set the current UI mode type in the configuration. |
| 661 | */ |
| 662 | void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType); |
| 663 | |
| 664 | /** |
| 665 | * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration. |
| 666 | */ |
| 667 | int32_t AConfiguration_getUiModeNight(AConfiguration* config); |
| 668 | |
| 669 | /** |
| 670 | * Set the current UI mode night in the configuration. |
| 671 | */ |
| 672 | void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight); |
| 673 | |
Dan Albert | 494ed55 | 2016-09-23 15:57:45 -0700 | [diff] [blame] | 674 | #if __ANDROID_API__ >= 13 |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 675 | /** |
| 676 | * Return the current configuration screen width in dp units, or |
| 677 | * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set. |
| 678 | */ |
| 679 | int32_t AConfiguration_getScreenWidthDp(AConfiguration* config); |
| 680 | |
| 681 | /** |
| 682 | * Set the configuration's current screen width in dp units. |
| 683 | */ |
| 684 | void 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 | */ |
| 690 | int32_t AConfiguration_getScreenHeightDp(AConfiguration* config); |
| 691 | |
| 692 | /** |
| 693 | * Set the configuration's current screen width in dp units. |
| 694 | */ |
| 695 | void 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 | */ |
| 701 | int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config); |
| 702 | |
| 703 | /** |
| 704 | * Set the configuration's smallest screen width in dp units. |
| 705 | */ |
| 706 | void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value); |
Dan Albert | 494ed55 | 2016-09-23 15:57:45 -0700 | [diff] [blame] | 707 | #endif /* __ANDROID_API__ >= 13 */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 708 | |
Dan Albert | 494ed55 | 2016-09-23 15:57:45 -0700 | [diff] [blame] | 709 | #if __ANDROID_API__ >= 17 |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 710 | /** |
Fabrice Di Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 711 | * Return the configuration's layout direction, or |
| 712 | * ACONFIGURATION_LAYOUTDIR_ANY if not set. |
| 713 | */ |
| 714 | int32_t AConfiguration_getLayoutDirection(AConfiguration* config); |
| 715 | |
| 716 | /** |
| 717 | * Set the configuration's layout direction. |
| 718 | */ |
| 719 | void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value); |
Dan Albert | 494ed55 | 2016-09-23 15:57:45 -0700 | [diff] [blame] | 720 | #endif /* __ANDROID_API__ >= 17 */ |
Fabrice Di Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 721 | |
| 722 | /** |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 723 | * 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 | */ |
| 727 | int32_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 | */ |
| 734 | int32_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 | */ |
| 746 | int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test, |
| 747 | AConfiguration* requested); |
| 748 | |
| 749 | #ifdef __cplusplus |
| 750 | }; |
| 751 | #endif |
| 752 | |
| 753 | #endif // ANDROID_CONFIGURATION_H |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame] | 754 | |
| 755 | /** @} */ |