~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/frontend/cprofile.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 CPROFILE_H
 
13
#define CPROFILE_H
 
14
 
 
15
#include "cprofilewindow.h"
 
16
 
 
17
//Qt includes
 
18
#include <qptrlist.h>
 
19
 
 
20
namespace Profile {
 
21
 
 
22
/** Manages one profile file. Provides functions to save and restore settings of the available display windows.
 
23
  * @author The BibleTime team
 
24
  */
 
25
class CProfile {
 
26
public:
 
27
        CProfile(const QString& fileName, const QString& name = QString::null);
 
28
        ~CProfile();
 
29
 
 
30
        /**
 
31
        * Saves the profile to the file given in the constructor.
 
32
        * @param windows The list of windows available in the profile.
 
33
        */
 
34
        const bool save( QPtrList<CProfileWindow> windows );
 
35
        /**
 
36
        * Saves the profile to the file given in the constructor.
 
37
        */
 
38
        const bool save();
 
39
        /**
 
40
        * Loads the profile from the file given in the constructor.
 
41
        * @return The list of profiled window which exist in the profile.
 
42
        */
 
43
        QPtrList<CProfileWindow> load();
 
44
        /**
 
45
        * Returns the name of this profile.
 
46
        */
 
47
        const QString& name();
 
48
        /**
 
49
        * Returns the filename used for this profile.
 
50
        */
 
51
        const QString& filename();
 
52
        /**
 
53
        * Initializes the XML for the first time (use to create a new profile)
 
54
        */
 
55
        void init(const QString);
 
56
        /**
 
57
        * Chnages the name of this profile.
 
58
        */
 
59
        void setName( const QString& );
 
60
        /**
 
61
        * Returns true if the main window was in fullscreen mode as the profile was saved.
 
62
        */
 
63
        const bool fullscreen() const;
 
64
        /**
 
65
        * Set the parameter to true if the main window coveres the full screen size.
 
66
        */
 
67
        void setFullscreen( const bool fullscreen );
 
68
        /**
 
69
        * Returns true if the main window was maximized as the profile was saved.
 
70
        */
 
71
        const bool maximized() const;
 
72
        /**
 
73
        * Set the parameter to true if the main window is maximized.
 
74
        */
 
75
        void setMaximized( const bool maximized );
 
76
        /**
 
77
        * Sets the geoemtry of the main window
 
78
        */
 
79
        void setGeometry( const QRect rect );
 
80
        /**
 
81
        * Returns the geometry of the main window
 
82
        */
 
83
        const QRect geometry();
 
84
 
 
85
private:
 
86
        /**
 
87
        * Loads the basic settings requires for proper operation.
 
88
        */
 
89
        void loadBasics();
 
90
        void saveBasics();
 
91
 
 
92
        QPtrList<CProfileWindow> m_profileWindows;
 
93
        QString m_name;
 
94
        QString m_filename;
 
95
        bool m_fullscreen;
 
96
        bool m_maximized;
 
97
        QRect m_geometry;
 
98
};
 
99
 
 
100
} //end of namespace Profile
 
101
 
 
102
#endif