File indexing completed on 2024-04-21 04:47:53
0001 /**************************************************************************************** 0002 * Copyright (c) 2003 Stanislav Karchebny <berkus@users.sf.net> * 0003 * Copyright (c) 2009 Mark Kretschmann <kretschmann@kde.org> * 0004 * Copyright (c) 2009-2011 Kevin Funk <krf@electrostorm.net> * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify it under * 0007 * the terms of the GNU General Public License as published by the Free Software * 0008 * Foundation; either version 2 of the License, or (at your option) any later * 0009 * version. * 0010 * * 0011 * This program is distributed in the hope that it will be useful, but WITHOUT ANY * 0012 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * 0013 * PARTICULAR PURPOSE. See the GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License along with * 0016 * this program. If not, see <http://www.gnu.org/licenses/>. * 0017 ****************************************************************************************/ 0018 0019 #ifndef AMAROK_TRAYICON_H 0020 #define AMAROK_TRAYICON_H 0021 0022 #include <KStatusNotifierItem> // baseclass 0023 0024 #include "core/meta/forward_declarations.h" 0025 0026 #include <QPointer> 0027 0028 0029 class QAction; 0030 0031 namespace Amarok { 0032 0033 class TrayIcon : public KStatusNotifierItem 0034 { 0035 Q_OBJECT 0036 0037 public: 0038 explicit TrayIcon( QObject *parent ); 0039 0040 private Q_SLOTS: 0041 void updateOverlayIcon(); 0042 void updateToolTipIcon(); 0043 void updateToolTip(); 0044 void updateMenu(); 0045 0046 void trackPlaying( const Meta::TrackPtr &track ); 0047 void stopped(); 0048 void paused(); 0049 void trackMetadataChanged( const Meta::TrackPtr &track ); 0050 void albumMetadataChanged( const Meta::AlbumPtr &album ); 0051 0052 void slotScrollRequested( int delta, Qt::Orientation orientation ); 0053 QAction* action(const QString& name, const QMap<QString, QAction *> &actionByName ); 0054 private: 0055 Meta::TrackPtr m_track; 0056 0057 QList<QAction*> m_extraActions; 0058 QPointer<QAction> m_separator; 0059 }; 0060 0061 } 0062 0063 #endif // AMAROK_TRAYICON_H