tdesktop/Telegram/SourceFiles/storage/localstorage.h

97 lines
2.1 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
#include "storage/file_download.h"
#include "storage/localimageloader.h"
#include <QtCore/QTimer>
class History;
2019-01-16 17:26:26 +00:00
namespace Data {
2019-01-28 13:59:49 +00:00
class WallPaper;
class DocumentMedia;
2019-01-16 17:26:26 +00:00
} // namespace Data
namespace Lang {
struct Language;
} // namespace Lang
namespace Storage {
namespace details {
struct ReadSettingsContext;
} // namespace details
class EncryptionKey;
} // namespace Storage
namespace Window {
namespace Theme {
struct Object;
struct Saved;
} // namespace Theme
} // namespace Window
2018-06-22 21:32:00 +00:00
namespace Export {
struct Settings;
} // namespace Export
2020-06-19 15:14:55 +00:00
namespace MTP {
class AuthKey;
using AuthKeyPtr = std::shared_ptr<AuthKey>;
} // namespace MTP
2016-09-15 19:15:49 +00:00
namespace Local {
2016-09-15 19:15:49 +00:00
void start();
void finish();
2016-09-15 19:15:49 +00:00
void writeSettings();
2020-06-19 15:14:55 +00:00
void rewriteSettingsIfNeeded();
2018-05-03 06:39:10 +00:00
void writeAutoupdatePrefix(const QString &prefix);
QString readAutoupdatePrefix();
2020-06-19 15:14:55 +00:00
void writeBackground(const Data::WallPaper &paper, const QImage &image);
bool readBackground();
void moveLegacyBackground(
const QString &fromBasePath,
const MTP::AuthKeyPtr &fromLocalKey,
uint64 legacyBackgroundKeyDay,
uint64 legacyBackgroundKeyNight);
2016-09-15 19:15:49 +00:00
void reset();
2016-09-15 19:15:49 +00:00
int32 oldSettingsVersion();
void countVoiceWaveform(not_null<Data::DocumentMedia*> media);
2016-09-15 19:15:49 +00:00
void cancelTask(TaskId id);
void writeTheme(const Window::Theme::Saved &saved);
void clearTheme();
[[nodiscard]] Window::Theme::Saved readThemeAfterSwitch();
[[nodiscard]] Window::Theme::Object ReadThemeContent();
void writeLangPack();
void pushRecentLanguage(const Lang::Language &language);
std::vector<Lang::Language> readRecentLanguages();
void saveRecentLanguages(const std::vector<Lang::Language> &list);
void removeRecentLanguage(const QString &id);
void incrementRecentHashtag(RecentHashtagPack &recent, const QString &tag);
bool readOldMtpData(
bool remove,
Storage::details::ReadSettingsContext &context);
bool readOldUserSettings(
bool remove,
Storage::details::ReadSettingsContext &context);
2016-09-15 19:15:49 +00:00
} // namespace Local