applicationview.h
1 /*
2  name: tools/editor/applicationview.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 __APPLICATIONVIEW_H__
30 #define __APPLICATIONVIEW_H__
31 
32 #include <QWidget>
33 #include <QDockWidget>
34 #include <arcs/arcsapplicationcomponent.h>
35 
36 class QComboBox;
37 class QTreeWidget;
38 class QTreeWidgetItem;
39 class QAction;
40 
41 class ApplicationView : public QDockWidget
42 {
43  Q_OBJECT
44 public:
45  explicit ApplicationView(ARCSApplicationComponent* aac = 0, QWidget *parent = 0);
46  ~ApplicationView();
47 
48  ARCSApplicationComponent* getApplication() { return application; }
49 
50  void setAssociatedFile(QString s) { associatedFile = s ; }
51  QString getAssociatedFile() { return associatedFile; }
52 
53 signals:
54  void addWidget(QWidget*);
55  void defaultOwnershipRequested(ApplicationView*);
56  void requestAppIdDestroy(QVariant);
57  void requestWidgetDestroy(QVariant,QString);
58  void requestUpdate();
59 
60 public slots:
61  void updateApplication();
62  void requestDefaultOwnership() { emit defaultOwnershipRequested(this);}
63  void addLibrary();
64  void addComponent();
65  void removeComponent();
66  void renameComponent();
67 
68  void setApplicationMode(int mode);
69 
70  void editComponent();
71  void attachController();
72  void handleTreeViewClic(QTreeWidgetItem* item, int );
73  void handleTreeViewDoubleClic(QTreeWidgetItem* item, int );
74 
75  void addSheet();
76  void editSheet();
77  void renameSheet();
78  void removeSheet();
79 
80  void moveProcessUp();
81  void moveProcessDown();
82  void addProcess();
83  void removeProcess();
84 
85 protected:
86  void closeEvent(QCloseEvent *event);
87 
88 
89 private:
90  void buildTreeView();
91 
92  bool defaultStatus;
93  ARCSApplicationComponent* application;
94  QComboBox* modeList;
95  QTreeWidget* treeView;
96  QTreeWidgetItem* componentList;
97  QTreeWidgetItem* processList;
98 
99  QAction* removeComponentAction;
100  QAction* editComponentAction;
101  QAction* renameComponentAction;
102  QAction* attachControllerAction;
103  QAction* moveProcessUpAction;
104  QAction* moveProcessDownAction;
105  QAction* removeProcessAction;
106 
107  QAction* addSheetAction;
108  QAction* removeSheetAction;
109  QAction* renameSheetAction;
110  QAction* editSheetAction;
111 
112  QAction* sheetSeparatorAction;
113  QAction* processSeparatorAction;
114  QAction* componentSeparatorAction;
115 
116  QTreeWidgetItem* selectedCandidate;
117 
118  QString associatedFile;
119 };
120 
121 #endif // __APPLICATIONVIEW_H__
This class represents an application.