~pkgcrosswire/bibletime/main

« back to all changes in this revision

Viewing changes to src/frontend/profile/cprofilewindow.cpp

  • Committer: Jonathan Marsden
  • Date: 2011-12-23 20:32:12 UTC
  • Revision ID: jmarsden@fastmail.fm-20111223203212-1g3e35rlhbys07iu
New upstream version 2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
#include "frontend/profile/cprofilewindow.h"
11
11
 
12
 
#include <QRect>
13
 
#include <QString>
14
 
#include <QStringList>
15
 
#include "backend/drivers/cswordmoduleinfo.h"
16
 
#include "backend/managers/cswordbackend.h"
17
 
 
18
12
 
19
13
namespace Profile {
20
14
 
21
 
CProfileWindow::CProfileWindow(CSwordModuleInfo::ModuleType type)
22
 
        : m_type(type),
23
 
        m_windowGeometry(),
24
 
        m_moduleList(),
25
 
        m_key(QString::null),
26
 
        m_maximized(false),
27
 
        m_hasFocus(false),
28
 
        m_windowSettings(0),
29
 
        m_writeWindowType(0) {
30
 
    m_scrollbarPos.horizontal = 0;
31
 
    m_scrollbarPos.vertical = 0;
32
 
}
33
 
 
34
 
CProfileWindow::~CProfileWindow() {}
35
 
 
36
 
/** Returns the size of the window including the x,y coordinates. */
37
 
const QRect& CProfileWindow::geometry() const {
38
 
    return m_windowGeometry;
39
 
}
40
 
 
41
 
/** Sets the size of the window. */
42
 
void CProfileWindow::setGeometry( const QRect& rect ) {
43
 
    m_windowGeometry = rect;
44
 
}
45
 
 
46
 
/** Returns the type of the managed window (bible window, commentary window or lexicon window). */
47
 
CSwordModuleInfo::ModuleType CProfileWindow::type() const {
48
 
    if (m_type != CSwordModuleInfo::Unknown)
49
 
        return m_type;
50
 
    return CSwordModuleInfo::Unknown;
51
 
}
52
 
 
53
 
/** Sets the modules. */
54
 
void CProfileWindow::setModules( const QStringList& modules ) {
55
 
    m_moduleList = modules; //copy module pointers into our own list
56
 
}
57
 
 
58
 
/** Returns a list of module names which are chosen in the managed window profile. */
59
 
const QStringList& CProfileWindow::modules() const {
60
 
    return m_moduleList;
61
 
}
62
 
 
63
 
/** Returns the current key set in the modules. */
64
 
const QString& CProfileWindow::key() const {
65
 
    return m_key;
66
 
}
67
 
 
68
 
/** Set the key used in the modules. */
69
 
void CProfileWindow::setKey( const QString& key ) {
70
 
    m_key = key;
71
 
}
72
 
 
73
 
/** Sets the current position of the scrollbars. */
74
 
void CProfileWindow::setScrollbarPositions(const int& horizontal, const int& vertical) {
75
 
    // m_scrollbarPos = {x,y};
76
 
    m_scrollbarPos.horizontal = horizontal;
77
 
    m_scrollbarPos.vertical = vertical;
78
 
}
79
 
 
80
 
/** Returns tghe position of the scrollbars */
81
 
const CProfileWindow::ScrollbarPos& CProfileWindow::scrollbarPositions() const {
82
 
    return m_scrollbarPos;
83
 
}
84
 
 
85
 
/** Sets the type of the used modules. */
86
 
void CProfileWindow::setType(const CSwordModuleInfo::ModuleType& type) {
87
 
    m_type = type;
88
 
}
89
 
 
90
 
/** Returns true if the window is maximized. */
91
 
const bool& CProfileWindow::maximized() const {
92
 
    return m_maximized;
93
 
}
94
 
 
95
 
/** Sets the windows maximized state to true or false. */
96
 
void CProfileWindow::setMaximized( const bool& maximized ) {
97
 
    m_maximized = maximized;
98
 
}
99
 
 
100
 
/** Returns true if the window is maximized. */
101
 
const bool& CProfileWindow::hasFocus() const {
102
 
    return m_hasFocus;
103
 
}
104
 
 
105
 
/** Sets the windows maximized state to true or false. */
106
 
void CProfileWindow::setFocus( const bool& hasFocus ) {
107
 
    m_hasFocus = hasFocus;
108
 
}
109
 
 
110
 
/** Returns an integer with the window specific settings */
111
 
const int& CProfileWindow::windowSettings() const {
112
 
    return m_windowSettings;
113
 
}
114
 
 
115
 
/** Sets the window specific settings. */
116
 
void CProfileWindow::setWindowSettings( const int& settings ) {
117
 
    m_windowSettings = settings;
118
 
}
119
 
 
120
 
/** Tells this profile window to represent a write window. */
121
 
void CProfileWindow::setWriteWindowType( const int& writeWindowType ) {
122
 
    m_writeWindowType = writeWindowType;
123
 
}
124
 
 
125
 
/** Returns whether this profile window represents a write window. */
126
 
const int& CProfileWindow::writeWindowType() const {
127
 
    return m_writeWindowType;
 
15
CProfileWindow::CProfileWindow(CSwordModuleInfo::ModuleType t)
 
16
    : type(t)
 
17
    , windowGeometry()
 
18
    , modules()
 
19
    , key(QString::null)
 
20
    , scrollbarPosH(0)
 
21
    , scrollbarPosV(0)
 
22
    , maximized(false)
 
23
    , hasFocus(false)
 
24
    , windowSettings(0)
 
25
    , writeWindowType(0)
 
26
{
 
27
    // Intentionally empty
128
28
}
129
29
 
130
30
} //end of namespace Profile