25 #ifndef __taskmanager_h__ 26 #define __taskmanager_h__ 28 #include <sys/types.h> 32 #include <tqvaluelist.h> 33 #include <tqptrlist.h> 36 #include <dcopobject.h> 38 #include <tdestartupinfo.h> 39 #include "karambaapp.h" 49 class Task:
public TQObject
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;
418 typedef TQPtrList<Task> TaskList;
419 typedef TQPtrList<Startup> StartupList;
436 TQ_PROPERTY(
int currentDesktop READ currentDesktop )
437 TQ_PROPERTY(
int numberOfDesktops READ numberOfDesktops )
440 TaskManager( TQObject *parent = 0,
const char *name = 0 );
447 TaskList
tasks()
const {
return _tasks; }
458 TQString desktopName(
int n)
const;
463 int numberOfDesktops()
const;
468 int currentDesktop()
const;
478 void activeTaskChanged(
Task*);
483 void taskAdded(
Task*);
488 void taskRemoved(
Task*);
505 void desktopChanged(
int desktop);
510 void windowChanged(WId);
514 void windowAdded(WId);
516 void windowRemoved(WId);
518 void windowChanged(WId,
unsigned int);
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& );
540 Task* findTask(WId w);
541 void configure_startup();
546 TQValueList< WId > _skiptaskbar_windows;
547 StartupList _startups;
548 TDEStartupInfo* _startup_info;
550 class TaskManagerPrivate *d;
TQPixmap bestIcon(int size, bool &isStaticIcon)
Returns the best icon for any of the TDEIcon::StdSizes.
void setAlwaysOnTop(bool)
If true, the task's window will remain at the top of the stacking order.
void activateRaiseOrIconify()
Perform the action that is most appropriate for this task.
void iconChanged()
Indicates that the icon for this task has changed.
void changed()
Indicates that this task has changed in some way.
void thumbnailChanged()
Indicates that the thumbnail for this task has changed.
void maximize()
Maximise the main window of this task.
double thumbnailSize() const
Returns the current thumbnail size.
TQValueList< WId > transients() const
A list of the window ids of all transient windows (dialogs) associated with this task.
void activated()
Indicates that this task is now the active task.
void toDesktop(int)
Moves the task's window to the specified virtual desktop.
Represents a task which is in the process of starting.
bool isOnCurrentDesktop() const
Returns true if the task's window is on the current virtual desktop.
bool isOnAllDesktops() const
Returns true if the task's window is on all virtual desktops.
TQPixmap icon(int width, int height, bool allowResize=false)
Tries to find an icon for the task with the specified size.
A generic API for task managers.
bool isIconified() const
Returns true if the task's window is iconified.
const TQPixmap & thumbnail() const
Returns the thumbnail for this task (or a null image if there is none).
bool isAlwaysOnTop() const
Returns true if the task's window will remain at the top of the stacking order.
bool isOnTop() const
Returns true if the task's window is the topmost non-iconified, non-always-on-top window...
void setShaded(bool)
If true then the task's window will be shaded.
void publishIconGeometry(TQRect)
This method informs the window manager of the location at which this task will be displayed when icon...
bool isShaded() const
Returns true if the task's window is shaded.
int desktop() const
Returns the desktop on which this task's window resides.
TQString icon() const
The name of the icon to be used for the starting task.
TaskList tasks() const
Returns a list of all current tasks.
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 close()
Activate the task's window.
bool isModified() const
Returns true if the document the task is editing has been modified.
bool hasThumbnail() const
Returns true if this task has a thumbnail.
StartupList startups() const
Returns a list of all current startups.
void activate()
Activate the task's window.
TQString bin() const
The name of the executable of the starting task.
void iconify()
Iconify the task.
void updateThumbnail()
Tells the task to generate a new thumbnail.
TQString text() const
The name of the starting task (if known).
void restore()
Restore the main window of the task (if it was iconified).
void deactivated()
Indicates that this task is no longer the active task.
TQPixmap pixmap() const
Returns a 16x16 (TDEIcon::Small) icon for the task.
bool isActive() const
Returns true if the task's window is the active window.
void toCurrentDesktop()
Moves the task's window to the current virtual desktop.
A dynamic interface to a task (main window).
void setThumbnailSize(double size)
Sets the size for the window thumbnail.
bool isMaximized() const
Returns true if the task's window is maximized.
void lower()
Lower the task's window.