libyui-rest-api
Loading...
Searching...
No Matches
YHttpWidgetsActionHandler Class Reference
Inheritance diagram for YHttpWidgetsActionHandler:
Collaboration diagram for YHttpWidgetsActionHandler:

Protected Member Functions

virtual void process_request (struct MHD_Connection *connection, const char *url, const char *method, const char *upload_data, size_t *upload_data_size, std::ostream &body, int &error_code, std::string &content_type, bool *redraw)
 
int do_action (YWidget *widget, const std::string &action, struct MHD_Connection *connection, std::ostream &body)
 
virtual YDumbTabActionHandlerget_dumb_tab_handler ()
 
virtual YMenuWidgetActionHandlerget_menu_handler ()
 
virtual YWidgetActionHandlerget_widget_handler ()
 
virtual YTableActionHandlerget_table_handler ()
 
virtual YMultiSelectionBoxActionHandlerget_multiselectionbox_handler ()
 
template<typename T >
int action_handler (YWidget *widget, std::ostream &body, std::function< void(T *)> handler_func, const bool allow_disabled=false)
 
- Protected Member Functions inherited from YHttpHandler
virtual void process_request (struct MHD_Connection *connection, const char *url, const char *method, const char *upload_data, size_t *upload_data_size, std::ostream &body, int &error_code, std::string &content_type, bool *redraw)=0
 
int handle_error (std::ostream &body, std::string error, int error_code)
 

Protected Attributes

YDumbTabActionHandlerdumb_tab_action_handler = nullptr
 
YMenuWidgetActionHandlermenu_action_handler = nullptr
 
YTableActionHandlertable_action_handler = nullptr
 
YWidgetActionHandlerwidget_action_handler = nullptr
 
YMultiSelectionBoxActionHandlermultiselection_action_handler = nullptr
 

Additional Inherited Members

- Public Member Functions inherited from YHttpHandler
virtual MHD_RESULT handle (struct MHD_Connection *connection, const char *url, const char *method, const char *upload_data, size_t *upload_data_size, bool *redraw=nullptr)
 

Member Function Documentation

◆ action_handler()

template<typename T >
int YHttpWidgetsActionHandler::action_handler ( YWidget *  widget,
std::ostream &  body,
std::function< void(T *)>  handler_func,
const bool  allow_disabled = false 
)
inlineprotected

Processes action on the given widget.

Template Parameters
Tthe type of the widget handler will act on
Parameters
widgetWidget to which action will be applied
bodyHTTP response body stream
handler_funcFunction which will be called with widget as an argument
allow_disabledSome widgets get to disabled state, but are actually enabled, like YCheckBoxFrame Not allowing by default, but allow explicit overrides for the exceptions.
Returns
HTTP status code

◆ get_dumb_tab_handler()

YDumbTabActionHandler * YHttpWidgetsActionHandler::get_dumb_tab_handler ( )
protectedvirtual

Define widgets handlers to override in case need to implement UI specific actions, like activation.

◆ process_request()

void YHttpWidgetsActionHandler::process_request ( struct MHD_Connection *  connection,
const char *  url,
const char *  method,
const char *  upload_data,
size_t *  upload_data_size,
std::ostream &  body,
int &  error_code,
std::string &  content_type,
bool *  redraw 
)
protectedvirtual

Implements YHttpHandler.


The documentation for this class was generated from the following files: