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

rocs/RocsCore

  • sources
  • kde-4.12
  • kdeedu
  • rocs
  • RocsCore
Document.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 2010-2011 Wagner Reck <wagner.reck@gmail.com>
6  Copyright 2011-2012 Andreas Cord-Landwehr <cola@uni-paderborn.de>
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 DOCUMENT_H
23 #define DOCUMENT_H
24 
25 #include "RocsCoreExport.h"
26 #include "CoreTypes.h"
27 #include <QList>
28 #include <QObject>
29 #include <QSize>
30 #include <QRectF>
31 #include <QMap>
32 
33 class DocumentPrivate;
34 class KUrl;
35 class DataStructureBackendInterface;
36 class DataStructure;
37 class QtScriptBackend;
38 class QSvgRenderer;
39 class QPointF;
40 
41 class ROCSLIB_EXPORT Document : public QObject
42 {
43  Q_OBJECT
44 
45 public:
46  explicit Document(const QString &name, QObject *parent = 0);
47  ~Document();
48 
49  bool isModified() const;
50 
51  void setName(const QString &name);
52  QString name() const;
53 
58  void save();
59 
65  void saveAs(const QString &fileUrl);
66 
70  QString fileUrl() const;
71 
77  void setFileUrl(const KUrl &fileUrl);
78 
84  static bool isValidIdentifier(const QString &identifier);
85 
86  QtScriptBackend * engineBackend() const;
87  QList<DataStructurePtr>& dataStructures() const;
88 
89  void remove(DataStructurePtr dataStructure);
90 
94  void clear();
95 
99  QRectF sceneRect() const;
100 
104  virtual void cleanUpBeforeConvert();
105 
109  DataStructureBackendInterface * backend() const;
110 
115  void setBackend(const QString &pluginIdentifier);
116 
122  void changeBackend();
123 
131  int registerDataType(const QString &name, int identifier = 0);
132 
139  int registerPointerType(const QString &name, int identifier = 0);
140 
146  bool removeDataType(int dataType);
147 
154  bool removePointerType(int pointerType);
155 
156  PointerTypePtr pointerType(int pointerType) const;
157  DataTypePtr dataType(int dataType) const;
158 
162  int groupType();
163 
168  QList<int> dataTypeList() const;
169 
174  QList<int> pointerTypeList() const;
175 
176  QString iconPackage() const;
177 
178 public Q_SLOTS:
179  void setModified(const bool mod = true);
180 
187  void updateSceneRect(const QPointF &position);
188 
196  DataStructurePtr addDataStructure(const QString &name = QString());
197 
204  DataStructurePtr addDataStructure(DataStructurePtr dataStructure);
205 
209  DataStructurePtr activeDataStructure() const;
210 
217  void setActiveDataStructure(int index);
218  void setActiveDataStructure(DataStructurePtr g);
219 
220  void updateGraphics(DataTypePtr dataType);
221  void updateGraphics(PointerTypePtr pointerType);
222 
223 Q_SIGNALS:
224  void dataStructureCreated(DataStructurePtr g);
225  void dataStructureListChanged();
226  void dataTypeCreated(int identifier);
227  void pointerTypeCreated(int identifier);
228  void dataTypeRemoved(int identifier);
229  void pointerTypeRemoved(int identifier);
230  void nameChanged(QString name);
231  void activeDataStructureChanged(DataStructurePtr g);
232  void sceneRectChanged(const QRectF &);
233 
234 private:
235  // d-pointer
236  const QScopedPointer<DocumentPrivate> d;
237  Document(const Document&);
238  Document& operator=(const Document&);
239 };
240 
241 #endif
DataStructure
Definition: DataStructure.h:43
PointerTypePtr
boost::shared_ptr< PointerType > PointerTypePtr
Definition: CoreTypes.h:37
DataStructurePtr
boost::shared_ptr< DataStructure > DataStructurePtr
Definition: CoreTypes.h:38
CoreTypes.h
RocsCoreExport.h
QObject
QtScriptBackend
This class provides the script backend for script executions.
Definition: QtScriptBackend.h:40
Document
Definition: Document.h:41
ROCSLIB_EXPORT
#define ROCSLIB_EXPORT
Definition: RocsCoreExport.h:32
DataTypePtr
boost::shared_ptr< DataType > DataTypePtr
Definition: CoreTypes.h:36
DataStructureBackendInterface
Definition: DataStructureBackendInterface.h:42
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/RocsCore

Skip menu "rocs/RocsCore"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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