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

Applets

WindowTaskItem Class Reference

#include <windowtaskitem.h>

Inheritance diagram for WindowTaskItem:

Inheritance graph
[legend]

List of all members.


Detailed Description

A task item for a task which represents a window on the desktop.

Definition at line 52 of file windowtaskitem.h.


Public Types

enum  TaskFlag { TaskWantsAttention = 1, TaskHasFocus = 2, TaskIsMinimized = 4 }

Public Slots

virtual void activate ()

Signals

void activated (WindowTaskItem *)
void windowSelected (WindowTaskItem *)

Public Member Functions

virtual void close ()
QIcon icon () const
void publishIconGeometry ()
void setGeometry (const QRectF &geometry)
void setIcon (const QIcon &icon)
void setShowTooltip (const bool showit)
void setStartupTask (TaskManager::StartupPtr task)
void setTaskFlags (TaskFlags flags)
void setText (const QString &text)
void setWindowTask (TaskManager::TaskPtr task)
TaskFlags taskFlags () const
QString text () const
TaskManager::TaskPtr windowTask () const
 WindowTaskItem (Tasks *parent, const bool showTooltip)

Protected Member Functions

virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
virtual void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
virtual void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
virtual void drawBackground (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
virtual void drawTask (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void drawTextLayout (QPainter *painter, const QTextLayout &layout, const QRect &rect) const
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
QSize layoutText (QTextLayout &layout, const QString &text, const QSize &constraints) const
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void queueUpdate ()
virtual void resizeEvent (QGraphicsSceneResizeEvent *event)
QTextOption textOption () const
virtual void timerEvent (QTimerEvent *event)

Member Enumeration Documentation

enum WindowTaskItem::TaskFlag

This enum describes the generic flags which are currently set by the task.

Enumerator:
TaskWantsAttention  This flag is set by the task to indicate that it wants the user's attention.
TaskHasFocus  Indicates that the task's window has the focus.
TaskIsMinimized  Indicates that the task is iconified.

Definition at line 84 of file windowtaskitem.h.


Constructor & Destructor Documentation

WindowTaskItem::WindowTaskItem ( Tasks *  parent,
const bool  showTooltip 
)

Constructs a new representation for a window task.

Definition at line 47 of file windowtaskitem.cpp.


Member Function Documentation

void WindowTaskItem::activate (  )  [virtual, slot]

Definition at line 70 of file windowtaskitem.cpp.

void WindowTaskItem::activated ( WindowTaskItem *   )  [signal]

void WindowTaskItem::close (  )  [virtual]

Definition at line 90 of file windowtaskitem.cpp.

void WindowTaskItem::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event  )  [protected, virtual]

Definition at line 625 of file windowtaskitem.cpp.

void WindowTaskItem::dragEnterEvent ( QGraphicsSceneDragDropEvent *  event  )  [protected, virtual]

Definition at line 636 of file windowtaskitem.cpp.

void WindowTaskItem::dragLeaveEvent ( QGraphicsSceneDragDropEvent *  event  )  [protected, virtual]

Definition at line 657 of file windowtaskitem.cpp.

void WindowTaskItem::dragMoveEvent ( QGraphicsSceneDragDropEvent *  event  )  [protected, virtual]

Definition at line 648 of file windowtaskitem.cpp.

void WindowTaskItem::drawBackground ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [protected, virtual]

Draws the background for the task item.

Definition at line 228 of file windowtaskitem.cpp.

void WindowTaskItem::drawTask ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [protected, virtual]

Draws the icon and text which represent the task item.

Definition at line 388 of file windowtaskitem.cpp.

void WindowTaskItem::drawTextLayout ( QPainter *  painter,
const QTextLayout &  layout,
const QRect &  rect 
) const [protected]

Draws the text layout (which must already have the text laid out) in the rect using the supplied painter.

If the layout contains text lines that are longer than the rect is wide, they will be elided by fading the text out.

Definition at line 458 of file windowtaskitem.cpp.

void WindowTaskItem::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event  )  [protected, virtual]

Definition at line 152 of file windowtaskitem.cpp.

void WindowTaskItem::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event  )  [protected, virtual]

Definition at line 166 of file windowtaskitem.cpp.

QIcon WindowTaskItem::icon (  )  const

Returns the current icon for this task.

QSize WindowTaskItem::layoutText ( QTextLayout &  layout,
const QString &  text,
const QSize &  constraints 
) const [protected]

Lays the text out in the text layout using the constraints, and returns the actual size required.

The returned size may be wider than the constraints if the text contains a non-breakable word that is wider than the maximum width. If more height is needed than what's available, the last line that will fit will be extended to hold the remainder of the text.

Definition at line 421 of file windowtaskitem.cpp.

void WindowTaskItem::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual]

Definition at line 185 of file windowtaskitem.cpp.

void WindowTaskItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual]

Definition at line 180 of file windowtaskitem.cpp.

void WindowTaskItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [protected, virtual]

Definition at line 215 of file windowtaskitem.cpp.

void WindowTaskItem::publishIconGeometry (  ) 

Tells the window manager the minimized task's geometry.

Definition at line 671 of file windowtaskitem.cpp.

void WindowTaskItem::queueUpdate (  )  [protected]

Event compression.

Definition at line 137 of file windowtaskitem.cpp.

void WindowTaskItem::resizeEvent ( QGraphicsSceneResizeEvent *  event  )  [protected, virtual]

Definition at line 208 of file windowtaskitem.cpp.

void WindowTaskItem::setGeometry ( const QRectF &  geometry  ) 

Overrided from LayoutItem.

Definition at line 665 of file windowtaskitem.cpp.

void WindowTaskItem::setIcon ( const QIcon &  icon  ) 

Sets the icon for this task item.

Definition at line 108 of file windowtaskitem.cpp.

void WindowTaskItem::setShowTooltip ( const bool  showit  ) 

Switch on/off tooltips above tasks.

Definition at line 97 of file windowtaskitem.cpp.

void WindowTaskItem::setStartupTask ( TaskManager::StartupPtr  task  ) 

Sets the starting task represented by this item.

Definition at line 587 of file windowtaskitem.cpp.

void WindowTaskItem::setTaskFlags ( TaskFlags  flags  ) 

Sets the task flags for this item.

Definition at line 113 of file windowtaskitem.cpp.

void WindowTaskItem::setText ( const QString &  text  ) 

Sets the text for this task item.

Definition at line 103 of file windowtaskitem.cpp.

void WindowTaskItem::setWindowTask ( TaskManager::TaskPtr  task  ) 

Sets the window represented by this task.

Definition at line 601 of file windowtaskitem.cpp.

WindowTaskItem::TaskFlags WindowTaskItem::taskFlags (  )  const

Returns the task's current flags.

Definition at line 132 of file windowtaskitem.cpp.

QString WindowTaskItem::text (  )  const

Returns current text for this task.

QTextOption WindowTaskItem::textOption (  )  const [protected]

Returns a QTextOption object for the icon label QTtextLayout.

Definition at line 409 of file windowtaskitem.cpp.

void WindowTaskItem::timerEvent ( QTimerEvent *  event  )  [protected, virtual]

Definition at line 190 of file windowtaskitem.cpp.

void WindowTaskItem::windowSelected ( WindowTaskItem *   )  [signal]

Emitted when a window is selected for activation, minimization, iconification.

TaskManager::TaskPtr WindowTaskItem::windowTask (  )  const

Returns the window represented by this task.

Definition at line 620 of file windowtaskitem.cpp.


The documentation for this class was generated from the following files:
  • windowtaskitem.h
  • windowtaskitem.cpp

Applets

Skip menu "Applets"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

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