MPSolve  3.2.1
polfileeditor.h
1 #ifndef POLFILEEDITOR_H
2 #define POLFILEEDITOR_H
3 
4 #include <QWidget>
5 #include "polsyntaxhighlighter.h"
6 
7 namespace Ui {
8 class PolFileEditor;
9 }
10 
11 namespace xmpsolve {
12 
13 class PolFileEditor : public QWidget
14 {
15  Q_OBJECT
16 
17 public:
18 
22  enum State {
23  SAVED,
24  MODIFIED
25  };
26 
27  explicit PolFileEditor(QWidget *parent = 0, QString path = QString());
28 
33  void savePolFile(QString path = QString());
34 
39  QString currentPolFile();
40 
45  bool isEmpty();
46 
51  State state();
52 
57  QString content();
58 
59  ~PolFileEditor();
60 
61 signals:
62  void filenameChanged(QString filename);
63  void stateChanged(PolFileEditor::State);
64 
65 private slots:
66  void onTextEditChanged(bool);
67 
68 private:
69  Ui::PolFileEditor *ui;
70  PolSyntaxHighlighter *m_syntaxHighlighter;
71  QString m_polFilePath;
72  State m_state;
73 
74 };
75 
76 } // End of namespace xmpsolve
77 
78 #endif // POLFILEEDITOR_H
Definition: polfileeditor.h:14
State
State of the document.
Definition: polfileeditor.h:22
bool isEmpty()
isEmpty returns true if the editor has no content in it.
Definition: polfileeditor.cpp:63
State state()
state returns the current state of the document
Definition: polfileeditor.cpp:73
QString currentPolFile()
currentPolFile returns the currently opened .pol file
Definition: polfileeditor.cpp:84
QString content()
content returns the content of the editor
Definition: polfileeditor.cpp:68
void savePolFile(QString path=QString())
Save the file to the given path, or to the default one if path is an empty string.
Definition: polfileeditor.cpp:39
Definition: polsyntaxhighlighter.h:9