-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAlertTab.h
149 lines (119 loc) · 3.4 KB
/
AlertTab.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* AlertTab.h
*
* Created on: 13 mai 2013
* Author: gdr
*/
#ifndef ALERTTAB_H_
#define ALERTTAB_H_
//#include "HTTPConnect.h"
#include <NativeUI/Screen.h>
#include <MAUtil/Map.h>
#include <NativeUI/Widgets.h>// Include all widgets
#include <Wormhole/HighLevelHttpConnection.h>
#include <Wormhole/MessageStreamJSON.h>
#include <mastdlib.h>
#include "conf.h"
#include "resource/Convert.h"
#define BUFSIZE 1024
using namespace Wormhole;
using namespace MAUtil;
using namespace NativeUI;
class AlertTab : public NativeUI::Screen, public ButtonListener/*, public RadioGroupListener*/, public HighLevelHttpConnection, public ListViewListener
{
public:
enum eAlertTab {
PLUGIN_LIST = 0,
INFORMATION_LIST,
ALERT_LIST,
ASSET_LIST,
OPERATOR_LIST,
UNIT_INFO,
SUB_UNIT_INFO
};
/**
* Constructor.
*/
AlertTab();
/**
* Destructor.
*/
virtual ~AlertTab();
void connectUrl(String url, eAlertTab fct);
void dataDownloaded(MAHandle , int );
virtual void buttonClicked(Widget* button);
// virtual void radioButtonSelected(NativeUI::RadioGroup*, int, NativeUI::RadioButton*);
virtual void listViewItemClicked(ListView* listView, ListViewItem* listViewItem);
void parseJSONPlugin(MAHandle data);
void parseJSONInformation(MAHandle data);
void parseJSONAlert(MAHandle data);
void parseJSONAsset(MAHandle data);
void parseJSONOperator(MAHandle data);
void parseJSONUnitInfo(MAHandle data);
void parseJSONSubUnitInfo(MAHandle data);
void createUI();
void createOptionPage();
void createUnitPage();
private:
eAlertTab fonction;
char mBuffer[BUFSIZE];
bool mIsConnected;
int count;
String contentString;
int selectedPlugin;
int selectedInformation;
//View 1
ListView *lValert;
VerticalLayout* mainLayoutAlertChoice;
MAUtil::Map<int,ListViewItem*> mapLVIAlert;
MAUtil::Map<int,Label*> mapLAlertName;
Button *bAddAlert;
Button *bCancel;
HorizontalLayout *HLOptionAlert;
int posOptionAlert;
//View 2
Label* assetTitle;
ListView *lVAsset;
MAUtil::Map<int,long long> mapAssetId;
VerticalLayout* mainLayoutAssetChoice;
MAUtil::Map<int,ListViewItem*> mapLVIAsset;
MAUtil::Map<int,Label*> mapLAssetName;
//View 3
ListView *lVPlugin;
MAUtil::Map<int, long long> mapPluginId;
VerticalLayout* mainLayoutPluginChoice;
MAUtil::Map<int,ListViewItem*> mapLVIPlugin;
MAUtil::Map<int,Label*> mapLPluginName;
//View 4
ListView *lVInfo;
MAUtil::Map<int, long long> mapInfoIdSrc;
MAUtil::Map<int, long long> mapInfoIdSea;
MAUtil::Map<int, long long> mapInfoIdUnit;
VerticalLayout* mainLayoutInfoChoice;
MAUtil::Map<int,ListViewItem*> mapLVIInfo;
MAUtil::Map<int,Label*> mapLInfoName;
//View 5
VerticalLayout* mainLayoutOptionChoice;
ListView* lVOption;
MAUtil::Map<int,ListViewItem*> mapLVIOption;
Label* keyValue;
Label* criterion;
Label* value;
EditBox* eBValue;
Label* unit;
Button* bDest;
//view 5.2
ListView *lVOperator;
MAUtil::Map<int, long long> mapOperatorId;
VerticalLayout* mainLayoutOperatorChoice;
MAUtil::Map<int,ListViewItem*> mapLVIOperator;
MAUtil::Map<int,Label*> mapLOperatorName;
//view 5.3
ListView *lVUnit;
MAUtil::Map<int, long long> mapUnitId;
VerticalLayout* mainLayoutUnitChoice;
MAUtil::Map<int,ListViewItem*> mapLVIUnit;
MAUtil::Map<int,Label*> mapLUnitName;
//HTTPConnect* httpConnect;
};
#endif /* ALERTTAB_H_ */