Files
tdesktop/Telegram/SourceFiles/storage/localstorage.h
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
init
2026-02-16 15:50:16 +03:00

98 lines
2.2 KiB
C++

/*
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;
namespace Data {
class WallPaper;
class DocumentMedia;
} // 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
namespace Export {
struct Settings;
} // namespace Export
namespace MTP {
class AuthKey;
using AuthKeyPtr = std::shared_ptr<AuthKey>;
} // namespace MTP
namespace Local {
void start();
void sync();
void finish();
void writeSettings();
void rewriteSettingsIfNeeded();
void writeAutoupdatePrefix(const QString &prefix);
QString readAutoupdatePrefix();
void writeBackground(const Data::WallPaper &paper, const QImage &image);
bool readBackground();
void moveLegacyBackground(
const QString &fromBasePath,
const MTP::AuthKeyPtr &fromLocalKey,
uint64 legacyBackgroundKeyDay,
uint64 legacyBackgroundKeyNight);
void reset();
int32 oldSettingsVersion();
void countVoiceWaveform(not_null<Data::DocumentMedia*> media);
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);
} // namespace Local