Task Class Reference
#include <taskmanager.h>
Inherits QObject.
Detailed Description
A dynamic interface to a task (main window).
- See also:
- TaskManager
KWinModule
Definition at line 49 of file taskmanager.h.
Public Slots | |
void | maximize () |
void | restore () |
void | iconify () |
void | close () |
void | raise () |
void | lower () |
void | activate () |
void | activateRaiseOrIconify () |
void | setAlwaysOnTop (bool) |
void | toggleAlwaysOnTop () |
void | setShaded (bool) |
void | toggleShaded () |
void | toDesktop (int) |
void | toCurrentDesktop () |
void | publishIconGeometry (QRect) |
void | updateThumbnail () |
Signals | |
void | changed () |
void | iconChanged () |
void | activated () |
void | deactivated () |
void | thumbnailChanged () |
Public Member Functions | |
Task (WId win, TaskManager *parent, const char *name=0) | |
TaskManager * | taskManager () const |
WId | window () const |
QString | name () const |
QString | visibleName () const |
int | desktop () const |
QString | visibleNameWithState () const |
QString | iconName () const |
QString | visibleIconName () const |
QString | className () |
QString | classClass () |
QValueList< WId > | transients () const |
QPixmap | pixmap () const |
QPixmap | bestIcon (int size, bool &isStaticIcon) |
QPixmap | icon (int width, int height, bool allowResize=false) |
bool | isMaximized () const |
bool | isIconified () const |
bool | isShaded () const |
bool | isActive () const |
bool | isOnTop () const |
bool | isOnCurrentDesktop () const |
bool | isOnAllDesktops () const |
bool | isAlwaysOnTop () const |
bool | isModified () const |
void | refresh (bool icon=false) |
void | addTransient (WId w) |
void | removeTransient (WId w) |
bool | hasTransient (WId w) const |
void | setActive (bool a) |
double | thumbnailSize () const |
void | setThumbnailSize (double size) |
bool | hasThumbnail () const |
const QPixmap & | thumbnail () const |
Static Public Member Functions | |
static bool | idMatch (const QString &, const QString &) |
Protected Slots | |
void | generateThumbnail () |
Properties | |
QString | name |
QString | visibleName |
QString | visibleNameWithState |
QString | iconName |
QString | visibleIconName |
QPixmap | pixmap |
bool | maximized |
bool | iconified |
bool | shaded |
bool | active |
bool | onCurrentDesktop |
bool | onAllDesktops |
bool | alwaysOnTop |
bool | modified |
int | desktop |
double | thumbnailSize |
bool | hasThumbnail |
QPixmap | thumbnail |
Member Function Documentation
int Task::desktop | ( | ) | const [inline] |
Returns the desktop on which this task's window resides.
Definition at line 91 of file taskmanager.h.
QValueList<WId> Task::transients | ( | ) | const [inline] |
A list of the window ids of all transient windows (dialogs) associated with this task.
Definition at line 103 of file taskmanager.h.
QPixmap Task::pixmap | ( | ) | const [inline] |
Returns a 16x16 (KIcon::Small) icon for the task.
This method will only fall back to a static icon if there is no icon of any size in the WM hints.
Definition at line 110 of file taskmanager.h.
QPixmap Task::bestIcon | ( | int | size, | |
bool & | isStaticIcon | |||
) |
Returns the best icon for any of the KIcon::StdSizes.
If there is no icon of the specified size specified in the WM hints, it will try to get one using KIconLoader.
bool gotStaticIcon; QPixmap icon = myTask->icon( KIcon::SizeMedium, gotStaticIcon );
- Parameters:
-
size Any of the constants in KIcon::StdSizes. isStaticIcon Set to true if KIconLoader was used, false otherwise.
- See also:
- KIcon
Definition at line 529 of file taskmanager.cpp.
QPixmap Task::icon | ( | int | width, | |
int | height, | |||
bool | allowResize = false | |||
) |
Tries to find an icon for the task with the specified size.
If there is no icon that matches then it will either resize the closest available icon or return a null pixmap depending on the value of allowResize.
Note that the last icon is cached, so a sequence of calls with the same parameters will only query the NET properties if the icon has changed or none was found.
Definition at line 510 of file taskmanager.cpp.
bool Task::idMatch | ( | const QString & | id1, | |
const QString & | id2 | |||
) | [static] |
Returns true iff the windows with the specified ids should be grouped together in the task list.
Definition at line 606 of file taskmanager.cpp.
bool Task::isMaximized | ( | ) | const |
bool Task::isIconified | ( | ) | const |
bool Task::isShaded | ( | ) | const |
bool Task::isActive | ( | ) | const |
Returns true if the task's window is the active window.
Definition at line 453 of file taskmanager.cpp.
bool Task::isOnTop | ( | ) | const |
Returns true if the task's window is the topmost non-iconified, non-always-on-top window.
Definition at line 458 of file taskmanager.cpp.
bool Task::isOnCurrentDesktop | ( | ) | const |
Returns true if the task's window is on the current virtual desktop.
Definition at line 435 of file taskmanager.cpp.
bool Task::isOnAllDesktops | ( | ) | const |
Returns true if the task's window is on all virtual desktops.
Definition at line 444 of file taskmanager.cpp.
bool Task::isAlwaysOnTop | ( | ) | const |
Returns true if the task's window will remain at the top of the stacking order.
Definition at line 417 of file taskmanager.cpp.
bool Task::isModified | ( | ) | const |
Returns true if the document the task is editing has been modified.
This is currently handled heuristically by looking for the string '[i18n_modified]' in the window title where i18n_modified is the word 'modified' in the current language.
Definition at line 463 of file taskmanager.cpp.
double Task::thumbnailSize | ( | ) | const [inline] |
void Task::setThumbnailSize | ( | double | size | ) | [inline] |
Sets the size for the window thumbnail.
For example a size of 0.2 indicates the thumbnail will be 20% of the original window size.
Definition at line 222 of file taskmanager.h.
bool Task::hasThumbnail | ( | ) | const [inline] |
Returns true if this task has a thumbnail.
Note that this method can only ever return true after a call to updateThumbnail().
Definition at line 228 of file taskmanager.h.
const QPixmap& Task::thumbnail | ( | ) | const [inline] |
Returns the thumbnail for this task (or a null image if there is none).
Definition at line 234 of file taskmanager.h.
void Task::maximize | ( | ) | [slot] |
void Task::restore | ( | ) | [slot] |
Restore the main window of the task (if it was iconified).
Definition at line 634 of file taskmanager.cpp.
void Task::iconify | ( | ) | [slot] |
void Task::close | ( | ) | [slot] |
void Task::raise | ( | ) | [slot] |
void Task::lower | ( | ) | [slot] |
void Task::activate | ( | ) | [slot] |
void Task::activateRaiseOrIconify | ( | ) | [slot] |
Perform the action that is most appropriate for this task.
If it is not active, activate it. Else if it is not the top window, raise it. Otherwise, iconify it.
Definition at line 676 of file taskmanager.cpp.
void Task::setAlwaysOnTop | ( | bool | stay | ) | [slot] |
If true, the task's window will remain at the top of the stacking order.
Definition at line 723 of file taskmanager.cpp.
void Task::setShaded | ( | bool | shade | ) | [slot] |
If true then the task's window will be shaded.
Most window managers represent this state by displaying on the window's title bar.
Definition at line 737 of file taskmanager.cpp.
void Task::toDesktop | ( | int | desk | ) | [slot] |
Moves the task's window to the specified virtual desktop.
Definition at line 687 of file taskmanager.cpp.
void Task::toCurrentDesktop | ( | ) | [slot] |
Moves the task's window to the current virtual desktop.
Definition at line 718 of file taskmanager.cpp.
void Task::publishIconGeometry | ( | QRect | rect | ) | [slot] |
This method informs the window manager of the location at which this task will be displayed when iconised.
It is used, for example by the KWin inconify animation.
Definition at line 751 of file taskmanager.cpp.
void Task::updateThumbnail | ( | ) | [slot] |
Tells the task to generate a new thumbnail.
When the thumbnail is ready the thumbnailChanged() signal will be emitted.
Definition at line 762 of file taskmanager.cpp.
void Task::changed | ( | ) | [signal] |
Indicates that this task has changed in some way.
void Task::iconChanged | ( | ) | [signal] |
Indicates that the icon for this task has changed.
void Task::activated | ( | ) | [signal] |
Indicates that this task is now the active task.
void Task::deactivated | ( | ) | [signal] |
Indicates that this task is no longer the active task.
void Task::thumbnailChanged | ( | ) | [signal] |
Indicates that the thumbnail for this task has changed.
The documentation for this class was generated from the following files: