window_theme_editor_box.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "ui/layers/generic_box.h"
  9. namespace Data {
  10. struct CloudTheme;
  11. } // namespace Data
  12. namespace Window {
  13. class Controller;
  14. namespace Theme {
  15. struct Object;
  16. struct ParsedTheme;
  17. void StartEditor(
  18. not_null<Window::Controller*> window,
  19. const Data::CloudTheme &cloud);
  20. void CreateBox(
  21. not_null<Ui::GenericBox*> box,
  22. not_null<Window::Controller*> window);
  23. void CreateForExistingBox(
  24. not_null<Ui::GenericBox*> box,
  25. not_null<Window::Controller*> window,
  26. const Data::CloudTheme &cloud);
  27. void SaveTheme(
  28. not_null<Window::Controller*> window,
  29. const Data::CloudTheme &cloud,
  30. const QByteArray &palette,
  31. Fn<void()> unlock);
  32. void SaveThemeBox(
  33. not_null<Ui::GenericBox*> box,
  34. not_null<Window::Controller*> window,
  35. const Data::CloudTheme &cloud,
  36. const QByteArray &palette);
  37. [[nodiscard]] bool PaletteChanged(
  38. const QByteArray &editorPalette,
  39. const Data::CloudTheme &cloud);
  40. [[nodiscard]] QByteArray CollectForExport(const QByteArray &palette);
  41. [[nodiscard]] ParsedTheme ParseTheme(
  42. const Object &theme,
  43. bool onlyPalette = false,
  44. bool parseCurrent = true);
  45. [[nodiscard]] QString GenerateSlug();
  46. } // namespace Theme
  47. } // namespace Window