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
|
|
|
|
|
2020-07-18 05:06:29 +00:00
|
|
|
#include "window/window_controls_layout.h"
|
|
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
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-06-09 20:36:51 +00:00
|
|
|
QString SingleInstanceLocalServerName(const QString &hash);
|
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);
|
2019-09-16 11:14:06 +00:00
|
|
|
void IgnoreApplicationActivationRightNow();
|
2020-05-29 17:49:39 +00:00
|
|
|
bool AutostartSupported();
|
2020-07-22 12:10:17 +00:00
|
|
|
bool TrayIconSupported();
|
2020-10-16 03:02:05 +00:00
|
|
|
bool SkipTaskbarSupported();
|
2020-12-11 08:00:52 +00:00
|
|
|
QImage GetImageFromClipboard();
|
2020-07-10 23:06:19 +00:00
|
|
|
bool StartSystemMove(QWindow *window);
|
|
|
|
bool StartSystemResize(QWindow *window, Qt::Edges edges);
|
2020-08-07 21:59:45 +00:00
|
|
|
bool ShowWindowMenu(QWindow *window);
|
2020-08-28 12:07:29 +00:00
|
|
|
bool WindowsNeedShadow();
|
|
|
|
bool SetWindowExtents(QWindow *window, const QMargins &extents);
|
2020-08-28 21:00:09 +00:00
|
|
|
bool UnsetWindowExtents(QWindow *window);
|
2020-07-18 05:06:29 +00:00
|
|
|
Window::ControlsLayout WindowControlsLayout();
|
2019-07-04 13:33:11 +00:00
|
|
|
|
2020-10-29 19:56:13 +00:00
|
|
|
[[nodiscard]] std::optional<bool> IsDarkMode();
|
|
|
|
[[nodiscard]] inline bool IsDarkModeSupported() {
|
|
|
|
return IsDarkMode().has_value();
|
|
|
|
}
|
|
|
|
|
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"
|
2020-06-13 01:03:23 +00:00
|
|
|
#elif defined Q_OS_UNIX // Q_OS_MAC
|
2017-04-13 17:59:05 +00:00
|
|
|
#include "platform/linux/specific_linux.h"
|
2020-06-13 01:03:23 +00:00
|
|
|
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX
|
2017-04-13 17:59:05 +00:00
|
|
|
#include "platform/win/specific_win.h"
|
2020-06-13 01:03:23 +00:00
|
|
|
#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN
|