add more spacing
[personal-kdebase.git] / workspace / libs / taskmanager / taskgroup.h
blobf8ea3b0683d9a068730f059122621ecbfd92e278
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 TASKGROUP_H
20 #define TASKGROUP_H
22 #include <QtGui/QIcon>
24 #include <taskmanager/abstractgroupableitem.h>
25 #include <taskmanager/taskmanager_export.h>
27 namespace TaskManager
29 class GroupManager;
31 /**
32 * TaskGroup, a container for tasks and subgroups
34 class TASKMANAGER_EXPORT TaskGroup : public AbstractGroupableItem
36 Q_OBJECT
37 public:
38 TaskGroup(GroupManager *parent, const QString& name, const QColor& color);
39 TaskGroup(GroupManager *parent);
40 ~TaskGroup();
42 ItemList members() const;
44 QIcon icon() const;
45 void setIcon(const QIcon &icon);
47 QColor color() const;
48 void setColor(const QColor &color);
50 QString name() const;
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;
63 int desktop() 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;
79 /**
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);
86 public Q_SLOTS:
87 /** the following are functions which perform the corresponding actions on all member tasks */
88 void toDesktop(int);
90 void setShaded(bool);
91 void toggleShaded();
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 */
109 void close();
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 */
118 void clear();
120 Q_SIGNALS:
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);
130 private:
131 class Private;
132 Private * const d;
136 } // TaskManager namespace
138 #endif