Document.hpp

Manage an entire document.

This file is part of Empirical, https://github.com/devosoft/Empirical Copyright (C) 2015-2018 Michigan State University MIT Software license; see doc/LICENSE.md

The Document class is built off of Div, but initializes the EMP web framework, if needed, and activates itself. It also provides quick ways to add and lookup widgets.

For example, you can use doc.AddButton(…) to add a new button to the document, where the … can be any of the mechanisms to build a new button. This technique works for any widget type.

You can also look up any widget by name. For example, if you previously created a Canvas widget with the HTML id “my_canvas”, you can look it up later by using doc.Canvas(“my_canvas”)

Defines

INCLUDE_EMP_WEB_DOCUMENT_HPP_GUARD
emp_main
class Document : public Div
#include <Document.hpp>

Public Functions

inline Document(const std::string &doc_id)
inline ~Document()
template<class ...T>
inline Button AddButton(T&&... args)
template<class ...T>
inline Canvas AddCanvas(T&&... args)
template<class ...T>
inline CheckBox AddCheckBox(T&&... args)
template<class ...T>
inline FileInput AddFileInput(T&&... args)
template<class ...T>
inline Image AddImage(T&&... args)
template<class ...T>
inline Selector AddSelector(T&&... args)
template<class ...T>
inline Div AddDiv(T&&... args)
template<class ...T>
inline Table AddTable(T&&... args)
template<class ...T>
inline Text AddText(T&&... args)
template<class ...T>
inline TextArea AddTextArea(T&&... args)
inline Button Button(const std::string &in_id)
inline Canvas Canvas(const std::string &in_id)
inline CheckBox CheckBox(const std::string &in_id)
inline Element Element(const std::string &in_id)
inline FileInput FileInput(const std::string &in_id)
inline Input Input(const std::string &in_id)
inline Image Image(const std::string &in_id)
inline Selector Selector(const std::string &in_id)
inline Div Div(const std::string &in_id)
inline Table Table(const std::string &in_id)
inline Text Text(const std::string &in_id)
inline TextArea TextArea(const std::string &in_id)