VPTissue Reference Manual
AppController.h
Go to the documentation of this file.
1 #ifndef GUI_APPCONTROLLER_H_INCLUDED
2 #define GUI_APPCONTROLLER_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "WorkspaceController.h"
23 
24 #include "gui/factory/IFactory.h"
25 #include "gui/IHasPTreeState.h"
26 #include "gui/LogWindow.h"
28 
29 #include <QMainWindow>
30 #include <QSettings>
31 #include <memory>
32 
33 class QCloseEvent;
34 
35 namespace SimShell {
36 namespace Gui {
37 namespace Controller {
38 
43 class AppController : public QMainWindow,
44  public IHasPTreeState,
46 {
47  Q_OBJECT
48 public:
49  AppController(const std::shared_ptr<Gui::IFactory>&,
50  QWidget* parent = 0);
51 
52  virtual ~AppController();
53 
55  virtual boost::property_tree::ptree GetPTreeState() const;
56 
58  virtual Timings GetTimings() const;
59 
60  void Log(const std::string&);
61 
63  virtual void SetPTreeState(const boost::property_tree::ptree&);
64 
65 protected:
66  virtual void closeEvent(QCloseEvent*);
67 
68 private slots:
69  void SLOT_AboutDialog();
70  void SLOT_WorkspaceWizard();
71 
72 private:
73  void InitMenu();
74  void InitProject();
75  void InitWidgets();
76  void InitWorkspace();
77 
78  void SetWorkspaceWindowTitle(const std::string & path);
79 
80 private:
81  std::shared_ptr<Gui::IFactory> m_factory;
82 
83  QSettings m_settings;
84 
85  // Widgets
86  LogWindow* m_log_dock;
87 
88  // Sub-state
89  WorkspaceController m_workspace_controller;
90 };
91 
92 } // namespace
93 } // namespace
94 } // namespace
95 
96 #endif // end_of_inclde_guard
virtual boost::property_tree::ptree GetPTreeState() const
A viewer that displays sim events in a log in a dock window.
Definition: LogWindow.h:34
Interface for objects that have non-critical state (metadata) information representable as a ptree...
Header for LogWindow.
virtual void SetPTreeState(const boost::property_tree::ptree &)
see the online Qt documentation
Interface for Timeable.
see the online Qt documentation
HasPtreeState interface.
Interface for IFactory.
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
WorkspaceController header.
Utility class to for timing.
Definition: Timeable.h:38