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 | |
| 29 | #include <android/asset_manager.h> |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
| 35 | struct AConfiguration; |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 36 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 44 | typedef struct AConfiguration AConfiguration; |
| 45 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 46 | |
| 47 | /** |
| 48 | * Define flags and constants for various subsystem configurations. |
| 49 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 50 | enum { |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 51 | /** Orientation: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 52 | ACONFIGURATION_ORIENTATION_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 53 | /** |
| 54 | * Orientation: value corresponding to the |
| 55 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">port</a> |
| 56 | * resource qualifier. |
| 57 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 58 | ACONFIGURATION_ORIENTATION_PORT = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 59 | /** |
| 60 | * Orientation: value corresponding to the |
| 61 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">land</a> |
| 62 | * resource qualifier. |
| 63 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 64 | ACONFIGURATION_ORIENTATION_LAND = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 65 | /** @deprecated Not currently supported or used. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 66 | ACONFIGURATION_ORIENTATION_SQUARE = 0x0003, |
| 67 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 68 | /** Touchscreen: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 69 | ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 70 | /** |
| 71 | * Touchscreen: value corresponding to the |
| 72 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">notouch</a> |
| 73 | * resource qualifier. |
| 74 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 75 | ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 76 | /** @deprecated Not currently supported or used. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 77 | ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 78 | /** |
| 79 | * Touchscreen: value corresponding to the |
| 80 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">finger</a> |
| 81 | * resource qualifier. |
| 82 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 83 | ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003, |
| 84 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 85 | /** Density: default density. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 86 | ACONFIGURATION_DENSITY_DEFAULT = 0, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 87 | /** |
| 88 | * Density: value corresponding to the |
| 89 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">ldpi</a> |
| 90 | * resource qualifier. |
| 91 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 92 | ACONFIGURATION_DENSITY_LOW = 120, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 93 | /** |
| 94 | * Density: value corresponding to the |
| 95 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">mdpi</a> |
| 96 | * resource qualifier. |
| 97 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 98 | ACONFIGURATION_DENSITY_MEDIUM = 160, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 99 | /** |
| 100 | * Density: value corresponding to the |
| 101 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">tvdpi</a> |
| 102 | * resource qualifier. |
| 103 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 104 | ACONFIGURATION_DENSITY_TV = 213, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 105 | /** |
| 106 | * Density: value corresponding to the |
| 107 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">hdpi</a> |
| 108 | * resource qualifier. |
| 109 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 110 | ACONFIGURATION_DENSITY_HIGH = 240, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 111 | /** |
| 112 | * Density: value corresponding to the |
| 113 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xhdpi</a> |
| 114 | * resource qualifier. |
| 115 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 116 | ACONFIGURATION_DENSITY_XHIGH = 320, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 117 | /** |
| 118 | * Density: value corresponding to the |
| 119 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxhdpi</a> |
| 120 | * resource qualifier. |
| 121 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 122 | ACONFIGURATION_DENSITY_XXHIGH = 480, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 123 | /** |
| 124 | * Density: value corresponding to the |
| 125 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">xxxhdpi</a> |
| 126 | * resource qualifier. |
| 127 | */ |
Dianne Hackborn | 6303d06 | 2013-02-12 15:36:31 -0800 | [diff] [blame] | 128 | ACONFIGURATION_DENSITY_XXXHIGH = 640, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 129 | /** Density: any density. */ |
Adam Lesinski | 16d08a5 | 2014-08-22 22:23:08 -0700 | [diff] [blame] | 130 | ACONFIGURATION_DENSITY_ANY = 0xfffe, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 131 | /** Density: no density specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 132 | ACONFIGURATION_DENSITY_NONE = 0xffff, |
| 133 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 134 | /** Keyboard: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 135 | ACONFIGURATION_KEYBOARD_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 136 | /** |
| 137 | * Keyboard: value corresponding to the |
| 138 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">nokeys</a> |
| 139 | * resource qualifier. |
| 140 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 141 | ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 142 | /** |
| 143 | * Keyboard: value corresponding to the |
| 144 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">qwerty</a> |
| 145 | * resource qualifier. |
| 146 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 147 | ACONFIGURATION_KEYBOARD_QWERTY = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 148 | /** |
| 149 | * Keyboard: value corresponding to the |
| 150 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">12key</a> |
| 151 | * resource qualifier. |
| 152 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 153 | ACONFIGURATION_KEYBOARD_12KEY = 0x0003, |
| 154 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 155 | /** Navigation: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 156 | ACONFIGURATION_NAVIGATION_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 157 | /** |
| 158 | * Navigation: value corresponding to the |
| 159 | * <a href="@@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">nonav</a> |
| 160 | * resource qualifier. |
| 161 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 162 | ACONFIGURATION_NAVIGATION_NONAV = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 163 | /** |
| 164 | * Navigation: value corresponding to the |
| 165 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">dpad</a> |
| 166 | * resource qualifier. |
| 167 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 168 | ACONFIGURATION_NAVIGATION_DPAD = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 169 | /** |
| 170 | * Navigation: value corresponding to the |
| 171 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">trackball</a> |
| 172 | * resource qualifier. |
| 173 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 174 | ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 175 | /** |
| 176 | * Navigation: value corresponding to the |
| 177 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">wheel</a> |
| 178 | * resource qualifier. |
| 179 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 180 | ACONFIGURATION_NAVIGATION_WHEEL = 0x0004, |
| 181 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 182 | /** Keyboard availability: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 183 | ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 184 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 189 | ACONFIGURATION_KEYSHIDDEN_NO = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 190 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 195 | ACONFIGURATION_KEYSHIDDEN_YES = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 196 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 201 | ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003, |
| 202 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 203 | /** Navigation availability: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 204 | ACONFIGURATION_NAVHIDDEN_ANY = 0x0000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 205 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 210 | ACONFIGURATION_NAVHIDDEN_NO = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 211 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 216 | ACONFIGURATION_NAVHIDDEN_YES = 0x0002, |
| 217 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 218 | /** Screen size: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 219 | ACONFIGURATION_SCREENSIZE_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 220 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 226 | ACONFIGURATION_SCREENSIZE_SMALL = 0x01, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 227 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 233 | ACONFIGURATION_SCREENSIZE_NORMAL = 0x02, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 234 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 240 | ACONFIGURATION_SCREENSIZE_LARGE = 0x03, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 241 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 247 | ACONFIGURATION_SCREENSIZE_XLARGE = 0x04, |
| 248 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 249 | /** Screen layout: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 250 | ACONFIGURATION_SCREENLONG_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 251 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 256 | ACONFIGURATION_SCREENLONG_NO = 0x1, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 257 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 262 | ACONFIGURATION_SCREENLONG_YES = 0x2, |
| 263 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 264 | /** UI mode: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 265 | ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 266 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 271 | ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 272 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 276 | ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 277 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 281 | ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 282 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 286 | ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 287 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 291 | ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 292 | /** |
| 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 Spurlock | ad98ad0 | 2014-04-03 16:39:17 -0400 | [diff] [blame] | 296 | ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06, |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 297 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 298 | /** UI night mode: not specified.*/ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 299 | ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 300 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 304 | ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 305 | /** |
| 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 Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 309 | ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2, |
| 310 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 311 | /** Screen width DPI: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 312 | ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000, |
| 313 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 314 | /** Screen height DPI: not specified. */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 315 | ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000, |
| 316 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 317 | /** Smallest screen width DPI: not specified.*/ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 318 | ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000, |
| 319 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 320 | /** Layout direction: not specified. */ |
Fabrice Di Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 321 | ACONFIGURATION_LAYOUTDIR_ANY = 0x00, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 322 | /** |
| 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 Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 326 | ACONFIGURATION_LAYOUTDIR_LTR = 0x01, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 327 | /** |
| 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 Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 331 | ACONFIGURATION_LAYOUTDIR_RTL = 0x02, |
| 332 | |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 333 | /** |
| 334 | * Bit mask for |
| 335 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mcc</a> |
| 336 | * configuration. |
| 337 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 338 | ACONFIGURATION_MCC = 0x0001, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 339 | /** |
| 340 | * Bit mask for |
| 341 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#MccQualifier">mnc</a> |
| 342 | * configuration. |
| 343 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 344 | ACONFIGURATION_MNC = 0x0002, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 345 | /** |
| 346 | * Bit mask for |
| 347 | * <a href="{@docRoot}guide/topics/resources/providing-resources.html#LocaleQualifier">locale</a> |
| 348 | * configuration. |
| 349 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 350 | ACONFIGURATION_LOCALE = 0x0004, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 351 | /** |
| 352 | * Bit mask for |
| 353 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#TouchscreenQualifier">touchscreen</a> |
| 354 | * configuration. |
| 355 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 356 | ACONFIGURATION_TOUCHSCREEN = 0x0008, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 357 | /** |
| 358 | * Bit mask for |
| 359 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ImeQualifier">keyboard</a> |
| 360 | * configuration. |
| 361 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 362 | ACONFIGURATION_KEYBOARD = 0x0010, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 363 | /** |
| 364 | * Bit mask for |
| 365 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#KeyboardAvailQualifier">keyboardHidden</a> |
| 366 | * configuration. |
| 367 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 368 | ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 369 | /** |
| 370 | * Bit mask for |
| 371 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#NavigationQualifier">navigation</a> |
| 372 | * configuration. |
| 373 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 374 | ACONFIGURATION_NAVIGATION = 0x0040, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 375 | /** |
| 376 | * Bit mask for |
| 377 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#OrientationQualifier">orientation</a> |
| 378 | * configuration. |
| 379 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 380 | ACONFIGURATION_ORIENTATION = 0x0080, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 381 | /** |
| 382 | * Bit mask for |
| 383 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#DensityQualifier">density</a> |
| 384 | * configuration. |
| 385 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 386 | ACONFIGURATION_DENSITY = 0x0100, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 387 | /** |
| 388 | * Bit mask for |
| 389 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#ScreenSizeQualifier">screen size</a> |
| 390 | * configuration. |
| 391 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 392 | ACONFIGURATION_SCREEN_SIZE = 0x0200, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 393 | /** |
| 394 | * Bit mask for |
| 395 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#VersionQualifier">platform version</a> |
| 396 | * configuration. |
| 397 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 398 | ACONFIGURATION_VERSION = 0x0400, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 399 | /** |
| 400 | * Bit mask for screen layout configuration. |
| 401 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 402 | ACONFIGURATION_SCREEN_LAYOUT = 0x0800, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 403 | /** |
| 404 | * Bit mask for |
| 405 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#UiModeQualifier">ui mode</a> |
| 406 | * configuration. |
| 407 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 408 | ACONFIGURATION_UI_MODE = 0x1000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 409 | /** |
| 410 | * Bit mask for |
| 411 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#SmallestScreenWidthQualifier">smallest screen width</a> |
| 412 | * configuration. |
| 413 | */ |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 414 | ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 415 | /** |
| 416 | * Bit mask for |
| 417 | * <a href="@dacRoot/guide/topics/resources/providing-resources.html#LayoutDirectionQualifier">layout direction</a> |
| 418 | * configuration. |
| 419 | */ |
Fabrice Di Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 420 | ACONFIGURATION_LAYOUTDIR = 0x4000, |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 421 | /** |
| 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 Redestig | 8df483c | 2013-05-30 08:30:42 +0200 | [diff] [blame] | 425 | ACONFIGURATION_MNC_ZERO = 0xffff, |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 426 | }; |
| 427 | |
| 428 | /** |
| 429 | * Create a new AConfiguration, initialized with no values set. |
| 430 | */ |
| 431 | AConfiguration* AConfiguration_new(); |
| 432 | |
| 433 | /** |
| 434 | * Free an AConfiguration that was previously created with |
| 435 | * AConfiguration_new(). |
| 436 | */ |
| 437 | void AConfiguration_delete(AConfiguration* config); |
| 438 | |
| 439 | /** |
| 440 | * Create and return a new AConfiguration based on the current configuration in |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 441 | * use in the given {@link AAssetManager}. |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 442 | */ |
| 443 | void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am); |
| 444 | |
| 445 | /** |
| 446 | * Copy the contents of 'src' to 'dest'. |
| 447 | */ |
| 448 | void AConfiguration_copy(AConfiguration* dest, AConfiguration* src); |
| 449 | |
| 450 | /** |
| 451 | * Return the current MCC set in the configuration. 0 if not set. |
| 452 | */ |
| 453 | int32_t AConfiguration_getMcc(AConfiguration* config); |
| 454 | |
| 455 | /** |
| 456 | * Set the current MCC in the configuration. 0 to clear. |
| 457 | */ |
| 458 | void AConfiguration_setMcc(AConfiguration* config, int32_t mcc); |
| 459 | |
| 460 | /** |
| 461 | * Return the current MNC set in the configuration. 0 if not set. |
| 462 | */ |
| 463 | int32_t AConfiguration_getMnc(AConfiguration* config); |
| 464 | |
| 465 | /** |
| 466 | * Set the current MNC in the configuration. 0 to clear. |
| 467 | */ |
| 468 | void 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 | */ |
| 475 | void 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 | */ |
| 481 | void 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 | */ |
| 488 | void 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 | */ |
| 494 | void AConfiguration_setCountry(AConfiguration* config, const char* country); |
| 495 | |
| 496 | /** |
| 497 | * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration. |
| 498 | */ |
| 499 | int32_t AConfiguration_getOrientation(AConfiguration* config); |
| 500 | |
| 501 | /** |
| 502 | * Set the current orientation in the configuration. |
| 503 | */ |
| 504 | void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation); |
| 505 | |
| 506 | /** |
| 507 | * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration. |
| 508 | */ |
| 509 | int32_t AConfiguration_getTouchscreen(AConfiguration* config); |
| 510 | |
| 511 | /** |
| 512 | * Set the current touchscreen in the configuration. |
| 513 | */ |
| 514 | void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen); |
| 515 | |
| 516 | /** |
| 517 | * Return the current ACONFIGURATION_DENSITY_* set in the configuration. |
| 518 | */ |
| 519 | int32_t AConfiguration_getDensity(AConfiguration* config); |
| 520 | |
| 521 | /** |
| 522 | * Set the current density in the configuration. |
| 523 | */ |
| 524 | void AConfiguration_setDensity(AConfiguration* config, int32_t density); |
| 525 | |
| 526 | /** |
| 527 | * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration. |
| 528 | */ |
| 529 | int32_t AConfiguration_getKeyboard(AConfiguration* config); |
| 530 | |
| 531 | /** |
| 532 | * Set the current keyboard in the configuration. |
| 533 | */ |
| 534 | void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard); |
| 535 | |
| 536 | /** |
| 537 | * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration. |
| 538 | */ |
| 539 | int32_t AConfiguration_getNavigation(AConfiguration* config); |
| 540 | |
| 541 | /** |
| 542 | * Set the current navigation in the configuration. |
| 543 | */ |
| 544 | void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation); |
| 545 | |
| 546 | /** |
| 547 | * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration. |
| 548 | */ |
| 549 | int32_t AConfiguration_getKeysHidden(AConfiguration* config); |
| 550 | |
| 551 | /** |
| 552 | * Set the current keys hidden in the configuration. |
| 553 | */ |
| 554 | void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden); |
| 555 | |
| 556 | /** |
| 557 | * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration. |
| 558 | */ |
| 559 | int32_t AConfiguration_getNavHidden(AConfiguration* config); |
| 560 | |
| 561 | /** |
| 562 | * Set the current nav hidden in the configuration. |
| 563 | */ |
| 564 | void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden); |
| 565 | |
| 566 | /** |
| 567 | * Return the current SDK (API) version set in the configuration. |
| 568 | */ |
| 569 | int32_t AConfiguration_getSdkVersion(AConfiguration* config); |
| 570 | |
| 571 | /** |
| 572 | * Set the current SDK version in the configuration. |
| 573 | */ |
| 574 | void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion); |
| 575 | |
| 576 | /** |
| 577 | * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration. |
| 578 | */ |
| 579 | int32_t AConfiguration_getScreenSize(AConfiguration* config); |
| 580 | |
| 581 | /** |
| 582 | * Set the current screen size in the configuration. |
| 583 | */ |
| 584 | void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize); |
| 585 | |
| 586 | /** |
| 587 | * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration. |
| 588 | */ |
| 589 | int32_t AConfiguration_getScreenLong(AConfiguration* config); |
| 590 | |
| 591 | /** |
| 592 | * Set the current screen long in the configuration. |
| 593 | */ |
| 594 | void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong); |
| 595 | |
| 596 | /** |
| 597 | * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration. |
| 598 | */ |
| 599 | int32_t AConfiguration_getUiModeType(AConfiguration* config); |
| 600 | |
| 601 | /** |
| 602 | * Set the current UI mode type in the configuration. |
| 603 | */ |
| 604 | void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType); |
| 605 | |
| 606 | /** |
| 607 | * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration. |
| 608 | */ |
| 609 | int32_t AConfiguration_getUiModeNight(AConfiguration* config); |
| 610 | |
| 611 | /** |
| 612 | * Set the current UI mode night in the configuration. |
| 613 | */ |
| 614 | void 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 | */ |
| 620 | int32_t AConfiguration_getScreenWidthDp(AConfiguration* config); |
| 621 | |
| 622 | /** |
| 623 | * Set the configuration's current screen width in dp units. |
| 624 | */ |
| 625 | void 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 | */ |
| 631 | int32_t AConfiguration_getScreenHeightDp(AConfiguration* config); |
| 632 | |
| 633 | /** |
| 634 | * Set the configuration's current screen width in dp units. |
| 635 | */ |
| 636 | void 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 | */ |
| 642 | int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config); |
| 643 | |
| 644 | /** |
| 645 | * Set the configuration's smallest screen width in dp units. |
| 646 | */ |
| 647 | void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value); |
| 648 | |
| 649 | /** |
Fabrice Di Meglio | 8855e6f | 2012-06-20 15:47:21 -0700 | [diff] [blame] | 650 | * Return the configuration's layout direction, or |
| 651 | * ACONFIGURATION_LAYOUTDIR_ANY if not set. |
| 652 | */ |
| 653 | int32_t AConfiguration_getLayoutDirection(AConfiguration* config); |
| 654 | |
| 655 | /** |
| 656 | * Set the configuration's layout direction. |
| 657 | */ |
| 658 | void AConfiguration_setLayoutDirection(AConfiguration* config, int32_t value); |
| 659 | |
| 660 | /** |
Mathias Agopian | e1c61d3 | 2012-03-23 14:19:36 -0700 | [diff] [blame] | 661 | * 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 | */ |
| 665 | int32_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 | */ |
| 672 | int32_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 | */ |
| 684 | int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test, |
| 685 | AConfiguration* requested); |
| 686 | |
| 687 | #ifdef __cplusplus |
| 688 | }; |
| 689 | #endif |
| 690 | |
| 691 | #endif // ANDROID_CONFIGURATION_H |
Johan Euphrosine | bf6d5e0 | 2015-03-27 17:15:43 -0700 | [diff] [blame^] | 692 | |
| 693 | /** @} */ |