Fawkes API  Fawkes Development Version
webview.cpp
00001 
00002 /***************************************************************************
00003  *  webview.cpp - Webview aspect for Fawkes
00004  *
00005  *  Created: Thu Nov 25 22:20:52 2010
00006  *  Copyright  2006-2010  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <aspect/webview.h>
00025 
00026 namespace fawkes {
00027 #if 0 /* just to make Emacs auto-indent happy */
00028 }
00029 #endif
00030 
00031 /** @class WebviewAspect <aspect/webview.h>
00032  * Thread aspect to provide web pages via Webview.
00033  *
00034  * The WebviewAspect differs from other aspects. It can be successfully
00035  * initialized even if there currently is no plugin loaded to serve web
00036  * pages. This is because the central interface, the WebUrlManager, is
00037  * held by the WebviewAspectIniFin and thus processor can be registerd
00038  * and deregistered all the time. The webview plugin itself has the
00039  * WebviewAspect, but it uses its access to the WebUrlManager instance
00040  * to serve requests and pass them on to the appropriate processor.
00041  *
00042  * It is guaranteed that if used properly from within plugins that
00043  * init_WebviewAspect() is called before the thread is started and that
00044  * you can access the webview request processor manager in the thread's
00045  * init() method.
00046  *
00047  * @ingroup Aspects
00048  * @author Tim Niemueller
00049  */
00050 
00051 
00052 /** Constructor. */
00053 WebviewAspect::WebviewAspect()
00054 {
00055   add_aspect("WebviewAspect");
00056 }
00057 
00058 
00059 /** Virtual empty Destructor. */
00060 WebviewAspect::~WebviewAspect()
00061 {
00062 }
00063 
00064 
00065 /** Set URL manager.
00066  * It is guaranteed that this is called for a logging thread before
00067  * Thread::start() is called (when running regularly inside Fawkes).
00068  * @param url_manager URL manager to register processors to
00069  * @param nav_manager Navigation manager to add navigation entries
00070  * @see WebviewMaster
00071  */
00072 void
00073 WebviewAspect::init_WebviewAspect(WebUrlManager *url_manager,
00074                                   WebNavManager *nav_manager)
00075 {
00076   webview_url_manager = url_manager;
00077   webview_nav_manager = nav_manager;
00078 }
00079 
00080 } // end namespace fawkes