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;
51
typedef QPtrList<PsiAccount> PsiAccountList;
52
typedef QPtrListIterator<PsiAccount> PsiAccountListIt;
54
class AccountsComboBox : public QComboBox
58
AccountsComboBox(PsiCon *, QWidget *parent=0, bool online_only = false);
61
void setAccount(PsiAccount *);
64
void activated(PsiAccount *);
68
void updateAccounts();
77
class PsiCon : public QObject
81
enum { QuitProgram, QuitProfile };
88
ContactView *contactView() const;
89
const PsiAccountList & accountList(bool enabledOnly=FALSE) const;
91
OpenPGP::Engine *pgp() const;
92
ProxyManager *proxy() const;
93
FileTransDlg *ftdlg() const;
95
QWidget *dialogFind(const char *className);
96
void dialogRegister(QWidget *w);
97
void dialogUnregister(QWidget *w);
99
bool isValid(PsiAccount *);
100
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);
101
//void createAccount(const QString &, const QString &host="", int port=5222, bool ssl=false, const QString &user="", const QString &pass="");
102
void modifyAccount(PsiAccount *);
103
void removeAccount(PsiAccount *);
104
void enableAccount(PsiAccount *, bool e=TRUE);
106
void playSound(const QString &);
109
// global event handling
111
PsiAccount *queueLowestEventId();
113
AccountsComboBox *accountsComboBox(QWidget *parent=0, bool online_only = false);
115
const QStringList & recentGCList() const;
116
void recentGCAdd(const QString &);
117
const QStringList & recentBrowseList() const;
118
void recentBrowseAdd(const QString &);
119
const QStringList & recentNodeList() const;
120
void recentNodeAdd(const QString &);
122
EventDlg *createEventDlg(const QString &, PsiAccount *);
123
void updateContactGlobal(PsiAccount *, const Jid &);
125
QPtrList<PsiToolBar> *toolbarList() const;
126
PsiToolBar *findToolBar(QString group, int index);
127
PsiActionList *actionList() const;
129
MainWin *mainWin() const;
130
IconSelectPopup *iconSelectPopup() const;
131
void processEvent(PsiEvent *);
135
void accountAdded(PsiAccount *);
136
void accountUpdated(PsiAccount *);
137
void accountRemoved(PsiAccount *);
138
void accountCountChanged();
139
void accountActivityChanged();
140
void emitOptionsUpdate();
141
void pgpToggled(bool);
142
void pgpKeysUpdated();
145
void setGlobalStatus(const Status &);
146
QWidget *doToolbars();
150
void changeProfile();
151
void doManageAccounts();
153
void doNewBlankMessage();
155
void doFileTransDlg();
156
void statusMenuChanged(int);
157
void pa_updatedActivity();
158
void pa_updatedAccount();
159
void slotApplyOptions(const Options &);
161
void recvNextEvent();
162
void setStatusFromDialog(const Status &);
163
void pgp_initFinished(bool, const QString &);
164
void pgp_keysUpdated();
165
void proxy_settingsChanged();
166
void updateMainwinStatus();
168
void mainWinGeomChanged(int x, int y, int w, int h);
174
PsiAccount *loadAccount(const UserAccount &);
175
void loadAccounts(const UserAccountList &);
176
UserAccountList unloadAccounts();
177
void deleteAllDialogs();
179
void pgp_init(const QString &);
181
void updateS5BServerAddresses();
183
friend class PsiAccount;
184
void link(PsiAccount *);
185
void unlink(PsiAccount *);
186
void setToggles(bool tog_offline, bool tog_away, bool tog_agents, bool tog_hidden, bool tog_self);
187
void getToggles(bool *tog_offline, bool *tog_away, bool *tog_agents, bool *tog_hidden, bool *tog_self);
189
friend class EventQueue;