OpenWalnut  1.5.0dev
WScriptUI.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut 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 Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WSCRIPTUI_H
26 #define WSCRIPTUI_H
27 
28 #include <string>
29 
30 #include <boost/program_options.hpp>
31 
32 #include "core/ui/WUI.h"
33 
34 /**
35  * \class WScriptUI
36  *
37  * Implements a UI that executes scripts. These can be read from files or input by the user,
38  * depending on the parameters supplied to the executable.
39  *
40  * \ingroup ui
41  */
42 class WScriptUI : public WUI
43 {
44 public:
45  /**
46  * Constructor.
47  *
48  * \param argc number of arguments given on command line.
49  * \param argv arguments given on command line.
50  * \param options The program options.
51  */
52  WScriptUI( int argc, char** argv, boost::program_options::variables_map const& options );
53 
54  /**
55  * Destructor.
56  */
57  virtual ~WScriptUI();
58 
59  /**
60  * Runs the UI.
61  *
62  * \return the return code.
63  */
64  virtual int run();
65 
66  /**
67  * Returns the widget factory of the UI. The Script UI always returns NULL as it does not support widgets. The WUIRequirement checks for this
68  * too and thus disallows modules using WUI.
69  *
70  * \return the factory. Use this to create your widget instances.
71  */
73 
74 protected:
75  /**
76  * If you need to load additional modules from your toolboxes, you might want specify these paths in a config file.
77  * In that file we need a line starting with: "additionalModulePaths=" followed by a comma separated list of paths.
78  * Please note this is the same format as in the config.qt4gui file, so you may symlink it.
79  *
80  * \param configPath This is the path to the config file. If not existent, nothing will be thrown or done.
81  */
82  virtual void loadToolboxes( boost::filesystem::path configPath );
83 
84  //! The programm options.
85  boost::program_options::variables_map const& m_programOptions;
86 };
87 
88 #endif // WSCRIPTUI_H
Implements a UI that executes scripts.
Definition: WScriptUI.h:43
WScriptUI(int argc, char **argv, boost::program_options::variables_map const &options)
Constructor.
Definition: WScriptUI.cpp:44
virtual ~WScriptUI()
Destructor.
Definition: WScriptUI.cpp:50
virtual WUIWidgetFactory::SPtr getWidgetFactory() const
Returns the widget factory of the UI.
Definition: WScriptUI.cpp:224
boost::program_options::variables_map const & m_programOptions
The programm options.
Definition: WScriptUI.h:85
virtual int run()
Runs the UI.
Definition: WScriptUI.cpp:54
virtual void loadToolboxes(boost::filesystem::path configPath)
If you need to load additional modules from your toolboxes, you might want specify these paths in a c...
Definition: WScriptUI.cpp:197
std::shared_ptr< WUIWidgetFactory > SPtr
Convenience typedef for a std::shared_ptr< WUIWidgetFactory >.
This class prescribes the interface to the UI.
Definition: WUI.h:51