2021-09-28 09:40:39 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gui/view.h>
|
2022-01-02 21:39:56 +00:00
|
|
|
#include "desktop_events.h"
|
2021-09-28 09:40:39 +00:00
|
|
|
|
2021-10-04 09:33:31 +00:00
|
|
|
#define HINT_TIMEOUT 2
|
|
|
|
|
2021-09-28 09:40:39 +00:00
|
|
|
typedef struct DesktopLockMenuView DesktopLockMenuView;
|
|
|
|
|
2022-01-02 21:39:56 +00:00
|
|
|
typedef void (*DesktopLockMenuViewCallback)(DesktopEvent event, void* context);
|
2021-09-28 09:40:39 +00:00
|
|
|
|
|
|
|
struct DesktopLockMenuView {
|
|
|
|
View* view;
|
|
|
|
DesktopLockMenuViewCallback callback;
|
|
|
|
void* context;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint8_t idx;
|
2022-09-19 13:03:42 +00:00
|
|
|
bool pin_is_set;
|
|
|
|
bool dummy_mode;
|
2021-09-28 09:40:39 +00:00
|
|
|
} DesktopLockMenuViewModel;
|
|
|
|
|
|
|
|
void desktop_lock_menu_set_callback(
|
|
|
|
DesktopLockMenuView* lock_menu,
|
|
|
|
DesktopLockMenuViewCallback callback,
|
|
|
|
void* context);
|
|
|
|
|
|
|
|
View* desktop_lock_menu_get_view(DesktopLockMenuView* lock_menu);
|
2022-09-19 13:03:42 +00:00
|
|
|
void desktop_lock_menu_set_pin_state(DesktopLockMenuView* lock_menu, bool pin_is_set);
|
|
|
|
void desktop_lock_menu_set_dummy_mode_state(DesktopLockMenuView* lock_menu, bool dummy_mode);
|
2022-01-29 09:39:10 +00:00
|
|
|
void desktop_lock_menu_set_idx(DesktopLockMenuView* lock_menu, uint8_t idx);
|
2021-09-28 09:40:39 +00:00
|
|
|
DesktopLockMenuView* desktop_lock_menu_alloc();
|
|
|
|
void desktop_lock_menu_free(DesktopLockMenuView* lock_menu);
|