tcMenu
SecuredMenuPopup.h
Go to the documentation of this file.
1 #ifndef _SECURED_MENU_POPUP_H_
2 #define _SECURED_MENU_POPUP_H_
3 
8 #include <RuntimeMenuItem.h>
9 #include <RemoteAuthentication.h>
10 
11 int secPopupActionRenderFn(RuntimeMenuItem* item, uint8_t row, RenderFnMode mode, char* buffer, int bufferSize);
12 
14 private:
15  SubMenuItem* securedItem;
16 public:
17  ActivateSubMenuItem(RuntimeRenderingFn customRenderFn, int activeStatus, MenuItem* next = NULL)
18  : RuntimeMenuItem(MENUTYPE_ACTIVATE_SUBMENU, nextRandomId(), customRenderFn, activeStatus, 1, next) {
19  }
20 
21  void setSecuredItem(SubMenuItem *secured) {
22  securedItem = secured;
23  }
24 
25  SubMenuItem* getSecuredItem() { return securedItem; }
26 };
27 
35 private:
36  BackMenuItem backMenuItem;
37  TextMenuItem pinEntryItem;
38  ActivateSubMenuItem actionProceedItem;
39  ActivateSubMenuItem actionCancelItem;
40  AuthenticationManager* authentication;
41 public:
42  SecuredMenuPopup(AuthenticationManager *authentication);
43 
44  MenuItem* getItemToActivate() { return &pinEntryItem; }
45 
46  MenuItem* start(SubMenuItem* securedMenu);
47 
48  MenuItem* getRootItem() {
49  return &backMenuItem;
50  }
51 
52  bool doesPinMatch() {
53  return authentication->doesPinMatch(pinEntryItem.getTextValue());
54  }
55 };
56 
57 #endif // _SECURED_MENU_POPUP_H_
RenderFnMode
Definition: MenuItems.h:287
Definition: MenuItems.h:329
Definition: RuntimeMenuItem.h:125
Definition: RuntimeMenuItem.h:110
const char * getTextValue() const
Definition: RuntimeMenuItem.h:262
Definition: MenuItems.h:260
menuid_t nextRandomId()
Definition: RuntimeMenuItem.cpp:14
Definition: SecuredMenuPopup.h:34
Definition: RuntimeMenuItem.h:73
Definition: RemoteAuthentication.h:33
Definition: SecuredMenuPopup.h:13
Definition: RuntimeMenuItem.h:235
int(* RuntimeRenderingFn)(RuntimeMenuItem *item, uint8_t row, RenderFnMode mode, char *buffer, int bufferSize)
Definition: MenuItems.h:318
virtual bool doesPinMatch(const char *pinAttempt)=0