choose_date_time.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 style {
  10. struct FlatLabel;
  11. struct InputField;
  12. struct CalendarColors;
  13. } // namespace style
  14. namespace Ui {
  15. class RoundButton;
  16. struct ChooseDateTimeBoxDescriptor {
  17. QPointer<RoundButton> submit;
  18. Fn<TimeId()> collect;
  19. rpl::producer<TimeId> values;
  20. };
  21. struct ChooseDateTimeStyleArgs {
  22. ChooseDateTimeStyleArgs();
  23. const style::FlatLabel *labelStyle;
  24. const style::InputField *dateFieldStyle;
  25. const style::InputField *timeFieldStyle;
  26. const style::FlatLabel *separatorStyle;
  27. const style::FlatLabel *atStyle;
  28. const style::CalendarColors *calendarStyle;
  29. };
  30. struct ChooseDateTimeBoxArgs {
  31. rpl::producer<QString> title;
  32. rpl::producer<QString> submit;
  33. Fn<void(TimeId)> done;
  34. Fn<TimeId()> min;
  35. TimeId time = 0;
  36. Fn<TimeId()> max;
  37. rpl::producer<QString> description;
  38. ChooseDateTimeStyleArgs style;
  39. };
  40. ChooseDateTimeBoxDescriptor ChooseDateTimeBox(
  41. not_null<GenericBox*> box,
  42. ChooseDateTimeBoxArgs &&args);
  43. } // namespace Ui