flipperzero-firmware/applications/desktop/views/desktop_view_lock_menu.h
Albert Kharisov 21ac37a6f6
[FL-2152] New PIN lock (#989)
* [Fl-2152] New PIN Lock, part 1
* Fix errors & leaks, renaming
* Add support to f6
* Fix error, remove duplicate code
* Fix drawing corners of Lock Popup
* FuriHal: insomnia if usb connected
* Applications: cleanup timers use

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-02-10 21:17:41 +03:00

34 lines
913 B
C

#pragma once
#include <gui/view.h>
#include "desktop_events.h"
#define HINT_TIMEOUT 2
typedef struct DesktopLockMenuView DesktopLockMenuView;
typedef void (*DesktopLockMenuViewCallback)(DesktopEvent event, void* context);
struct DesktopLockMenuView {
View* view;
DesktopLockMenuViewCallback callback;
void* context;
};
typedef struct {
uint8_t idx;
uint8_t hint_timeout;
bool pin_set;
} DesktopLockMenuViewModel;
void desktop_lock_menu_set_callback(
DesktopLockMenuView* lock_menu,
DesktopLockMenuViewCallback callback,
void* context);
View* desktop_lock_menu_get_view(DesktopLockMenuView* lock_menu);
void desktop_lock_menu_pin_set(DesktopLockMenuView* lock_menu, bool pin_is_set);
void desktop_lock_menu_set_idx(DesktopLockMenuView* lock_menu, uint8_t idx);
DesktopLockMenuView* desktop_lock_menu_alloc();
void desktop_lock_menu_free(DesktopLockMenuView* lock_menu);