1 /***************************************************************************
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. *
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. *
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 ***************************************************************************/
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>
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
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
);
45 /** Sets the taskpointer after the startup pointer */
46 void setTaskPointer(TaskPtr
);
47 /** Returns the shared pointer to the Task */
50 StartupPtr
startup() const;
51 bool isGroupItem() const { return false; }
56 bool isOnCurrentDesktop() const;
57 bool isOnAllDesktops() 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;
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();
94 /** Indicates that the startup task now is a normal task */
95 void gotTaskPointer();
102 } // TaskManager namespace