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.
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>
43 class KRecentFilesAction
;
46 class MainWindow
: public KParts::MainWindow
51 MainWindow(KTextEditor::Document
* = 0L);
52 virtual ~MainWindow();
56 void changeSpeed(int speed
);
57 void unpauseExecution();
62 void slotOpenFile(const KURL
& url
= NULL
);
63 void slotOpenExample();
66 void slotSaveCanvas();
70 void slotPauseExecution();
71 void slotAbortExecution();
72 void slotChangeSpeed();
73 void slotInputDialog(QString
& value
);
74 void slotMessageDialog(QString text
);
77 void slotSetHighlightstyle(QString langCode
);
84 void slotClearSelection();
87 void slotFindPrevious();
89 void slotToggleInsert();
90 void slotInsertText(QString
);
91 void slotToggleLineNumbers();
94 void slotCleanIndent();
97 void slotSetCursorPos(uint row
, uint column
);
98 void slotSetSelection(uint StartLine
, uint StartCol
, uint EndLine
, uint EndCol
);
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();
123 void setupStatusBar();
125 void loadFile(const KURL
& url
);
126 void writeFile(const KURL
& url
);
129 void finishExecution();
130 void readConfig(KConfig
*config
);
132 void updateFullScreen();
133 virtual bool event(QEvent
* e
);
137 QGridLayout
*baseLayout
;
138 QDockWindow
*editorDock
;
140 ErrorMessage
*errMsg
;
142 RestartOrBack
*restartOrBackDialog
;
146 KAction
*openExAction
;
147 KAction
*openFileAction
;
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
;
166 Translate
*translate
;
169 // configuration related
172 QGroupBox
*WidthHeightBox
;
175 KIntNumInput
*kcfg_CanvasWidth
;
176 KIntNumInput
*kcfg_CanvasHeight
;
177 KComboBox
*kcfg_LanguageComboBox
;
178 QLabel
*LanguageLabel
;
182 #endif // _KTURTLE_H_