• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

rocs/App

  • sources
  • kde-4.14
  • kdeedu
  • rocs
  • App
  • Ui
MainWindow.h
Go to the documentation of this file.
1 /*
2  This file is part of Rocs.
3  Copyright 2008-2011 Tomaz Canabrava <tomaz.canabrava@gmail.com>
4  Copyright 2008 Ugo Sangiori <ugorox@gmail.com>
5  Copyright 2009-2011 Wagner Reck <wagner.reck@gmail.com>
6  Copyright 2011-2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of
11  the License, or (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef SUI_MAINWINDOW_H
23 #define SUI_MAINWINDOW_H
24 
25 #include <KXmlGuiWindow>
26 #include <kmessagebox.h>
27 #include <QMutex>
28 #include <KUrl>
29 
30 class DocumentTypesWidget;
31 class KRecentFilesAction;
32 class QAction;
33 class KPushButton;
34 class KComboBox;
35 class GraphLayers;
36 class GraphVisualEditor;
37 class KActionCollection;
38 class Document;
39 class DataStructure;
40 class Project;
41 class KTextBrowser;
42 class QSplitter;
43 class KAction;
44 class SelectMoveHandAction;
45 class CodeEditor;
46 class QScriptEngine;
47 class QScriptEngineDebugger;
48 class ToolsPluginInterface;
49 class QCloseEvent;
50 class QComboBox;
51 class QToolButton;
52 class KActionMenu;
53 class ScriptOutputWidget;
54 class JournalEditorWidget;
55 
56 #ifndef USING_QTSCRIPT
57 #define USING_QTSCRIPT 1
58 #endif
59 
60 class MainWindow : public KXmlGuiWindow
61 {
62  Q_OBJECT
63 
64 
65 public:
67  MainWindow();
68  ~MainWindow();
69 
70  enum ScriptMode {
71  Execute,
72  DebugMode,
73  DebugOnlyInCaseOfError
74  };
75 
76 private: // Methods
77  void setupWidgets(); // Setup all the widgets.
78  void setupActions(); // Setup all the actions.
79  void setupToolbars();
80 
86  QWidget* setupSidePanel();
87  QWidget* setupScriptPanel(); // setup the panel with the editors and stuff
88 
89  void finishLoadingUi();
90  void createAction(const QByteArray& iconName, const QString& actionTitle, const QString& actionName,
91  const QKeySequence & shortcut , const char* slot, QObject *parent);
92  void createAction(const QByteArray& iconName, const QString& actionTitle, const QString& actionName,
93  const char* slot, QObject *parent);
94 
96  void setupDSPluginsAction();
97 
105  QString uniqueFilename(const QString &basePrefix, const QString &suffix);
106 
107 protected:
111  virtual bool queryClose();
112  void closeEvent(QCloseEvent *event);
113 
114 private slots:
115  void showSettings();
116  //Testing to connect to KGHNS3
117  void downloadNewExamples();
118  void uploadScript();
119 
120  void showPossibleIncludes();
121 
122  void showLoadedPlugins();
123 
124  void showCodeEditorConfig();
125 
130  void createNewProject();
131 
136  void executeScriptFull(const QString &text = QString());
137  void executeScript(const ScriptMode mode, const QString &text = QString());
138 
139  void debugScript();
140 
145  void executeScriptOneStep(const QString &text = QString());
146 
150  void stopScript();
151 
157  void addEmptyGraphDocument();
158 
159  void newProjectAssistant();
160  void saveProject(bool saveAs = false);
161  void openProject(const KUrl& fileName = KUrl());
162 
167  void importScript();
168 
172  void updateCaption();
173 
174 
180  void saveGraph(Document* document = 0);
181 
185  void saveAllGraphs();
186 
190  void saveGraphAs();
191 
197  void saveGraphAs(Document* document);
198  void newGraph();
199  void saveScripts();
200  void newScript();
201  void loadDocument(const QString& name = QString());
202 
207  void importGraphFile();
208  void exportGraphFile();
209 
214 // void importProject();
215 
216  void saveProjectAs();
217  void setupToolsPluginsAction();
218  void quit();
219 
220 public slots:
226  void setActiveDocument();
227  void releaseDocument(Document *d);
228  void runToolPlugin();
229 
231  void setupDocumentsList();
232  void disableStopAction();
233  void enableStopAction();
234 
239  void showExecutionButtonDebug(bool visible);
240 
245  void showExecutionButtonOneStep(bool visible);
246 
247 signals:
248  void startEvaluation();
249  void stopEvaluation();
250 
251 private: // Variables.
252  Project* _currentProject;
253 
254  // Right Area:
255  GraphVisualEditor* _graphVisualEditor;
256  CodeEditor *_codeEditor;
257  ScriptOutputWidget* _outputWidget;
258  JournalEditorWidget* _journalWidget;
259 
260  // Other Bunch of stuff.
261  KAction *_runScript;
262  KAction *_stepRunScript;
263  KAction *_stopScript;
264  KActionMenu *_debugMenu;
265  QList<QAction*> _toolsPlugins;
266 
268  KRecentFilesAction *_recentProjects;
269 
271  QSplitter *_vSplitter;
272  QSplitter *_hSplitter;
273  QSplitter *_hScriptSplitter;
274 
275  QComboBox *_selectListing;
276 
277  QScriptEngineDebugger *_scriptDbg;
278  KAction* _debugScript;
279  KAction* _interruptScript;
280 
281  void createToolsPluginsAction();
282 };
283 
284 #endif
MainWindow::showExecutionButtonDebug
void showExecutionButtonDebug(bool visible)
Show button to execute script in debug mode.
Definition: MainWindow.cpp:1064
MainWindow::setupDocumentsList
void setupDocumentsList()
setup documents list.
Definition: MainWindow.cpp:502
QWidget
MainWindow::ScriptMode
ScriptMode
Definition: MainWindow.h:70
QByteArray
ScriptOutputWidget
This widget displays output and debug messages from a ConsoleInterface object.
Definition: ScriptOutputWidget.h:33
MainWindow::closeEvent
void closeEvent(QCloseEvent *event)
Definition: MainWindow.cpp:166
QCloseEvent
QScriptEngine
KXmlGuiWindow
DocumentTypesWidget
This widget allows direct access to the data and pointer types of the currently activated document...
Definition: DocumentTypesWidget.h:40
QObject
QString
QList< QAction * >
MainWindow::disableStopAction
void disableStopAction()
Definition: MainWindow.cpp:1059
CodeEditor
Definition: CodeEditor.h:38
MainWindow::showExecutionButtonOneStep
void showExecutionButtonOneStep(bool visible)
Show button to exectue script for one command.
Definition: MainWindow.cpp:1069
QToolButton
MainWindow::stopEvaluation
void stopEvaluation()
MainWindow::setActiveDocument
void setActiveDocument()
Sets the current active document given by.
Definition: MainWindow.cpp:524
MainWindow::queryClose
virtual bool queryClose()
Reimplemented method KMainWindow::queryClose().
Definition: MainWindow.cpp:854
MainWindow::DebugMode
Definition: MainWindow.h:72
MainWindow::enableStopAction
void enableStopAction()
Definition: MainWindow.cpp:1054
JournalEditorWidget
This class contains a UI to edit a project's journal file.
Definition: JournalEditorWidget.h:34
QSplitter
MainWindow::MainWindow
MainWindow()
Definition: MainWindow.cpp:110
QKeySequence
QAction
QScriptEngineDebugger
MainWindow::~MainWindow
~MainWindow()
Definition: MainWindow.cpp:153
MainWindow::Execute
Definition: MainWindow.h:71
MainWindow::DebugOnlyInCaseOfError
Definition: MainWindow.h:73
MainWindow::releaseDocument
void releaseDocument(Document *d)
Definition: MainWindow.cpp:543
MainWindow
Definition: MainWindow.h:60
MainWindow::startEvaluation
void startEvaluation()
MainWindow::runToolPlugin
void runToolPlugin()
Definition: MainWindow.cpp:941
QComboBox
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/App

Skip menu "rocs/App"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal