Added getNetworkId(UserId user, const QString &network) to make the transition to...
[quassel.git] / src / qtopia / coreconnectdlg.h
1 /***************************************************************************
2  *   Copyright (C) 2005-07 by The Quassel IRC Development Team             *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (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                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef _CORECONNECTDLG_H
22 #define _CORECONNECTDLG_H
23
24 #include "ui_coreconnectdlg.h"
25 #include "ui_coreconnectprogressdlg.h"
26 #include "ui_editcoreacctdlg.h"
27 #include "global.h"
28
29 class CoreConnectProgressDlg;
30
31 class CoreConnectDlg : public QDialog {
32   Q_OBJECT
33
34   public:
35     CoreConnectDlg(QWidget *parent = 0, bool doAutoConnect = false);
36     ~CoreConnectDlg();
37     QVariant getCoreState();
38
39   private slots:
40     void createAccount();
41     void removeAccount();
42     void editAccount();
43     void setWidgetStates();
44     void doConnect();
45     void connectionSuccess();
46     void connectionFailure();
47
48   private:
49     Ui::CoreConnectDlg ui;
50     QVariant coreState;
51
52     void editAccount(QString);
53
54     QAction *newAccAction, *editAccAction, *delAccAction;
55
56     CoreConnectProgressDlg *progressDlg;
57 };
58
59 class EditCoreAcctDlg : public QDialog {
60   Q_OBJECT
61
62   public:
63     EditCoreAcctDlg(QString accname = 0, QDialog *parent = 0);
64     QString accountName() const;
65
66   public slots:
67     void accept();
68
69   private slots:
70
71
72   private:
73     Ui::EditCoreAcctDlg ui;
74     QString accName;
75
76 };
77
78 class CoreConnectProgressDlg : public QDialog {
79   Q_OBJECT
80
81   public:
82     CoreConnectProgressDlg(QDialog *parent = 0);
83     bool isConnected() const;
84
85   public slots:
86     void connectToCore(QVariantMap connInfo);
87
88   private slots:
89     void coreConnected();
90     void coreConnectionError(QString);
91     void updateProgressBar(uint partial, uint total);
92
93   private:
94     Ui::CoreConnectProgressDlg ui;
95     bool connectsuccess;
96
97 };
98
99 #endif