Debian Codegraph @

Server/Web/WebClientRoute.h

raw symbols SCIP
1 /*
2 RailControl - Model Railway Control Software
3
4 Copyright (c) 2017-2025 by Teddy / Dominik Mahrer - www.railcontrol.org
5
6 RailControl is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 3, or (at your option) any
9 later version.
10
11 RailControl is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 See the GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with RailControl; see the file LICENCE. If not see
18 <http://www.gnu.org/licenses/>.
19 */
20
21 #pragma once
22
23 #include "Logger/Logger.h"
24 #include "Manager.h"
25 #include "Server/Web/WebClient.h"
26
27 namespace Server { namespace Web
28 {
29 class WebClient;
30
31 class WebClientRoute
32 {
33 public:
34 WebClientRoute() = delete;
35 WebClientRoute(const WebClientRoute&) = delete;
36 WebClientRoute& operator=(const WebClientRoute&) = delete;
37
38 inline WebClientRoute(Manager& manager, WebClient& client, Logger::Logger* logger)
39 : manager(manager),
40 client(client),
41 logger(logger)
42 {
43 }
44
45 void HandleRouteEdit(const std::map<std::string,std::string>& arguments);
46 void HandleRouteSave(const std::map<std::string,std::string>& arguments);
47 void HandleRouteList();
48 void HandleRouteAskDelete(const std::map<std::string,std::string>& arguments);
49 void HandleRouteDelete(const std::map<std::string,std::string>& arguments);
50 void HandleRouteGet(const std::map<std::string,std::string>& arguments);
51 void HandleRouteExecute(const std::map<std::string,std::string>& arguments);
52 void HandleRouteRelease(const std::map<std::string,std::string>& arguments);
53 void HandleRelationAdd(const std::map<std::string,std::string>& arguments);
54 void HandleRelationObject(const std::map<std::string, std::string>& arguments);
55 void HandleRelationSwitchStates(const std::map<std::string,std::string>& arguments);
56 void HandleFeedbacksOfTrack(const std::map<std::string,std::string>& arguments);
57
58 private:
59 HtmlTag HtmlTagRelation(const std::string& atlock,
60 const Priority priority,
61 const ObjectType objectType = ObjectTypeSwitch,
62 const ObjectID objectId = ObjectNone,
63 const DataModel::Relation::Data = DataModel::Relation::DefaultData);
64
65 HtmlTag HtmlTagRelationObject(const std::string& atlock,
66 const std::string& priorityString,
67 const ObjectType objectType,
68 const ObjectID objectId = ObjectNone,
69 const DataModel::Relation::Data state = DataModel::Relation::DefaultData);
70
71 HtmlTag HtmlTagRelationSwitchState(const std::string& name,
72 const SwitchID switchId,
73 const DataModel::Relation::Data data = DataModel::SwitchStateStraight);
74
75 HtmlTag HtmlTagSelectTrack(const std::string& name,
76 const Languages::TextSelector label,
77 const TrackID trackID,
78 const Orientation orientation,
79 const std::string& onchange = "") const;
80
81 HtmlTag HtmlTagSelectFeedbacksOfTrack(const TrackID trackID,
82 const RouteID followUpRoute = RouteNone,
83 const FeedbackID feedbackIdReduced = FeedbackNone,
84 const Delay reducedDelay = 0,
85 const FeedbackID feedbackIdCreep = FeedbackNone,
86 const Delay creepDelay = 0,
87 const FeedbackID feedbackIdStop = FeedbackNone,
88 const Delay stopDelay = 0,
89 const FeedbackID feedbackIdOver = FeedbackNone) const;
90
91 Manager& manager;
92 WebClient& client;
93 Logger::Logger* logger;
94 };
95 }} // namespace Server::Web
96