infrared_progress_view.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * @file infrared_progress_view.h
  3. * Infrared: Custom Infrared view module.
  4. * It shows popup progress bar during brute force.
  5. */
  6. #pragma once
  7. #include <gui/view.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /** Anonumous instance */
  12. typedef struct InfraredProgressView InfraredProgressView;
  13. /** Callback for back button handling */
  14. typedef void (*InfraredProgressViewBackCallback)(void*);
  15. /** Allocate and initialize Infrared view
  16. *
  17. * @retval new allocated instance
  18. */
  19. InfraredProgressView* infrared_progress_view_alloc();
  20. /** Free previously allocated Progress view module instance
  21. *
  22. * @param instance to free
  23. */
  24. void infrared_progress_view_free(InfraredProgressView* instance);
  25. /** Get progress view module view
  26. *
  27. * @param instance view module
  28. * @retval view
  29. */
  30. View* infrared_progress_view_get_view(InfraredProgressView* instance);
  31. /** Increase progress on progress view module
  32. *
  33. * @param instance view module
  34. * @retval true - value is incremented and maximum is reached,
  35. * false - value is incremented and maximum is not reached
  36. */
  37. bool infrared_progress_view_increase_progress(InfraredProgressView* instance);
  38. /** Set maximum progress value
  39. *
  40. * @param instance - view module
  41. * @param progress_max - maximum value of progress
  42. */
  43. void infrared_progress_view_set_progress_total(
  44. InfraredProgressView* instance,
  45. uint16_t progress_max);
  46. /** Set back button callback
  47. *
  48. * @param instance - view module
  49. * @param callback - callback to call for back button
  50. * @param context - context to pass to callback
  51. */
  52. void infrared_progress_view_set_back_callback(
  53. InfraredProgressView* instance,
  54. InfraredProgressViewBackCallback callback,
  55. void* context);
  56. #ifdef __cplusplus
  57. }
  58. #endif