Fawkes API  Fawkes Development Version
webview.cpp
1 
2 /***************************************************************************
3  * webview.cpp - Webview aspect for Fawkes
4  *
5  * Created: Thu Nov 25 22:20:52 2010
6  * Copyright 2006-2010 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. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <aspect/webview.h>
25 
26 namespace fawkes {
27 #if 0 /* just to make Emacs auto-indent happy */
28 }
29 #endif
30 
31 /** @class WebviewAspect <aspect/webview.h>
32  * Thread aspect to provide web pages via Webview.
33  *
34  * The WebviewAspect differs from other aspects. It can be successfully
35  * initialized even if there currently is no plugin loaded to serve web
36  * pages. This is because the central interface, the WebUrlManager, is
37  * held by the WebviewAspectIniFin and thus processor can be registerd
38  * and deregistered all the time. The webview plugin itself has the
39  * WebviewAspect, but it uses its access to the WebUrlManager instance
40  * to serve requests and pass them on to the appropriate processor.
41  *
42  * It is guaranteed that if used properly from within plugins that
43  * init_WebviewAspect() is called before the thread is started and that
44  * you can access the webview request processor manager in the thread's
45  * init() method.
46  *
47  * @ingroup Aspects
48  * @author Tim Niemueller
49  */
50 
51 
52 /** Constructor. */
54 {
55  add_aspect("WebviewAspect");
56 }
57 
58 
59 /** Virtual empty Destructor. */
61 {
62 }
63 
64 
65 /** Set URL manager.
66  * It is guaranteed that this is called for a logging thread before
67  * Thread::start() is called (when running regularly inside Fawkes).
68  * @param url_manager URL manager to register processors to
69  * @param nav_manager Navigation manager to add navigation entries
70  * @param request_manager Request manager to query request information
71  * @see WebviewMaster
72  */
73 void
75  WebNavManager *nav_manager,
76  WebRequestManager *request_manager)
77 {
78  webview_url_manager = url_manager;
79  webview_nav_manager = nav_manager;
80  webview_request_manager = request_manager;
81 }
82 
83 } // end namespace fawkes
WebNavManager * webview_nav_manager
Webview navigation manager.
Definition: webview.h:52
Fawkes library namespace.
WebviewAspect()
Constructor.
Definition: webview.cpp:53
void add_aspect(const char *name)
Add an aspect to a thread.
Definition: aspect.cpp:52
virtual ~WebviewAspect()
Virtual empty Destructor.
Definition: webview.cpp:60
WebRequestManager * webview_request_manager
Webview request manager.
Definition: webview.h:54
Manage URL mappings.
Definition: url_manager.h:37
WebUrlManager * webview_url_manager
Webview request processor manager.
Definition: webview.h:50
Manage visible navigation entries.
Definition: nav_manager.h:36
Probides information about ongoing requests.
void init_WebviewAspect(WebUrlManager *url_manager, WebNavManager *nav_manager, WebRequestManager *request_manager)
Set URL manager.
Definition: webview.cpp:74