map.h 2.69 KB
Newer Older
Albert Astals Cid's avatar
Albert Astals Cid committed
1
/***************************************************************************
2
 *   Copyright (C) 2004-2007 by Albert Astals Cid                          *
Albert Astals Cid's avatar
Albert Astals Cid committed
3
 *   aacid@kde.org                                                         *
Albert Astals Cid's avatar
Albert Astals Cid committed
4
5
6
7
8
9
10
11
12
13
 *                                                                         *
 *   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 MAP_H
#define MAP_H

14
15
#include <klocalizedstring.h>

Albert Astals Cid's avatar
Albert Astals Cid committed
16
17
18
#include <qcolor.h>
#include <qmap.h>

19
#include "division.h"
Albert Astals Cid's avatar
Albert Astals Cid committed
20

Albert Astals Cid's avatar
Albert Astals Cid committed
21
class KGmap
Albert Astals Cid's avatar
Albert Astals Cid committed
22
23
{
	public:
Albert Astals Cid's avatar
Albert Astals Cid committed
24
25
		KGmap();
		~KGmap();
Albert Astals Cid's avatar
Albert Astals Cid committed
26
27
28
29
		
		bool addDivision(division *d);
		
		void setFile(const QString &s);
Albert Astals Cid's avatar
Albert Astals Cid committed
30
		bool setMapFile(const QString &s);
Albert Astals Cid's avatar
Albert Astals Cid committed
31
		void setName(const QString &s);
Albert Astals Cid's avatar
Albert Astals Cid committed
32
		void setDivisionsString(const QString &s);
33
		void setAuthor(const QString &s);
34
35
36
37
		void setCapitalToDivisionQuestionPattern(const QString &str);
		void setDivisionToCapitalQuestionPattern(const QString &str);
		void setCapitalToDivisionTitle(const QString &str);
		void setDivisionToCapitalTitle(const QString &str);
Albert Astals Cid's avatar
Albert Astals Cid committed
38
39
		
		// return the number of askable divisions
40
		uint count(division::askMode am) const;
41
42
		QString getDivisionFlagFile(const QString &divisionName) const;
		QString getDivisionCapital(const QString &divisionName) const;
43
		QStringList getDivisionFalseCapitals(const QString &divisionName) const;
44
		bool getDivisionCanAsk(const QString &div, division::askMode am) const;
Albert Astals Cid's avatar
Albert Astals Cid committed
45
		QString getFile() const;
46
		QString getFileName() const;
47
		QString getMapFile() const;
Albert Astals Cid's avatar
Albert Astals Cid committed
48
		QString getName() const;
Albert Astals Cid's avatar
Albert Astals Cid committed
49
		QString getDivisionsString() const;
50
		QString getRandomDivision(division::askMode am) const;
Albert Astals Cid's avatar
Albert Astals Cid committed
51
		QString getWhatIs(QRgb c, bool all) const;
52
		QString getAuthor() const;
Albert Astals Cid's avatar
Albert Astals Cid committed
53
		QColor getColor(const QString &s) const;
54
		QList<const division*> getIgnoredDivisions(division::askMode am) const;
Laurent G's avatar
Laurent G committed
55
		QList<const division*> getAllDivisionsOrdered() const;
56
		KLocalizedString getCapitalToDivisionQuestionPattern() const;
57
58
59
		QString getDivisionToCapitalQuestionPattern() const;
		QString getCapitalToDivisionTitle() const;
		QString getDivisionToCapitalTitle() const;
60
		division *getDivision(QRgb c) const;
61
		division *getDivision(const QString &divisionName) const;
Albert Astals Cid's avatar
Albert Astals Cid committed
62
63
		
	private:
64
		QList<division*> p_divisions;
Albert Astals Cid's avatar
Albert Astals Cid committed
65
		
66
		QString p_name, p_file, p_mapFile;
Albert Astals Cid's avatar
Albert Astals Cid committed
67
		QString p_divisionsString;
68
69
70
71
		QString p_capitalToDivisionPattern;
		QString p_divisionToCapitalPattern;
		QString p_capitalToDivisionTitle;
		QString p_divisionToCapitalTitle;
72
		QString p_author;
Albert Astals Cid's avatar
Albert Astals Cid committed
73
74
75
};

#endif