moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kturtle / src / kturtle.h
blob1f67ce9d79f0477b226a1a414bbcdb4a1a8ba0aa
1 /*
2 Copyright (C) 2003-04 Cies Breijs <cies # kde ! nl>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of version 2 of the GNU General Public
6 License as published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #ifndef _KTURTLE_H_
20 #define _KTURTLE_H_
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
27 #include <qgroupbox.h>
29 #include <kcombobox.h>
30 #include <klineedit.h>
31 #include <knuminput.h>
33 #include <kparts/mainwindow.h>
34 #include <ktexteditor/editinterface.h>
35 #include <ktexteditor/view.h>
37 #include "canvas.h"
38 #include "dialogs.h"
39 #include "executer.h"
40 #include "parser.h"
43 class KRecentFilesAction;
46 class MainWindow : public KParts::MainWindow
48 Q_OBJECT
50 public:
51 MainWindow(KTextEditor::Document* = 0L);
52 virtual ~MainWindow();
55 signals:
56 void changeSpeed(int speed);
57 void unpauseExecution();
60 protected slots:
61 void slotNewFile();
62 void slotOpenFile(const KURL& url = NULL);
63 void slotOpenExample();
64 void slotSaveFile();
65 void slotSaveAs();
66 void slotSaveCanvas();
67 void slotPrint();
69 void slotExecute();
70 void slotPauseExecution();
71 void slotAbortExecution();
72 void slotChangeSpeed();
73 void slotInputDialog(QString& value);
74 void slotMessageDialog(QString text);
76 void slotEditor();
77 void slotSetHighlightstyle(QString langCode);
78 void slotUndo();
79 void slotRedo();
80 void slotCut();
81 void slotCopy();
82 void slotPaste();
83 void slotSelectAll();
84 void slotClearSelection();
85 void slotFind();
86 void slotFindNext();
87 void slotFindPrevious();
88 void slotReplace();
89 void slotToggleInsert();
90 void slotInsertText(QString);
91 void slotToggleLineNumbers();
92 void slotIndent();
93 void slotUnIndent();
94 void slotCleanIndent();
95 void slotComment();
96 void slotUnComment();
97 void slotSetCursorPos(uint row, uint column);
98 void slotSetSelection(uint StartLine, uint StartCol, uint EndLine, uint EndCol);
100 void slotSettings();
101 void slotUpdateSettings();
102 void slotSettingsHelp();
104 void slotContextHelp();
105 void slotContextHelpUpdate();
107 void slotStatusBar(QString text, int place);
108 void slotCursorStatusBar();
110 void slotToggleFullscreen();
111 void slotFinishedFullScreenExecution();
112 void slotRestartFullScreen();
113 void slotBackToFullScreen();
115 void slotColorPicker();
116 void slotUpdateCanvas();
119 protected:
120 void setupActions();
121 void setupEditor();
122 void setupCanvas();
123 void setupStatusBar();
125 void loadFile(const KURL& url);
126 void writeFile(const KURL& url);
127 bool queryClose();
129 void finishExecution();
130 void readConfig(KConfig *config);
132 void updateFullScreen();
133 virtual bool event(QEvent* e);
135 Canvas *canvasView;
136 QWidget *baseWidget;
137 QGridLayout *baseLayout;
138 QDockWindow *editorDock;
139 Executer *exe;
140 ErrorMessage *errMsg;
141 ColorPicker *picker;
142 RestartOrBack *restartOrBackDialog;
144 KAction *run;
145 KAction *stop;
146 KAction *openExAction;
147 KAction *openFileAction;
148 KAction *newAction;
149 KAction *ContextHelp;
150 KToggleAction *pause;
151 KToggleAction *m_fullscreen;
152 KToggleAction *colorpicker;
153 KSelectAction *speed;
154 KRecentFilesAction *m_recentFiles;
156 KTextEditor::View *view() const { return editor; }
157 KTextEditor::EditInterface *editorInterface;
158 KTextEditor::Document *doc;
159 KTextEditor::View *editor;
161 bool executing;
162 bool b_fullscreen;
163 bool b_editorShown;
165 QString helpKeyword;
166 Translate *translate;
167 KURL CurrentFile;
169 // configuration related
170 QWidget *general;
171 QWidget *language;
172 QGroupBox *WidthHeightBox;
173 QLabel *WidthLabel;
174 QLabel *HeightLabel;
175 KIntNumInput *kcfg_CanvasWidth;
176 KIntNumInput *kcfg_CanvasHeight;
177 KComboBox *kcfg_LanguageComboBox;
178 QLabel *LanguageLabel;
182 #endif // _KTURTLE_H_