summaryrefslogtreecommitdiffstats
path: root/klatin/klatin/klatinverbs.h
blob: b389102e5db4ae77266d1f80f4d6986a49d05117 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/***************************************************************************
    begin                : Fri Aug 15 2003
    copyright            : (C) 2001-2004 by George Wright
    email                : gwright@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KLATINVERBS_H
#define KLATINVERBS_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <vector>

#include "keduvocdata.h"
#include "klatinverbswidget.h"

struct fileparts {
	std::vector<QString> declension;
	std::vector<const char*> mood;
	std::vector<const char*> voice;
};

struct questionparts {
	std::vector<const char*> person;
	std::vector<const char*> number;
	std::vector<const char*> tense;
};

/** @short Main class for testing verb forms */
class KLatinVerbs : public KLatinVerbsWidget
{
	Q_OBJECT
public:
	KLatinVerbs(QWidget* parent=0, const char *name=0);
	~KLatinVerbs();

	/// Load next question
	void nextQuestion();
	/// Update current scores
	void updateScores();
public slots:
	/// Destroy the widget
	void goBack();
	/// Called when the combobox is clicked
	/** @param itemNumber is the index of the item selected */
	void conjugationActivated(int itemNumber);
	/// Load the verb definitions database
	void loadDatabase();
	/// Check the user's input
	void checkAnswer();
signals:
	/// Signal that is emitted when the widget wishes to terminate
	void exited();
	void statusMsg(const QString&);
private:
	/// These are structs containing information required to generate a question
	struct fileparts verbparts;
	struct questionparts question;
	/// String array for the various verbs
	QString m_verb[36];
	QString m_currentVerb;
	/// Number to reference the verb form given
	int m_verbNumber;
	/// Total number of wrong answers given
	int m_numWrong;
	/// Total number of answers given
	int m_total;
	/// Total number of correct answers given
	int m_totalCorrect;
};

#endif // KLATINVERBS_H