Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAndroidUtils.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-or-later
3 */
4#ifndef __KISANDROIDUTILS_H_
5#define __KISANDROIDUTILS_H_
6
7#include <QString>
8#include <kritaglobal_export.h>
9
10class QTemporaryFile;
11
12namespace KisAndroidUtils
13{
14
15// Installs the Android log handler and copies assets.
16KRITAGLOBAL_EXPORT void performInitialSetup();
17
18// Check whether we seem to be running on a Xiaomi device, which requires
19// enabling several workarounds by default. If we need additional workarounds
20// in the future, change this to return an enum or a flag set instead, depending
21// on what's actually needed.
22KRITAGLOBAL_EXPORT bool looksLikeXiaomiDevice();
23
24// Check whether the device supports reporting low-memory situations as an exit
25// reason. Devices that don't will instead report a SIGKILL.
26KRITAGLOBAL_EXPORT bool isLowMemoryKillReportSupported();
27
28// Checks , logs and clears the pending exception in the Java Native Interface.
29// If an exception occurs while one is pending, the application dies. Some Qt
30// stuff, such as QDesktopServices, can throw JNI errors and don't clear them.
31KRITAGLOBAL_EXPORT void clearJniException(const QString &location);
32
33// Checks whether we are in immersive mode, which is basically full-screen.
34KRITAGLOBAL_EXPORT bool isInFullScreen();
35
36// Enters or exits immersive mode if we're not in that state already.
37KRITAGLOBAL_EXPORT void setFullScreen(bool fullScreen);
38
39// QFile::copy doesn't work on sandboxed directories, use this instead. The
40// value placed in outErrorMessage is not translated, use it for logging or
41// present it to the user as an internal error. On success, it will be cleared.
42KRITAGLOBAL_EXPORT bool
43copyFile(const QString &inputPath, const QString &outputPath, QString *outErrorMessage = nullptr);
44
45KRITAGLOBAL_EXPORT bool
46copyFileToTemporary(const QString &inputPath, QTemporaryFile &outputFile, QString *outErrorMessage = nullptr);
47
48} // namespace KisAndroidUtils
49
50#endif // __KISANDROIDUTILS_H_
bool isLowMemoryKillReportSupported()
bool copyFile(const QString &inputPath, const QString &outputPath, QString *outErrorMessage)
void setFullScreen(bool fullScreen)
void clearJniException(const QString &location)
bool copyFileToTemporary(const QString &inputPath, QTemporaryFile &outputFile, QString *outErrorMessage)