summaryrefslogtreecommitdiffstats
path: root/bibletime/frontend/cprofilewindow.cpp
blob: fbaf4de3f9afe90d9f4b2a4e0328b870873258e8 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*********
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2006 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/



#include "cprofilewindow.h"

namespace Profile {

CProfileWindow::CProfileWindow(CSwordModuleInfo::ModuleType type)
: m_type(type),
m_windowGeometry(),
m_moduleList(),
m_key(TQString::null),
m_maximized(false),
m_hasFocus(false),
m_windowSettings(0),
m_writeWindowType(0) {
	m_scrollbarPos.horizontal = 0;
	m_scrollbarPos.vertical = 0;
}

CProfileWindow::~CProfileWindow() {}

/** Returns the size of the window including the x,y coordinates. */
const TQRect& CProfileWindow::geometry() const {
	return m_windowGeometry;
}

/** Sets the size of the window. */
void CProfileWindow::setGeometry( const TQRect& rect ) {
	m_windowGeometry = rect;
}

/** Returns the type of the managed window (bible window, commentary window or lexicon window). */
const CSwordModuleInfo::ModuleType CProfileWindow::type() const {
	if (m_type != CSwordModuleInfo::Unknown)
	return m_type;
	return CSwordModuleInfo::Unknown;
}

/** Sets the modules. */
void CProfileWindow::setModules( const TQStringList& modules ) {
	m_moduleList = modules; //copy module pointers into our own list
}

/** Returns a list of module names which are chosen in the managed window profile. */
const TQStringList& CProfileWindow::modules() const {
	return m_moduleList;
}

/** Returns the current key set in the modules. */
const TQString& CProfileWindow::key() const {
	return m_key;
}

/** Set the key used in the modules. */
void CProfileWindow::setKey( const TQString& key ) {
	m_key = key;
}

/** Sets the current position of the scrollbars. */
void CProfileWindow::setScrollbarPositions(const int& horizontal, const int& vertical) {
	// m_scrollbarPos = {x,y};
	m_scrollbarPos.horizontal = horizontal;
	m_scrollbarPos.vertical = vertical;
}

/** Returns tghe position of the scrollbars */
const CProfileWindow::ScrollbarPos& CProfileWindow::scrollbarPositions() const {
	return m_scrollbarPos;
}

/** Sets the type of the used modules. */
void CProfileWindow::setType(const CSwordModuleInfo::ModuleType& type) {
	m_type = type;
}

/** Returns true if the window is maximized. */
const bool& CProfileWindow::maximized() const {
	return m_maximized;
}

/** Sets the windows maximized state to true or false. */
void CProfileWindow::setMaximized( const bool& maximized ) {
	m_maximized = maximized;
}

/** Returns true if the window is maximized. */
const bool& CProfileWindow::hasFocus() const {
	return m_hasFocus;
}

/** Sets the windows maximized state to true or false. */
void CProfileWindow::setFocus( const bool& hasFocus ) {
	m_hasFocus = hasFocus;
}

/** Returns an integer with the window specific settings */
const int& CProfileWindow::windowSettings() const {
	return m_windowSettings;
}

/** Sets the window specific settings. */
void CProfileWindow::setWindowSettings( const int& settings ) {
	m_windowSettings = settings;
}

/** Tells this profile window to represent a write window. */
void CProfileWindow::setWriteWindowType( const int& writeWindowType ) {
	m_writeWindowType = writeWindowType;
}

/** Returns whether this profile window represents a write window. */
const int& CProfileWindow::writeWindowType() const {
	return m_writeWindowType;
}

} //end of namespace Profile