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