MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostly_harmless::events::WebEvent Struct Reference

An convenience wrapper around an event to send to a webview. More...

#include <mostlyharmless_WebEvent.h>

Public Member Functions

 WebEvent (std::string id_, nlohmann::json content_)
 
 WebEvent (ProcToGuiParamEvent event)
 

Public Attributes

std::string id
 
nlohmann::json content
 

Detailed Description

An convenience wrapper around an event to send to a webview.

Constructor & Destructor Documentation

◆ WebEvent() [1/2]

mostly_harmless::events::WebEvent::WebEvent ( std::string id_,
nlohmann::json content_ )

Constructs a WebEvent from an id, and some json.

Parameters
id_Some name the event should have - useful for js CustomEvents, etc.
content_The json content for the event.

◆ WebEvent() [2/2]

mostly_harmless::events::WebEvent::WebEvent ( ProcToGuiParamEvent event)
explicit

Constructs a WebEvent from a ProcToGuiParamEvent. Sets id to param, and content to:

{
"paramId": The event's pid,
"value" The event's value
}
Parameters
eventa ProcToGuiParamEvent, to convert to a WebEvent.

Member Data Documentation

◆ content

nlohmann::json mostly_harmless::events::WebEvent::content

The event's json content.

◆ id

std::string mostly_harmless::events::WebEvent::id

The event's id


The documentation for this struct was generated from the following file: