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
29namespace fawkes {
30
31class Mutex;
32
34{
35public:
36 /** Navigation map type, mapping URLs to labels. */
37 typedef std::map<std::string, std::string> NavMap;
38
41
42 void add_nav_entry(std::string baseurl, std::string name);
43 void remove_nav_entry(std::string baseurl);
44
45 /** Get navigation entries. @return navigation entries map. */
46 const NavMap &
48 {
49 return nav_entries_;
50 }
51 /** Get mutex for navigation entries. @return mutex for navigation entries. */
52 Mutex *
54 {
55 return mutex_;
56 }
57
58private:
59 Mutex *mutex_;
60 NavMap nav_entries_;
61};
62
63} // end namespace fawkes
64
65#endif
Mutex mutual exclusion lock.
Definition: mutex.h:33
Manage visible navigation entries.
Definition: nav_manager.h:34
const NavMap & get_nav_entries() const
Get navigation entries.
Definition: nav_manager.h:47
WebNavManager()
Constructor.
Definition: nav_manager.cpp:38
~WebNavManager()
Destructor.
Definition: nav_manager.cpp:44
Mutex * mutex()
Get mutex for navigation entries.
Definition: nav_manager.h:53
std::map< std::string, std::string > NavMap
Navigation map type, mapping URLs to labels.
Definition: nav_manager.h:37
void add_nav_entry(std::string baseurl, std::string name)
Add a navigation entry.
Definition: nav_manager.cpp:55
void remove_nav_entry(std::string baseurl)
Remove a navigation entry.
Definition: nav_manager.cpp:68
Fawkes library namespace.