MPSolve  3.2.1
polfileeditorwindow.h
1 #ifndef POLFILEEDITORWINDOW_H
2 #define POLFILEEDITORWINDOW_H
3 
4 #include <QMainWindow>
5 #include <QList>
6 #include "polfileeditor.h"
7 
8 namespace Ui {
9 class PolFileEditorWindow;
10 }
11 
12 namespace xmpsolve {
13 
14 class PolFileEditorWindow : public QMainWindow
15 {
16  Q_OBJECT
17 
18 public:
19  explicit PolFileEditorWindow(QWidget *parent = 0);
21 
28  void loadPolFile(QString path = QString());
29 
33  void savePolFile();
34 
39  void closePolFile(QString path);
40 
44  void closeEditor(PolFileEditor* editor);
45 
52  QString currentPolFile();
53 
60 
61 signals:
66  void solvePoly(QString content);
67 
68 public slots:
73  void onEditorFilenameChanged(QString);
74 
79 
80 private slots:
81  void on_actionOpen_pol_file_triggered();
82 
83  void on_actionSave_triggered();
84 
85  void on_actionSolve_triggered();
86 
87  void on_actionClose_triggered();
88 
89  void on_actionClose_editor_triggered();
90 
91  void on_actionNew_triggered();
92 
93 private:
94  Ui::PolFileEditorWindow *ui;
95 
102  QMap<QString, PolFileEditor*> m_polFileEditors;
103 
108  void closeEvent(QCloseEvent *);
109 
113  void closeOpenedTabs();
114 
115  void showEvent(QShowEvent *event);
116 
120  void setupIcons();
121 };
122 
123 } // End of namespace xmpsolve
124 
125 #endif // POLFILEEDITORWINDOW_H
xmpsolve::PolFileEditorWindow::onEditorFilenameChanged
void onEditorFilenameChanged(QString)
onEditorFilenameChanged handle the change of filename inside and editor tab.
Definition: polfileeditorwindow.cpp:121
xmpsolve::PolFileEditorWindow::closeEditor
void closeEditor(PolFileEditor *editor)
Close the given editor.
Definition: polfileeditorwindow.cpp:82
xmpsolve::PolFileEditorWindow::onEditorStateChanged
void onEditorStateChanged(PolFileEditor::State)
onEditorStateChanged handle the state changed of the editor tab.
Definition: polfileeditorwindow.cpp:137
xmpsolve::PolFileEditorWindow::loadPolFile
void loadPolFile(QString path=QString())
loadPolFile loads the file specified by path or simply focus the tab containing it if it's already lo...
Definition: polfileeditorwindow.cpp:29
xmpsolve::PolFileEditorWindow::closePolFile
void closePolFile(QString path)
closePolFile closes the tab of the given .pol file
Definition: polfileeditorwindow.cpp:73
xmpsolve::PolFileEditor
Definition: polfileeditor.h:14
xmpsolve::PolFileEditor::State
State
State of the document.
Definition: polfileeditor.h:22
xmpsolve::PolFileEditorWindow
Definition: polfileeditorwindow.h:15
xmpsolve::PolFileEditorWindow::currentEditor
PolFileEditor * currentEditor()
currentEditor can be used to access the current PolFileEditor focused in the tabWidget.
Definition: polfileeditorwindow.cpp:161
xmpsolve::PolFileEditorWindow::currentPolFile
QString currentPolFile()
currentPolFile returns the path to the currently focused .pol file.
Definition: polfileeditorwindow.cpp:167
xmpsolve::PolFileEditorWindow::solvePoly
void solvePoly(QString content)
solvePoly is emitted when the user asks to solve a .pol file.
xmpsolve::PolFileEditorWindow::savePolFile
void savePolFile()
savePolFile save the pol file in the currently selected tab.
Definition: polfileeditorwindow.cpp:66