• 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
  • DataStructures
  • RootedTree
RootedTreeStructure.h
Go to the documentation of this file.
1 /*
2  This file is part of RootedTree (Rocs Plugin).
3  Copyright 2012 Wagner Reck <wagner.reck@gmail.com>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License as
7  published by the Free Software Foundation; either version 2 of
8  the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef ROOTEDTREESTRUCTURE_H
20 #define ROOTEDTREESTRUCTURE_H
21 
22 #include "DataStructure.h"
23 #include <boost/shared_ptr.hpp>
24 
25 class RootedTreeNode;
26 
27 class RootedTreeStructure : public DataStructure
28 {
29  Q_OBJECT
30 
31  Q_PROPERTY(bool ShowAllPointers READ isShowingAllPointers WRITE setShowAllPointers NOTIFY showPointersChanged)
32 
33  RootedTreeNode *m_rootNode;
34 
35  bool m_showPointers;
36 
37 public:
38  //to avoid hide some methods
39  using DataStructure::createData;
40  using DataStructure::createPointer;
41 
42  static DataStructurePtr create(Document *parent);
43  static DataStructurePtr create(DataStructurePtr other, Document *parent);
44 
45  explicit RootedTreeStructure(Document *parent = 0 );
46  ~RootedTreeStructure();
47  void importStructure(DataStructurePtr other);
48 
49  PointerPtr createPointer(DataPtr from, DataPtr to, int dataType=0);
50  DataPtr createData(const QString& name, int dataType=0);
51 
52  void setEngine(QScriptEngine *engine);
53  DataPtr rootNode() const;
54 
56  bool isShowingAllPointers() const;
57 
58 public slots:
62  QScriptValue add_data(const QString &name);
63 
64  void set_root_node(RootedTreeNode *node);
65  QScriptValue root_node() const;
66 
69  void setShowAllPointers(const bool v);
70 
71 signals:
73  void showPointersChanged(const bool);
74 
75 };
76 #endif // ROOTEDTREESTRUCTURE_H
DataStructure::engine
QScriptEngine * engine() const
Definition: DataStructure.cpp:565
DataStructure
Definition: DataStructure.h:43
DataStructurePtr
boost::shared_ptr< DataStructure > DataStructurePtr
Definition: CoreTypes.h:38
RootedTreeStructure::importStructure
void importStructure(DataStructurePtr other)
overwrites the current DataStructure with all values (Data and Pointer) from the given datastructure ...
Definition: RootedTreeStructure.cpp:69
RootedTreeStructure::ShowAllPointers
bool ShowAllPointers
Definition: RootedTreeStructure.h:31
RootedTreeStructure::isShowingAllPointers
bool isShowingAllPointers() const
return true if all the pointers need to be draw.
Definition: RootedTreeStructure.cpp:240
RootedTreeStructure::showPointersChanged
void showPointersChanged(const bool)
signal emitted on change of pointers visibility
RootedTreeStructure::setShowAllPointers
void setShowAllPointers(const bool v)
set if all the pointers should be draw or not.
Definition: RootedTreeStructure.cpp:245
RootedTreeStructure::createPointer
PointerPtr createPointer(DataPtr from, DataPtr to, int dataType=0)
FIXME addeding multiple pointers.
Definition: RootedTreeStructure.cpp:147
RootedTreeStructure
Definition: RootedTreeStructure.h:27
RootedTreeStructure::rootNode
DataPtr rootNode() const
Definition: RootedTreeStructure.cpp:225
PointerPtr
boost::shared_ptr< Pointer > PointerPtr
Definition: CoreTypes.h:35
DataStructure.h
RootedTreeStructure::root_node
QScriptValue root_node() const
Definition: RootedTreeStructure.cpp:210
RootedTreeStructure::setEngine
void setEngine(QScriptEngine *engine)
Definition: RootedTreeStructure.cpp:233
Document
Definition: Document.h:41
RootedTreeStructure::add_data
QScriptValue add_data(const QString &name)
Create a new data (tree node) Note that it only create but not insert it into the tree...
Definition: RootedTreeStructure.cpp:138
RootedTreeStructure::m_rootNode
RootedTreeNode * m_rootNode
Definition: RootedTreeStructure.h:33
DataPtr
boost::shared_ptr< Data > DataPtr
Definition: CoreTypes.h:34
RootedTreeStructure::createData
DataPtr createData(const QString &name, int dataType=0)
Definition: RootedTreeStructure.cpp:199
RootedTreeStructure::set_root_node
void set_root_node(RootedTreeNode *node)
Definition: RootedTreeStructure.cpp:219
RootedTreeStructure::create
static DataStructurePtr create(Document *parent)
Definition: RootedTreeStructure.cpp:45
RootedTreeNode
Definition: RootedTreeNode.h:25
RootedTreeStructure::m_showPointers
bool m_showPointers
Definition: RootedTreeStructure.h:35
DataStructure::name
QString name() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:26 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