SAbleTimeRange.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Copyright Epic Games, Inc. All Rights Reserved.
  2. #pragma once
  3. #include "ITimeSlider.h"
  4. #include "Templates/SharedPointer.h"
  5. #include "Types/SlateEnums.h"
  6. #include "Widgets/DeclarativeSyntaxSupport.h"
  7. class SWidget;
  8. template <typename NumericType> struct INumericTypeInterface;
  9. class SAbleTimeRange : public ITimeSlider
  10. {
  11. public:
  12. SLATE_BEGIN_ARGS(SAbleTimeRange)
  13. : _ShowWorkingRange(true), _ShowViewRange(false), _ShowPlaybackRange(true)
  14. {}
  15. /** Whether to show the working range */
  16. SLATE_ARGUMENT( bool, ShowWorkingRange )
  17. /** Whether to show the view range */
  18. SLATE_ARGUMENT( bool, ShowViewRange )
  19. /** Whether to show the playback range */
  20. SLATE_ARGUMENT( bool, ShowPlaybackRange )
  21. /** Whether to enable the working range */
  22. SLATE_ARGUMENT( bool, EnableWorkingRange )
  23. /** Whether to enable the view range */
  24. SLATE_ARGUMENT( bool, EnableViewRange )
  25. /** Whether to enable the playback range */
  26. SLATE_ARGUMENT( bool, EnablePlaybackRange )
  27. /* Content to display inside the time range */
  28. SLATE_DEFAULT_SLOT( FArguments, CenterContent )
  29. SLATE_END_ARGS()
  30. /**
  31. * Construct the widget
  32. *
  33. * @param InArgs A declaration from which to construct the widget
  34. */
  35. void Construct( const FArguments& InArgs, TSharedRef<ITimeSliderController> InTimeSliderController, TSharedRef<INumericTypeInterface<double>> NumericTypeInterface );
  36. protected:
  37. double GetSpinboxDelta() const;
  38. protected:
  39. double PlayStartTime() const;
  40. double PlayEndTime() const;
  41. void OnPlayStartTimeCommitted(double NewValue, ETextCommit::Type InTextCommit);
  42. void OnPlayEndTimeCommitted(double NewValue, ETextCommit::Type InTextCommit);
  43. void OnPlayStartTimeChanged(double NewValue);
  44. void OnPlayEndTimeChanged(double NewValue);
  45. protected:
  46. double ViewStartTime() const;
  47. double ViewEndTime() const;
  48. void OnViewStartTimeCommitted(double NewValue, ETextCommit::Type InTextCommit);
  49. void OnViewEndTimeCommitted(double NewValue, ETextCommit::Type InTextCommit);
  50. void OnViewStartTimeChanged(double NewValue);
  51. void OnViewEndTimeChanged(double NewValue);
  52. protected:
  53. double WorkingStartTime() const;
  54. double WorkingEndTime() const;
  55. void OnWorkingStartTimeCommitted(double NewValue, ETextCommit::Type InTextCommit);
  56. void OnWorkingEndTimeCommitted(double NewValue, ETextCommit::Type InTextCommit);
  57. void OnWorkingStartTimeChanged(double NewValue);
  58. void OnWorkingEndTimeChanged(double NewValue);
  59. private:
  60. TSharedPtr<ITimeSliderController> TimeSliderController;
  61. };