Fawkes API  Fawkes Development Version
nav_manager.h
00001 
00002 /***************************************************************************
00003  *  nav_manager.h - Web Navigation manager
00004  *
00005  *  Created: Tue Dec 21 01:28:50 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.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #ifndef __LIBS_WEBVIEW_NAV_MANAGER_H_
00024 #define __LIBS_WEBVIEW_NAV_MANAGER_H_
00025 
00026 #include <map>
00027 #include <string>
00028 
00029 namespace fawkes {
00030 #if 0 /* just to make Emacs auto-indent happy */
00031 }
00032 #endif
00033 
00034 class Mutex;
00035 
00036 class WebNavManager
00037 {
00038  public:
00039   /** Navigation map type, mapping URLs to labels. */
00040   typedef std::map<std::string, std::string> NavMap;
00041 
00042   WebNavManager();
00043   ~WebNavManager();
00044 
00045   void add_nav_entry(std::string baseurl, std::string name);
00046   void remove_nav_entry(std::string baseurl);
00047 
00048   /** Get navigation entries. @return navigation entries map. */
00049   const NavMap & get_nav_entries() const { return __nav_entries; }
00050   /** Get mutex for navigation entries. @return mutex for navigation entries. */
00051   Mutex *  mutex() { return __mutex; }
00052 
00053  private:
00054   Mutex                                        *__mutex;
00055   NavMap __nav_entries;
00056 };
00057 
00058 } // end namespace fawkes
00059 
00060 #endif