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 <QtGui/QIcon>
24 #include <taskmanager/abstractgroupableitem.h>
25 #include <taskmanager/taskmanager_export.h>
32 * TaskGroup, a container for tasks and subgroups
34 class TASKMANAGER_EXPORT TaskGroup
: public AbstractGroupableItem
38 TaskGroup(GroupManager
*parent
, const QString
& name
, const QColor
& color
);
39 TaskGroup(GroupManager
*parent
);
42 ItemList
members() const;
45 void setIcon(const QIcon
&icon
);
48 void setColor(const QColor
&color
);
51 void setName(const QString
&newName
);
53 virtual bool isGroupItem() const { return true; }
54 bool isRootGroup() const;
56 /** only true if item is in this group */
57 bool hasDirectMember(AbstractItemPtr item
) const;
58 /** only true if item is in this or any sub group */
59 bool hasMember(AbstractItemPtr item
) const;
60 /** Returns Direct Member group if the passed item is in a subgroup */
61 AbstractItemPtr
directMember(AbstractItemPtr
) const;
64 bool isShaded() const;
65 bool isMaximized() const;
66 bool isMinimized() const;
67 bool isFullScreen() const;
68 bool isKeptBelowOthers() const;
69 bool isAlwaysOnTop() const;
70 bool isActionSupported(NET::Action
) const;
71 /** returns true if at least one member is active */
72 bool isActive() const;
73 /** returns true if at least one member is demands attention */
74 bool demandsAttention() const;
75 bool isOnAllDesktops() const;
76 bool isOnCurrentDesktop() const;
77 void addMimeData(QMimeData
*mimeData
) const;
80 * Sorting strategies may use this to move items around
81 * @param oldIndex the index the item to be moved is currently at
82 * @param newIndex the index the item will be moved to
84 bool moveItem(int oldIndex
, int newIndex
);
87 /** the following are functions which perform the corresponding actions on all member tasks */
93 void setMaximized(bool);
94 void toggleMaximized();
96 void setMinimized(bool);
97 void toggleMinimized();
99 void setFullScreen(bool);
100 void toggleFullScreen();
102 void setKeptBelowOthers(bool);
103 void toggleKeptBelowOthers();
105 void setAlwaysOnTop(bool);
106 void toggleAlwaysOnTop();
108 /** close all members of this group */
111 /** add item to group */
112 void add(AbstractItemPtr
);
114 /** remove item from group */
115 void remove(AbstractItemPtr
);
117 /** Removes all tasks and groups from this group */
121 /** inform visualization about wat is added and removed */
122 void itemAdded(const AbstractItemPtr item
);
123 void itemRemoved(const AbstractItemPtr item
);
124 void groupEditRequest();
125 /** inform visualization about position change */
126 void itemPositionChanged(AbstractItemPtr item
);
127 /** The group changed the desktop, is emitted in the toDesktop function */
128 void movedToDesktop(int newDesk
);
136 } // TaskManager namespace