2022-02-17 22:59:27 +01:00
|
|
|
#ifndef BUILDING_NODE_H
|
|
|
|
#define BUILDING_NODE_H
|
2021-11-14 14:19:13 +01:00
|
|
|
|
|
|
|
#include "core/string.h"
|
|
|
|
#include "core/containers/vector.h"
|
|
|
|
|
2022-02-05 23:02:06 +01:00
|
|
|
#include "web_modules/admin_panel/admin_node.h"
|
2021-11-14 14:19:13 +01:00
|
|
|
|
|
|
|
#include "building.h"
|
|
|
|
|
|
|
|
class Request;
|
|
|
|
class FormValidator;
|
2022-02-17 22:59:27 +01:00
|
|
|
class QueryResult;
|
2021-11-14 14:19:13 +01:00
|
|
|
|
2022-02-17 22:59:27 +01:00
|
|
|
class BuildingNode : public AdminNode {
|
|
|
|
RCPP_OBJECT(BuildingNode, AdminNode);
|
2021-11-14 14:19:13 +01:00
|
|
|
|
|
|
|
public:
|
2021-11-14 21:37:04 +01:00
|
|
|
void handle_request_default(Request *request);
|
|
|
|
|
|
|
|
void admin_handle_request_main(Request *request);
|
|
|
|
String admin_get_section_name();
|
|
|
|
void admin_add_section_links(Vector<AdminSectionLinkInfo> *links);
|
|
|
|
bool admin_full_render();
|
|
|
|
|
|
|
|
void admin_render_building_list(Request *request);
|
2021-11-16 17:00:58 +01:00
|
|
|
void admin_render_building(Request *request, Ref<Building> building);
|
2021-11-14 21:37:04 +01:00
|
|
|
|
2022-02-17 22:59:27 +01:00
|
|
|
virtual Ref<Building> db_get_building(const int id);
|
|
|
|
virtual Vector<Ref<Building> > db_get_all();
|
|
|
|
virtual void db_save_building(Ref<Building> &building);
|
|
|
|
|
|
|
|
virtual void db_parse_row(Ref<QueryResult> &result, Ref<Building> &building);
|
|
|
|
|
2022-02-05 23:02:06 +01:00
|
|
|
void create_table();
|
|
|
|
void drop_table();
|
|
|
|
void create_default_entries();
|
2021-11-14 14:19:13 +01:00
|
|
|
|
2022-02-17 22:59:27 +01:00
|
|
|
static BuildingNode *get_singleton();
|
2021-11-14 14:19:13 +01:00
|
|
|
|
2022-02-17 22:59:27 +01:00
|
|
|
BuildingNode();
|
|
|
|
~BuildingNode();
|
2021-11-14 14:19:13 +01:00
|
|
|
|
|
|
|
protected:
|
2022-02-17 22:59:27 +01:00
|
|
|
static BuildingNode *_self;
|
2021-11-14 14:19:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|