• 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
  • practice
abstractbackendmode.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2009 Frederik Gladhorn <gladhorn@kde.org>
3  ***************************************************************************/
4 
5 /***************************************************************************
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  ***************************************************************************/
13 
14 #ifndef ABSTRACTBACKENDMODE_H
15 #define ABSTRACTBACKENDMODE_H
16 
17 #include <QVariant>
18 
19 #include "testentry.h"
20 #include "practiceoptions.h"
21 #include "abstractfrontend.h"
22 
23 
24 namespace Practice {
25 
26 class AbstractBackendMode :public QObject
27 {
28  Q_OBJECT
29 
30 public:
31 
32  AbstractBackendMode(const PracticeOptions& practiceOptions, AbstractFrontend *frontend, QObject *parent);
33  virtual ~AbstractBackendMode() {}
34 
37  virtual bool setTestEntry(TestEntry* current);
38 
41  void addSynonym(const QString& entry) { if (!entry.isEmpty()) m_synonyms.append(entry); }
42 
51  virtual grade_t currentGradeForEntry();
52 
58  virtual void updateGrades();
59 
60 public Q_SLOTS:
62  virtual void hintAction() = 0;
63 
68  virtual void checkAnswer() = 0;
69 
70 Q_SIGNALS:
71  void removeCurrentEntryFromPractice();
72 
74  void nextEntry();
75 
76  void answerRight();
77  void answerWrongRetry();
78  void answerWrongShowSolution();
79  void showSolution();
80 
81 protected:
82  PracticeOptions m_practiceOptions;
83  AbstractFrontend* m_frontend;
84  TestEntry* m_current;
85  QStringList m_synonyms;
86 };
87 
88 }
89 
90 #endif // ABSTRACTBACKENDMODE_H
Practice::PracticeOptions
Definition: practiceoptions.h:22
Practice::AbstractBackendMode::hintAction
virtual void hintAction()=0
the frontend requested a hint
practiceoptions.h
Practice::AbstractBackendMode::addSynonym
void addSynonym(const QString &entry)
add a new synonym to the list of shown/answered synonyms depending on which mode we are in...
Definition: abstractbackendmode.h:41
Practice::AbstractBackendMode::showSolution
void showSolution()
Practice::AbstractBackendMode::answerRight
void answerRight()
Practice::AbstractBackendMode::AbstractBackendMode
AbstractBackendMode(const PracticeOptions &practiceOptions, AbstractFrontend *frontend, QObject *parent)
Definition: abstractbackendmode.cpp:19
Practice::AbstractBackendMode::checkAnswer
virtual void checkAnswer()=0
Check if the current answer is right.
QObject
Practice::AbstractBackendMode::removeCurrentEntryFromPractice
void removeCurrentEntryFromPractice()
testentry.h
Practice::AbstractBackendMode::m_frontend
AbstractFrontend * m_frontend
Definition: abstractbackendmode.h:83
Practice::AbstractBackendMode::~AbstractBackendMode
virtual ~AbstractBackendMode()
Definition: abstractbackendmode.h:33
Practice::AbstractBackendMode::m_current
TestEntry * m_current
Definition: abstractbackendmode.h:84
Practice::AbstractBackendMode::m_synonyms
QStringList m_synonyms
Definition: abstractbackendmode.h:85
Practice::AbstractBackendMode::updateGrades
virtual void updateGrades()
Change the grades for the current entry.
Definition: abstractbackendmode.cpp:46
Practice::AbstractBackendMode::setTestEntry
virtual bool setTestEntry(TestEntry *current)
start practicing a new word.
Definition: abstractbackendmode.cpp:27
Practice::AbstractBackendMode::nextEntry
void nextEntry()
ask for the next word to be practiced
Practice::AbstractBackendMode::answerWrongShowSolution
void answerWrongShowSolution()
abstractfrontend.h
Practice::AbstractBackendMode
Definition: abstractbackendmode.h:26
Practice::AbstractFrontend
Definition: abstractfrontend.h:25
Practice::AbstractBackendMode::currentGradeForEntry
virtual grade_t currentGradeForEntry()
The grade of the current entry - this has an default implementation to return the grade for the curre...
Definition: abstractbackendmode.cpp:41
Practice::AbstractBackendMode::m_practiceOptions
PracticeOptions m_practiceOptions
Definition: abstractbackendmode.h:82
Practice::AbstractBackendMode::answerWrongRetry
void answerWrongRetry()
TestEntry
Definition: testentry.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:05 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