root/trunk/qt4-gui/src/dockicons/themeddockicon.h

Revision 6079, 2.4 kB (checked in by flynd, 9 months ago)

Move popup implementation to dock icon as kde want's the tray icon as reference. Added use of showMessage when building without kde support.

Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of Licq, an instant messaging client for UNIX.
4 * Copyright (C) 2007 Licq developers
5 *
6 * Licq is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Licq is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Licq; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 */
20
21#ifndef THEMEDDOCKICON_H
22#define THEMEDDOCKICON_H
23
24class QMenu;
25
26#include "dockicon.h"
27
28namespace LicqQtGui
29{
30/**
31 * Dock icon that can be use custom graphics defined externaly
32 */
33class ThemedDockIcon : public DockIcon
34{
35  Q_OBJECT
36
37public:
38  /**
39   * Constructor
40   *
41   * @param menu System menu to popup from tray icon
42   */
43  ThemedDockIcon(QMenu* menu);
44
45  /**
46   * Destructor
47   */
48  virtual ~ThemedDockIcon();
49
50  /**
51   * Update icon to reflect current status
52   */
53  virtual void updateIconStatus();
54
55  /**
56   * Update number of unread events
57   *
58   * @param newMsg Number of unread user events
59   * @param sysMsg Number of unread system events
60   */
61  virtual void updateIconMessages(int newMsg, int sysMsg);
62
63  /**
64   * Popup message from system tray
65   * NOT IMPLEMENTED FOR THEMED ICON
66   *
67   * @param title Popup title text
68   * @param message Message text
69   * @param icon Icon to display in the popup
70   * @param timeout Time before hiding popup
71   */
72  virtual void popupMessage(QString /* title */, QString /* message */, const QPixmap& /* icon */, int /* timeout */) {}
73
74protected slots:
75  /**
76   * Update configuration for dock icon
77   */
78  virtual void updateConfig();
79
80private:
81  QString myTheme;
82  QPixmap* pixNoMessages;
83  QPixmap* pixRegularMessages;
84  QPixmap* pixSystemMessages;
85  QPixmap* pixBothMessages;
86  QPixmap* pixOnline;
87  QPixmap* pixOffline;
88  QPixmap* pixAway;
89  QPixmap* pixNA;
90  QPixmap* pixOccupied;
91  QPixmap* pixDND;
92  QPixmap* pixInvisible;
93  QPixmap* pixFFC;
94
95  void cleanup(bool initial = false);
96};
97
98} // namespace LicqQtGui
99
100#endif
Note: See TracBrowser for help on using the browser.