| semilimes mcu sdk 1.1.2 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
6 class FcSingleChoice
7{
8 private:
9 SmeJson json_data;
10 char* json = nullptr;
11 char* jsonArray = nullptr;
12
13 public:
14// indicates if the choice should be displayed as a radio list or a dropdown control.
16 char mode[2][9] = {"list", "dropdown"};
17
18// Function: ~FcSingleChoice
19
20// distructor of the class, frees up the memory occupied by the array/s
21
22// Prototype:
23// ~FcSingleChoice()
24
25// Parameters:
26
27// Returns:
29 ~FcSingleChoice()
30 {
31 delete[] json;
32 delete[] jsonArray;
33 json = nullptr;
34 jsonArray = nullptr;
35 }
36
37// Function: FcSingleChoice.set
38
39// Initialize the component that display a list of options and allowing only one choice
40
41// Prototype:
42// void FcSingleChoice::set(const char* refname,const char* title,bool reqSel, const char* mode, const char* value);
43
44// Parameters:
50
51// Returns:
53 void set(const char* refname,const char* title,bool reqSel, const char* mode, const char* value);
54
55// Function: FcSingleChoice.addOptions
56
57// add an array of options where name is the option identifier and value is the text displayed to the user
58
59// Prototype:
60// void FcSingleChoice::ddOptions(const char* name,const char* value);
61
62// Parameters:
65
66// Returns:
68
69 void addOptions(const char* name,const char* value);
70
71// Function: FcSingleChoice.appendOptions
72
73// Append the selected options
74
75// Prototype:
76// void FcSingleChoice::appendOptions();
77
78// Parameters:
79
80// Returns:
82 void appendOptions();
83
84// Function: FcSingleChoice.get
85
86// return the json script
87
88// Prototype:
89// void FcSingleChoice::get();
90
91// Parameters:
92
93// Returns:
95 char* get();
96};
97
98#endif
FcSingleChoice
Definition fc_single_choice.h:7
FcSingleChoice::mode
char mode[2][9]
Definition fc_single_choice.h:16
FcSingleChoice::appendOptions
void appendOptions()
Definition fc_single_choice.cpp:81
FcSingleChoice::addOptions
void addOptions(const char *name, const char *value)
Definition fc_single_choice.cpp:48
FcSingleChoice::~FcSingleChoice
~FcSingleChoice()
Definition fc_single_choice.h:29
FcSingleChoice::get
char * get()
Definition fc_single_choice.cpp:103
FcSingleChoice::set
void set(const char *refname, const char *title, bool reqSel, const char *mode, const char *value)
Definition fc_single_choice.cpp:20