export_view_progress.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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/rp_widget.h"
  9. #include "export/view/export_view_content.h"
  10. #include "base/object_ptr.h"
  11. #include "base/timer.h"
  12. namespace Ui {
  13. class VerticalLayout;
  14. class RoundButton;
  15. class FlatLabel;
  16. class LinkButton;
  17. template <typename Widget>
  18. class FadeWrap;
  19. } // namespace Ui
  20. namespace Export {
  21. namespace View {
  22. class ProgressWidget : public Ui::RpWidget {
  23. public:
  24. ProgressWidget(
  25. QWidget *parent,
  26. rpl::producer<Content> content);
  27. rpl::producer<uint64> skipFileClicks() const;
  28. rpl::producer<> cancelClicks() const;
  29. rpl::producer<> doneClicks() const;
  30. ~ProgressWidget();
  31. private:
  32. void setupBottomButton(not_null<Ui::RoundButton*> button);
  33. void updateState(Content &&content);
  34. void showDone();
  35. Content _content;
  36. class Row;
  37. object_ptr<Ui::VerticalLayout> _body;
  38. std::vector<not_null<Row*>> _rows;
  39. base::unique_qptr<Ui::FadeWrap<Ui::LinkButton>> _skipFile;
  40. QPointer<Ui::FlatLabel> _about;
  41. base::unique_qptr<Ui::RoundButton> _cancel;
  42. base::unique_qptr<Ui::RoundButton> _done;
  43. rpl::event_stream<> _doneClicks;
  44. uint64 _fileRandomId = 0;
  45. base::Timer _fileShowSkipTimer;
  46. };
  47. } // namespace View
  48. } // namespace Export