• 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
CodeEditor.h
Go to the documentation of this file.
1 /*
2  This file is part of Rocs.
3  Copyright 2009-2010 Tomaz Canabrava <tomaz.canabrava@gmail.com>
4  Copyright 2011 Andreas Cord-Landwehr <cola@uni-paderborn.de>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation; either version 2 of
9  the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef CODEEDITOR_H
21 #define CODEEDITOR_H
22 
23 #include <QWidget>
24 #include <KTabBar>
25 #include <QList>
26 #include "MainWindow.h"
27 
28 namespace KTextEditor
29 {
30 class Document;
31 class View;
32 class Editor;
33 }
34 class QVBoxLayout;
35 class QStackedWidget;
36 class KUrl;
37 
38 class CodeEditor : public QWidget
39 {
40  Q_OBJECT
41 public:
45  explicit CodeEditor(MainWindow *parent = 0);
46 
47  QString text() const;
48  KTextEditor::Editor *editor() const {
49  return _editor;
50  }
51  KTextEditor::Document *document() const {
52  return _activeDocument;
53  }
54  KTextEditor::View *view() const {
55  return _activeView;
56  }
57 
61  bool isModified() const;
62 
63 public slots:
67  KTextEditor::Document* newScript();
72  KTextEditor::Document* newScript(const KUrl& file);
73  void saveActiveScript();
74  void saveActiveScriptAs();
75  void saveAllScripts();
76  void openScript(const KUrl& fileUrl);
77  void closeAllScripts();
78 
83  void saveScript(KTextEditor::Document *doc);
84 
85 private slots:
86  void closeDocument(int index);
87  void changeCurrentDocument(int index);
88  void updateTabText(KTextEditor::Document* text);
89 
90 private:
95  void saveScriptAs(KTextEditor::Document *doc);
97  QStackedWidget *_docArea;
98  KTabBar *_tabDocs;
99  QList<KTextEditor::View*> _docViews;
100  QList<KTextEditor::Document*> _scriptDocs;
101  KTextEditor::Editor *_editor;
102  QVBoxLayout* _layout;
103 
104  KTextEditor::Document *_activeDocument;
105  KTextEditor::View *_activeView;
106 };
107 
108 #endif
CodeEditor::saveScript
void saveScript(KTextEditor::Document *doc)
Save the given script or if no text document is given, the currently active script is saved...
Definition: CodeEditor.cpp:184
CodeEditor::document
KTextEditor::Document * document() const
Definition: CodeEditor.h:51
QWidget
CodeEditor::openScript
void openScript(const KUrl &fileUrl)
Definition: CodeEditor.cpp:158
CodeEditor::isModified
bool isModified() const
This method gives modification state of code-editor texts.
Definition: CodeEditor.cpp:255
MainWindow.h
CodeEditor::text
QString text() const
Definition: CodeEditor.cpp:249
CodeEditor::saveActiveScript
void saveActiveScript()
Definition: CodeEditor.cpp:237
QVBoxLayout
QStackedWidget
QString
QList< KTextEditor::View * >
CodeEditor::newScript
KTextEditor::Document * newScript()
Creates new script.
Definition: CodeEditor.cpp:106
CodeEditor
Definition: CodeEditor.h:38
CodeEditor::closeAllScripts
void closeAllScripts()
Definition: CodeEditor.cpp:58
CodeEditor::editor
KTextEditor::Editor * editor() const
Definition: CodeEditor.h:48
CodeEditor::view
KTextEditor::View * view() const
Definition: CodeEditor.h:54
CodeEditor::saveAllScripts
void saveAllScripts()
Definition: CodeEditor.cpp:218
CodeEditor::CodeEditor
CodeEditor(MainWindow *parent=0)
Creates new CodeEditor without any scripts.
Definition: CodeEditor.cpp:31
QObject::parent
QObject * parent() const
MainWindow
Definition: MainWindow.h:60
CodeEditor::saveActiveScriptAs
void saveActiveScriptAs()
Definition: CodeEditor.cpp:243
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