• 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
guifrontend.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2009 Daniel Laidig <d.laidig@gmx.de>
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 PRACTICE_GUIFRONTEND_H
15 #define PRACTICE_GUIFRONTEND_H
16 
17 #include "abstractwidget.h"
18 #include "abstractfrontend.h"
19 
20 #include <KXmlGuiWindow>
21 #include <KUrl>
22 
23 #include "practicemainwindow.h"
24 
25 namespace Ui {
26  class PracticeMainWindow;
27 }
28 
29 namespace Practice {
30 class ThemedBackgroundRenderer;
31 class ImageWidget;
32 
33 class GuiFrontend : public AbstractFrontend
34 {
35  Q_OBJECT
36 
37 public:
38  GuiFrontend(QWidget* parent = 0);
39  virtual ~GuiFrontend();
40 
41  virtual QVariant userInput();
42  QWidget* widget();
43 
44  virtual void setQuestion(const QVariant& question);
45  virtual void setQuestionImage(const KUrl& img);
46  virtual void setQuestionPronunciation(const QString& pronunciationText);
47  virtual void setQuestionSound(const KUrl& soundUrl);
48  virtual void setQuestionFont(const QFont& font);
49 
50  virtual void setSolution(const QVariant& solution);
51  virtual void setSolutionImage(const KUrl& img);
52  virtual void setSolutionPronunciation(const QString& pronunciationText);
53  virtual void setSolutionSound(const KUrl& soundUrl);
54  virtual void setSolutionFont(const QFont& font);
55 
56  virtual void setHint(const QVariant& hint);
57  virtual void setFeedback(const QVariant& feedback);
58 
59  virtual void setFeedbackState(ResultState feedbackState);
60  virtual void setResultState(ResultState resultState);
61  virtual ResultState resultState();
62 
64  void setLessonName(const QString& lessonName);
65  virtual void setFinishedWordsTotalWords(int finished, int total);
66 
67  virtual void setSynonym(const QString& entry);
68 
69 public Q_SLOTS:
70  void setMode(Mode mode);
71  void showQuestion();
72  void showSolution();
73  void setBoxes(grade_t currentBox, grade_t newBoxIfCorrect, grade_t newBoxIfWrong);
74 
75  void showSynonym();
76 
77  void backgroundChanged(const QPixmap& pixmap);
78 
79  // show two buttons (i didn't know it, i knew it) instead of the continue button and disable the correct/wrong toggle (needed for flash card mode)
80  void showSetResultButtons(bool show);
81  void toggleResultState();
82 
83 protected:
84  bool eventFilter(QObject *object, QEvent *event);
85 
86 private Q_SLOTS:
87  void countAsCorrectButtonClicked();
88  void countAsWrongButtonClicked();
89  void updateBackground();
90  void updateFontColors();
91  void setTheme();
92 
93 private:
94  void setImage(const KUrl& image);
95 
96  ImageWidget* m_widget;
97  Ui::PracticeMainWindow* m_ui;
98  AbstractModeWidget* m_modeWidget;
99  ResultState m_resultState;
100  ResultState m_feedbackState;
101  KUrl m_lastImage;
102  KUrl m_questionImage;
103  KUrl m_solutionImage;
104  int m_currentBox;
105  int m_newBoxIfCorrect;
106  int m_newBoxIfWrong;
107  ThemedBackgroundRenderer *m_themedBackgroundRenderer;
108 };
109 
110 }
111 
112 #endif // PRACTICE_GUIFRONTEND_H
Practice::GuiFrontend::setResultState
virtual void setResultState(ResultState resultState)
The result state indicated whether a word is counted as correct (and grades are raised) and can be ch...
Definition: guifrontend.cpp:275
Practice::GuiFrontend
Definition: guifrontend.h:33
Practice::GuiFrontend::setFeedback
virtual void setFeedback(const QVariant &feedback)
Definition: guifrontend.cpp:264
Practice::GuiFrontend::toggleResultState
void toggleResultState()
Definition: guifrontend.cpp:329
Practice::GuiFrontend::userInput
virtual QVariant userInput()
Enables access to the input of the user.
Definition: guifrontend.cpp:74
Practice::GuiFrontend::setSolutionSound
virtual void setSolutionSound(const KUrl &soundUrl)
Definition: guifrontend.cpp:259
Practice::GuiFrontend::setSolutionImage
virtual void setSolutionImage(const KUrl &img)
Definition: guifrontend.cpp:225
QWidget
Practice::GuiFrontend::resultState
virtual ResultState resultState()
Definition: guifrontend.cpp:312
Practice::GuiFrontend::showSolution
void showSolution()
Definition: guifrontend.cpp:138
Practice::GuiFrontend::setSolution
virtual void setSolution(const QVariant &solution)
Definition: guifrontend.cpp:215
QObject
Practice::AbstractModeWidget
Definition: abstractwidget.h:26
Practice::GuiFrontend::GuiFrontend
GuiFrontend(QWidget *parent=0)
Definition: guifrontend.cpp:35
Practice::GuiFrontend::showSetResultButtons
void showSetResultButtons(bool show)
Definition: guifrontend.cpp:169
Practice::GuiFrontend::showQuestion
void showQuestion()
Definition: guifrontend.cpp:129
Practice::GuiFrontend::setFinishedWordsTotalWords
virtual void setFinishedWordsTotalWords(int finished, int total)
The status such as lesson or number of words has changed.
Definition: guifrontend.cpp:184
Practice::GuiFrontend::setQuestion
virtual void setQuestion(const QVariant &question)
Definition: guifrontend.cpp:199
Practice::GuiFrontend::showSynonym
void showSynonym()
Definition: guifrontend.cpp:151
Practice::GuiFrontend::eventFilter
bool eventFilter(QObject *object, QEvent *event)
Definition: guifrontend.cpp:177
Practice::GuiFrontend::setSolutionPronunciation
virtual void setSolutionPronunciation(const QString &pronunciationText)
Definition: guifrontend.cpp:254
Practice::AbstractFrontend::ResultState
ResultState
Definition: abstractfrontend.h:39
Practice::GuiFrontend::setSolutionFont
virtual void setSolutionFont(const QFont &font)
Definition: guifrontend.cpp:235
practicemainwindow.h
Practice::GuiFrontend::setSynonym
virtual void setSynonym(const QString &entry)
set a new synonym that should be shown
Definition: guifrontend.cpp:146
Practice::ThemedBackgroundRenderer
Definition: themedbackgroundrenderer.h:30
Practice::GuiFrontend::setFeedbackState
virtual void setFeedbackState(ResultState feedbackState)
The feedback state tells the user if the currently entered word is correct (independent of whether th...
Definition: guifrontend.cpp:269
Practice::AbstractFrontend::Mode
Mode
Definition: abstractfrontend.h:29
abstractfrontend.h
Practice::GuiFrontend::backgroundChanged
void backgroundChanged(const QPixmap &pixmap)
Definition: guifrontend.cpp:164
Practice::AbstractFrontend
Definition: abstractfrontend.h:25
Practice::GuiFrontend::setHint
virtual void setHint(const QVariant &hint)
Definition: guifrontend.cpp:194
Practice::GuiFrontend::setLessonName
void setLessonName(const QString &lessonName)
update lesson label
Definition: guifrontend.cpp:124
Practice::GuiFrontend::setQuestionPronunciation
virtual void setQuestionPronunciation(const QString &pronunciationText)
Definition: guifrontend.cpp:205
Practice::GuiFrontend::setQuestionFont
virtual void setQuestionFont(const QFont &font)
Definition: guifrontend.cpp:230
Practice::GuiFrontend::setBoxes
void setBoxes(grade_t currentBox, grade_t newBoxIfCorrect, grade_t newBoxIfWrong)
Definition: guifrontend.cpp:156
Practice::ImageWidget
Definition: imagewidget.h:23
abstractwidget.h
Practice::GuiFrontend::setQuestionSound
virtual void setQuestionSound(const KUrl &soundUrl)
Definition: guifrontend.cpp:210
Practice::GuiFrontend::setQuestionImage
virtual void setQuestionImage(const KUrl &img)
Definition: guifrontend.cpp:220
Practice::GuiFrontend::widget
QWidget * widget()
Definition: guifrontend.cpp:79
Practice::GuiFrontend::setMode
void setMode(Mode mode)
Definition: guifrontend.cpp:84
Practice::GuiFrontend::~GuiFrontend
virtual ~GuiFrontend()
Definition: guifrontend.cpp:69
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