1
/****************************************************************************
2
** eventdlg.h - multi-window chat dialog for sending/receiving events
3
** Copyright (C) 2001, 2002 Justin Karneges
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.
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.
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.
19
****************************************************************************/
2
* eventdlg.h - dialog for sending / receiving messages and events
3
* Copyright (C) 2001, 2002 Justin Karneges
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.
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.
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
24
24
#include<qwidget.h>
27
#include<qpushbutton.h>
28
#include<qtoolbutton.h>
25
#define private protected
29
26
#include<qlineedit.h>
37
31
#include"userlist.h"
39
#include"uniquewindow.h"
41
class AnimatedButton : public QPushButton
45
AnimatedButton(QWidget *parent=0, const char *name=0);
48
bool isActive() { return v_isActive; }
56
void changeIcon(const QPixmap &);
63
44
class ELineEdit : public QLineEdit
67
ELineEdit(QWidget *parent=0, const char *name=0);
48
ELineEdit(EventDlg *parent, const char *name=0);
51
void changeResource(const QString &);
70
56
void dragEnterEvent(QDragEnterEvent *);
71
57
void dropEvent(QDropEvent *);
74
class EventDlg : public QWidget, public UniqueWindow
78
EventDlg(UserListItem *item, int localStatus, bool isUnique, bool compose=FALSE, bool urlMode=FALSE);
79
EventDlg(const QStringList &to, int x_localStatus);
58
void keyPressEvent(QKeyEvent *);
59
QPopupMenu *createPopupMenu();
62
void resourceMenuActivated(int);
68
class AttachView : public QListView
72
AttachView(QWidget *parent=0, const char *name=0);
75
void setReadOnly(bool);
76
void urlAdd(const QString &, const QString &);
77
void gcAdd(const QString &);
79
UrlList urlList() const;
80
void addUrlList(const UrlList &);
83
void childCountChanged();
84
void actionGCJoin(const QString &);
87
void qlv_context(QListViewItem *, const QPoint &, int);
88
void qlv_doubleClicked(QListViewItem *);
93
void goURL(const QString &);
96
class AddUrlDlg : public AddUrlUI
100
AddUrlDlg(QWidget *parent=0, const char *name=0);
104
class EventDlg : public QWidget
109
EventDlg(const QString &, PsiCon *, PsiAccount *);
111
EventDlg(const Jid &, PsiAccount *, bool unique);
84
QString & jid() { return v_jid; }
85
static EventDlg *find(const QString &);
114
QString text() const;
115
void setText(const QString &);
116
void setSubject(const QString &);
117
void setThread(const QString &);
120
PsiAccount *psiAccount();
86
122
static QSize defaultSize();
125
void aReply(const Jid &jid, const QString &body, const QString &subject, const QString &thread);
126
void aReadNext(const Jid &);
127
void aDeny(const Jid &);
128
void aAuth(const Jid &);
132
void showEvent(QShowEvent *);
90
133
void resizeEvent(QResizeEvent *);
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);
134
void keyPressEvent(QKeyEvent *);
135
void closeEvent(QCloseEvent *);
102
void localUpdate(const JabRosterEntry &);
103
void updateContact(UserListItem *);
104
void updateReadNext(int nextType, int amount);
105
void updateEvent(const Message &);
138
void optionsUpdate();
106
139
void closeAfterReply();
107
void optionsUpdate();
140
void updateContact(const Jid &);
141
void updateEvent(PsiEvent *);
142
void updateReadNext(Icon *, int);
143
void actionGCJoin(const QString &);
146
void to_textChanged(const QString &);
147
void to_changeResource(const QString &);
148
void to_tryComplete();
149
void updateIdentity(PsiAccount *);
150
void accountUpdatedActivity();
151
void doWhois(bool force=false);
110
159
void doHistory();
114
void setCurrentTime();
115
void showSubject(bool);
160
void showHideAttachView();
164
void encryptedMessageSent(int, bool);
165
void trySendEncryptedNext();
122
bool isCompose, isMulti;
123
QString v_jid, v_nick;
133
QWidget *lo_single, *lo_multi;
135
QLabel *lb_statusIcon, *lb_statusStr, *lb_eventType, *lb_time;
136
QLineEdit *le_nick, *le_jid;
138
QPushButton *pb_toMulti, *pb_toSingle;
139
QToolButton *tb_subj, *tb_url, *tb_history, *tb_info;
140
QComboBox *cb_eventType;
149
QLabel *lb_url, *lb_desc;
150
QLineEdit *le_url, *le_desc;
152
QPushButton *pb_button1;
155
AnimatedButton *pb_next;
159
void setTime(const QDateTime &);
161
void keyPressEvent(QKeyEvent *e);
175
QStringList stringToList(const QString &, bool enc=true) const;
176
QString findJidInString(const QString &) const;
177
QString expandAddresses(const QString &, bool enc=true) const;
178
void buildCompletionList();
179
void setAccount(PsiAccount *);
180
void setTime(const QDateTime &, bool late=false);
182
friend class ELineEdit;
183
UserResourceList getResources(const QString &) const;
184
QString jidToString(const Jid &, const QString &r="") const;