~ubuntu-branches/ubuntu/trusty/bibletime/trusty

« back to all changes in this revision

Viewing changes to src/frontend/profile/cprofilemgr.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Marsden
  • Date: 2009-11-18 17:30:00 UTC
  • mfrom: (1.3.4 upstream) (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091118173000-endkhjz5qai88tvr
Tags: 2.4-1
* New upstream version 2.4
* debian/control: 
  - Replace incorrect bibletime-data Depends on lib4qt-gui
    with bibletime Depends on libqtgui4 (>= 4.4.0). (Closes: #556209).
  - Add Build-depends: on zlib1g-dev and libcurl4-gnutls-dev 
    (Closes: #556805).

Show diffs side-by-side

added added

removed removed

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