moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kverbos / kverbos / kverbosview.h
blobcfc4c702438074b9711c19c2429532a29f9f5cbd
1 /***************************************************************************
2 kverbosview.h - description
3 -------------------
4 begin : Fre Dez 14 19:28:09 CET 2001
5 copyright : (C) 2001 by Arnold Kraschinski
6 email : arnold.k67@gmx.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef KVERBOSVIEW_H
19 #define KVERBOSVIEW_H
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
25 // include files for Qt
26 #include "qlernen.h"
28 // weitere include-Files für das Programm
29 #include "kverbos.h"
31 // forward-Deklaration der Klasse. Während man die API-Dokumentation erstellt,
32 // muss diese Zeile auskommentiert werden, weil sonst der falsche Text als Beschreibung
33 // der Klasse erkannt wird.
34 //class KVerbosDoc;
36 /** The KVerbosView class provides the view widget for the KVerbosApp instance.
37 * The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow. As KVerbosView is part of the
38 * docuement-view model, it needs a reference to the document object connected with it by the KVerbosApp class to manipulate and display
39 * the document structure provided by the KVerbosDoc class.
41 * Diese Klasse soll folgende Funktionen erfüllen:
42 * - sie soll das momentan ausgewählte Verb vom Dokument holen.
43 * Diese Information enthält die spanische und deutsche Bedeutung des Verbes, die Zeit, die
44 * momentan getestet werden soll, und alle Verbformen, die zu dieser Zeit gehören.
45 * - die Klasse nimmt die Eingaben des Benutzers entgegen und prüft anschließend, ob die Ein-
46 * gaben richtig sind.
47 * - Die Informationen, wie viele Verben richtig geübt und wie viele falsch geübt wurden, soll
48 * direkt in dieser Klasse gespeichert werden und nicht im Dokument.
49 * - Die Klasse meldet an das Dokument, wenn es Zeit ist sich ein neues Verb zu suchen.
50 * Das ist in folgenden Fällen nötig:
51 * - wenn die Klasse zum ersten Mal gestartet wird und ein erstes Verb eingestellt werden
52 * soll.
53 * - wenn ein neues Dokument mit Verben geladen wird.
54 * - wenn der Benutzer die Formen richtig eingegeben hat.
55 * - wenn ihm nichts mehr einfällt und er weiter will.
57 * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
58 * @version KDevelop version 0.4 code generation
60 class KVerbosView : public QLernen /*QWidget*/
62 Q_OBJECT
63 public:
64 /** Constructor for the main view */
65 KVerbosView(QWidget *parent = 0, const char *name=0);
66 /** Destructor for the main view */
67 ~KVerbosView();
69 /** returns a pointer to the document connected to the view instance. Mind that this method requires a KVerbosApp instance as a parent
70 * widget to get to the window document pointer by calling the KVerbosApp::getDocument() method.
72 * @see KVerbosApp#getDocument
74 KVerbosDoc* getDocument() const;
76 /** contains the implementation for printing functionality */
77 void print(QPrinter *pPrinter);
78 /** This funktion erases all accents from the letters of a string
80 QString deleteAccents(const QString& s) const;
81 /** tell the view that the user has changed. Training results are deleted and set to the
82 * initial values. A new verb is chosen. The function returns the training result of the
83 * old user. r1 is the training results and r2 is the number of the trained verbs.
85 int userChanged(int& r1, int& r2);
87 public slots:
88 /** Die folgenden Slots werden aufgerufen, wenn ein Button mit einem
89 * spanischen Sonderzeichen gedrückt wird.
90 * Das Zeichen wird dann dem Eingabefeld, das den Focus hat zugefügt.
92 virtual void slotN();
93 virtual void slotA();
94 virtual void slotE();
95 virtual void slotI();
96 virtual void slotO();
97 virtual void slotU();
98 /** all the LineEdits will be cleared
100 virtual void slotClearAll();
101 /** if the verb is already corrected (corrected == true) then the font is
102 * set to the normal font
104 virtual void slotFont();
105 /** if the time is a progressiv or a perfect form the input of the yo-Editbox
106 * which contains the gerund or the partizip is copied into the others.
108 virtual void slotCopyText();
109 /** Die Ansicht wird aufgefordert sich das aktuelle Verb vom Dokument zu holen
110 * sich eine Zeit auszuwählen und dann das Verb in dem Fenster zum Üben bereitzustellen
112 virtual void zeigeVerb();
113 /** Es soll ein anderes Verb zum Lernen ausgewählt werden, das momentan eingegebene wird
114 nicht gewertet.
116 virtual void slotWeiter();
117 /** The input should be corrected.
119 virtual void slotCorregir();
120 /** The solution should be shown in the window
122 virtual void slotSolution();
125 signals:
126 void numberTrainedChanged(int);
127 void numberCorrectChanged(int);
128 void informKFeeder(int);
130 private:
131 /** the following variables store the information about the actual verb. The information
132 * is obtained from the doc.
134 QString espanol;
135 QString aleman;
136 int zeitAuswahl;
137 QString formen[7][3];
138 /** tells if the actual input already has been correced by using the button */
139 bool corrected;
140 /** Are pointers to the GUI elements for an easier use */
141 QLineEdit* formEdit[6][3];
142 /** the number of verbs that habe been correct */
143 int enteredCorrect;
144 /** the number of all verbs that have been trained */
145 int verbsTrained;
148 #endif // KVERBOSVIEW_H