flipp_pomodoro.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <furi_hal.h>
  3. #include "../helpers/time.h"
  4. /// @brief Options of pomodoro stages
  5. typedef enum
  6. {
  7. Work,
  8. Rest,
  9. } PomodoroStage;
  10. /// @brief State of the pomodoro timer
  11. typedef struct
  12. {
  13. PomodoroStage stage;
  14. uint32_t started_at_timestamp;
  15. } FlippPomodoroState;
  16. /// @brief Generates initial state
  17. /// @param state - pointer to the state of pomorodo.
  18. /// @returns A new pre-populated state for pomodoro timer
  19. FlippPomodoroState *flipp_pomodoro__new();
  20. /// @brief Destroys state of timer and it's dependencies
  21. void flipp_pomodoro__destroy(FlippPomodoroState *state);
  22. /// @brief Get remaining stage time.
  23. /// @param state - pointer to the state of pomorodo.
  24. /// @returns Time difference to the end of current stage
  25. TimeDifference flipp_pomodoro__stage_remaining_duration(FlippPomodoroState *state);
  26. /// @brief Label of transition to the next stage
  27. /// @param state - pointer to the state of pomorodo.
  28. /// @returns string with the label of the "skipp" button
  29. char *flipp_pomodoro__next_stage_label(FlippPomodoroState *state);
  30. /// @brief Check if current stage is expired
  31. /// @param state - pointer to the state of pomorodo.
  32. /// @returns expriations status - true means stage is expired
  33. bool flipp_pomodoro__is_stage_expired(FlippPomodoroState *state);
  34. /// @brief Rotate stage of the timer
  35. /// @param state - pointer to the state of pomorodo.
  36. void flipp_pomodoro__toggle_stage(FlippPomodoroState *state);