summaryrefslogtreecommitdiffstats
path: root/kanagram/src/leitnersystem.h
blob: 87e583d9fc6e591dccd9dda729f986ab005f20d0 (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
//
// C++ Interface: leitnersystem
//
// Description: 
//
//
// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

#include <qstring.h>
#include <qstringlist.h>
#include <qvaluelist.h>
#include "leitnerbox.h"

#ifndef LEITNERSYSTEM_H
#define LEITNERSYSTEM_H


/**
@author Martin Pfeiffer
*/
class LeitnerSystem
{
public:
	LeitnerSystem();
	LeitnerSystem( QValueList<LeitnerBox>& boxes, QString name );

	~LeitnerSystem();

	int getNumberOfBoxes();				//returns the number of boxes in the system
	QStringList getBoxNameList();			//returns a list with the boxes names

	QString& getSystemName();			//returns the systems name
	void setSystemName( const QString& name );		//sets the systems name

	LeitnerBox* getBoxWithNumber( int number );	//returns box by number
	LeitnerBox* getBoxWithName( const QString& name );//returns box by name
	int getNumber( LeitnerBox* box );
	const QString& getBox( int i );
	
	const QString& getNextBox( QString& previousBox );	//returns the next box for the next question
	
	const QString& getCorrectBox( int box );	//returns the correct word box of "int box"
	const QString& getWrongBox( int box );		//returns the wrong word box of "int box"
	int getWrongBoxNumber( int box );
	int getCorrectBoxNumber( int box );
	void setCorrectBox( const QString& box, const QString& correctWordBox );
	void setWrongBox( const QString& box, const QString& wrongWordBox );
	bool setBoxName( int box, const QString& name );
	bool setBoxName( LeitnerBox* box, const QString& name );
	
	//inserts a box with number, name, correct and wrong word box
	bool insertBox( const QString& name, int correctWordBox, int wrongWordBox );
	bool insertBox( const QString& name );
	void deleteBox( int box );
	void deleteBox( LeitnerBox* box );

private:
	QString m_systemName;				//the systems name

	QValueList<LeitnerBox> m_boxes;
};

#endif