2
* psicon.h - core of Psi
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
41
class IconSelectPopup;
49
typedef QPtrList<PsiAccount> PsiAccountList;
50
typedef QPtrListIterator<PsiAccount> PsiAccountListIt;
52
class AccountsComboBox : public QComboBox
56
AccountsComboBox(PsiCon *, QWidget *parent=0);
59
void setAccount(PsiAccount *);
62
void activated(PsiAccount *);
66
void updateAccounts();
74
class PsiCon : public QObject
78
enum { QuitProgram, QuitProfile };
85
ContactView *contactView() const;
86
const PsiAccountList & accountList(bool enabledOnly=FALSE) const;
88
OpenPGP::Engine *pgp() const;
89
ProxyManager *proxy() const;
90
FileTransDlg *ftdlg() const;
92
QWidget *dialogFind(const char *className);
93
void dialogRegister(QWidget *w);
94
void dialogUnregister(QWidget *w);
96
bool isValid(PsiAccount *);
97
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);
98
//void createAccount(const QString &, const QString &host="", int port=5222, bool ssl=false, const QString &user="", const QString &pass="");
99
void modifyAccount(PsiAccount *);
100
void removeAccount(PsiAccount *);
101
void enableAccount(PsiAccount *, bool e=TRUE);
103
void playSound(const QString &);
106
// global event handling
108
PsiAccount *queueLowestEventId();
110
AccountsComboBox *accountsComboBox(QWidget *parent=0);
112
const QStringList & recentGCList() const;
113
void recentGCAdd(const QString &);
114
const QStringList & recentBrowseList() const;
115
void recentBrowseAdd(const QString &);
116
const QStringList & recentNodeList() const;
117
void recentNodeAdd(const QString &);
119
EventDlg *createEventDlg(const QString &, PsiAccount *);
120
void updateContactGlobal(PsiAccount *, const Jid &);
122
MainWin *mainWin() const;
123
IconSelectPopup *iconSelectPopup() const;
124
void processEvent(PsiEvent *);
128
void accountAdded(PsiAccount *);
129
void accountUpdated(PsiAccount *);
130
void accountRemoved(PsiAccount *);
131
void accountCountChanged();
132
void emitOptionsUpdate();
133
void pgpToggled(bool);
134
void pgpKeysUpdated();
137
void setGlobalStatus(const Status &);
138
QWidget *doToolbars();
142
void changeProfile();
143
void doManageAccounts();
145
void doNewBlankMessage();
147
void doFileTransDlg();
148
void statusMenuChanged(int);
149
void pa_updatedActivity();
150
void pa_updatedAccount();
151
void slotApplyOptions(const Options &);
153
void recvNextEvent();
154
void setStatusFromDialog(const Status &);
155
void pgp_initFinished(bool, const QString &);
156
void pgp_keysUpdated();
157
void proxy_settingsChanged();
158
void updateMainwinStatus();
160
void mainWinGeomChanged(int x, int y, int w, int h);
166
PsiAccount *loadAccount(const UserAccount &);
167
void loadAccounts(const UserAccountList &);
168
UserAccountList unloadAccounts();
169
void deleteAllDialogs();
171
void pgp_init(const QString &);
173
void updateS5BServerAddresses();
175
friend class PsiAccount;
176
void link(PsiAccount *);
177
void unlink(PsiAccount *);
178
void setToggles(bool tog_offline, bool tog_away, bool tog_agents, bool tog_hidden);
179
void getToggles(bool *tog_offline, bool *tog_away, bool *tog_agents, bool *tog_hidden);
181
friend class EventQueue;