| 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 DEFAULTDOCKICON_H |
|---|
| 22 | #define DEFAULTDOCKICON_H |
|---|
| 23 | |
|---|
| 24 | class QMenu; |
|---|
| 25 | class QPixmap; |
|---|
| 26 | |
|---|
| 27 | #include "dockicon.h" |
|---|
| 28 | |
|---|
| 29 | namespace LicqQtGui |
|---|
| 30 | { |
|---|
| 31 | /** |
|---|
| 32 | * Standard dock icon |
|---|
| 33 | * Can be displayed in two sizes: 64x64 and 64x48. |
|---|
| 34 | */ |
|---|
| 35 | class DefaultDockIcon : public DockIcon |
|---|
| 36 | { |
|---|
| 37 | Q_OBJECT |
|---|
| 38 | |
|---|
| 39 | public: |
|---|
| 40 | /** |
|---|
| 41 | * Constructor |
|---|
| 42 | * |
|---|
| 43 | * @param menu System menu to popup from tray icon |
|---|
| 44 | */ |
|---|
| 45 | DefaultDockIcon(QMenu* menu); |
|---|
| 46 | |
|---|
| 47 | /** |
|---|
| 48 | * Update number of unread events |
|---|
| 49 | * |
|---|
| 50 | * @param newMsg Number of unread user events |
|---|
| 51 | * @param sysMsg Number of unread system events |
|---|
| 52 | */ |
|---|
| 53 | virtual void updateIconMessages(int newMsg, int sysMsg); |
|---|
| 54 | |
|---|
| 55 | /** |
|---|
| 56 | * Popup message from system tray |
|---|
| 57 | * NOT IMPLEMENTED FOR DEFAULT ICON |
|---|
| 58 | * |
|---|
| 59 | * @param title Popup title text |
|---|
| 60 | * @param message Message text |
|---|
| 61 | * @param icon Icon to display in the popup |
|---|
| 62 | * @param timeout Time before hiding popup |
|---|
| 63 | */ |
|---|
| 64 | virtual void popupMessage(QString /* title */, QString /* message */, const QPixmap& /* icon */, int /* timeout */) {} |
|---|
| 65 | |
|---|
| 66 | protected slots: |
|---|
| 67 | /** |
|---|
| 68 | * Updated the icon for current status |
|---|
| 69 | */ |
|---|
| 70 | virtual void updateStatusIcon(); |
|---|
| 71 | |
|---|
| 72 | /** |
|---|
| 73 | * Updated the icon for current event |
|---|
| 74 | */ |
|---|
| 75 | virtual void updateEventIcon(); |
|---|
| 76 | |
|---|
| 77 | /** |
|---|
| 78 | * Update configuration for dock icon |
|---|
| 79 | */ |
|---|
| 80 | virtual void updateConfig(); |
|---|
| 81 | |
|---|
| 82 | private: |
|---|
| 83 | /** |
|---|
| 84 | * Draws a given @a icon into the 64x64 dock icon area |
|---|
| 85 | * |
|---|
| 86 | * @param icon The icon to draw |
|---|
| 87 | */ |
|---|
| 88 | void drawIcon64(QPixmap* icon); |
|---|
| 89 | |
|---|
| 90 | bool myFortyEight; |
|---|
| 91 | }; |
|---|
| 92 | |
|---|
| 93 | } // namespace LicqQtGui |
|---|
| 94 | |
|---|
| 95 | #endif |
|---|