~ubuntu-branches/ubuntu/hoary/psi/hoary

« back to all changes in this revision

Viewing changes to src/accountdlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2004-06-15 00:10:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040615001041-enywb6pcpe4sjsw6
Tags: 0.9.2-1
* New upstream release
* Set KDEDIR for ./configure so kde specific files get installed
* Don't install libpsiwidgets.so. It got installed in /usr/share
  where it doesn't belong. May be included (at a better location)
  later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
** accountdlg.h - dialogs for manipulating Jabber accounts
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 program; if not, write to the Free Software
17
 
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 
**
19
 
****************************************************************************/
 
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
20
 
21
21
#ifndef ACCOUNTDLG_H
22
22
#define ACCOUNTDLG_H
23
23
 
24
 
#include<qdialog.h>
25
 
#include<qlistview.h>
26
 
#include"profiles.h"
27
 
#include"uniquewindow.h"
28
 
#include"jabsess.h"
 
24
#include<qca.h>
29
25
#include"ui_accountmanage.h"
 
26
#include"ui_accountadd.h"
 
27
#include"ui_accountreg.h"
 
28
#include"ui_accountremove.h"
30
29
#include"ui_accountmodify.h"
31
 
#include"busywidget.h"
32
 
 
33
 
 
34
 
class AccountViewItem : public QListViewItem
35
 
{
 
30
#include"ui_pgpkey.h"
 
31
#include"xmpp.h"
 
32
#include"openpgp.h"
 
33
 
 
34
namespace XMPP
 
35
{
 
36
        class Jid;
 
37
        class Client;
 
38
}
 
39
 
 
40
using namespace XMPP;
 
41
 
 
42
class PsiCon;
 
43
class PsiAccount;
 
44
class QListViewItem;
 
45
class UserAccount;
 
46
class ProxyManager;
 
47
class ProxyChooser;
 
48
 
 
49
namespace QCA
 
50
{
 
51
        class Cert;
 
52
}
 
53
 
 
54
class MiniClient : public QObject
 
55
{
 
56
        Q_OBJECT
36
57
public:
37
 
        AccountViewItem(QListView *, JabSession *);
38
 
 
39
 
        JabSession *s;
40
 
 
41
 
        void updateInfo();
 
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
 
 
66
signals:
 
67
        void handshaken();
 
68
        void error();
 
69
 
 
70
private 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
 
 
81
private:
 
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;
42
90
};
43
91
 
44
92
class AccountManageDlg : public AccountManageUI
45
93
{
46
94
        Q_OBJECT
47
95
public:
48
 
        AccountManageDlg(JabSessionManager *, QWidget *parent=0, const char *name=0);
 
96
        AccountManageDlg(PsiCon *, const char *name=0);
49
97
        ~AccountManageDlg();
50
98
 
51
 
        static AccountManageDlg *find();
52
 
 
53
 
signals:
54
 
        void signalModify(const QString &);
55
 
 
56
 
public slots:
57
 
        void updateEntry(JabSession *);
58
 
        void sessionUpdate(JabSession *);
59
 
 
60
99
private slots:
 
100
        void qlv_selectionChanged(QListViewItem *);
 
101
        void add();
61
102
        void modify();
62
103
        void modify(QListViewItem *);
63
 
 
64
 
private:
65
 
        JabSessionManager *jsm;
66
 
};
67
 
 
68
 
class AccountModifyDlg : public AccountModifyUI, public UniqueWindow
69
 
{
70
 
        Q_OBJECT
71
 
public:
72
 
        AccountModifyDlg(JabSession *, bool haveSSL, QWidget *parent=0, const char *name=0);
 
104
        void remove();
 
105
        void accountAdded(PsiAccount *);
 
106
        void accountUpdated(PsiAccount *);
 
107
        void accountRemoved(PsiAccount *);
 
108
 
 
109
private:
 
110
        PsiCon *psi;
 
111
};
 
112
 
 
113
class AccountAddDlg : public AccountAddUI
 
114
{
 
115
        Q_OBJECT
 
116
public:
 
117
        AccountAddDlg(PsiCon *, QWidget *parent=0, const char *name=0);
 
118
        ~AccountAddDlg();
 
119
 
 
120
private slots:
 
121
        void add();
 
122
        void setAddButton(const QString &);
 
123
 
 
124
private:
 
125
        PsiCon *psi;
 
126
};
 
127
 
 
128
class AccountModifyDlg : public AccountModifyUI
 
129
{
 
130
        Q_OBJECT
 
131
public:
 
132
        AccountModifyDlg(PsiAccount *, QWidget *parent=0, const char *name=0);
73
133
        ~AccountModifyDlg();
74
134
 
75
 
        static AccountModifyDlg *find(const QString &accname);
 
135
        void setPassword(const QString &);
76
136
 
77
137
private slots:
78
138
        void sslToggled(bool);
 
139
        void hostToggled(bool);
 
140
 
 
141
        void detailsVCard();
 
142
        void detailsChangePW();
 
143
 
79
144
        void save();
80
 
        void doRegister();
81
 
 
82
 
private:
83
 
        JabSession *s;
84
 
        bool haveSSL;
85
 
};
86
 
 
87
 
class AccountRegisterDlg : public QDialog
88
 
{
89
 
        Q_OBJECT
90
 
public:
91
 
        AccountRegisterDlg(QWidget *parent=0, const char *name=0);
92
 
        ~AccountRegisterDlg();
93
 
 
94
 
        void start(const QString &, int, bool, const QString &, const QString &);
95
 
        void stop();
96
 
 
97
 
        static bool reg(QWidget *, const QString &, int, bool, const QString &, const QString &);
98
 
 
99
 
protected:
100
 
        // reimplemented
101
 
        void closeEvent(QCloseEvent *);
102
 
 
103
 
private slots:
104
 
        void accRegisterFinished(bool, const QString &);
105
 
        void jab_error(JabError *);
106
 
        void cancel();
107
 
 
108
 
private:
109
 
        Jabber *jab;
110
 
        BusyWidget *busy;
 
145
 
 
146
        void pgpToggled(bool);
 
147
        void optpp_toggled(bool);
 
148
        void chooseKey();
 
149
        void clearKey();
 
150
 
 
151
private:
 
152
        PsiAccount *pa;
 
153
        ProxyChooser *pc;
 
154
        QString keyID;
 
155
 
 
156
        void updateUserID();
 
157
        void setKeyID(bool b, const QString &s="");
 
158
};
 
159
 
 
160
class AccountRegDlg : public AccountRegUI
 
161
{
 
162
        Q_OBJECT
 
163
public:
 
164
        AccountRegDlg(ProxyManager *, QWidget *parent=0, const char *name=0);
 
165
        ~AccountRegDlg();
 
166
 
 
167
        Jid jid;
 
168
        QString sp_host, pass;
 
169
        int sp_port;
 
170
        bool ssl, opt_host;
 
171
        int proxy;
 
172
 
 
173
protected:
 
174
        // reimplemented
 
175
        //void closeEvent(QCloseEvent *);
 
176
 
 
177
public slots:
 
178
        void done(int);
 
179
 
 
180
private slots:
 
181
        void sslToggled(bool);
 
182
        void hostToggled(bool);
 
183
        void reg();
 
184
 
 
185
        void client_handshaken();
 
186
        void client_error();
 
187
 
 
188
        void reg_finished();
 
189
 
 
190
        void block();
 
191
        void unblock();
 
192
 
 
193
private:
 
194
        ProxyManager *proxyman;
 
195
        ProxyChooser *pc;
 
196
        MiniClient *client;
 
197
};
 
198
 
 
199
class AccountRemoveDlg : public AccountRemoveUI
 
200
{
 
201
        Q_OBJECT
 
202
public:
 
203
        AccountRemoveDlg(ProxyManager *, const UserAccount &, QWidget *parent=0, const char *name=0);
 
204
        ~AccountRemoveDlg();
 
205
 
 
206
protected:
 
207
        // reimplemented
 
208
        //void closeEvent(QCloseEvent *);
 
209
 
 
210
public slots:
 
211
        void done(int);
 
212
 
 
213
private slots:
 
214
        void remove();
 
215
        void bg_clicked(int);
 
216
 
 
217
        void client_handshaken();
 
218
        void client_error();
 
219
        void unreg_finished();
 
220
 
 
221
private:
 
222
        class Private;
 
223
        Private *d;
 
224
 
 
225
        MiniClient *client;
111
226
};
112
227
 
113
228
#endif