~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/frontend/cprofilewindow.h

  • Committer: mgruner
  • Date: 2007-05-08 15:51:07 UTC
  • Revision ID: vcs-imports@canonical.com-20070508155107-0rj7jdmm5ivf8685
-imported source and data files to new svn module
-this is where KDE4-based development will take place

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2006 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
 
9
 
 
10
 
 
11
 
 
12
#ifndef CPROFILEWINDOW_H
 
13
#define CPROFILEWINDOW_H
 
14
 
 
15
#include "backend/cswordmoduleinfo.h"
 
16
#include "backend/cswordbackend.h"
 
17
 
 
18
//Qt includes
 
19
#include <qstring.h>
 
20
#include <qrect.h>
 
21
#include <qstringlist.h>
 
22
#include <qptrlist.h>
 
23
 
 
24
namespace Profile {
 
25
 
 
26
/** Contains the settings for one window saved in the profile.
 
27
  * @author The BibleTime team
 
28
  */
 
29
class CProfileWindow {
 
30
public:
 
31
        struct ScrollbarPos {
 
32
                int horizontal;  //the position of the horizontal scrollbar
 
33
                int vertical; //the position of the vertical scrollbar
 
34
        };
 
35
 
 
36
        CProfileWindow(CSwordModuleInfo::ModuleType type = CSwordModuleInfo::Unknown);
 
37
        ~CProfileWindow();
 
38
        /**
 
39
        * Sets the modules.
 
40
        */
 
41
        void setModules( const QStringList& modules );
 
42
        /**
 
43
        * Returns the type of the managed window (bible window, commentary window or lexicon window).
 
44
        */
 
45
        const CSwordModuleInfo::ModuleType type() const;
 
46
        /**
 
47
        * Sets the type of the used modules.
 
48
        */
 
49
        void setType(const CSwordModuleInfo::ModuleType& type);
 
50
        /**
 
51
        * Sets the size of the window.
 
52
        */
 
53
        void setGeometry( const QRect& s );
 
54
        /**
 
55
        * Returns the size of the window including the x,y coordinates.
 
56
        */
 
57
        const QRect& geometry() const;
 
58
        /**
 
59
        * Returns a list of module names which are chosen in the managed window profile.
 
60
        */
 
61
        const QStringList& modules() const;
 
62
        /**
 
63
        * Set the key used in the modules.
 
64
        */
 
65
        void setKey( const QString& );
 
66
        /**
 
67
        * Returns the current key set in the modules.
 
68
        */
 
69
        const QString& key() const;
 
70
        /**
 
71
        * Sets the current position of the scrollbars.
 
72
        */
 
73
        void setScrollbarPositions(const int& x, const int& y);
 
74
        /**
 
75
        * Sets the windows maximized state to true or false.
 
76
        */
 
77
        void setMaximized( const bool& maximized );
 
78
        /**
 
79
        * Sets the windows hasFocus state to true or false.
 
80
        */
 
81
        void setFocus( const bool& hasFocus );
 
82
        /**
 
83
        * Sets the window specific settings.
 
84
        */
 
85
        void setWindowSettings( const int& settings );
 
86
        /**
 
87
        * Returns an integer with the window specific settings
 
88
        */
 
89
        const int& windowSettings() const;
 
90
        /**
 
91
        * Returns true if the window is maximized.
 
92
        */
 
93
        const bool& maximized() const;
 
94
        /**
 
95
        * Returns true if the window has the focus in the MDI area.
 
96
        */
 
97
        const bool& hasFocus() const;
 
98
        /**
 
99
        * Returns tghe position of the scrollbars
 
100
        */
 
101
        const CProfileWindow::ScrollbarPos& scrollbarPositions() const;
 
102
        /**
 
103
        * Returns whether this profile window represents a write window.
 
104
        */
 
105
        const int& writeWindowType() const;
 
106
        /**
 
107
        * Tells this profile window to represent a write window.
 
108
        */
 
109
        void setWriteWindowType( const int& writeWindowType );
 
110
 
 
111
private:
 
112
        CSwordModuleInfo::ModuleType m_type;
 
113
        QRect m_windowGeometry;
 
114
        QStringList m_moduleList;
 
115
        QString m_key;
 
116
        ScrollbarPos m_scrollbarPos;
 
117
        bool m_maximized;
 
118
        bool m_hasFocus;
 
119
        int m_windowSettings;
 
120
        int m_writeWindowType;
 
121
};
 
122
 
 
123
} //end of namespace Profile
 
124
 
 
125
#endif
 
126