semilimes mcu sdk 1.1.3 semilimes Software Development Kit for microcontrollers

Loading...
Searching...
No Matches
dc_form.h
1#ifndef _dc_form_
2#define _dc_form_
3
4#include "../defines.h"
5
6 class DcForm
7{
8 private:
9 SmeJson json_data;
10 char* json = nullptr;
11 char* jsonArray = nullptr;
12
13 public:
14// variable: DcForm.featureType
15// describes the types of the feature
17 char featureType[3][10] = {"contact","groupchat","channel"};
18
19// variable: DcForm.align
20// allows to align all the children form components to a direction
22 char align[3][7] = {"left","center","right"};
23
24// Function: ~DcForm
25
26// distructor of the class, frees up the memory occupied by the array/s
27
28// Prototype:
29// ~DcForm()
30
31// Parameters:
32
33// Returns:
35 ~DcForm()
36 {
37 delete[] json;
38 delete[] jsonArray;
39 json = nullptr;
40 jsonArray = nullptr;
41 }
42
43// Function: DcForm.set
44
45// A form message is a complex data component which can be arbitrarily structured using available form components
46
47// Prototype:
48// void DcForm::set(const char* recId, const char* recFeatureType, bool submitEnabled, bool retainStatus, const char* submitText, const char* refName, const char* align, bool authorizeSubmit, bool hideSubmissionMsg);
49
50// Parameters:
60// Returns:
62 void set(const char* recId, const char* recFeatureType, bool submitEnabled, bool retainStatus, const char* submitText, const char* refName, const char* align, bool authorizeSubmit, bool hideSubmissionMsg);
63
64// Function: DcForm.addFormComponents
65
66// Add a Form Component to the array
67
68// Prototype:
69// void DcForm::addFormComponents(const char* component);
70
71// Parameters:
73
74// Returns:
76 void addFormComponents(const char* component);
77
78// Function: DcForm.appendFormComponents
79
80// Append the Form Components to the json message
81
82// Prototype:
83// void DcForm::appendFormComponents();
84
85// Parameters:
86
87// Returns:
89 void appendFormComponents();
90
91
92// Function: DcForm.get
93
94// return the json script
95
96// Prototype:
97// void DcForm::get();
98
99// Parameters:
100
101// Returns:
103 char* get();
104};
105
106#endif
DcForm
Definition dc_form.h:7
DcForm::align
char align[3][7]
Definition dc_form.h:22
DcForm::set
void set(const char *recId, const char *recFeatureType, bool submitEnabled, bool retainStatus, const char *submitText, const char *refName, const char *align, bool authorizeSubmit, bool hideSubmissionMsg)
Definition dc_form.cpp:23
DcForm::~DcForm
~DcForm()
Definition dc_form.h:35
DcForm::get
char * get()
Definition dc_form.cpp:111
DcForm::featureType
char featureType[3][10]
Definition dc_form.h:17
DcForm::appendFormComponents
void appendFormComponents()
Definition dc_form.cpp:89
DcForm::addFormComponents
void addFormComponents(const char *component)
Definition dc_form.cpp:60