Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / kopete / kopetewindow.h
blobfba0e41e634684fc33a2d6a1129bca500305454c
1 /*
2 kopetewindow.h - Kopete Main Window
4 Copyright (c) 2001-2002 by Duncan Mac-Vicar Prett <duncan@kde.org>
5 Copyright (c) 2001-2002 by Stefan Gehn <metz AT gehn.net>
6 Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
8 Kopete (c) 2002-2008 by the Kopete developers <kopete-devel@kde.org>
10 *************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 *************************************************************************
20 #ifndef KOPETEWINDOW_H
21 #define KOPETEWINDOW_H
23 // Qt includes
24 #include <QtGui/QLabel>
26 // KDE includes
27 #include <kxmlguiwindow.h>
29 class QCloseEvent;
30 class QEvent;
31 class QShowEvent;
33 class KMenu;
35 namespace Kopete
37 class Identity;
38 class Account;
39 class Contact;
40 class Plugin;
41 class StatusMessage;
42 class StatusRootAction;
45 /**
46 * @author Duncan Mac-Vicar P. <duncan@kde.org>
48 class KopeteWindow : public KXmlGuiWindow
50 Q_OBJECT
52 public:
53 explicit KopeteWindow ( QWidget *parent = 0 );
54 ~KopeteWindow();
56 virtual bool eventFilter( QObject* o, QEvent* e );
58 protected:
59 virtual void closeEvent( QCloseEvent *ev );
60 virtual void leaveEvent( QEvent* ev );
61 virtual void showEvent( QShowEvent* ev );
62 virtual void hideEvent( QHideEvent* ev );
64 private slots:
65 void slotToggleShowAllOfflineEmpty( bool toggled );
66 void slotToggleShowOfflineUsers();
67 void slotToggleShowEmptyGroups();
68 void slotConfigChanged();
69 void slotConfNotifications();
70 void slotConfToolbar();
71 void slotUpdateToolbar();
72 void slotConfGlobalKeys();
73 void slotShowHide();
74 void slotToggleAway();
77 void setStatusMessage( const Kopete::StatusMessage& );
79 void globalStatusChanged();
81 /**
82 * Checks if the mousecursor is in the contact list.
83 * If not, the window will be hidden.
85 void slotAutoHide();
87 /**
88 * Resize window to fit size of contact list nicely.
90 void slotUpdateSize();
92 void slotStartAutoResizeTimer();
94 /**
95 * This slot will apply settings that change the
96 * contact list's appearance. Only autohiding is
97 * handled here at the moment
99 void slotContactListAppearanceChanged();
102 * This slot will set all the protocols to away
104 void slotGlobalAway();
105 void slotGlobalBusy();
106 void slotGlobalAvailable();
107 void slotSetInvisibleAll();
108 void slotDisconnectAll();
110 void slotQuit();
113 * Get a notification when a plugin is loaded, so we can merge
114 * XMLGUI cruft
116 void slotPluginLoaded( Kopete::Plugin *p );
119 * Get a notification when an identity is created, so we can add a status bar
120 * icon
121 * @param identity the registered identity
123 void slotIdentityRegistered( Kopete::Identity *identity );
126 * Cleanup the status bar icon when the identity is destroyed
127 * @param identity the unregistered identity
129 void slotIdentityUnregistered( const Kopete::Identity *identity );
132 * The tooltip got changed, update it.
133 * @param identity the identity that has changed
135 void slotIdentityToolTipChanged( Kopete::Identity *identity );
138 * The status icon got changed, update it.
139 * @param identity the identity that has changed
141 void slotIdentityStatusIconChanged( Kopete::Identity *identity );
144 * Show a in-place widget for an identity
146 void slotIdentityStatusIconLeftClicked( Kopete::Identity *i,
147 const QPoint &p );
151 * This is used to add the account to the "Add Contact" submenu
153 void slotAccountRegistered( Kopete::Account *account );
156 * This is used to add the account to the "Add Contact" submenu
158 void slotAccountUnregistered( const Kopete::Account *account );
160 void slotTrayAboutToShowMenu(KMenu *);
163 * Show the Add Contact wizard
165 void showAddContactDialog( Kopete::Account * );
168 * Show the Export Contacts wizards
170 void showExportDialog();
173 * Enable the Connect All and Disconnect All buttons here
174 * along with connecting the accountRegistered and accountUnregistered
175 * signals.
177 void slotAllPluginsLoaded();
180 * Show the set global status message menu when clicking on the icon in the status bar.
182 void slotGlobalStatusMessageIconClicked( const QPoint &position );
185 * Show Info Event widget and if necessary raise the Kopete window.
187 void slotShowInfoEventWidget();
190 * Show/hide Info Event widget.
192 void slotInfoIconClicked();
195 * Extracts protocolId and accountId from the single QString argument signalled by a QSignalMapper,
196 * get the account, and call showAddContactDialog.
197 * @param accountIdentifer QString of protocolId and accountId, concatenated with QChar( 0xE000 )
198 * We need both to uniquely identify an account, but QSignalMapper only emits one QString.
200 void slotAddContactDialogInternal( const QString & accountIdentifier );
202 void updateStatusMenuMessage( Kopete::StatusRootAction *statusRootAction );
204 private:
205 void initView();
206 void initActions();
207 void initSystray();
208 void loadOptions();
209 void saveOptions();
211 void makeTrayToolTip();
212 void startAutoHideTimer();
214 virtual bool queryClose();
215 virtual bool queryExit();
217 private:
218 class Private;
219 Private * const d;
223 class GlobalStatusMessageIconLabel : public QLabel
225 Q_OBJECT
226 public:
227 GlobalStatusMessageIconLabel(QWidget *parent = 0);
229 protected:
230 void mouseReleaseEvent(QMouseEvent *event);
232 signals:
233 void iconClicked(const QPoint &position);
237 class InfoEventIconLabel : public QLabel
239 Q_OBJECT
240 public:
241 InfoEventIconLabel( QWidget *parent = 0 );
243 protected:
244 void mouseReleaseEvent( QMouseEvent *event );
246 signals:
247 void clicked();
249 private slots:
250 void updateIcon();
254 #endif
255 // vim: set noet ts=4 sts=4 sw=4: