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;
|
|
|
|
uint8_t hint_timeout;
|
2021-10-26 18:34:31 +00:00
|
|
|
bool pin_set;
|
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);
|
2021-10-26 18:34:31 +00:00
|
|
|
void desktop_lock_menu_pin_set(DesktopLockMenuView* lock_menu, bool pin_is_set);
|
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);
|