Fawkes API  Fawkes Development Version
nav_manager.h
1 
2 /***************************************************************************
3  * nav_manager.h - Web Navigation manager
4  *
5  * Created: Tue Dec 21 01:28:50 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.
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_NAV_MANAGER_H_
24 #define __LIBS_WEBVIEW_NAV_MANAGER_H_
25 
26 #include <map>
27 #include <string>
28 
29 namespace fawkes {
30 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
34 class Mutex;
35 
37 {
38  public:
39  /** Navigation map type, mapping URLs to labels. */
40  typedef std::map<std::string, std::string> NavMap;
41 
42  WebNavManager();
44 
45  void add_nav_entry(std::string baseurl, std::string name);
46  void remove_nav_entry(std::string baseurl);
47 
48  /** Get navigation entries. @return navigation entries map. */
49  const NavMap & get_nav_entries() const { return __nav_entries; }
50  /** Get mutex for navigation entries. @return mutex for navigation entries. */
51  Mutex * mutex() { return __mutex; }
52 
53  private:
54  Mutex *__mutex;
55  NavMap __nav_entries;
56 };
57 
58 } // end namespace fawkes
59 
60 #endif
Fawkes library namespace.
WebNavManager()
Constructor.
Definition: nav_manager.cpp:42
Mutex * mutex()
Get mutex for navigation entries.
Definition: nav_manager.h:51
const NavMap & get_nav_entries() const
Get navigation entries.
Definition: nav_manager.h:49
std::map< std::string, std::string > NavMap
Navigation map type, mapping URLs to labels.
Definition: nav_manager.h:40
Manage visible navigation entries.
Definition: nav_manager.h:36
void add_nav_entry(std::string baseurl, std::string name)
Add a navigation entry.
Definition: nav_manager.cpp:61
void remove_nav_entry(std::string baseurl)
Remove a navigation entry.
Definition: nav_manager.cpp:76
Mutex mutual exclusion lock.
Definition: mutex.h:32
~WebNavManager()
Destructor.
Definition: nav_manager.cpp:49