1 | /*
|
---|
2 | * profiles.h - deal with profiles
|
---|
3 | * Copyright (C) 2001-2003 Justin Karneges
|
---|
4 | *
|
---|
5 | * This program is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU General Public License
|
---|
7 | * as published by the Free Software Foundation; either version 2
|
---|
8 | * of the License, or (at your option) any later version.
|
---|
9 | *
|
---|
10 | * This program is distributed in the hope that it will be useful,
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | * GNU General Public License for more details.
|
---|
14 | *
|
---|
15 | * You should have received a copy of the GNU General Public License
|
---|
16 | * along with this library; if not, write to the Free Software
|
---|
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
18 | *
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef PROFILES_H
|
---|
22 | #define PROFILES_H
|
---|
23 |
|
---|
24 | #include<qstring.h>
|
---|
25 | #include<qstringlist.h>
|
---|
26 | #include<qvaluelist.h>
|
---|
27 | #include"im.h"
|
---|
28 | #include"proxy.h"
|
---|
29 | #include"common.h"
|
---|
30 |
|
---|
31 | class UserAccount
|
---|
32 | {
|
---|
33 | public:
|
---|
34 | UserAccount();
|
---|
35 | ~UserAccount();
|
---|
36 |
|
---|
37 | void reset();
|
---|
38 |
|
---|
39 | QDomElement toXml(QDomDocument &, const QString &tagName);
|
---|
40 | void fromXml(const QDomElement &);
|
---|
41 |
|
---|
42 | QString name;
|
---|
43 | QString jid, pass, host, resource;
|
---|
44 | int port, priority;
|
---|
45 | bool opt_enabled, opt_ssl, opt_pass, opt_host, opt_auto, opt_keepAlive, opt_plain, opt_log, opt_reconn, opt_ignoreSSLWarnings;
|
---|
46 | bool tog_offline, tog_away, tog_agents, tog_hidden, tog_self;
|
---|
47 |
|
---|
48 | int proxy_index;
|
---|
49 | int proxy_type, proxy_port;
|
---|
50 | QString proxy_host, proxy_user, proxy_pass;
|
---|
51 |
|
---|
52 | QString olr_string;
|
---|
53 | XMPP::Roster roster;
|
---|
54 |
|
---|
55 | struct GroupData {
|
---|
56 | bool open;
|
---|
57 | int rank;
|
---|
58 | };
|
---|
59 | QMap<QString, GroupData> groupState;
|
---|
60 |
|
---|
61 | QString pgpSecretKeyID;
|
---|
62 |
|
---|
63 | VarList keybind;
|
---|
64 |
|
---|
65 | XMPP::Jid dtProxy;
|
---|
66 | };
|
---|
67 |
|
---|
68 | typedef QValueList<UserAccount> UserAccountList;
|
---|
69 |
|
---|
70 |
|
---|
71 | class UserProfile
|
---|
72 | {
|
---|
73 | public:
|
---|
74 | UserProfile();
|
---|
75 |
|
---|
76 | void reset();
|
---|
77 | bool toFile(const QString &);
|
---|
78 | bool fromFile(const QString &);
|
---|
79 |
|
---|
80 | QString progver;
|
---|
81 | UserAccountList acc;
|
---|
82 | Options prefs;
|
---|
83 |
|
---|
84 | QRect mwgeom;
|
---|
85 | QStringList recentGCList;
|
---|
86 | QStringList recentBrowseList;
|
---|
87 | QString lastStatusString;
|
---|
88 | bool useSound;
|
---|
89 |
|
---|
90 | ProxyItemList proxyList;
|
---|
91 | };
|
---|
92 |
|
---|
93 | QString pathToProfile(const QString &);
|
---|
94 | QString pathToProfileConfig(const QString &);
|
---|
95 | QStringList getProfilesList();
|
---|
96 | bool profileExists(const QString &);
|
---|
97 | bool profileNew(const QString &);
|
---|
98 | bool profileRename(const QString &, const QString &);
|
---|
99 | bool profileDelete(const QString &);
|
---|
100 |
|
---|
101 | #endif
|
---|