/* * Icon Task Manager * * Copyright 2011 Craig Drummond * * ---- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __DOCKITEM_H__ #define __DOCKITEM_H__ #include #include #include #include #include #include class AbstractTaskItem; #include #include #include class DockItem : public QObject, protected QDBusContext { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "net.launchpad.DockItem") Q_PROPERTY(QString DesktopFile READ DesktopFile) Q_PROPERTY(QString Uri READ Uri) public: DockItem(const KUrl &desktopFile); ~DockItem(); QString DesktopFile() const; QString Uri() const; const QString & path() const { return m_path; } QString name() const; const KUrl & url() const { return m_url; } const QIcon & icon() const { return m_icon; } const QIcon & overlayIcon() const { return m_overlayIcon; } const QString & badge() const { return m_badge; } int progress() const { return m_progress; } QList menu() const; void registerTask(AbstractTaskItem *item); void unregisterTask(AbstractTaskItem *item); void reset(); public Q_SLOTS: Q_SCRIPTABLE unsigned int AddMenuItem(QMap hints); void RemoveMenuItem(unsigned int id); void UpdateDockItem(QMap hints); private Q_SLOTS: void menuActivated(); void check(); Q_SIGNALS: void MenuItemActivated(unsigned int id); private: KUrl m_url; QString m_path; mutable QString m_name; QSet m_tasks; QMap m_menu; QTimer *m_timer; QString m_remoteService; QMap m_actionMenus; QString m_badge; QIcon m_icon; QIcon m_overlayIcon; int m_progress; unsigned int m_menuIdCount; }; #endif