qwwtaskpanel.h

00001 //
00002 // C++ Interface: qwwtaskpanel
00003 //
00004 // Description:
00005 //
00006 //
00007 // Author: Witold Wysota <wysota@wysota.eu.org>, (C) 2007
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 #ifndef QWWTASKPANEL_H
00013 #define QWWTASKPANEL_H
00014 #ifndef WW_NO_TASKPANEL
00015 #include <QScrollArea>
00016 #include <QList>
00017 #include <QIcon>
00018 #include <wwglobal.h>
00019 
00020 class Q_WW_EXPORT QwwTaskPanel : public QScrollArea {
00021     Q_OBJECT
00022     Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
00023     Q_PROPERTY(QIcon toggleIcon READ toggleIcon WRITE setToggleIcon)
00024     Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated)
00025 public:
00026     QwwTaskPanel(QWidget *parent = 0);
00027     ~QwwTaskPanel();
00028     void addTask(QWidget *task, const QString &label = QString());
00029     void addTask(QWidget *task, const QIcon &icon, const QString &label = QString());
00030 
00031     void insertTask(int index, QWidget *task, const QString &label = QString());
00032     void insertTask(int index, QWidget *task, const QIcon &icon, const QString &label = QString());
00033     void removeTask(int index);
00034     int taskCount() const;
00035     QWidget *task(int index) const;
00036     QWidget *currentTask() const;
00037     int indexOf(QWidget *task) const;
00038     const QIcon &toggleIcon() const { return m_toggleIcon; }
00039     void setToggleIcon(const QIcon &icon);
00040     void setTaskIcon(int index, const QIcon &icon);
00041     void setTaskTitle(int index, const QString &title);
00042     void setTaskName(int index, const QString &name);
00043     int currentIndex() const { return m_current; }
00044     bool isAnimated() const { return m_animated; }
00045     //void setCurrentTask(QWidget *task);
00046 public slots:
00047     void setCurrentIndex(int index);
00048     void setAnimated(bool a){ m_animated = a; }
00049 signals:
00050     void currentIndexChanged(int);
00051 private:
00052     QList<QWidget*> m_tasks;
00053     QWidget *m_panel;
00054     QIcon m_toggleIcon;
00055     int m_current;
00056     bool m_animated;
00057 };
00058 
00059 
00060 #endif
00061 #endif

Generated on Sat Apr 21 21:54:36 2007 for wwWidgets by  doxygen 1.5.1