vlp-27 Removed some unused code. Added undo&redo to menu. Removed maximum window...
[vlp.git] / src / edit / editor.h
1 #ifndef VLP_EDITOR_H
2 #define VLP_EDITOR_H
3
4 #include <QtGui/QTextEdit>
5 #include <QtGui/QMainWindow>
6 #include <QtGui/QLineEdit>
7 #include <QtGui/QPushButton>
8 #include <QtGui/QLabel>
9
10 #include "ui/editor-window.h"
11
12 #define COMP_MODE       1
13 #define GEN_MODE        2
14 #define ALL_MODE        3
15
16 typedef struct {
17         char name[255];
18         char filename[255];
19 } FuncEntry;
20
21 typedef struct {
22         QList<FuncEntry> dictionary;
23         QStringList names;
24         char name[255];
25 } CategoryEntry;
26
27 class Editor : public QMainWindow, private Ui::EditorWindow {
28         Q_OBJECT
29 public:
30         QString compiler_path;
31         QString gen_path;
32         QString file_path;
33
34         Editor(char *hdir = 0, QWidget *parent = 0);
35         ~Editor();
36
37         void compile(int mode);
38
39 public slots:
40         void on_actionOpen_triggered();
41         void load(const char *fileName);
42         void on_actionSave_triggered();
43         void save(const char *fileName);
44         void on_actionSave_as_triggered();
45         void on_actionNew_triggered();
46         void on_actionProperties_triggered();
47 //      void print();
48         void on_actionCompile_triggered();
49         void gen();
50         void comp_all();
51
52         void log_unit();
53         void log_prog();
54
55         void on_actionFind_triggered();
56         void on_actionFind_next_triggered();
57         //void gotoline();
58         void updateline();
59
60 protected:
61         virtual void closeEvent (QCloseEvent * e);
62 private:
63         QLabel *position;
64         QString fname;
65         QString find_text;
66         bool sensitive;
67         char HomeDir[255];
68 };
69
70 #endif /* VLP_EDITOR */