maineditor.h
1 /*
2  name: tools/editor/maineditor.h
3 
4  This file is part of ARCS - Augmented Reality Component System
5  (version 2-current), written by Jean-Yves Didier
6  for IBISC Laboratory (http://www.ibisc.univ-evry.fr)
7 
8  Copyright (C) 2013 Université d'Evry-Val d'Essonne
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 General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23 
24  Please send bugreports with examples or suggestions to
25  jean-yves.didier__at__ibisc.univ-evry.fr
26 */
27 
28 
29 #ifndef __MAINEDITOR_H__
30 #define __MAINEDITOR_H__
31 
32 #include <QMainWindow>
33 #include <QTabWidget>
34 #include <QStringList>
35 #include <QVariant>
36 
37 
38 class QTabWidget;
39 class QTextEdit;
40 class LogView;
41 class ApplicationView;
42 class QMenu;
43 class QAction;
44 
45 class MainEditor : public QMainWindow
46 {
47  Q_OBJECT
48 public:
49  explicit MainEditor(QWidget *parent = 0);
50  ~MainEditor();
51 signals:
52 
53 public slots:
54  void newApplication();
55  void saveApplication();
56  void saveAsApplication();
57  void openApplication(QString s = QString::null);
58  void addNewTabWidget(QWidget* wdg);
59  void removeTab(int i ) {
60  QWidget* widget = tbElements->widget(i);
61  tbElements->removeTab(i);
62  delete widget;
63  }
64 
65  void actualizeFromTab(int);
66 
67  void handleRecentAction(QAction*);
68  void setDefaultApplication(ApplicationView* app);
69  void destroyAppId(QVariant appId);
70  void destroyWidget(QVariant appId,QString name);
71 
72 private:
73  void buildRecentMenu();
74 
75  QTabWidget* tbElements;
76  QTextEdit* welcomeWidget;
77  LogView* logView;
78  QList<ApplicationView*> applications;
79  ApplicationView* defaultApplication;
80  QStringList recentList ;
81  QMenu* recentMenu;
82 
83  QAction* saveFileAction;
84  QMenu* editMenu;
85 };
86 
87 #endif // __MAINEDITOR_H__
void addNewTabWidget(QWidget *wdg)
Definition: maineditor.cpp:194