OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loader_manager.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GUI_LOADER_MANAGER_HH
20 #define OST_GUI_LOADER_MANAGER_HH
21 #include <vector>
22 
23 #include <boost/shared_ptr.hpp>
24 
25 #include <QString>
26 #include <QMap>
27 
29 
30 namespace ost { namespace gui {
31 
33 
34 public:
35  LoaderManager();
36  virtual ~LoaderManager();
37  std::vector<String> GetSiteLoaderIdents();
38  void AddRemoteSiteLoader(const QString& ident, RemoteSiteLoader* site_loader);
39  void RemoveRemoteSiteLoader(const QString& ident);
40  RemoteSiteLoader* GetRemoteSiteLoader(const QString& ident);
41  RemoteSiteLoader* GetCurrentSiteLoader();
42  RemoteSiteLoader* GetDefaultRemoteSiteLoader();
43  QString GetDefaultRemoteSiteIdent();
44  void SetDefaultRemoteSiteIdent(const QString& ident);
45  QMenu* GetSiteMenu();
46 
47 private:
48  QMap<QString,RemoteSiteLoader*> site_loaders_;
49  QActionGroup* site_actions_;
50  QString default_site_;
51 
52 
53 };
54 
55 typedef boost::shared_ptr<LoaderManager> LoaderManagerPtr;
56 
57 } }
58 
59 #endif /* OST_GUI_LOADER_MANAGER_HH */