|
Fawkes API
Fawkes Development Version
|
Basic page reply. More...
#include <>>

Public Member Functions | |
| WebPageReply (std::string title, std::string page="") | |
| Constructor. More... | |
| virtual const std::string & | body () |
| Get body. More... | |
| virtual std::string::size_type | body_length () |
| Get length of body. More... | |
| virtual void | pack () |
| Pack the data. More... | |
| virtual void | pack (std::string active_baseurl, WebPageHeaderGenerator *headergen, WebPageFooterGenerator *footergen) |
| Pack web page reply. More... | |
| virtual void | set_html_header (std::string h) |
| Set HTML header text. More... | |
| void | set_navbar_enabled (bool enabled) |
| Enable or disable the Fawkes Navigationbar (default enabled) More... | |
| bool | get_navbar_enabled () |
| Is the Fawkes Navigation bar enabled? More... | |
| void | set_footer_enabled (bool enabled) |
| Enable or disable the Fawkes Webview footer (default enabled) More... | |
| bool | get_footer_enabled () |
| Is the Fawkes Webview footer enabled? More... | |
Public Member Functions inherited from fawkes::StaticWebReply | |
| StaticWebReply (Code code, std::string body="") | |
| Constructor. More... | |
| void | append_body (const char *format,...) |
| Append to body. More... | |
| void | append_body (const std::string &s) |
| Append string to body. More... | |
| StaticWebReply & | operator+= (std::string text) |
| Append simple text line. More... | |
Public Member Functions inherited from fawkes::WebReply | |
| WebReply (Code code) | |
| Constructor. More... | |
| virtual | ~WebReply () |
| Destructor. More... | |
| Code | code () const |
| Get response code. More... | |
| void | set_code (Code code) |
| Set response code. More... | |
| void | add_header (const std::string &header, const std::string &content) |
| Add a HTTP header. More... | |
| void | add_header (const std::string &header_string) |
| Add a HTTP header. More... | |
| const HeaderMap & | headers () const |
| get headers. More... | |
| void | set_caching (bool caching) |
| Enable or disable caching for this specific reply. More... | |
| void | set_request (WebRequest *request) |
| Set associated request. More... | |
| WebRequest * | get_request () const |
| Get associated request. More... | |
| void | pack_caching () |
| Called just before the reply is sent. More... | |
Protected Member Functions | |
| WebPageReply (Code code) | |
| Base constructor. More... | |
Protected Attributes | |
| std::string | _title |
| Title of the page. More... | |
Protected Attributes inherited from fawkes::StaticWebReply | |
| std::string | _body |
| Body of the reply. More... | |
Basic page reply.
This reply adds header and footer as appropriate to form a HTML document with logo and navigation.
Definition at line 33 of file page_reply.h.
| fawkes::WebPageReply::WebPageReply | ( | std::string | title, |
| std::string | body = "" |
||
| ) |
Constructor.
| title | title of the page |
| body | Optional initial body of the page |
Definition at line 59 of file page_reply.cpp.
References _title, and fawkes::WebReply::add_header().
|
protected |
Base constructor.
Constructor that does not set a title or anything. Use for sub-classes.
| code | HTTP code for this reply |
Definition at line 73 of file page_reply.cpp.
References fawkes::WebReply::add_header().
|
virtual |
Get body.
Reimplemented from fawkes::StaticWebReply.
Definition at line 131 of file page_reply.cpp.
|
virtual |
Get length of body.
Reimplemented from fawkes::StaticWebReply.
Definition at line 125 of file page_reply.cpp.
| bool fawkes::WebPageReply::get_footer_enabled | ( | ) |
| bool fawkes::WebPageReply::get_navbar_enabled | ( | ) |
|
inlinevirtual |
Pack the data.
This method is called just before the reply is sent. You can implement this method if you need to compose your reply before body() and body_length() provide valid output.
Reimplemented from fawkes::StaticWebReply.
Definition at line 41 of file page_reply.h.
|
virtual |
Pack web page reply.
This method creates the final page by calling the header and footer generators if supplied (otherwise a standard header is chosen) and the body.
| active_baseurl | the active navigation URL, can be used for instance to high-light the current section in the navigation. |
| headergen | header generator |
| footergen | footer generator |
Definition at line 101 of file page_reply.cpp.
References fawkes::StaticWebReply::_body, _title, fawkes::WebPageFooterGenerator::html_footer(), fawkes::WebPageHeaderGenerator::html_header(), and fawkes::HostInfo::short_name().
| void fawkes::WebPageReply::set_footer_enabled | ( | bool | enabled | ) |
Enable or disable the Fawkes Webview footer (default enabled)
| enabled | enabled |
Definition at line 159 of file page_reply.cpp.
|
virtual |
Set HTML header text.
The given text is placed in the head section of the HTML page. You can use it for example to add custom stylesheets or JavaScript.
| h | header to set |
Definition at line 87 of file page_reply.cpp.
| void fawkes::WebPageReply::set_navbar_enabled | ( | bool | enabled | ) |
Enable or disable the Fawkes Navigationbar (default enabled)
| enabled | enabled |
Definition at line 141 of file page_reply.cpp.
|
protected |
Title of the page.
Definition at line 61 of file page_reply.h.
Referenced by pack(), fawkes::WebErrorPageReply::WebErrorPageReply(), and WebPageReply().