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

« back to all changes in this revision

Viewing changes to src/eventdlg.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
** eventdlg.h - multi-window chat dialog for sending/receiving events
 
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 EVENTDLG_H
 
22
#define EVENTDLG_H
 
23
 
 
24
#include<qwidget.h>
 
25
#include<qlayout.h>
 
26
#include<qlabel.h>
 
27
#include<qpushbutton.h>
 
28
#include<qtoolbutton.h>
 
29
#include<qlineedit.h>
 
30
#include<qpixmap.h>
 
31
#include<qgroupbox.h>
 
32
#include<qdropsite.h>
 
33
#include<qcombobox.h>
 
34
 
 
35
#include"message.h"
 
36
#include"msgmle.h"
 
37
#include"userlist.h"
 
38
#include"anim.h"
 
39
#include"uniquewindow.h"
 
40
 
 
41
class AnimatedButton : public QPushButton
 
42
{
 
43
        Q_OBJECT
 
44
public:
 
45
        AnimatedButton(QWidget *parent=0, const char *name=0);
 
46
 
 
47
        void setAnim(Anim *);
 
48
        bool isActive() { return v_isActive; }
 
49
 
 
50
private:
 
51
        Anim *anim;
 
52
        bool v_isActive;
 
53
        QTimer *t;
 
54
        int animStep;
 
55
 
 
56
        void changeIcon(const QPixmap &);
 
57
 
 
58
private slots:
 
59
        void animate();
 
60
};
 
61
 
 
62
 
 
63
class ELineEdit : public QLineEdit
 
64
{
 
65
        Q_OBJECT
 
66
public:
 
67
        ELineEdit(QWidget *parent=0, const char *name=0);
 
68
 
 
69
protected:
 
70
        void dragEnterEvent(QDragEnterEvent *);
 
71
        void dropEvent(QDropEvent *);
 
72
};
 
73
 
 
74
class EventDlg : public QWidget, public UniqueWindow
 
75
{
 
76
        Q_OBJECT
 
77
public:
 
78
        EventDlg(UserListItem *item, int localStatus, bool isUnique, bool compose=FALSE, bool urlMode=FALSE);
 
79
        EventDlg(const QStringList &to, int x_localStatus);
 
80
        ~EventDlg();
 
81
 
 
82
        void init();
 
83
 
 
84
        QString & jid() { return v_jid; }
 
85
        static EventDlg *find(const QString &);
 
86
        static QSize defaultSize();
 
87
 
 
88
        // reimplemented
 
89
protected:
 
90
        void resizeEvent(QResizeEvent *);
 
91
 
 
92
signals:
 
93
        void aSend(const Message &);
 
94
        void aHistory(const QString &jid);
 
95
        void aReply(const QString &jid);
 
96
        void aReadNext(const QString &jid);
 
97
        void aAuth(const QString &jid);
 
98
        void aInfo(const QString &jid);
 
99
        void aOpenURL(const QString &url);
 
100
 
 
101
public slots:
 
102
        void localUpdate(const JabRosterEntry &);
 
103
        void updateContact(UserListItem *);
 
104
        void updateReadNext(int nextType, int amount);
 
105
        void updateEvent(const Message &);
 
106
        void closeAfterReply();
 
107
        void optionsUpdate();
 
108
 
 
109
private slots:
 
110
        void doHistory();
 
111
        void doInfo();
 
112
        void doReadNext();
 
113
        void doButton1();
 
114
        void setCurrentTime();
 
115
        void showSubject(bool);
 
116
        void showUrl(bool);
 
117
        void showMulti();
 
118
        void showSingle();
 
119
        void goToURL();
 
120
 
 
121
private:
 
122
        bool isCompose, isMulti;
 
123
        QString v_jid, v_nick;
 
124
        int v_status;
 
125
        int localStatus;
 
126
        Anim *eventAnim;
 
127
        int eventType;
 
128
        Message *msg;
 
129
        int numReadNext;
 
130
        int nextType;
 
131
 
 
132
        QBoxLayout *layout1;
 
133
        QWidget *lo_single, *lo_multi;
 
134
 
 
135
        QLabel *lb_statusIcon, *lb_statusStr, *lb_eventType, *lb_time;
 
136
        QLineEdit *le_nick, *le_jid;
 
137
        ELineEdit *le_to;
 
138
        QPushButton *pb_toMulti, *pb_toSingle;
 
139
        QToolButton *tb_subj, *tb_url, *tb_history, *tb_info;
 
140
        QComboBox *cb_eventType;
 
141
 
 
142
        // optional subject
 
143
        QGroupBox *gb_subj;
 
144
        QLabel *lb_subj;
 
145
        QLineEdit *le_subj;
 
146
 
 
147
        // optional URL
 
148
        QGroupBox *gb_url;
 
149
        QLabel *lb_url, *lb_desc;
 
150
        QLineEdit *le_url, *le_desc;
 
151
 
 
152
        QPushButton *pb_button1;
 
153
        bool flag_button1;
 
154
 
 
155
        AnimatedButton *pb_next;
 
156
        MsgMle *mle;
 
157
 
 
158
        void setButton1();
 
159
        void setTime(const QDateTime &);
 
160
 
 
161
        void keyPressEvent(QKeyEvent *e);
 
162
};
 
163
 
 
164
#endif