tdesktop/Telegram/SourceFiles/platform/platform_specific.h

71 lines
1.7 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,
};
2019-01-05 11:08:02 +00:00
enum class SystemSettingsType {
Audio,
};
2019-04-29 13:41:51 +00:00
enum class TouchBarType {
AudioPlayer,
None,
};
void SetWatchingMediaKeys(bool watching);
bool IsApplicationActive();
void SetApplicationIcon(const QIcon &icon);
bool TranslucentWindowsSupported(QPoint globalPosition);
void StartTranslucentPaint(QPainter &p, QPaintEvent *e);
void InitOnTopPanel(QWidget *panel);
void DeInitOnTopPanel(QWidget *panel);
void ReInitOnTopPanel(QWidget *panel);
void RegisterCustomScheme();
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);
[[nodiscard]] QString SystemLanguage();
[[nodiscard]] QString SystemCountry();
[[nodiscard]] std::optional<crl::time> LastUserInputTime();
[[nodiscard]] inline bool LastUserInputTimeSupported() {
return LastUserInputTime().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_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