1
/****************************************************************************
2
** mainwin.h - the main window. holds contactlist and buttons.
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
* mainwin.h - the main window. holds contactlist and buttons.
3
* Copyright (C) 2001-2003 Justin Karneges, Michail Pishchagin
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
25
#include<qpushbutton.h>
26
#include<qtoolbutton.h>
27
#include<qpopupmenu.h>
30
#include<qptrvector.h>
24
#include<qmainwindow.h>
33
27
#include"contactview.h"
38
class AboutDlg : public QDialog
42
AboutDlg(const QPixmap &icon, const QString &content, QWidget *par=0);
45
class MPushButton : public QPushButton
49
MPushButton(QWidget *parent=0, const char *name=0);
51
void setText(const QString &);
55
void drawButtonLabel(QPainter *);
62
class MToolButton : public QToolButton
66
MToolButton(QWidget *parent=0, const char *name=0);
69
void setPressed(bool);
73
class MLabel : public QLabel
77
MLabel(QWidget *parent=0, const char *name=0);
81
void mouseReleaseEvent(QMouseEvent *);
82
void mouseDoubleClickEvent(QMouseEvent *);
90
class MainWin : public QWidget
94
MainWin(bool onTop, QWidget *parent=0, const char *name=0);
28
#include"psitoolbar.h"
42
class MainWin : public QMainWindow
46
MainWin(bool onTop, bool asTool, PsiCon *, const char *name=0);
97
void setAlwaysOnTop(bool);
49
void setWindowOpts(bool onTop, bool asTool);
98
50
void setUseDock(bool);
99
51
void setInfo(const QString &);
100
void setUsingSSL(bool);
102
QVBoxLayout *vb_main;
103
QHBoxLayout *hb_status;
53
// evil stuff! remove ASAP!!
54
QStringList actionList;
55
QMap<QString, QAction*> actions;
105
57
ContactView *cvlist;
109
QPushButton *pb_options;
110
MPushButton *pb_status;
112
int nextType, nextAmount;
118
QPopupMenu *statusMenu, *optionsMenu;
121
MToolButton *tb_offline, *tb_away, *tb_agents;
123
QPopupMenu *trayMenu;
128
void updateCaption();
129
void setToolBarIcons();
130
QString makeToolTip(const JabRosterEntry &e);
131
QPixmap makeTrayIcon(const QImage &);
140
void traySetAnim(Anim *_anim);
58
QPtrList<PsiToolBar> toolbars;
61
void saveToolbarsPositions();
62
PsiCon *psiCon() const;
145
virtual void closeEvent(QCloseEvent *);
65
void closeEvent(QCloseEvent *);
66
void keyPressEvent(QKeyEvent *);
148
69
void statusChanged(int);
150
71
void blankMessage();
151
72
void closeProgram();
153
void doManageServices();
154
75
void doManageAccounts();
155
void doFileSharing();
77
void doFileTransDlg();
156
78
void accountInfo();
158
79
void recvNextEvent();
81
void geomChanged(int x, int y, int w, int h);
161
84
void buildStatusMenu();
162
void activatedStatusMenu(int);
163
85
void buildOptionsMenu();
164
void activatedOptionsMenu(int);
165
86
void buildTrayMenu();
88
void buildToolsMenu();
90
void setTrayToolTip(int);
92
void activatedStatusAction(int);
166
94
void trayClicked(const QPoint &, int);
167
95
void trayDoubleClicked();
169
99
void doRecvNextEvent();
170
100
void statusClicked(int);
101
void try2tryCloseProgram();
173
102
void tryCloseProgram();
104
void numAccountsChanged();
106
void activatedAccOption(PsiAccount *, int);
108
void actReadmeActivated ();
109
void actOnlineHelpActivated ();
110
void actBugReportActivated ();
111
void actAboutActivated ();
112
void actAboutQtActivated ();
113
void actPlaySoundsActivated (bool);
114
void actTipActivated();
116
bool showDockMenu(const QPoint &);
117
void dockActivated();
119
void registerAction( IconAction * );
122
void setIcon(const QPixmap&);
176
125
void decorateButton(int);
177
void localUpdate(const JabRosterEntry &);
178
void updateReadNext(int nextType, int amount);
126
void updateReadNext(Icon *nextAnim, int nextAmount);
180
128
void optionsUpdate();
130
void setTrayToolTip(const Status &);
133
void buildGeneralMenu(QPopupMenu *);
134
QString numEventsString(int) const;
138
void updateCaption();
144
friend class Private;