info_userpic_emoji_builder_common.h 868 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. namespace UserpicBuilder {
  9. struct Result {
  10. QImage&& image;
  11. DocumentId id = 0;
  12. std::vector<QColor> colors;
  13. };
  14. [[nodiscard]] QImage GenerateGradient(
  15. const QSize &size,
  16. const std::vector<QColor> &colors,
  17. bool circle = true,
  18. bool roundForumRect = false);
  19. struct StartData {
  20. DocumentId documentId = DocumentId(0);
  21. int builderColorIndex = 0;
  22. rpl::producer<std::vector<DocumentId>> documents;
  23. std::vector<QColor> gradientEditorColors;
  24. bool isForum = false;
  25. };
  26. template <typename Result>
  27. struct BothWayCommunication {
  28. rpl::producer<> triggers;
  29. Fn<void(Result)> result;
  30. };
  31. } // namespace UserpicBuilder