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

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • scripts
  • scripting
lesson.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  Copyright 2008 Avgoustinos Kadis <avgoustinos.kadis@kdemail.net>
4 
5  ***************************************************************************/
6 
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef SCRIPTINGSCRIPTOBJECTLESSON_H
16 #define SCRIPTINGSCRIPTOBJECTLESSON_H
17 
18 #include <keduvoclesson.h>
19 #include "container.h"
20 
21 #include <QObject>
22 #include <QStringList>
23 
24 #include <KSharedPtr>
25 
26 namespace Scripting
27 {
28 
29 class Expression;
30 
47 class Lesson : public Container
48 {
49  Q_OBJECT
50 public:
51 
52  Lesson(KEduVocLesson * lesson);
53 
54  Lesson(KEduVocContainer * container);
55 
56  Lesson(const QString& name);
57 
58  ~Lesson();
59 
60 public slots:
72  QVariantList entries(bool recursive = false) const;
73 
74  void setEntries(QVariantList entries);
75 
77  QObject * entry(int row, bool recursive = false);
78 
80  int entryCount(bool recursive = false);
81 
95  QObject* newEntry();
96 
109  QObject* newEntry(QStringList translations);
110 
122  void appendEntry(Expression * entry);
123 
135  void appendNewEntry(QStringList translations);
136 
142  void insertEntry(int index, Expression * entry);
143 
157  void removeEntry(QObject * entry);
158 
162  void clearEntries();
163 
164  // @note this one doesn't work with the previous one (python doesn't know which one to call)
165  /*
166  * Creates and returns a new Expression Object
167  * @param expression
168  * @return A new Expression object
169  */
170 // QObject* newEntry ( const QString & expression );
171 
172 
173  //child lesson public functions (just to change the names from "Container" to "Lesson")
177  void appendChildLesson(Lesson *child) {
178  appendChildContainer(child);
179  }
183  void insertChildLesson(int row, Lesson *child) {
184  insertChildContainer(row, child);
185  }
186  /*
187  * Delete child lesson of the specified @p row
188  */
189 // void deleteChildLesson ( int row ) { deleteChildContainer ( row ); }
193  void removeChildLesson(int row) {
194  removeChildContainer(row);
195  }
199  QObject *childLesson(int row) {
200  return new Lesson(m_lesson->childContainer(row));
201  }
202 
209  QObject *childLesson(const QString& name) {
210  return new Lesson(m_lesson->childContainer(name));
211  }
212 
224  QVariantList childLessons(bool recursive = false);
225 
241  QObject * findChildLesson(const QString& name);
242 
246  int childLessonCount() const {
247  return childContainerCount();
248  }
249 
250 private:
251  KEduVocLesson* m_lesson;
252 };
253 
254 }
255 
256 #endif
QObject::child
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
Scripting::Lesson::findChildLesson
QObject * findChildLesson(const QString &name)
Searches through all the child lessons (recursively) and returns the first lesson the specified name...
Definition: lesson.cpp:142
Scripting::Container::childContainerCount
int childContainerCount() const
Definition: container.h:112
Scripting::Lesson::childLessons
QVariantList childLessons(bool recursive=false)
Returns a list of all the child lessons.
Definition: lesson.cpp:57
Scripting::Lesson
KEduVocLesson wrapping class for Kross scripts.
Definition: lesson.h:47
Scripting::Lesson::childLesson
QObject * childLesson(int row)
Return the child lesson with the corresponding row.
Definition: lesson.h:199
Scripting::Lesson::appendChildLesson
void appendChildLesson(Lesson *child)
Appends a child lesson under the current lesson.
Definition: lesson.h:177
Scripting::Container
KEduVocContainer wrapping class for Kross scripts (inherited by Lesson)
Definition: container.h:33
Scripting::Lesson::insertChildLesson
void insertChildLesson(int row, Lesson *child)
Inserts a child lesson (child) on the specified row.
Definition: lesson.h:183
Scripting::Lesson::removeEntry
void removeEntry(QObject *entry)
Removes an entry from this lesson.
Definition: lesson.cpp:102
Scripting::Lesson::Lesson
Lesson(KEduVocLesson *lesson)
Definition: lesson.cpp:24
Scripting::Lesson::appendEntry
void appendEntry(Expression *entry)
Appends an entry at the end of the lesson.
Definition: lesson.cpp:92
Scripting::Lesson::entries
QVariantList entries(bool recursive=false) const
Returns a list of all the entries of a lesson.
Definition: lesson.cpp:64
Scripting::Lesson::entry
QObject * entry(int row, bool recursive=false)
Returns the entry of the given row.
Definition: lesson.cpp:82
QObject
Scripting::Container::row
int row() const
Returns an integer, the Container's unique row.
Definition: container.h:156
Scripting::Container::removeChildContainer
void removeChildContainer(int row)
Definition: container.h:95
Scripting::Lesson::newEntry
QObject * newEntry()
Creates and returns a new Expression Object.
Definition: lesson.cpp:121
Scripting::Lesson::childLesson
QObject * childLesson(const QString &name)
Retrieve a child container by its name Returns 0 if no container is found.
Definition: lesson.h:209
QString
container.h
Scripting::Lesson::childLessonCount
int childLessonCount() const
Returns how many child lessons exist under this lesson.
Definition: lesson.h:246
QStringList
Scripting::Lesson::entryCount
int entryCount(bool recursive=false)
Returns how many entries are in this lesson (or with sublessons if recursive is true) ...
Definition: lesson.cpp:87
Scripting::Lesson::removeChildLesson
void removeChildLesson(int row)
Remove child lesson of the specified row.
Definition: lesson.h:193
Scripting::Container::name
QString name()
Definition: container.h:84
Scripting::Lesson::insertEntry
void insertEntry(int index, Expression *entry)
Insert an entry on a specific index.
Definition: lesson.cpp:97
Scripting::Lesson::~Lesson
~Lesson()
Definition: lesson.cpp:42
Scripting::Lesson::appendNewEntry
void appendNewEntry(QStringList translations)
Creates and appends a new entry with the given translations.
Definition: lesson.cpp:136
Scripting::Lesson::setEntries
void setEntries(QVariantList entries)
Definition: lesson.cpp:69
Scripting::Lesson::clearEntries
void clearEntries()
Removes all the lesson entries (not recursively)
Definition: lesson.cpp:113
Scripting::Expression
This class represents.
Definition: expression.h:35
Scripting::Container::appendChildContainer
void appendChildContainer(Container *child)
Definition: container.h:88
Scripting::Container::insertChildContainer
void insertChildContainer(int row, Container *child)
Definition: container.h:91
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • 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
  • 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