source: psi/vendor/affinix/current/src/psicon.h@ 2

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

Imported original Psi 0.10 sources from Affinix

File size: 5.2 KB
Line 
1/*
2 * psicon.h - core of Psi
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 PSICON_H
22#define PSICON_H
23
24#include<qcombobox.h>
25#include"profiles.h"
26#include"psievent.h"
27#include"im.h"
28
29using namespace XMPP;
30
31class PsiCon;
32class PsiAccount;
33class ContactView;
34class EventDlg;
35class UserListItem;
36class EDB;
37class EDBItem;
38class ProxyManager;
39class MainWin;
40class FileTransDlg;
41class IconSelectPopup;
42class QThread;
43class PsiActionList;
44class PsiToolBar;
45class TabDlg;
46class ChatDlg;
47
48namespace OpenPGP
49{
50 class Engine;
51}
52
53typedef QPtrList<PsiAccount> PsiAccountList;
54typedef QPtrListIterator<PsiAccount> PsiAccountListIt;
55
56class AccountsComboBox : public QComboBox
57{
58 Q_OBJECT
59public:
60 AccountsComboBox(PsiCon *, QWidget *parent=0, bool online_only = false);
61 ~AccountsComboBox();
62
63 void setAccount(PsiAccount *);
64
65signals:
66 void activated(PsiAccount *);
67
68private slots:
69 void changeAccount();
70 void updateAccounts();
71 void deleteMe();
72
73private:
74 PsiCon *psi;
75 PsiAccount *pa;
76 bool onlineOnly;
77};
78
79class PsiCon : public QObject
80{
81 Q_OBJECT
82public:
83 enum { QuitProgram, QuitProfile };
84 PsiCon();
85 ~PsiCon();
86
87 bool init();
88 void deinit();
89
90 ContactView *contactView() const;
91 const PsiAccountList & accountList(bool enabledOnly=FALSE) const;
92 EDB *edb() const;
93 OpenPGP::Engine *pgp() const;
94 ProxyManager *proxy() const;
95 FileTransDlg *ftdlg() const;
96
97 TabDlg* getTabs();
98 TabDlg* newTabs();
99 bool isChatTabbed(ChatDlg*);
100 bool isChatActiveWindow(ChatDlg*);
101 ChatDlg* getChatInTabs(QString);
102 TabDlg* getManagingTabs(ChatDlg*);
103 QPtrList<TabDlg>* getTabSets();
104
105 QWidget *dialogFind(const char *className);
106 void dialogRegister(QWidget *w);
107 void dialogUnregister(QWidget *w);
108
109 bool isValid(PsiAccount *);
110 void createAccount(const QString &name, const Jid &j="", const QString &pass="", bool opt_host=false, const QString &host="", int port=5222, bool ssl=false, int proxy=0);
111 //void createAccount(const QString &, const QString &host="", int port=5222, bool ssl=false, const QString &user="", const QString &pass="");
112 void modifyAccount(PsiAccount *);
113 void removeAccount(PsiAccount *);
114 void enableAccount(PsiAccount *, bool e=TRUE);
115
116 void playSound(const QString &);
117 void raiseMainwin();
118
119 // global event handling
120 int queueCount();
121 PsiAccount *queueLowestEventId();
122
123 AccountsComboBox *accountsComboBox(QWidget *parent=0, bool online_only = false);
124
125 const QStringList & recentGCList() const;
126 void recentGCAdd(const QString &);
127 const QStringList & recentBrowseList() const;
128 void recentBrowseAdd(const QString &);
129 const QStringList & recentNodeList() const;
130 void recentNodeAdd(const QString &);
131
132 EventDlg *createEventDlg(const QString &, PsiAccount *);
133 void updateContactGlobal(PsiAccount *, const Jid &);
134
135 QPtrList<PsiToolBar> *toolbarList() const;
136 PsiToolBar *findToolBar(QString group, int index);
137 PsiActionList *actionList() const;
138
139 MainWin *mainWin() const;
140 IconSelectPopup *iconSelectPopup() const;
141 void processEvent(PsiEvent *);
142
143signals:
144 void quit(int);
145 void accountAdded(PsiAccount *);
146 void accountUpdated(PsiAccount *);
147 void accountRemoved(PsiAccount *);
148 void accountCountChanged();
149 void accountActivityChanged();
150 void emitOptionsUpdate();
151 void pgpToggled(bool);
152 void pgpKeysUpdated();
153
154public slots:
155 void setGlobalStatus(const Status &);
156 QWidget *doToolbars();
157
158private slots:
159 void doSleep();
160 void doWakeup();
161 void closeProgram();
162 void changeProfile();
163 void doManageAccounts();
164 void doGroupChat();
165 void doNewBlankMessage();
166 void doOptions();
167 void doFileTransDlg();
168 void statusMenuChanged(int);
169 void pa_updatedActivity();
170 void pa_updatedAccount();
171 void slotApplyOptions(const Options &);
172 void queueChanged();
173 void recvNextEvent();
174 void setStatusFromDialog(const Status &);
175 void pgp_initFinished(bool, const QString &);
176 void pgp_keysUpdated();
177 void proxy_settingsChanged();
178 void accel_activated(int);
179 void updateMainwinStatus();
180 void tabDying(TabDlg*);
181
182 void mainWinGeomChanged(int x, int y, int w, int h);
183
184private:
185 class Private;
186 Private *d;
187
188 PsiAccount *loadAccount(const UserAccount &);
189 void loadAccounts(const UserAccountList &);
190 UserAccountList unloadAccounts();
191 void deleteAllDialogs();
192 void saveAccounts();
193 void pgp_init(const QString &);
194 void s5b_init();
195 void updateS5BServerAddresses();
196
197 friend class PsiAccount;
198 void link(PsiAccount *);
199 void unlink(PsiAccount *);
200 void setToggles(bool tog_offline, bool tog_away, bool tog_agents, bool tog_hidden, bool tog_self);
201 void getToggles(bool *tog_offline, bool *tog_away, bool *tog_agents, bool *tog_hidden, bool *tog_self);
202
203 friend class EventQueue;
204 int getId();
205};
206
207#endif
Note: See TracBrowser for help on using the repository browser.