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,
|
|
|
|
};
|
2016-01-11 15:43:29 +00:00
|
|
|
|
2019-01-05 11:08:02 +00:00
|
|
|
enum class SystemSettingsType {
|
|
|
|
Audio,
|
|
|
|
};
|
|
|
|
|
2016-10-22 14:35:37 +00:00
|
|
|
void SetWatchingMediaKeys(bool watching);
|
2018-10-24 08:28:11 +00:00
|
|
|
void SetApplicationIcon(const QIcon &icon);
|
2020-02-25 02:39:14 +00:00
|
|
|
void RegisterCustomScheme(bool force = false);
|
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);
|
2017-05-02 07:25:20 +00:00
|
|
|
|
2019-03-14 17:59:10 +00:00
|
|
|
[[nodiscard]] std::optional<crl::time> LastUserInputTime();
|
|
|
|
[[nodiscard]] inline bool LastUserInputTimeSupported() {
|
|
|
|
return LastUserInputTime().has_value();
|
|
|
|
}
|
2017-04-13 17:59:05 +00:00
|
|
|
|
2019-09-16 11:14:06 +00:00
|
|
|
void IgnoreApplicationActivationRightNow();
|
2019-07-04 13:33:11 +00:00
|
|
|
|
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"
|
|
|
|
#elif defined Q_OS_LINUX // Q_OS_MAC
|
|
|
|
#include "platform/linux/specific_linux.h"
|
|
|
|
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_LINUX
|
|
|
|
#include "platform/win/specific_win.h"
|
|
|
|
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WIN
|