2021-09-28 09:40:39 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gui/gui_i.h>
|
|
|
|
#include <gui/view.h>
|
|
|
|
#include <gui/canvas.h>
|
|
|
|
#include <gui/elements.h>
|
|
|
|
#include <furi.h>
|
|
|
|
|
2021-10-04 09:33:31 +00:00
|
|
|
#define HINT_TIMEOUT 2
|
|
|
|
|
2021-09-28 09:40:39 +00:00
|
|
|
typedef enum {
|
|
|
|
DesktopLockMenuEventLock,
|
|
|
|
DesktopLockMenuEventUnlock,
|
2021-10-26 18:34:31 +00:00
|
|
|
DesktopLockMenuEventPinLock,
|
2021-09-28 09:40:39 +00:00
|
|
|
DesktopLockMenuEventExit,
|
|
|
|
} DesktopLockMenuEvent;
|
|
|
|
|
|
|
|
typedef struct DesktopLockMenuView DesktopLockMenuView;
|
|
|
|
|
|
|
|
typedef void (*DesktopLockMenuViewCallback)(DesktopLockMenuEvent event, void* context);
|
|
|
|
|
|
|
|
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);
|
2021-09-28 09:40:39 +00:00
|
|
|
void desktop_lock_menu_reset_idx(DesktopLockMenuView* lock_menu);
|
|
|
|
DesktopLockMenuView* desktop_lock_menu_alloc();
|
|
|
|
void desktop_lock_menu_free(DesktopLockMenuView* lock_menu);
|