• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libtaskmanager

tasklmbmenu.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 
00003 Copyright (c) 2001 Matthias Elter <elter@kde.org>
00004 Copyright (c) 2002 John Firebaugh <jfirebaugh@kde.org>
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a copy
00007 of this software and associated documentation files (the "Software"), to deal
00008 in the Software without restriction, including without limitation the rights
00009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00010 copies of the Software, and to permit persons to whom the Software is
00011 furnished to do so, subject to the following conditions:
00012 
00013 The above copyright notice and this permission notice shall be included in
00014 all copies or substantial portions of the Software.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00019 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00022 
00023 ******************************************************************/
00024 
00025 #ifndef __tasklmbmenu_h__
00026 #define __tasklmbmenu_h__
00027 
00028 #include <QMenu>
00029 #include <QTimer>
00030 #include <QAction>
00031 #include <QDragEnterEvent>
00032 #include <QMouseEvent>
00033 #include <QDragLeaveEvent>
00034 #include <QDragMoveEvent>
00035 #include <QList>
00036 
00037 #include "taskmanager.h"
00038 
00039 #ifdef __GNUC__
00040 #warning "Need custom menu item support, which isn't there in Qt4!"
00041 #endif
00042 #if 0
00043 class TaskMenuItem : public QCustomMenuItem
00044 {
00045 public:
00046     TaskMenuItem(const QString &text,
00047                  bool active, bool minimized, bool attention);
00048     ~TaskMenuItem();
00049 
00050     void paint(QPainter*, const QColorGroup&, bool, bool, int, int, int, int);
00051     QSize sizeHint();
00052     void setAttentionState(bool state) { m_attentionState = state; }
00053 
00054 private:
00055     QString m_text;
00056     bool m_isActive;
00057     bool m_isMinimized;
00058     bool m_demandsAttention;
00059     bool m_attentionState;
00060 };
00061 #endif
00062 
00063 typedef QAction TaskMenuItem;
00064 
00065 
00066 /*****************************************************************************/
00067 
00068 class KDE_EXPORT TaskLMBMenu : public QMenu
00069 {
00070     Q_OBJECT
00071 
00072 public:
00073     explicit TaskLMBMenu(const Task::List& list, QWidget *parent = 0, const char *name = 0);
00074 
00075 protected Q_SLOTS:
00076     void dragSwitch();
00077     void attentionTimeout();
00078 
00079 protected:
00080     void dragEnterEvent(QDragEnterEvent*);
00081     void dragLeaveEvent(QDragLeaveEvent*);
00082     void dragMoveEvent(QDragMoveEvent*);
00083     void mousePressEvent(QMouseEvent*);
00084     void mouseMoveEvent(QMouseEvent*);
00085     void mouseReleaseEvent(QMouseEvent*);
00086 
00087 private:
00088     void fillMenu();
00089 
00090     Task::List m_tasks;
00091     int        m_lastDragId;
00092     bool       m_attentionState;
00093     QTimer*    m_attentionTimer;
00094     QTimer*    m_dragSwitchTimer;
00095     QPoint     m_dragStartPos;
00096     QList<TaskMenuItem*> m_attentionMap;
00097 };
00098 
00099 #endif

libtaskmanager

Skip menu "libtaskmanager"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal