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

parley

  • sources
  • kde-4.12
  • 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 ) { appendChildContainer ( child ); }
181  void insertChildLesson ( int row, Lesson *child ) { insertChildContainer ( row, child ); }
182  /*
183  * Delete child lesson of the specified @p row
184  */
185 // void deleteChildLesson ( int row ) { deleteChildContainer ( row ); }
189  void removeChildLesson ( int row ) { removeChildContainer ( row ); }
193  QObject *childLesson ( int row ) { return new Lesson ( m_lesson->childContainer ( row ) ); }
194 
201  QObject *childLesson ( const QString& name ) { return new Lesson ( m_lesson->childContainer ( name ) ); }
202 
214  QVariantList childLessons ( bool recursive = false );
215 
231  QObject * findChildLesson ( const QString& name );
232 
236  int childLessonCount() const { return childContainerCount(); }
237 
238  private:
239  KEduVocLesson* m_lesson;
240  };
241 
242 }
243 
244 #endif
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:147
Scripting::Container::childContainerCount
int childContainerCount() const
Definition: container.h:96
Scripting::Lesson::childLessons
QVariantList childLessons(bool recursive=false)
Returns a list of all the child lessons.
Definition: lesson.cpp:58
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:193
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:181
QObject
Scripting::Lesson::removeEntry
void removeEntry(QObject *entry)
Removes an entry from this lesson.
Definition: lesson.cpp:104
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:94
Scripting::Lesson::entries
QVariantList entries(bool recursive=false) const
Returns a list of all the entries of a lesson.
Definition: lesson.cpp:65
Scripting::Lesson::entry
QObject * entry(int row, bool recursive=false)
Returns the entry of the given row.
Definition: lesson.cpp:84
Scripting::Container::row
int row() const
Returns an integer, the Container's unique row.
Definition: container.h:128
Scripting::Container::removeChildContainer
void removeChildContainer(int row)
Definition: container.h:85
Scripting::Lesson::newEntry
QObject * newEntry()
Creates and returns a new Expression Object.
Definition: lesson.cpp:126
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:201
container.h
Scripting::Lesson::childLessonCount
int childLessonCount() const
Returns how many child lessons exist under this lesson.
Definition: lesson.h:236
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:89
Scripting::Lesson::removeChildLesson
void removeChildLesson(int row)
Remove child lesson of the specified row.
Definition: lesson.h:189
Scripting::Container::name
QString name()
Definition: container.h:80
Scripting::Lesson::insertEntry
void insertEntry(int index, Expression *entry)
Insert an entry on a specific index.
Definition: lesson.cpp:99
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:141
Scripting::Lesson::setEntries
void setEntries(QVariantList entries)
Definition: lesson.cpp:70
Scripting::Lesson::clearEntries
void clearEntries()
Removes all the lesson entries (not recursively)
Definition: lesson.cpp:118
Scripting::Expression
This class represents.
Definition: expression.h:35
Scripting::Container::appendChildContainer
void appendChildContainer(Container *child)
Definition: container.h:82
Scripting::Container::insertChildContainer
void insertChildContainer(int row, Container *child)
Definition: container.h:83
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:06 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
  • 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