2014-05-30 08:53:19 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2014-05-30 08:53:19 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-06-16 12:59:54 +00:00
|
|
|
namespace Platform {
|
2016-01-11 15:43:29 +00:00
|
|
|
|
2016-06-16 12:59:54 +00:00
|
|
|
void start();
|
|
|
|
void finish();
|
2018-10-17 06:09:59 +00:00
|
|
|
|
2018-09-30 15:42:50 +00:00
|
|
|
enum class PermissionStatus {
|
|
|
|
Granted,
|
|
|
|
CanRequest,
|
|
|
|
Denied,
|
|
|
|
};
|
2018-10-17 06:09:59 +00:00
|
|
|
|
2018-09-30 15:42:50 +00:00
|
|
|
enum class PermissionType {
|
|
|
|
Microphone,
|
2020-05-17 09:12:27 +00:00
|
|
|
Camera,
|
2018-09-30 15:42:50 +00:00
|
|
|
};
|
2016-01-11 15:43:29 +00:00
|
|
|
|
2019-01-05 11:08:02 +00:00
|
|
|
enum class SystemSettingsType {
|
|
|
|
Audio,
|
|
|
|
};
|
|
|
|
|
2018-10-24 08:28:11 +00:00
|
|
|
void SetApplicationIcon(const QIcon &icon);
|
2020-06-09 20:36:51 +00:00
|
|
|
QString SingleInstanceLocalServerName(const QString &hash);
|
2018-09-30 15:42:50 +00:00
|
|
|
PermissionStatus GetPermissionStatus(PermissionType type);
|
|
|
|
void RequestPermission(PermissionType type, Fn<void(PermissionStatus)> resultCallback);
|
|
|
|
void OpenSystemSettingsForPermission(PermissionType type);
|
2019-01-05 11:08:02 +00:00
|
|
|
bool OpenSystemSettings(SystemSettingsType type);
|
2019-09-16 11:14:06 +00:00
|
|
|
void IgnoreApplicationActivationRightNow();
|
2021-11-04 08:35:34 +00:00
|
|
|
[[nodiscard]] bool AutostartSupported();
|
|
|
|
void AutostartRequestStateFromSystem(Fn<void(bool)> callback);
|
|
|
|
void AutostartToggle(bool enabled, Fn<void(bool)> done = nullptr);
|
|
|
|
[[nodiscard]] bool AutostartSkip();
|
2020-07-22 12:10:17 +00:00
|
|
|
bool TrayIconSupported();
|
2020-10-16 03:02:05 +00:00
|
|
|
bool SkipTaskbarSupported();
|
2021-05-03 13:34:33 +00:00
|
|
|
void WriteCrashDumpDetails();
|
2019-07-04 13:33:11 +00:00
|
|
|
|
2020-10-29 19:56:13 +00:00
|
|
|
[[nodiscard]] std::optional<bool> IsDarkMode();
|
|
|
|
[[nodiscard]] inline bool IsDarkModeSupported() {
|
|
|
|
return IsDarkMode().has_value();
|
|
|
|
}
|
|
|
|
|
2016-06-16 12:59:54 +00:00
|
|
|
namespace ThirdParty {
|
2016-01-11 15:43:29 +00:00
|
|
|
|
2016-06-16 12:59:54 +00:00
|
|
|
void start();
|
|
|
|
void finish();
|
2016-02-21 14:45:07 +00:00
|
|
|
|
2016-06-16 12:59:54 +00:00
|
|
|
} // namespace ThirdParty
|
|
|
|
} // namespace Platform
|
2017-04-13 17:59:05 +00:00
|
|
|
|
|
|
|
#ifdef Q_OS_MAC
|
|
|
|
#include "platform/mac/specific_mac.h"
|
2020-06-13 01:03:23 +00:00
|
|
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
2017-04-13 17:59:05 +00:00
|
|
|
#include "platform/linux/specific_linux.h"
|
2020-06-13 01:03:23 +00:00
|
|
|
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
2017-04-13 17:59:05 +00:00
|
|
|
#include "platform/win/specific_win.h"
|
2020-06-13 01:03:23 +00:00
|
|
|
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|