semilimes mcu sdk 1.1.1
semilimes Software Development Kit for microcontrollers
Loading...
Searching...
No Matches
fc_single_choice.h
1#ifndef _fc_single_choice_
2#define _fc_single_choice_
3
4#include "../defines.h"
5
7{
8private:
9 #define headerSize 102
10 #define headerArraySize 24
11 SmeJson json_data;
12 char* json = nullptr;
13 char* jsonArray = nullptr;
14
15public:
16// indicates if the choice should be displayed as a radio list or a dropdown control.
18 char mode[2][9] = {"list", "dropdown"};
19
20// Function: ~FcSingleChoice
21
22// distructor of the class, frees up the memory occupied by the array/s
23
24// Prototype:
25// ~FcSingleChoice()
26
27// Parameters:
28
29// Returns:
32 {
33 delete[] json;
34 delete[] jsonArray;
35 json = nullptr;
36 jsonArray = nullptr;
37 }
38
39// Function: FcSingleChoice.set
40
41// Initialize the component that display a list of options and allowing only one choice
42
43// Prototype:
44// void FcSingleChoice::set(char* refname,char* title,bool reqSel, char* value);
45
46// Parameters:
52
53// Returns:
55 void set(char* refname,char* title,bool reqSel,char* mode,char* value);
56
57// Function: FcSingleChoice.addOptions
58
59// add an array of options where name is the option identifier and value is the text displayed to the user
60
61// Prototype:
62// void FcSingleChoice::addOptions(char* name,char* value);
63
64// Parameters:
67
68// Returns:
70
71 void addOptions(char* name,char* value);
72
73// Function: FcSingleChoice.appendOptions
74
75// Append the selected options
76
77// Prototype:
78// void FcSingleChoice::appendOptions();
79
80// Parameters:
81
82// Returns:
84 void appendOptions();
85
86// Function: FcSingleChoice.get
87
88// return the json script
89
90// Prototype:
91// void FcSingleChoice::get();
92
93// Parameters:
94
95// Returns:
97 char* get();
98};
99
100#endif
Definition fc_single_choice.h:7
char mode[2][9]
Definition fc_single_choice.h:18
void appendOptions()
Definition fc_single_choice.cpp:81
void addOptions(char *name, char *value)
Definition fc_single_choice.cpp:48
~FcSingleChoice()
Definition fc_single_choice.h:31
char * get()
Definition fc_single_choice.cpp:103
void set(char *refname, char *title, bool reqSel, char *mode, char *value)
Definition fc_single_choice.cpp:20