Fawkes API  Fawkes Development Version
page_reply.h
1 
2 /***************************************************************************
3  * page_reply.h - Web request reply for a normal page
4  *
5  * Created: Thu Oct 23 16:13:48 2008
6  * Copyright 2006-2009 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __LIBS_WEBVIEW_PAGE_REPLY_H_
24 #define __LIBS_WEBVIEW_PAGE_REPLY_H_
25 
26 #include <webview/reply.h>
27 
28 namespace fawkes {
29 #if 0 /* just to make Emacs auto-indent happy */
30 }
31 #endif
32 
33 class WebPageHeaderGenerator;
34 class WebPageFooterGenerator;
35 
37 {
38  public:
39  WebPageReply(std::string title, std::string page = "");
40 
41  virtual const std::string & body();
42  virtual std::string::size_type body_length();
43  virtual void pack() { pack("", 0, 0); }
44  virtual void pack(std::string active_baseurl,
45  WebPageHeaderGenerator *headergen,
46  WebPageFooterGenerator *footergen);
47 
48  virtual void set_html_header(std::string h);
49 
50  protected:
51  WebPageReply(response_code_t code);
52 
53  protected:
54  /** Title of the page. */
55  std::string _title;
56 
57  private:
58  static const char *PAGE_HEADER;
59  static const char *PAGE_FOOTER;
60 
61  std::string __merged_body;
62  std::string __html_header;
63 };
64 
65 } // end namespace fawkes
66 
67 #endif
std::string _title
Title of the page.
Definition: page_reply.h:55
Fawkes library namespace.
virtual void pack()
Pack the data.
Definition: page_reply.h:43
Interface for HTML header generator.
Basic page reply.
Definition: page_reply.h:36
Interface for HTML footer generator.
Static web reply.
Definition: reply.h:125