supla-device
Loading...
Searching...
No Matches
src
supla
network
html_generator.h
1
/*
2
Copyright (C) AC SOFTWARE SP. Z O.O.
3
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License
6
as published by the Free Software Foundation; either version 2
7
of the License, or (at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
*/
18
19
#ifndef SRC_SUPLA_NETWORK_HTML_GENERATOR_H_
20
#define SRC_SUPLA_NETWORK_HTML_GENERATOR_H_
21
22
namespace
Supla {
23
24
enum class
SetupRequestResult {
25
NONE,
26
OK,
27
PASSWORD_MISMATCH,
28
WEAK_PASSWORD,
29
INVALID_REQUEST,
30
INVALID_OLD_PASSWORD,
31
};
32
33
class
WebSender
;
34
35
class
HtmlGenerator
{
36
public
:
37
virtual
~HtmlGenerator
();
38
39
virtual
void
sendPage(
Supla::WebSender
*,
40
bool
dataSaved =
false
,
41
bool
includeSessionLinks =
false
);
42
virtual
void
sendBetaPage(
Supla::WebSender
*,
43
bool
dataSaved =
false
,
44
bool
includeSessionLinks =
false
);
45
46
virtual
void
sendHeaderBegin(
Supla::WebSender
*);
47
virtual
void
sendHeader(
Supla::WebSender
*);
48
virtual
void
sendHeaderEnd(
Supla::WebSender
*);
49
virtual
void
sendBodyBegin(
Supla::WebSender
*);
50
virtual
void
sendDataSaved(
Supla::WebSender
*);
51
virtual
void
sendLogo(
Supla::WebSender
*);
52
virtual
void
sendDeviceInfo(
Supla::WebSender
*);
53
virtual
void
sendForm(
Supla::WebSender
*);
// form send in standard request
54
virtual
void
sendBetaForm(
Supla::WebSender
*);
// form send in /beta request
55
virtual
void
sendButtons(
Supla::WebSender
*);
56
virtual
void
sendSubmitButton(
Supla::WebSender
*);
57
virtual
void
sendBodyEnd(
Supla::WebSender
*);
58
59
// methods called in sendHeader default implementation
60
virtual
void
sendStyle(
Supla::WebSender
*);
61
virtual
void
sendJavascript(
Supla::WebSender
*);
62
63
virtual
void
sendLoginPage(
Supla::WebSender
*,
bool
loginError =
false
);
64
virtual
void
sendSetupPage(
65
Supla::WebSender
*,
66
bool
changePassword,
67
Supla::SetupRequestResult = Supla::SetupRequestResult::NONE);
68
69
virtual
void
sendSessionLinks(
Supla::WebSender
*);
70
};
71
72
};
// namespace Supla
73
74
#endif
// SRC_SUPLA_NETWORK_HTML_GENERATOR_H_
Supla::HtmlGenerator
Definition
html_generator.h:35
Supla::WebSender
Definition
web_sender.h:26
Generated by
1.13.2