desktop_view_lock_menu.h 913 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <gui/view.h>
  3. #include "desktop_events.h"
  4. #define HINT_TIMEOUT 2
  5. typedef struct DesktopLockMenuView DesktopLockMenuView;
  6. typedef void (*DesktopLockMenuViewCallback)(DesktopEvent event, void* context);
  7. struct DesktopLockMenuView {
  8. View* view;
  9. DesktopLockMenuViewCallback callback;
  10. void* context;
  11. };
  12. typedef struct {
  13. uint8_t idx;
  14. uint8_t hint_timeout;
  15. bool pin_set;
  16. } DesktopLockMenuViewModel;
  17. void desktop_lock_menu_set_callback(
  18. DesktopLockMenuView* lock_menu,
  19. DesktopLockMenuViewCallback callback,
  20. void* context);
  21. View* desktop_lock_menu_get_view(DesktopLockMenuView* lock_menu);
  22. void desktop_lock_menu_pin_set(DesktopLockMenuView* lock_menu, bool pin_is_set);
  23. void desktop_lock_menu_set_idx(DesktopLockMenuView* lock_menu, uint8_t idx);
  24. DesktopLockMenuView* desktop_lock_menu_alloc();
  25. void desktop_lock_menu_free(DesktopLockMenuView* lock_menu);