mourne_rcpp_fw/app/weather/weather_node.h

48 lines
1.1 KiB
C
Raw Permalink Normal View History

2022-02-17 23:53:36 +01:00
#ifndef WEATHER_NODE_H
#define WEATHER_NODE_H
2021-12-18 11:23:59 +01:00
#include "core/containers/vector.h"
2022-02-17 23:37:02 +01:00
#include "core/string.h"
2021-12-18 11:23:59 +01:00
2022-02-05 23:02:06 +01:00
#include "web_modules/admin_panel/admin_node.h"
2021-12-18 11:23:59 +01:00
#include "weather.h"
class Request;
class FormValidator;
2022-02-17 23:37:02 +01:00
class QueryResult;
class WeatherNode : public AdminNode {
RCPP_OBJECT(WeatherNode, AdminNode);
2021-12-18 11:23:59 +01:00
public:
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_weather_list(Request *request);
void admin_render_weather(Request *request, Ref<Weather> weather);
2022-02-17 23:37:02 +01:00
virtual Ref<Weather> db_get_weather(const int id);
virtual Vector<Ref<Weather> > db_get_all();
virtual void db_save_weather(Ref<Weather> &weather);
virtual void db_parse_row(Ref<QueryResult> &result, Ref<Weather> &weather);
2022-02-05 23:02:06 +01:00
void create_table();
void drop_table();
void create_default_entries();
2021-12-18 11:23:59 +01:00
2022-02-17 23:37:02 +01:00
static WeatherNode *get_singleton();
2021-12-18 11:23:59 +01:00
2022-02-17 23:37:02 +01:00
WeatherNode();
~WeatherNode();
2021-12-18 11:23:59 +01:00
protected:
2022-02-17 23:37:02 +01:00
static WeatherNode *_self;
2021-12-18 11:23:59 +01:00
};
#endif