~ubuntu-branches/ubuntu/trusty/kvirc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/kvilib/irc/KviIdentityProfileSet.h

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch, Kai Wasserbäch, Raúl Sánchez Siles
  • Date: 2011-02-12 10:40:21 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110212104021-5mh4f75jlku20mnt
The combined "Twisted Experiment" and "Nocturnal Raid" release.

[ Kai Wasserbäch ]
* Synced to upstream's SVN revision 5467.
* debian/rules:
  - Added .PHONY line.
  - Resurrect -DMANUAL_REVISION, got lost somewhere and we build SVN
    revisions again.
  - Replace "-DWITH_NO_EMBEDDED_CODE=YES" with "-DWANT_CRYPTOPP=YES".
  - Change the remaining -DWITH/-DWITHOUT to the new -DWANT syntax.
* debian/control:
  - Removed DMUA, I'm a DD now.
  - Changed my e-mail address.
  - Removed unneeded relationships (no upgrades over two releases are
    supported).
  - Fix Suggests for kvirc-dbg.
  - kvirc-data: Make the "Suggests: kvirc" a Recommends, doesn't make much
    sense to install the -data package without the program.
* debian/source/local-options: Added with "unapply-patches".
* debian/kvirc.lintian-overrides: Updated to work for 4.1.1.
* debian/patches/21_make_shared-mime-info_B-D_superfluous.patch: Updated.
* debian/kvirc-data.install: Added .notifyrc.

[ Raúl Sánchez Siles ]
* Stating the right version where kvirc-data break and replace should happen.
* Fixing link to license file.
* Added French and Portuguese man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _KVI_IDENTITY_PROFILE_SET_H_
 
2
#define _KVI_IDENTITY_PROFILE_SET_H_
 
3
//=============================================================================
 
4
//
 
5
//   File : KviIdentityProfileSet.h
 
6
//   Creation date : Thu Dec 30 2010 15:54:48 by Elvio Basello
 
7
//
 
8
//   This file is part of the KVIrc irc client distribution
 
9
//   Copyright (C) 2010 Elvio Basello (hellvis69 at netsons dot org)
 
10
//
 
11
//   This program is FREE software. You can redistribute it and/or
 
12
//   modify it under the terms of the GNU General Public License
 
13
//   as published by the Free Software Foundation; either version 2
 
14
//   of the License, or (at your opinion) any later version.
 
15
//
 
16
//   This program is distributed in the HOPE that it will be USEFUL,
 
17
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
19
//   See the GNU General Public License for more details.
 
20
//
 
21
//   You should have received a copy of the GNU General Public License
 
22
//   along with this program. If not, write to the Free Software Foundation,
 
23
//   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
24
//
 
25
//=============================================================================
 
26
 
 
27
/**
 
28
* \file KviIdentityProfileSet.h
 
29
* \author Elvio Basello
 
30
* \brief Identity profiles handling
 
31
*/
 
32
 
 
33
#include "kvi_settings.h"
 
34
#include "KviHeapObject.h"
 
35
#include "KviPointerList.h"
 
36
#include "KviIdentityProfile.h"
 
37
 
 
38
class KviConfigurationFile;
 
39
 
 
40
/**
 
41
* \class KviIdentityProfileSet
 
42
* \brief Class which manages the list of identity profiles
 
43
*/
 
44
class KVILIB_API KviIdentityProfileSet : public KviHeapObject
 
45
{
 
46
public:
 
47
        /**
 
48
        * \brief Constructs the identity profile set object
 
49
        * \return KviIdentityProfileSet
 
50
        */
 
51
        KviIdentityProfileSet();
 
52
 
 
53
        /**
 
54
        * \brief Constructs the identity profile set object
 
55
        *
 
56
        * This is a carbon copy.
 
57
        * \param set A profile set to copy from
 
58
        * \return KviIdentityProfileSet
 
59
        */
 
60
        KviIdentityProfileSet(const KviIdentityProfileSet & set);
 
61
 
 
62
        /**
 
63
        * \brief Destroys the identity profile set object
 
64
        */
 
65
        ~KviIdentityProfileSet();
 
66
private:
 
67
        static KviIdentityProfileSet * m_pSelf;
 
68
        static unsigned int            m_uCount;
 
69
protected:
 
70
        KviPointerList<KviIdentityProfile> * m_pProfiles;
 
71
        bool                                 m_bEnabled;
 
72
public:
 
73
        /**
 
74
        * \brief Initializes the class instance
 
75
        * \return void
 
76
        */
 
77
        static void init();
 
78
 
 
79
        /**
 
80
        * \brief Destroys the class instance
 
81
        * \return void
 
82
        */
 
83
        static void done();
 
84
 
 
85
        /**
 
86
        * \brief Returns the instance of the class
 
87
        * \return KviIdentityProfileSet *
 
88
        */
 
89
        static inline KviIdentityProfileSet * instance(){ return m_pSelf; };
 
90
 
 
91
        /**
 
92
        * \brief Returns the number of instances of the class
 
93
        * \return unsigned int
 
94
        */
 
95
        unsigned int count(){ return m_uCount; };
 
96
 
 
97
        /**
 
98
        * \brief Returns the profiles set
 
99
        * \return KviPointerList<KviIdentityProfile> *
 
100
        */
 
101
        KviPointerList<KviIdentityProfile> * profiles(){ return m_pProfiles; };
 
102
 
 
103
        /**
 
104
        * \brief Searches for a profile name. Returns true if the profile exists
 
105
        * \param szName The name of the profile
 
106
        * \return KviIdentityProfile *
 
107
        */
 
108
        KviIdentityProfile * findName(const QString & szName);
 
109
 
 
110
        /**
 
111
        * \brief Searches for a profile network. Returns true if the profile exists
 
112
        * \param szNetwork The network name of the profile
 
113
        * \return KviIdentityProfile *
 
114
        */
 
115
        KviIdentityProfile * findNetwork(const QString & szNetwork);
 
116
 
 
117
        /**
 
118
        * \brief Clears the list
 
119
        * \return void
 
120
        */
 
121
        void clear();
 
122
 
 
123
        /**
 
124
        * \brief Returns true if the profile set is empty
 
125
        * \return bool
 
126
        */
 
127
        bool isEmpty(){ return m_pProfiles ? m_pProfiles->isEmpty() : true; };
 
128
 
 
129
        /**
 
130
        * \brief Returns true if the profile set is enabled
 
131
        * \return bool
 
132
        */
 
133
        bool isEnabled(){ return m_bEnabled; };
 
134
 
 
135
        /**
 
136
        * \brief Enables the profile set
 
137
        * \param bEnabled Whether to enable the profile set
 
138
        * \return void
 
139
        */
 
140
        void setEnabled(bool bEnabled){ m_bEnabled = bEnabled; };
 
141
 
 
142
        /**
 
143
        * \brief Carbon copy
 
144
        * \param src The source profile set
 
145
        * \return void
 
146
        */
 
147
        void copyFrom(const KviIdentityProfileSet & src);
 
148
 
 
149
        /**
 
150
        * \brief Adds a profile to the set
 
151
        * \param pProfile The source profile to add
 
152
        * \return void
 
153
        */
 
154
        void addProfile(KviIdentityProfile * pProfile);
 
155
 
 
156
        /**
 
157
        * \brief Loads the configuration of the profiles from file
 
158
        * \param szConfigFile The file where to load
 
159
        * \return void
 
160
        */
 
161
        void load(const QString & szConfigFile);
 
162
 
 
163
        /**
 
164
        * \brief Saves the configuration of the profiles to file
 
165
        * \param szConfigFile The file to save
 
166
        * \return void
 
167
        */
 
168
        void save(const QString & szConfigFile);
 
169
 
 
170
        /**
 
171
        * \brief Saves the configuration of the profiles
 
172
        * \param pCfg The configuration file
 
173
        * \param szPrefix The prefix of the rules
 
174
        * \return void
 
175
        */
 
176
        void save(KviConfigurationFile * pCfg, const QString & szPrefix);
 
177
protected:
 
178
        /**
 
179
        * \brief Loads the configuration of the profiles from file
 
180
        * \param pCfg The configuration file
 
181
        * \param szPrefix The prefix of the rules
 
182
        * \param uEntries The number of entries
 
183
        * \return bool
 
184
        */
 
185
        bool loadPrivate(KviConfigurationFile * pCfg, const QString & szPrefix, unsigned int uEntries);
 
186
};
 
187
 
 
188
#endif // _KVI_IDENTITY_PROFILE_SET_H_