vlp-28 Moving editor to use QtDesigner files.
[vlp.git] / src / edit / editor.h
1 #ifndef QWERTY_H
2 #define QWERTY_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 My_Edit : public QTextEdit {
28         Q_OBJECT
29 public:
30         My_Edit(QWidget *parent = 0, const char *name = 0);
31 signals:
32         void cursorMove();
33 };
34 */
35 class Editor : public QMainWindow, private Ui::EditorWindow {
36         Q_OBJECT
37 public:
38         QString compiler_path;
39         QString gen_path;
40         QString file_path;
41
42         Editor(char *hdir = 0, QWidget *parent = 0);
43         ~Editor();
44
45         void compile(int mode);
46
47 public slots:
48         void on_actionOpen_triggered();
49         void load(const char *fileName);
50         void on_actionSave_triggered();
51         void save(const char *fileName);
52         void on_actionSave_as_triggered();
53         void on_actionNew_triggered();
54         void on_actionProperties_triggered();
55 //      void print();
56         void on_actionCompile_triggered();
57         void gen();
58         void comp_all();
59
60         void log_unit();
61         void log_prog();
62
63         void on_actionFind_triggered();
64         void on_actionFind_next_triggered();
65         //void gotoline();
66         void updateline();
67
68 protected:
69 //      virtual void editorKeyPressEvent(QKeyEvent *ev);
70         void resizeEvent(QResizeEvent *);
71         virtual void closeEvent (QCloseEvent * e);
72 private:
73 //      My_Edit *e;
74 //      QTextEdit *msg;
75         QLabel *position;
76         QString fname;
77         QString find_text;
78         bool sensitive;
79         char HomeDir[255];
80 };
81
82 #endif // QWERTY_H