tdesktop/Telegram/SourceFiles/platform/platform_specific.h

62 lines
1.5 KiB
C
Raw Normal View History

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace Platform {
void start();
void finish();
2018-10-17 06:09:59 +00:00
enum class PermissionStatus {
Granted,
CanRequest,
Denied,
};
2018-10-17 06:09:59 +00:00
enum class PermissionType {
Microphone,
2020-05-17 09:12:27 +00:00
Camera,
};
2019-01-05 11:08:02 +00:00
enum class SystemSettingsType {
Audio,
};
void SetApplicationIcon(const QIcon &icon);
QString SingleInstanceLocalServerName(const QString &hash);
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();
2020-05-29 17:49:39 +00:00
bool AutostartSupported();
bool TrayIconSupported();
bool SkipTaskbarSupported();
2021-05-03 13:34:33 +00:00
void WriteCrashDumpDetails();
2020-10-29 19:56:13 +00:00
[[nodiscard]] std::optional<bool> IsDarkMode();
[[nodiscard]] inline bool IsDarkModeSupported() {
return IsDarkMode().has_value();
}
namespace ThirdParty {
void start();
void finish();
} // namespace ThirdParty
} // namespace Platform
#ifdef Q_OS_MAC
#include "platform/mac/specific_mac.h"
#elif defined Q_OS_UNIX // Q_OS_MAC
#include "platform/linux/specific_linux.h"
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
#include "platform/win/specific_win.h"
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN