Webdar 1.0.0
Web user interface to libdar
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
user_interface Class Reference

main webdar html components that defines for a given session the type of output (config pages, libdar output, error, etc.) More...

#include <user_interface.hpp>

Inheritance diagram for user_interface:
Inheritance graph
[legend]
Collaboration diagram for user_interface:
Collaboration graph
[legend]

Public Member Functions

 user_interface ()
 
 user_interface (const user_interface &ref)=delete
 
 user_interface (user_interface &&ref) noexcept=delete
 
user_interfaceoperator= (const user_interface &ref)=delete
 
user_interfaceoperator= (user_interface &&ref) noexcept=delete
 
virtual answer give_answer (const request &req) override
 inherited from responder More...
 
virtual void on_event (const std::string &event_name) override
 inherited from actor More...
 
std::string get_session_name () const
 provide the name of the session (given by the user);
 
void set_session_name (const std::string &name)
 set the session name (customizable by user)
 
void set_username (const std::string &username)
 define the username that the current session is owned by
 
bool is_libdar_running () const
 whether a libdar thread is running
 
bool disconnection_requested () const
 whether user has requested to disconnect
 
- Public Member Functions inherited from responder
 responder (const responder &ref)=default
 
 responder (responder &&ref) noexcept=default
 
responderoperator= (const responder &ref)=default
 
responderoperator= (responder &&ref) noexcept=default
 
void set_prefix (const chemin &chem)
 used for body_builder object for they have a proper prefix in path
 
const cheminget_prefix () const
 get the recorded URI path prefix for body_builder root hierarchy
 
virtual answer give_answer (const request &req)=0
 provides a standard mean for inherited class to provide answer to requests More...
 
- Public Member Functions inherited from events
 events (const events &ref)
 copy constructor More...
 
 events (events &&ref) noexcept(false)=default
 
eventsoperator= (const events &ref)=default
 
eventsoperator= (events &&ref) noexcept(false)
 
void record_actor_on_event (actor *ptr, const std::string &name)
 record an actor for an given event
 
- Public Member Functions inherited from reference
 reference ()
 usual constructor
 
 reference (const reference &ref)
 copy constructor More...
 
 reference (reference &&ref) noexcept(false)
 move constructor (only operational for objects without peering) More...
 
referenceoperator= (const reference &ref)
 assignment operator (only operational for objects without peering) More...
 
referenceoperator= (reference &&ref) noexcept(false)
 move assigment operator More...
 
virtual ~reference ()
 destructor
 
void peer_with (reference *obj)
 method used to create a relation between two objects More...
 
void break_peer_with (reference *obj)
 break the peering with the object given as argument
 
bool is_peer (reference *obj) const
 whether a peering exists with that object
 
bool is_empty () const
 whether the current object has peering
 
unsigned int size () const
 the number of peers
 
- Public Member Functions inherited from actor
 actor (const actor &ref)=default
 
 actor (actor &&ref) noexcept(false)=default
 
actoroperator= (const actor &ref)=default
 
actoroperator= (actor &&ref) noexcept(false)
 
virtual void on_event (const std::string &event_name)=0
 implementation in inherited class of the action triggered by the event given in argument More...
 

Static Public Attributes

static const std::string closing = "user_interface_closing"
 available event for that class More...
 

Protected Member Functions

virtual void prefix_has_changed () override
 inherited from responder More...
 
virtual void prefix_has_changed ()
 hook for inherited class, when the body builder object had its prefix changed More...
 
- Protected Member Functions inherited from events
virtual void broken_peering_from (reference *obj) override
 inherited from class reference More...
 
void register_name (const std::string &name)
 add a new event for actors to register against
 
void unregister_name (const std::string &name)
 remove an event and remove all actors that registed on it
 
void rename_name (const std::string &old_name, const std::string &new_name)
 rename an event and keep all existing peering to this new event More...
 
void act (const std::string &name)
 trigger a given event
 
- Protected Member Functions inherited from reference
virtual void broken_peering_from (reference *obj)
 to be informed when a peer has broke the peering with me More...
 
void reset_read_peers () const
 reset the peers reading
 
bool read_next_peer (reference *&peer) const
 

Detailed Description

main webdar html components that defines for a given session the type of output (config pages, libdar output, error, etc.)

Note
the configuration downloading process is the following: at construction time, the parametrage field (saisie class) is set with an html_fichier object using saisie::set_data_place() method. When the user clicks on the download button inside class saisie (html_bibliotheque field) this triggers the browser to save to file the body of the next http response, and the saisie object saves into the html_fichier the json configuration of the bibiliotheque and triggers the event event_download. The user_interface class has registered to this event which leads to change to mode to "download", but the body_builder evaluation of field parametrage continues to its end. When it has finished if the mode has been changed to download the obtained http body is just dropped and replaced by the content of the html_fichier we provided to the parametrage object and the mode is set back to config before returning the http response.

Constructor & Destructor Documentation

◆ user_interface()

user_interface::user_interface ( )

messages receved from saisie object named parametrage

messages received from html_libdar_running object named in_action

messages received from html_error object named in_error;

messages received from html_listring_page object named in_list

create the events that this object is willing to generate

Member Function Documentation

◆ give_answer()

answer user_interface::give_answer ( const request req)
overridevirtual

inherited from responder

Implements responder.

◆ on_event()

void user_interface::on_event ( const std::string &  event_name)
overridevirtual

inherited from actor

Implements actor.

◆ prefix_has_changed()

void user_interface::prefix_has_changed ( )
overrideprotectedvirtual

inherited from responder

Reimplemented from responder.

Member Data Documentation

◆ closing

const string user_interface::closing = "user_interface_closing"
static

available event for that class

signal end of user session


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