source: psi/trunk/src/eventdlg.h@ 11

Last change on this file since 11 was 2, checked in by dmik, 19 years ago

Imported original Psi 0.10 sources from Affinix

File size: 4.2 KB
Line 
1/*
2 * eventdlg.h - dialog for sending / receiving messages and 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 library; 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"advwidget.h"
25#define private protected
26#include<qlineedit.h>
27#undef private
28#include<qlistview.h>
29
30#include"im.h"
31#include"userlist.h"
32#include"ui_addurl.h"
33
34using namespace XMPP;
35
36class QDateTime;
37class QStringList;
38class PsiEvent;
39class PsiCon;
40class PsiAccount;
41class Icon;
42
43class EventDlg;
44class ELineEdit : public QLineEdit
45{
46 Q_OBJECT
47public:
48 ELineEdit(EventDlg *parent, const char *name=0);
49
50signals:
51 void changeResource(const QString &);
52 void tryComplete();
53
54protected:
55 // reimplemented
56 void dragEnterEvent(QDragEnterEvent *);
57 void dropEvent(QDropEvent *);
58 void keyPressEvent(QKeyEvent *);
59 QPopupMenu *createPopupMenu();
60
61private slots:
62 void resourceMenuActivated(int);
63
64private:
65 UserResourceList url;
66};
67
68class AttachView : public QListView
69{
70 Q_OBJECT
71public:
72 AttachView(QWidget *parent=0, const char *name=0);
73 ~AttachView();
74
75 void setReadOnly(bool);
76 void urlAdd(const QString &, const QString &);
77 void gcAdd(const QString &);
78
79 UrlList urlList() const;
80 void addUrlList(const UrlList &);
81
82signals:
83 void childCountChanged();
84 void actionGCJoin(const QString &);
85
86private slots:
87 void qlv_context(QListViewItem *, const QPoint &, int);
88 void qlv_doubleClicked(QListViewItem *);
89
90private:
91 bool v_readOnly;
92
93 void goURL(const QString &);
94};
95
96class AddUrlDlg : public AddUrlUI
97{
98 Q_OBJECT
99public:
100 AddUrlDlg(QWidget *parent=0, const char *name=0);
101 ~AddUrlDlg();
102};
103
104class EventDlg : public AdvancedWidget<QWidget>
105{
106 Q_OBJECT
107public:
108 // compose
109 EventDlg(const QString &, PsiCon *, PsiAccount *);
110 // read
111 EventDlg(const Jid &, PsiAccount *, bool unique);
112 ~EventDlg();
113
114 QString text() const;
115 void setText(const QString &);
116 void setSubject(const QString &);
117 void setThread(const QString &);
118 void setUrlOnShow();
119
120 PsiAccount *psiAccount();
121
122 static QSize defaultSize();
123
124signals:
125 void aChat(const Jid& jid);
126 void aReply(const Jid &jid, const QString &body, const QString &subject, const QString &thread);
127 void aReadNext(const Jid &);
128 void aDeny(const Jid &);
129 void aAuth(const Jid &);
130
131protected:
132 // reimplemented
133 void showEvent(QShowEvent *);
134 void resizeEvent(QResizeEvent *);
135 void keyPressEvent(QKeyEvent *);
136 void closeEvent(QCloseEvent *);
137
138public slots:
139 void optionsUpdate();
140 void closeAfterReply();
141 void updateContact(const Jid &);
142 void updateEvent(PsiEvent *);
143 void updateReadNext(Icon *, int);
144 void actionGCJoin(const QString &);
145
146private slots:
147 void to_textChanged(const QString &);
148 void to_changeResource(const QString &);
149 void to_tryComplete();
150 void updateIdentity(PsiAccount *);
151 void accountUpdatedActivity();
152 void doWhois(bool force=false);
153 void doSend();
154 void doReadNext();
155 void doChat();
156 void doReply();
157 void doQuote();
158 void doDeny();
159 void doAuth();
160 void doInfo();
161 void doHistory();
162 void showHideAttachView();
163 void addUrl();
164
165 void updatePGP();
166 void encryptedMessageSent(int, bool);
167 void trySendEncryptedNext();
168
169public:
170 class Private;
171private:
172 Private *d;
173
174 void doneSend();
175
176 void init();
177 QStringList stringToList(const QString &, bool enc=true) const;
178 QString findJidInString(const QString &) const;
179 QString expandAddresses(const QString &, bool enc=true) const;
180 void buildCompletionList();
181 void setAccount(PsiAccount *);
182 void setTime(const QDateTime &, bool late=false);
183
184 friend class ELineEdit;
185 UserResourceList getResources(const QString &) const;
186 QString jidToString(const Jid &, const QString &r="") const;
187};
188
189#endif
Note: See TracBrowser for help on using the repository browser.