2020-04-21 06:49:33 +03:00
|
|
|
/*
|
|
|
|
This file is part of Kotatogram Desktop,
|
|
|
|
the unofficial app based on Telegram Desktop.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2021-05-30 01:25:29 +00:00
|
|
|
#include <rpl/producer.h>
|
|
|
|
|
|
|
|
namespace Platform {
|
|
|
|
namespace FileDialog {
|
|
|
|
|
|
|
|
enum class ImplementationType;
|
|
|
|
|
|
|
|
} // namespace FileDialog
|
|
|
|
} // namespace Platform
|
2021-03-31 12:34:17 +04:00
|
|
|
|
2020-04-21 06:49:33 +03:00
|
|
|
#define DeclareReadSetting(Type, Name) extern Type g##Name; \
|
|
|
|
inline const Type &c##Name() { \
|
|
|
|
return g##Name; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define DeclareSetting(Type, Name) DeclareReadSetting(Type, Name) \
|
|
|
|
inline void cSet##Name(const Type &Name) { \
|
|
|
|
g##Name = Name; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define DeclareRefSetting(Type, Name) DeclareSetting(Type, Name) \
|
|
|
|
inline Type &cRef##Name() { \
|
|
|
|
return g##Name; \
|
|
|
|
}
|
|
|
|
|
|
|
|
DeclareSetting(bool, KotatoFirstRun);
|
|
|
|
|
|
|
|
DeclareSetting(QString, MainFont);
|
|
|
|
DeclareSetting(QString, SemiboldFont);
|
|
|
|
DeclareSetting(bool, SemiboldFontIsBold);
|
|
|
|
DeclareSetting(QString, MonospaceFont);
|
2021-05-30 01:24:56 +00:00
|
|
|
DeclareSetting(int, FontSize);
|
2020-04-21 06:49:33 +03:00
|
|
|
DeclareSetting(bool, UseSystemFont);
|
|
|
|
DeclareSetting(bool, UseOriginalMetrics);
|
|
|
|
|
|
|
|
void SetBigEmojiOutline(bool enabled);
|
|
|
|
[[nodiscard]] bool BigEmojiOutline();
|
|
|
|
[[nodiscard]] rpl::producer<bool> BigEmojiOutlineChanges();
|
|
|
|
|
|
|
|
void SetStickerHeight(int height);
|
|
|
|
[[nodiscard]] int StickerHeight();
|
|
|
|
[[nodiscard]] rpl::producer<int> StickerHeightChanges();
|
|
|
|
|
2020-05-06 02:27:04 +03:00
|
|
|
void SetStickerScaleBoth(bool scale);
|
|
|
|
[[nodiscard]] bool StickerScaleBoth();
|
|
|
|
[[nodiscard]] rpl::producer<bool> StickerScaleBothChanges();
|
|
|
|
|
2020-04-21 06:49:33 +03:00
|
|
|
void SetAdaptiveBubbles(bool enabled);
|
|
|
|
[[nodiscard]] bool AdaptiveBubbles();
|
|
|
|
[[nodiscard]] rpl::producer<bool> AdaptiveBubblesChanges();
|
|
|
|
|
2020-06-27 22:16:29 +02:00
|
|
|
void SetMonospaceLargeBubbles(bool enabled);
|
|
|
|
[[nodiscard]] bool MonospaceLargeBubbles();
|
|
|
|
[[nodiscard]] rpl::producer<bool> MonospaceLargeBubblesChanges();
|
|
|
|
|
2020-04-21 06:49:33 +03:00
|
|
|
DeclareSetting(bool, AlwaysShowScheduled);
|
2021-06-25 22:55:37 +03:00
|
|
|
|
|
|
|
void SetShowChatId(int chatIdType);
|
|
|
|
[[nodiscard]] int ShowChatId();
|
|
|
|
[[nodiscard]] rpl::producer<int> ShowChatIdChanges();
|
2020-04-21 06:49:33 +03:00
|
|
|
|
|
|
|
DeclareSetting(int, NetSpeedBoost);
|
|
|
|
DeclareSetting(int, NetRequestsCount);
|
|
|
|
DeclareSetting(int, NetUploadSessionsCount);
|
|
|
|
DeclareSetting(int, NetUploadRequestInterval);
|
|
|
|
|
|
|
|
inline void SetNetworkBoost(int boost) {
|
|
|
|
if (boost < 0) {
|
|
|
|
cSetNetSpeedBoost(0);
|
|
|
|
} else if (boost > 3) {
|
|
|
|
cSetNetSpeedBoost(3);
|
|
|
|
} else {
|
|
|
|
cSetNetSpeedBoost(boost);
|
|
|
|
}
|
|
|
|
|
|
|
|
cSetNetRequestsCount(2 + (2 * cNetSpeedBoost()));
|
|
|
|
cSetNetUploadSessionsCount(2 + (2 * cNetSpeedBoost()));
|
|
|
|
cSetNetUploadRequestInterval(500 - (100 * cNetSpeedBoost()));
|
|
|
|
}
|
|
|
|
|
|
|
|
DeclareSetting(bool, ShowPhoneInDrawer);
|
|
|
|
|
|
|
|
using ScaleVector = std::vector<int>;
|
|
|
|
DeclareRefSetting(ScaleVector, InterfaceScales);
|
|
|
|
bool HasCustomScales();
|
|
|
|
bool AddCustomScale(int scale);
|
|
|
|
void ClearCustomScales();
|
|
|
|
|
|
|
|
void SetDialogListLines(int lines);
|
|
|
|
[[nodiscard]] int DialogListLines();
|
|
|
|
[[nodiscard]] rpl::producer<int> DialogListLinesChanges();
|
|
|
|
|
|
|
|
DeclareSetting(bool, DisableUpEdit);
|
|
|
|
|
|
|
|
using CustomReplacementsMap = QMap<QString, QString>;
|
|
|
|
DeclareRefSetting(CustomReplacementsMap, CustomReplaces);
|
|
|
|
bool AddCustomReplace(QString from, QString to);
|
|
|
|
DeclareSetting(bool, ConfirmBeforeCall);
|
|
|
|
|
2021-05-30 01:25:29 +00:00
|
|
|
DeclareSetting(bool, FFmpegMultithread);
|
|
|
|
DeclareSetting(uint, FFmpegThreadCount);
|
|
|
|
|
2020-05-17 21:59:33 +04:00
|
|
|
DeclareSetting(bool, UseNativeDecorations);
|
|
|
|
[[nodiscard]] bool UseNativeDecorations();
|
|
|
|
|
2020-04-21 06:49:33 +03:00
|
|
|
void SetRecentStickersLimit(int limit);
|
|
|
|
[[nodiscard]] int RecentStickersLimit();
|
|
|
|
[[nodiscard]] rpl::producer<int> RecentStickersLimitChanges();
|
|
|
|
|
|
|
|
DeclareSetting(int, UserpicCornersType);
|
|
|
|
DeclareSetting(bool, ShowTopBarUserpic);
|
2021-04-01 21:31:06 +00:00
|
|
|
|
|
|
|
DeclareSetting(bool, QtScale);
|
2020-12-25 20:12:31 +04:00
|
|
|
DeclareSetting(bool, GtkIntegration);
|
2021-04-01 07:23:53 +03:00
|
|
|
|
|
|
|
void SetFileDialogType(Platform::FileDialog::ImplementationType t);
|
|
|
|
[[nodiscard]] Platform::FileDialog::ImplementationType FileDialogType();
|
|
|
|
[[nodiscard]] rpl::producer<Platform::FileDialog::ImplementationType> FileDialogTypeChanges();
|
|
|
|
|
2020-05-18 01:35:08 +04:00
|
|
|
DeclareSetting(bool, DisableTrayCounter);
|
|
|
|
DeclareSetting(bool, UseTelegramPanelIcon);
|
2020-04-21 06:49:33 +03:00
|
|
|
DeclareSetting(int, CustomAppIcon);
|
|
|
|
|
2021-04-26 23:45:08 +03:00
|
|
|
using DefaultFilterMap = QMap<QString, int>;
|
2020-07-02 03:34:22 +03:00
|
|
|
DeclareRefSetting(DefaultFilterMap, DefaultFilterId);
|
2021-04-26 23:45:08 +03:00
|
|
|
void SetDefaultFilterId(QString account, int filter);
|
|
|
|
int DefaultFilterId(QString account);
|
|
|
|
bool HasDefaultFilterId(QString account);
|
|
|
|
bool ClearDefaultFilterId(QString account);
|
2020-04-21 06:49:33 +03:00
|
|
|
DeclareSetting(bool, UnmutedFilterCounterOnly);
|
|
|
|
DeclareSetting(bool, HideFilterEditButton);
|
|
|
|
DeclareSetting(bool, HideFilterNames);
|
|
|
|
DeclareSetting(bool, HideFilterAllChats);
|
|
|
|
|
|
|
|
DeclareSetting(bool, ProfileTopBarNotifications);
|
2020-05-15 20:20:12 +03:00
|
|
|
|
|
|
|
void SetHoverEmojiPanel(bool enabled);
|
|
|
|
[[nodiscard]] bool HoverEmojiPanel();
|
|
|
|
[[nodiscard]] rpl::producer<bool> HoverEmojiPanelChanges();
|
2020-07-09 11:14:54 +03:00
|
|
|
|
|
|
|
DeclareSetting(bool, ForwardRetainSelection);
|
2020-07-09 11:42:10 +03:00
|
|
|
DeclareSetting(bool, ForwardChatOnClick);
|
2020-07-23 16:51:25 +04:00
|
|
|
|
|
|
|
DeclareSetting(int, ApiId);
|
|
|
|
DeclareSetting(QString, ApiHash);
|
2020-07-23 17:52:26 +03:00
|
|
|
DeclareSetting(bool, UseEnvApi);
|
|
|
|
DeclareSetting(bool, ApiFromStartParams);
|
2020-07-15 16:47:26 +03:00
|
|
|
|
2021-05-30 01:25:08 +00:00
|
|
|
DeclareSetting(bool, AutoScrollUnfocused);
|
|
|
|
|
2020-08-16 03:48:17 +03:00
|
|
|
struct LocalFolder {
|
2021-05-10 08:41:58 +03:00
|
|
|
int id = 0;
|
2021-05-11 03:41:20 +03:00
|
|
|
uint64 ownerId = 0;
|
2021-05-10 08:41:58 +03:00
|
|
|
bool isTest = false;
|
|
|
|
int cloudOrder = 0;
|
2020-08-16 03:48:17 +03:00
|
|
|
QString name;
|
|
|
|
QString emoticon;
|
2021-04-26 23:45:08 +03:00
|
|
|
std::vector<uint64> always;
|
|
|
|
std::vector<uint64> never;
|
|
|
|
std::vector<uint64> pinned;
|
2021-05-11 03:41:20 +03:00
|
|
|
ushort flags = 0;
|
2020-08-16 03:48:17 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
using LocalFolderVector = std::vector<LocalFolder>;
|
|
|
|
DeclareRefSetting(LocalFolderVector, LocalFolders);
|
2021-07-04 22:44:33 +03:00
|
|
|
|
|
|
|
DeclareSetting(bool, TelegramSitesAutologin);
|
2021-09-20 15:36:21 +03:00
|
|
|
|
|
|
|
DeclareSetting(bool, ForwardRememberMode);
|
|
|
|
|
|
|
|
void SetForwardMode(int mode);
|
|
|
|
[[nodiscard]] int ForwardMode();
|
|
|
|
[[nodiscard]] rpl::producer<int> ForwardModeChanges();
|
|
|
|
|
|
|
|
void SetForwardGroupingMode(int mode);
|
|
|
|
[[nodiscard]] int ForwardGroupingMode();
|
|
|
|
[[nodiscard]] rpl::producer<int> ForwardGroupingModeChanges();
|