summaryrefslogtreecommitdiff
path: root/bibletime/frontend/cinfodisplay.h
blob: 789aab1437fe7147cd6ae6aeb2720e6ddfe4540f (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
//
// C++ Interface: cinfodisplay
//
// Description:
//
//
// Author: The BibleTime team <info@bibletime.info>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//

#ifndef CINFODISPLAY_H
#define CINFODISPLAY_H

//Backend
#include "backend/ctextrendering.h"

//Qt includes
#include <qwidget.h>
#include <qvaluelist.h>
#include <qpair.h>

//class forward declarations
class CReadDisplay;

namespace InfoDisplay {

	/**
	@author The BibleTime team
	*/
class CInfoDisplay : public QWidget {
		Q_OBJECT
public:
		enum InfoType {
			Abbreviation,
			CrossReference,
			Footnote,
			Lemma,
			Morph,
			WordTranslation,
			WordGloss
		};

		typedef QPair<InfoType, QString> InfoData;
		typedef QValueList<InfoData> ListInfoData;

		CInfoDisplay(QWidget *parent = 0, const char *name = 0);
		virtual ~CInfoDisplay();

		void setInfo(const InfoType, const QString& data);
		void setInfo(const ListInfoData&);
		void clearInfo();

protected:
		const QString decodeAbbreviation( const QString& data );
		const QString decodeCrossReference( const QString& data );
		const QString decodeFootnote( const QString& data );
		const QString decodeStrongs( const QString& data );
		const QString decodeMorph( const QString& data );
		const QString getWordTranslation( const QString& data );

protected slots:
		void lookup(const QString &, const QString &);

private:
		CReadDisplay* m_htmlPart;
	};

} //end of InfoDisplay namespace

#endif