25#ifndef __taskmanager_h__
26#define __taskmanager_h__
32#include <tqvaluelist.h>
36#include <dcopobject.h>
38#include <tdestartupinfo.h>
39#include "karambaapp.h"
53 TQ_PROPERTY( TQString name READ name )
54 TQ_PROPERTY( TQString visibleName READ visibleName )
55 TQ_PROPERTY( TQString visibleNameWithState READ visibleNameWithState )
56 TQ_PROPERTY( TQString iconName READ iconName )
57 TQ_PROPERTY( TQString visibleIconName READ visibleIconName )
62 TQ_PROPERTY(
bool active READ
isActive )
78 WId window()
const {
return _win; }
80 TQString name()
const {
return _info.name(); }
81 TQString visibleName()
const {
return _info.visibleName(); }
85 int desktop()
const {
return _info.desktop(); }
87 TQString name()
const {
return _info.name; }
88 TQString visibleName()
const {
return _info.visibleName; }
92 int desktop()
const {
return _info.desktop; }
94 TQString visibleNameWithState()
const {
return _info.visibleNameWithState(); }
95 TQString iconName()
const;
96 TQString visibleIconName()
const;
98 TQString classClass();
111 TQPixmap
pixmap()
const {
return _pixmap; }
127 TQPixmap
bestIcon(
int size,
bool &isStaticIcon );
138 TQPixmap
icon(
int width,
int height,
bool allowResize =
false );
144 static bool idMatch(
const TQString &,
const TQString &);
201 void refresh(
bool icon =
false);
203 void addTransient( WId w ) { _transients.append( w ); }
205 void removeTransient( WId w ) { _transients.remove( w ); }
207 bool hasTransient( WId w )
const {
return _transients.contains( w ); }
209 void setActive(
bool a);
286 void toggleAlwaysOnTop();
346 void generateThumbnail();
353 KWin::WindowInfo _info;
357 TQValueList<WId> _transients;
368 class TaskPrivate *d;
380 TQ_PROPERTY( TQString
text READ
text )
381 TQ_PROPERTY( TQString
bin READ
bin )
382 TQ_PROPERTY( TQString
icon READ
icon )
385 Startup(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data, TQObject * parent,
386 const char *name = 0);
392 TQString
text()
const {
return _data.findName(); }
397 TQString
bin()
const {
return _data.bin(); }
402 TQString
icon()
const {
return _data.findIcon(); }
403 void update(
const TDEStartupInfoData& data );
404 const TDEStartupInfoId& id()
const {
return _id; }
413 TDEStartupInfoId _id;
414 TDEStartupInfoData _data;
415 class StartupPrivate *d;
418typedef TQPtrList<Task> TaskList;
419typedef TQPtrList<Startup> StartupList;
440 TaskManager( TQObject *parent = 0,
const char *name = 0 );
447 TaskList
tasks()
const {
return _tasks; }
514 void windowAdded(WId);
516 void windowRemoved(WId);
521 void activeWindowChanged(WId);
523 void currentDesktopChanged(
int);
525 void killStartup(
const TDEStartupInfoId& );
530 void gotNewStartup(
const TDEStartupInfoId&,
const TDEStartupInfoData& );
532 void gotStartupChange(
const TDEStartupInfoId&,
const TDEStartupInfoData& );
534 void gotRemoveStartup(
const TDEStartupInfoId& );
541 void configure_startup();
546 TQValueList< WId > _skiptaskbar_windows;
547 StartupList _startups;
548 TDEStartupInfo* _startup_info;
550 class TaskManagerPrivate *d;
Represents a task which is in the process of starting.
TQString text() const
The name of the starting task (if known).
void changed()
Indicates that this startup has changed in some way.
TQString icon() const
The name of the icon to be used for the starting task.
TQString bin() const
The name of the executable of the starting task.
A generic API for task managers.
int numberOfDesktops() const
Returns the number of virtual desktops.
void windowChanged(WId)
Emitted when a window changes desktop.
Task * findTask(WId w)
Returns the task for a given WId, or 0 if there is no such task.
void activeTaskChanged(Task *)
Emitted when the active window changed.
TQString desktopName(int n) const
Returns the name of the nth desktop.
StartupList startups() const
Returns a list of all current startups.
int currentDesktop() const
Returns the number of the current desktop.
bool isOnTop(const Task *)
Returns true if the specified task is on top.
void startupAdded(Startup *)
Emitted when a new task is expected.
void desktopChanged(int desktop)
Emitted when the current desktop changes.
void startupRemoved(Startup *)
Emitted when a startup item should be removed.
TaskList tasks() const
Returns a list of all current tasks.
void taskAdded(Task *)
Emitted when a new task has started.
void taskRemoved(Task *)
Emitted when a task has terminated.
A dynamic interface to a task (main window).
void raise()
Raise the task's window.
bool isActive() const
Returns true if the task's window is the active window.
void maximize()
Maximise the main window of this task.
void publishIconGeometry(TQRect)
This method informs the window manager of the location at which this task will be displayed when icon...
bool isOnAllDesktops() const
Returns true if the task's window is on all virtual desktops.
bool isShaded() const
Returns true if the task's window is shaded.
TQPixmap pixmap() const
Returns a 16x16 (TDEIcon::Small) icon for the task.
void activate()
Activate the task's window.
const TQPixmap & thumbnail() const
Returns the thumbnail for this task (or a null image if there is none).
bool isModified() const
Returns true if the document the task is editing has been modified.
void lower()
Lower the task's window.
void iconChanged()
Indicates that the icon for this task has changed.
bool isIconified() const
Returns true if the task's window is iconified.
void toDesktop(int)
Moves the task's window to the specified virtual desktop.
bool isAlwaysOnTop() const
Returns true if the task's window will remain at the top of the stacking order.
bool isOnCurrentDesktop() const
Returns true if the task's window is on the current virtual desktop.
void thumbnailChanged()
Indicates that the thumbnail for this task has changed.
void toCurrentDesktop()
Moves the task's window to the current virtual desktop.
void activated()
Indicates that this task is now the active task.
bool hasThumbnail() const
Returns true if this task has a thumbnail.
void activateRaiseOrIconify()
Perform the action that is most appropriate for this task.
TQValueList< WId > transients() const
A list of the window ids of all transient windows (dialogs) associated with this task.
void changed()
Indicates that this task has changed in some way.
void restore()
Restore the main window of the task (if it was iconified).
TQPixmap bestIcon(int size, bool &isStaticIcon)
Returns the best icon for any of the TDEIcon::StdSizes.
int desktop() const
Returns the desktop on which this task's window resides.
double thumbnailSize() const
Returns the current thumbnail size.
void iconify()
Iconify the task.
TQPixmap icon(int width, int height, bool allowResize=false)
Tries to find an icon for the task with the specified size.
bool isOnTop() const
Returns true if the task's window is the topmost non-iconified, non-always-on-top window.
void setAlwaysOnTop(bool)
If true, the task's window will remain at the top of the stacking order.
void close()
Activate the task's window.
static bool idMatch(const TQString &, const TQString &)
Returns true iff the windows with the specified ids should be grouped together in the task list.
void setShaded(bool)
If true then the task's window will be shaded.
void updateThumbnail()
Tells the task to generate a new thumbnail.
bool isMaximized() const
Returns true if the task's window is maximized.
void setThumbnailSize(double size)
Sets the size for the window thumbnail.
void deactivated()
Indicates that this task is no longer the active task.