userpic_view.h 880 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 "base/weak_ptr.h"
  9. #include <QtGui/QImage>
  10. namespace Ui {
  11. class EmptyUserpic;
  12. [[nodiscard]] float64 ForumUserpicRadiusMultiplier();
  13. struct PeerUserpicView {
  14. [[nodiscard]] bool null() const {
  15. return cached.isNull() && !cloud && empty.null();
  16. }
  17. QImage cached;
  18. std::shared_ptr<QImage> cloud;
  19. base::weak_ptr<const EmptyUserpic> empty;
  20. uint32 paletteVersion : 31 = 0;
  21. uint32 forum : 1 = 0;
  22. };
  23. [[nodiscard]] bool PeerUserpicLoading(const PeerUserpicView &view);
  24. void ValidateUserpicCache(
  25. PeerUserpicView &view,
  26. const QImage *cloud,
  27. const EmptyUserpic *empty,
  28. int size,
  29. bool forum);
  30. } // namespace Ui