~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/frontend/cprofilemgr.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 CPROFILEMGR_H
 
13
#define CPROFILEMGR_H
 
14
 
 
15
#include "cprofile.h"
 
16
 
 
17
//Qt includes
 
18
#include <qstring.h>
 
19
 
 
20
namespace Profile {
 
21
/** The manager for profiles.
 
22
 * Provides functions to create, delete, save and load profiles.
 
23
 * @author The BibleTime team
 
24
 */
 
25
class CProfileMgr {
 
26
public:
 
27
        CProfileMgr();
 
28
        ~CProfileMgr();
 
29
 
 
30
        /** Creates a new profile with the name "name" (first parameter).
 
31
        * @return The profile object
 
32
        */
 
33
        CProfile* create( const QString name );
 
34
        /**
 
35
        * @return a list of available profiles
 
36
        */
 
37
        const QPtrList<CProfile>& profiles();
 
38
        /**
 
39
        * Removes the profile from the list and from the directory containg the profile files.
 
40
        */
 
41
        const bool remove
 
42
                ( CProfile* p );
 
43
        /**
 
44
        * Removes the profile from the list and from the directory containg the profile files.
 
45
        */
 
46
        const bool remove
 
47
                ( const QString& );
 
48
        /**
 
49
        * Returns the profile with the desired name. If there's no such profile 0 is returned.
 
50
        */
 
51
        CProfile* profile(const QString&);
 
52
        /**
 
53
        * Returns the startup profile if it exists, otherwise return 0.
 
54
        */
 
55
        CProfile* startupProfile();
 
56
        /**
 
57
        * Refreshes the profiles available on disk. Use this function to update the list of profiles after another instance of CProfileMgr created a new profile.
 
58
        */
 
59
        void refresh();
 
60
 
 
61
protected:
 
62
        QPtrList<CProfile> m_profiles;
 
63
        QString m_profilePath;
 
64
        CProfile* m_startupProfile;
 
65
};
 
66
 
 
67
} //end of namespace Profile
 
68
 
 
69
#endif