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
|
|
|
|
|
2023-02-14 16:47:11 +00:00
|
|
|
namespace Core {
|
|
|
|
enum class QuitReason;
|
|
|
|
} // namespace Core
|
|
|
|
|
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);
|
2023-09-11 23:59:11 +00:00
|
|
|
[[nodiscard]] QString SingleInstanceLocalServerName(const QString &hash);
|
|
|
|
[[nodiscard]] PermissionStatus GetPermissionStatus(PermissionType type);
|
2018-09-30 15:42:50 +00:00
|
|
|
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();
|
2023-09-11 23:59:11 +00:00
|
|
|
[[nodiscard]] bool TrayIconSupported();
|
|
|
|
[[nodiscard]] bool SkipTaskbarSupported();
|
2023-09-11 23:56:08 +00:00
|
|
|
[[nodiscard]] bool RunInBackground();
|
2021-05-03 13:34:33 +00:00
|
|
|
void WriteCrashDumpDetails();
|
2022-09-01 06:44:23 +00:00
|
|
|
void NewVersionLaunched(int oldVersion);
|
2023-02-28 16:49:45 +00:00
|
|
|
[[nodiscard]] QImage DefaultApplicationIcon();
|
2023-02-14 16:47:11 +00:00
|
|
|
[[nodiscard]] bool PreventsQuit(Core::QuitReason reason);
|
2023-06-15 20:15:23 +00:00
|
|
|
[[nodiscard]] QString ExecutablePathForShortcuts();
|
2023-02-14 16:47:11 +00:00
|
|
|
|
2023-05-13 17:01:06 +00:00
|
|
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
2020-10-29 19:56:13 +00:00
|
|
|
[[nodiscard]] std::optional<bool> IsDarkMode();
|
2023-05-13 17:01:06 +00:00
|
|
|
#endif // Qt < 6.5.0
|
2020-10-29 19:56:13 +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
|
|
|
|
2023-09-15 05:51:42 +00:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
#include "platform/win/specific_win.h"
|
|
|
|
#elif defined Q_OS_MAC // Q_OS_WIN
|
2017-04-13 17:59:05 +00:00
|
|
|
#include "platform/mac/specific_mac.h"
|
2023-09-15 05:51:42 +00:00
|
|
|
#else // Q_OS_WIN || Q_OS_MAC
|
2017-04-13 17:59:05 +00:00
|
|
|
#include "platform/linux/specific_linux.h"
|
2023-09-15 05:51:42 +00:00
|
|
|
#endif // else for Q_OS_WIN || Q_OS_MAC
|