summaryrefslogtreecommitdiff
path: root/src/frontend/profile/cprofilewindow.h
blob: 4b3a7004068272b7c24ba4b7988692e94f8ee7e9 (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
126
/*********
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2008 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/



#ifndef CPROFILEWINDOW_H
#define CPROFILEWINDOW_H

class CSwordModuleInfo;
#include "backend/managers/cswordbackend.h"

//Qt includes
#include <QString>
#include <QRect>
#include <QStringList>
//#include <QList>

namespace Profile {

/** Contains the settings for one window saved in the profile.
  * @author The BibleTime team
  */
class CProfileWindow {
    public:
        struct ScrollbarPos {
            int horizontal;  //the position of the horizontal scrollbar
            int vertical; //the position of the vertical scrollbar
        };

        CProfileWindow(CSwordModuleInfo::ModuleType type = CSwordModuleInfo::Unknown);
        ~CProfileWindow();
        /**
        * Sets the modules.
        */
        void setModules( const QStringList& modules );
        /**
        * Returns the type of the managed window (bible window, commentary window or lexicon window).
        */
        CSwordModuleInfo::ModuleType type() const;
        /**
        * Sets the type of the used modules.
        */
        void setType(const CSwordModuleInfo::ModuleType& type);
        /**
        * Sets the size of the window.
        */
        void setGeometry( const QRect& s );
        /**
        * Returns the size of the window including the x,y coordinates.
        */
        const QRect& geometry() const;
        /**
        * Returns a list of module names which are chosen in the managed window profile.
        */
        const QStringList& modules() const;
        /**
        * Set the key used in the modules.
        */
        void setKey( const QString& );
        /**
        * Returns the current key set in the modules.
        */
        const QString& key() const;
        /**
        * Sets the current position of the scrollbars.
        */
        void setScrollbarPositions(const int& x, const int& y);
        /**
        * Sets the windows maximized state to true or false.
        */
        void setMaximized( const bool& maximized );
        /**
        * Sets the windows hasFocus state to true or false.
        */
        void setFocus( const bool& hasFocus );
        /**
        * Sets the window specific settings.
        */
        void setWindowSettings( const int& settings );
        /**
        * Returns an integer with the window specific settings
        */
        const int& windowSettings() const;
        /**
        * Returns true if the window is maximized.
        */
        const bool& maximized() const;
        /**
        * Returns true if the window has the focus in the MDI area.
        */
        const bool& hasFocus() const;
        /**
        * Returns tghe position of the scrollbars
        */
        const CProfileWindow::ScrollbarPos& scrollbarPositions() const;
        /**
        * Returns whether this profile window represents a write window.
        */
        const int& writeWindowType() const;
        /**
        * Tells this profile window to represent a write window.
        */
        void setWriteWindowType( const int& writeWindowType );

    private:
        CSwordModuleInfo::ModuleType m_type;
        QRect m_windowGeometry;
        QStringList m_moduleList;
        QString m_key;
        ScrollbarPos m_scrollbarPos;
        bool m_maximized;
        bool m_hasFocus;
        int m_windowSettings;
        int m_writeWindowType;
};

} //end of namespace Profile

#endif