blob: 8647f014b6ca23493339885c057c112cb42448ea [file] [log] [blame]
[email protected]aebcd0dd2012-10-05 17:48:581// Copyright 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_IOS_IOS_UTIL_H_
6#define BASE_IOS_IOS_UTIL_H_
7
avi9b6f42932015-12-26 22:15:148#include <stdint.h>
9
[email protected]aebcd0dd2012-10-05 17:48:5810#include "base/base_export.h"
justincohenb83910d2016-01-08 23:49:4311#include "base/files/file_path.h"
[email protected]aebcd0dd2012-10-05 17:48:5812
13namespace base {
14namespace ios {
15
Justin Cohen8f8fd9b2018-06-13 20:03:1116// Returns whether the operating system is iOS 12 or later.
Mike Doughertya219f7a042020-09-17 17:58:3117// TODO(crbug.com/1129482): Remove once minimum supported version is at least 12
Justin Cohen8f8fd9b2018-06-13 20:03:1118BASE_EXPORT bool IsRunningOnIOS12OrLater();
19
Rohit Raoc04c972d2019-06-12 14:53:3820// Returns whether the operating system is iOS 13 or later.
Mike Doughertya219f7a042020-09-17 17:58:3121// TODO(crbug.com/1129483): Remove once minimum supported version is at least 13
Rohit Raoc04c972d2019-06-12 14:53:3822BASE_EXPORT bool IsRunningOnIOS13OrLater();
23
Rohit Rao73112552020-07-07 19:58:2124// Returns whether the operating system is iOS 14 or later.
Mike Doughertya219f7a042020-09-17 17:58:3125// TODO(crbug.com/1129484): Remove once minimum supported version is at least 14
Rohit Rao73112552020-07-07 19:58:2126BASE_EXPORT bool IsRunningOnIOS14OrLater();
27
[email protected]1c95c212013-06-29 14:16:0028// Returns whether the operating system is at the given version or later.
avi9b6f42932015-12-26 22:15:1429BASE_EXPORT bool IsRunningOnOrLater(int32_t major,
30 int32_t minor,
31 int32_t bug_fix);
[email protected]aebcd0dd2012-10-05 17:48:5832
marqf51b0032015-08-10 08:55:1733// Returns whether iOS is signalling that an RTL text direction should be used
marqb2238de2015-09-21 17:06:2134// regardless of the current locale. This should not return true if the current
35// language is a "real" RTL language such as Arabic or Urdu; it should only
36// return true in cases where the RTL text direction has been forced (for
37// example by using the "RTL Psuedolanguage" option when launching from XCode).
marqf51b0032015-08-10 08:55:1738BASE_EXPORT bool IsInForcedRTL();
39
justincohenb83910d2016-01-08 23:49:4340// Stores the |path| of the ICU dat file in a global to be referenced later by
41// FilePathOfICUFile(). This should only be called once.
42BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path);
43
44// Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise
45// returns invalid FilePath.
46BASE_EXPORT FilePath FilePathOfEmbeddedICU();
47
Eugene But30162ae2020-10-13 23:50:3748// Returns true if multiwindow is supported on this OS version and is enabled in
49// the current build configuration. Does not check if this device can actually
50// show multiple windows (e.g. on iPhone): use [UIApplication
51// supportsMultipleScenes] instead.
52BASE_EXPORT bool IsMultiwindowSupported();
53
54// Returns true if the iOS13 UIScene-based startup flow is supported, regardless
55// of whether multiple windows are permitted. This always returns true if
56// base::ios::IsMultiwindowSupported() returns true.
57BASE_EXPORT bool IsSceneStartupSupported();
58
Sylvain Defresne226653e2021-01-21 16:36:1159// Returns true iff multiple windows can be opened, i.e. when the multiwindow
60// build flag is on, the device is running on iOS 13+ and it's a compatible
61// iPad.
62BASE_EXPORT bool IsMultipleScenesSupported();
63
[email protected]aebcd0dd2012-10-05 17:48:5864} // namespace ios
65} // namespace base
66
67#endif // BASE_IOS_IOS_UTIL_H_