00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __tasklmbmenu_h__
00026 #define __tasklmbmenu_h__
00027
00028 #include <tqpopupmenu.h>
00029 #include <tqtimer.h>
00030
00031 #include "taskmanager.h"
00032
00033 class TaskMenuItem : public QCustomMenuItem
00034 {
00035 public:
00036 TaskMenuItem(const TQString &text,
00037 bool active, bool minimized, bool attention);
00038 ~TaskMenuItem();
00039
00040 void paint(TQPainter*, const TQColorGroup&, bool, bool, int, int, int, int);
00041 TQSize sizeHint();
00042 void setAttentionState(bool state) { m_attentionState = state; }
00043
00044 private:
00045 TQString m_text;
00046 bool m_isActive;
00047 bool m_isMinimized;
00048 bool m_demandsAttention;
00049 bool m_attentionState;
00050 };
00051
00052
00053
00054 class KDE_EXPORT TaskLMBMenu : public QPopupMenu
00055 {
00056 Q_OBJECT
00057
00058 public:
00059 TaskLMBMenu(const Task::List& list, TQWidget *parent = 0, const char *name = 0);
00060
00061 protected slots:
00062 void dragSwitch();
00063 void attentionTimeout();
00064
00065 protected:
00066 void dragEnterEvent(TQDragEnterEvent*);
00067 void dragLeaveEvent(TQDragLeaveEvent*);
00068 void dragMoveEvent(TQDragMoveEvent*);
00069 void mousePressEvent(TQMouseEvent*);
00070 void mouseMoveEvent(TQMouseEvent*);
00071 void mouseReleaseEvent(TQMouseEvent*);
00072
00073 private:
00074 void fillMenu();
00075
00076 Task::List m_tasks;
00077 int m_lastDragId;
00078 bool m_attentionState;
00079 TQTimer* m_attentionTimer;
00080 TQTimer* m_dragSwitchTimer;
00081 TQPoint m_dragStartPos;
00082 TQValueList<TaskMenuItem*> m_attentionMap;
00083 };
00084
00085 #endif