2019-09-02 19:10:18 +03:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
|
2019-09-03 11:25:19 +03:00
|
|
|
#include "boxes/generic_box.h"
|
2019-09-02 19:10:18 +03:00
|
|
|
|
2019-09-05 08:18:21 +03:00
|
|
|
namespace Data {
|
|
|
|
struct CloudTheme;
|
|
|
|
} // namespace Data
|
|
|
|
|
2019-09-02 19:10:18 +03:00
|
|
|
namespace Window {
|
2019-09-03 11:25:19 +03:00
|
|
|
|
|
|
|
class Controller;
|
|
|
|
|
2019-09-02 19:10:18 +03:00
|
|
|
namespace Theme {
|
|
|
|
|
2019-09-09 23:58:41 +03:00
|
|
|
struct Object;
|
|
|
|
struct ParsedTheme;
|
|
|
|
|
2019-09-05 08:18:21 +03:00
|
|
|
void StartEditor(
|
|
|
|
not_null<Window::Controller*> window,
|
|
|
|
const Data::CloudTheme &cloud);
|
2019-09-03 11:25:19 +03:00
|
|
|
void CreateBox(
|
|
|
|
not_null<GenericBox*> box,
|
|
|
|
not_null<Window::Controller*> window);
|
2019-09-05 13:51:36 +03:00
|
|
|
void CreateForExistingBox(
|
|
|
|
not_null<GenericBox*> box,
|
|
|
|
not_null<Window::Controller*> window,
|
|
|
|
const Data::CloudTheme &cloud);
|
2019-09-05 23:21:44 +03:00
|
|
|
void SaveTheme(
|
|
|
|
not_null<Window::Controller*> window,
|
|
|
|
const Data::CloudTheme &cloud,
|
|
|
|
const QByteArray &palette,
|
|
|
|
Fn<void()> unlock);
|
2019-09-03 11:25:19 +03:00
|
|
|
void SaveThemeBox(
|
|
|
|
not_null<GenericBox*> box,
|
|
|
|
not_null<Window::Controller*> window,
|
2019-09-05 13:51:36 +03:00
|
|
|
const Data::CloudTheme &cloud,
|
2019-09-03 11:25:19 +03:00
|
|
|
const QByteArray &palette);
|
2019-09-02 19:10:18 +03:00
|
|
|
|
2019-09-08 16:40:15 +03:00
|
|
|
[[nodiscard]] bool PaletteChanged(
|
|
|
|
const QByteArray &editorPalette,
|
|
|
|
const Data::CloudTheme &cloud);
|
|
|
|
|
2019-09-09 17:44:08 +03:00
|
|
|
[[nodiscard]] QByteArray CollectForExport(const QByteArray &palette);
|
|
|
|
|
2019-09-09 23:58:41 +03:00
|
|
|
[[nodiscard]] ParsedTheme ParseTheme(
|
|
|
|
const Object &theme,
|
|
|
|
bool onlyPalette = false,
|
|
|
|
bool parseCurrent = true);
|
|
|
|
|
2019-09-02 19:10:18 +03:00
|
|
|
} // namespace Theme
|
|
|
|
} // namespace Window
|