not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / taskmanager / taskitem.h
blob72ac03f1a25483fa1b1065151b4415abd12e5517
1 /***************************************************************************
2 * *
3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. *
7 * *
8 * This program is distributed in the hope that it will be useful, *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11 * GNU General Public License for more details. *
12 * *
13 * You should have received a copy of the GNU General Public License *
14 * along with this program; if not, write to the *
15 * Free Software Foundation, Inc., *
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
17 ***************************************************************************/
19 #ifndef TASKITEM_H
20 #define TASKITEM_H
22 #include <taskmanager/abstractgroupableitem.h>
23 #include <taskmanager/startup.h>
24 #include <taskmanager/task.h>
25 #include <taskmanager/taskmanager_export.h>
27 #include <QtGui/QIcon>
29 namespace TaskManager
33 /**
34 * Wrapper class so we do not have to use the Task class directly and the TaskPtr remains guarded
36 class TASKMANAGER_EXPORT TaskItem : public AbstractGroupableItem
38 Q_OBJECT
39 public:
40 /** Creates a taskitem for a task*/
41 TaskItem(QObject *parent, TaskPtr item);
42 /** Creates a taskitem for a startuptask*/
43 TaskItem(QObject *parent, StartupPtr item);
44 ~TaskItem();
45 /** Sets the taskpointer after the startup pointer */
46 void setTaskPointer(TaskPtr);
47 /** Returns the shared pointer to the Task */
48 TaskPtr task() const;
50 StartupPtr startup() const;
51 bool isGroupItem() const { return false; }
53 QIcon icon() const;
54 QString name() const;
56 bool isOnCurrentDesktop() const;
57 bool isOnAllDesktops() const;
58 int desktop() const;
59 bool isShaded() const;
60 bool isMaximized() const;
61 bool isMinimized() const;
62 bool isFullScreen() const;
63 bool isKeptBelowOthers() const;
64 bool isAlwaysOnTop() const;
65 bool isActive() const;
66 bool demandsAttention() const;
67 bool isActionSupported(NET::Action) const;
68 void addMimeData(QMimeData *mimeData) const;
70 public Q_SLOTS:
71 void toDesktop(int);
73 void setShaded(bool);
74 void toggleShaded();
76 void setMaximized(bool);
77 void toggleMaximized();
79 void setMinimized(bool);
80 void toggleMinimized();
82 void setFullScreen(bool);
83 void toggleFullScreen();
85 void setKeptBelowOthers(bool);
86 void toggleKeptBelowOthers();
88 void setAlwaysOnTop(bool);
89 void toggleAlwaysOnTop();
91 void close();
93 Q_SIGNALS:
94 /** Indicates that the startup task now is a normal task */
95 void gotTaskPointer();
97 private:
98 class Private;
99 Private * const d;
102 } // TaskManager namespace
104 #endif