source: psi/vendor/affinix/current/src/accountdlg.h@ 2

Last change on this file since 2 was 2, checked in by dmik, 19 years ago

Imported original Psi 0.10 sources from Affinix

File size: 4.2 KB
Line 
1/*
2 * accountdlg.h - dialogs for manipulating PsiAccounts
3 * Copyright (C) 2001, 2002 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 ACCOUNTDLG_H
22#define ACCOUNTDLG_H
23
24#include<qca.h>
25#include"ui_accountmanage.h"
26#include"ui_accountadd.h"
27#include"ui_accountreg.h"
28#include"ui_accountremove.h"
29#include"ui_accountmodify.h"
30#include"ui_pgpkey.h"
31#include"xmpp.h"
32#include"openpgp.h"
33
34namespace XMPP
35{
36 class Jid;
37 class Client;
38}
39
40using namespace XMPP;
41
42class PsiCon;
43class PsiAccount;
44class QListViewItem;
45class UserAccount;
46class ProxyManager;
47class ProxyChooser;
48
49namespace QCA
50{
51 class Cert;
52}
53
54class MiniClient : public QObject
55{
56 Q_OBJECT
57public:
58 MiniClient(QObject *parent=0);
59 ~MiniClient();
60
61 void reset();
62 void connectToServer(const Jid &j, bool ssl, const QString &host, int port, ProxyManager *pm, int proxy, QString *pass);
63 void close();
64 Client *client();
65
66signals:
67 void handshaken();
68 void error();
69
70private slots:
71 void tls_handshaken();
72 void cs_connected();
73 void cs_securityLayerActivated(int);
74 void cs_needAuthParams(bool, bool, bool);
75 void cs_authenticated();
76 void cs_connectionClosed();
77 void cs_delayedCloseFinished();
78 void cs_warning(int);
79 void cs_error(int);
80
81private:
82 AdvancedConnector *conn;
83 ClientStream *stream;
84 QCA::TLS *tls;
85 QCATLSHandler *tlsHandler;
86 QPtrList<QCA::Cert> certList;
87 Client *_client;
88 Jid j;
89 QString pass;
90};
91
92class AccountManageDlg : public AccountManageUI
93{
94 Q_OBJECT
95public:
96 AccountManageDlg(PsiCon *, const char *name=0);
97 ~AccountManageDlg();
98
99private slots:
100 void qlv_selectionChanged(QListViewItem *);
101 void add();
102 void modify();
103 void modify(QListViewItem *);
104 void remove();
105 void accountAdded(PsiAccount *);
106 void accountUpdated(PsiAccount *);
107 void accountRemoved(PsiAccount *);
108
109private:
110 PsiCon *psi;
111};
112
113class AccountAddDlg : public AccountAddUI
114{
115 Q_OBJECT
116public:
117 AccountAddDlg(PsiCon *, QWidget *parent=0, const char *name=0);
118 ~AccountAddDlg();
119
120private slots:
121 void add();
122 void setAddButton(const QString &);
123
124private:
125 PsiCon *psi;
126};
127
128class AccountModifyDlg : public AccountModifyUI
129{
130 Q_OBJECT
131public:
132 AccountModifyDlg(PsiAccount *, QWidget *parent=0, const char *name=0);
133 ~AccountModifyDlg();
134
135 void setPassword(const QString &);
136
137private slots:
138 void sslToggled(bool);
139 void hostToggled(bool);
140
141 void detailsVCard();
142 void detailsChangePW();
143
144 void save();
145
146 void pgpToggled(bool);
147 void chooseKey();
148 void clearKey();
149
150private:
151 PsiAccount *pa;
152 ProxyChooser *pc;
153 QString keyID;
154
155 void updateUserID();
156 void setKeyID(bool b, const QString &s="");
157};
158
159class AccountRegDlg : public AccountRegUI
160{
161 Q_OBJECT
162public:
163 AccountRegDlg(ProxyManager *, QWidget *parent=0, const char *name=0);
164 ~AccountRegDlg();
165
166 Jid jid;
167 QString sp_host, pass;
168 int sp_port;
169 bool ssl, opt_host;
170 int proxy;
171
172protected:
173 // reimplemented
174 //void closeEvent(QCloseEvent *);
175
176public slots:
177 void done(int);
178
179private slots:
180 void sslToggled(bool);
181 void hostToggled(bool);
182 void reg();
183
184 void client_handshaken();
185 void client_error();
186
187 void reg_finished();
188
189 void block();
190 void unblock();
191
192private:
193 ProxyManager *proxyman;
194 ProxyChooser *pc;
195 MiniClient *client;
196};
197
198class AccountRemoveDlg : public AccountRemoveUI
199{
200 Q_OBJECT
201public:
202 AccountRemoveDlg(ProxyManager *, const UserAccount &, QWidget *parent=0, const char *name=0);
203 ~AccountRemoveDlg();
204
205protected:
206 // reimplemented
207 //void closeEvent(QCloseEvent *);
208
209public slots:
210 void done(int);
211
212private slots:
213 void remove();
214 void bg_clicked(int);
215
216 void client_handshaken();
217 void client_error();
218 void unreg_finished();
219
220private:
221 class Private;
222 Private *d;
223
224 MiniClient *client;
225};
226
227#endif
Note: See TracBrowser for help on using the repository browser.