Tulip  4.4.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
PythonEditorsTabWidget.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 
20 #ifndef PYTHONEDITORSTABWIDGET_H
21 #define PYTHONEDITORSTABWIDGET_H
22 
23 #include <QMap>
24 #include <QTabWidget>
25 
26 #include <tulip/tulipconf.h>
27 
28 namespace tlp {
29 
30 class PythonCodeEditor;
31 
32 class TLP_PYTHON_SCOPE PythonEditorsTabWidget : public QTabWidget {
33 
34  Q_OBJECT
35 
36  int _fontZoom;
37  bool _dontTreatFocusIn;
38  bool reloadCodeInEditorIfNeeded(int index);
39 
40 public:
41 
42  explicit PythonEditorsTabWidget(QWidget *parent = 0);
43 
44  int addEditor(const QString &fileName = "");
45 
46  PythonCodeEditor *getCurrentEditor() const;
47 
48  PythonCodeEditor *getEditor(int) const;
49 
50  void indicateErrors(const QMap<QString, QVector<int> > &errorLines);
51 
52  void clearErrorIndicators();
53 
54  bool eventFilter(QObject *, QEvent *);
55 
56  void saveCurrentEditorContentToFile();
57 
58  void saveEditorContentToFile(int);
59 
60  void increaseFontSize();
61 
62  void decreaseFontSize();
63 
64 signals:
65 
66  void tabAboutToBeDeleted(int);
67 
68  void fileSaved(int);
69 
70  void filesReloaded();
71 
72 public slots:
73 
74  void scriptTextChanged();
75 
76  void reloadCodeInEditorsIfNeeded();
77 
78  void closeTabRequested(int tab);
79 
80 };
81 
82 }
83 
84 #endif // PYTHONEDITORSTABWIDGET_H