~ubuntu-branches/ubuntu/edgy/psi/edgy

« back to all changes in this revision

Viewing changes to src/servicesdlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2002-04-19 02:28:44 UTC
  • Revision ID: james.westby@ubuntu.com-20020419022844-za7xgai5qyfd9xv6
Tags: upstream-0.8.5
ImportĀ upstreamĀ versionĀ 0.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
** servicesdlg.h - a dialog for browsing Jabber services/agents/transports
 
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
****************************************************************************/
 
20
 
 
21
#ifndef SERVICESDLG_H
 
22
#define SERVICESDLG_H
 
23
 
 
24
#include<qwidget.h>
 
25
#include<qpixmap.h>
 
26
#include<qlistbox.h>
 
27
#include<qlabel.h>
 
28
#include<qlineedit.h>
 
29
#include<qptrlist.h>
 
30
#include"ui_services.h"
 
31
#include"jabcommon.h"
 
32
#include"userlist.h"
 
33
#include"uniquewindow.h"
 
34
#include"busywidget.h"
 
35
 
 
36
#define SERVICESDLG_ACT_REGISTER 0
 
37
#define SERVICESDLG_ACT_SEARCH   1
 
38
 
 
39
 
 
40
class ServicesDlg : public ServicesUI
 
41
{
 
42
        Q_OBJECT
 
43
public:
 
44
        ServicesDlg(int localStatus, QWidget *parent=0, const char *name=0);
 
45
        ~ServicesDlg();
 
46
 
 
47
        static ServicesDlg *find();
 
48
 
 
49
protected:
 
50
        void closeEvent(QCloseEvent *);
 
51
 
 
52
signals:
 
53
        void signalRefresh(QString *id);
 
54
        void signalSearch(const QString &, QString *id);
 
55
        void signalGetRegForm(const QString &, QString *id);
 
56
        void signalCancelTransaction(const QString &);
 
57
 
 
58
public slots:
 
59
        void doRefresh();
 
60
 
 
61
        void loadSuccess(JabRoster *);
 
62
        void loadFail();
 
63
 
 
64
        void loadFormSuccess();
 
65
        void loadFormFail();
 
66
 
 
67
        void localUpdate(const JabRosterEntry &);
 
68
 
 
69
private slots:
 
70
        void serviceSelected(int);
 
71
        void serviceRegister();
 
72
        void serviceSearch();
 
73
        void doubleClicked(QListBoxItem *i);
 
74
 
 
75
private:
 
76
        void restoreWidgets();
 
77
 
 
78
        int localStatus;
 
79
        bool isBusy;
 
80
        BusyWidget *busy;
 
81
 
 
82
        JabRoster servicesList;
 
83
 
 
84
        QString regname, id;
 
85
        int actionType;
 
86
};
 
87
 
 
88
 
 
89
class RegistrationDlg : public QDialog, public UniqueWindow
 
90
{
 
91
        Q_OBJECT
 
92
public:
 
93
        RegistrationDlg(const JabForm &, QWidget *parent=0, const char *name=0);
 
94
 
 
95
        static RegistrationDlg *find(const QString &);
 
96
 
 
97
protected:
 
98
        // reimplemented
 
99
        void closeEvent(QCloseEvent *);
 
100
 
 
101
signals:
 
102
        void signalSubmitForm(const JabForm &, QString *id);
 
103
 
 
104
public slots:
 
105
        void putRegFormResponse(bool, const QString &err);
 
106
        void localUpdate(const JabRosterEntry &);
 
107
 
 
108
private slots:
 
109
        void doRegSubmit();
 
110
 
 
111
private:
 
112
        BusyWidget *busy;
 
113
        QPushButton *pb_register, *pb_close;
 
114
 
 
115
        QPtrList<QLabel> lb_field;
 
116
        QPtrList<QLineEdit> le_field;
 
117
 
 
118
        JabForm form;
 
119
 
 
120
        QString id;
 
121
        bool isBusy;
 
122
};
 
123
 
 
124
#endif
 
125