1 /***************************************************************************
2 * Copyright (C) 2007 by Robert Knight <robertknight@gmail.com> *
3 * Copyright (C) 2008 by Alexis Ménard <darktears31@gmail.com> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
19 ***************************************************************************/
25 #include "ui_tasksConfig.h"
32 #include <taskmanager/taskmanager.h>
33 #include <taskmanager/abstractgroupableitem.h>
34 #include <taskmanager/groupmanager.h>
35 #include <taskmanager/taskitem.h>
36 #include <taskmanager/startup.h>
40 #include <Plasma/Applet>
42 class QGraphicsLinearLayout
;
54 class AbstractTaskItem
;
56 using TaskManager::StartupPtr
;
57 using TaskManager::TaskPtr
;
58 using TaskManager::StartupPtr
;
59 using TaskManager::GroupPtr
;
60 using TaskManager::AbstractItemPtr
;
61 using TaskManager::AbstractGroupableItem
;
62 using TaskManager::GroupManager
;
63 using TaskManager::TaskItem
;
64 using TaskManager::TaskGroup
;
67 * An applet which provides a visual representation of running
68 * graphical tasks (ie. tasks that have some form of visual interface),
69 * and allows the user to perform various actions on those tasks such
70 * as bringing them to the foreground, sending them to the background
73 class Tasks
: public Plasma::Applet
78 * Constructs a new tasks applet
79 * With the specified parent.
81 explicit Tasks(QObject
*parent
, const QVariantList
&args
= QVariantList());
86 void constraintsEvent(Plasma::Constraints constraints
);
88 Plasma::FrameSvg
*itemBackground();
89 KColorScheme
*colorScheme();
91 qreal
itemLeftMargin() { return m_leftMargin
; }
92 qreal
itemRightMargin() { return m_rightMargin
; }
93 qreal
itemTopMargin() { return m_topMargin
; }
94 qreal
itemBottomMargin() { return m_bottomMargin
; }
95 void resizeItemBackground(const QSizeF
&newSize
);
97 TaskGroupItem
* rootGroupItem();
99 TaskManager::GroupManager
&groupManager() const;
101 Qt::KeyboardModifiers
groupModifierKey() const;
103 bool showTooltip() const;
108 * emitted whenever we receive a constraintsEvent
110 void constraintsChanged(Plasma::Constraints
);
112 void desktopChanged(int,int);
113 void settingsChanged();
116 void configAccepted();
120 void createConfigurationInterface(KConfigDialog
*parent
);
121 QSizeF
sizeHint(Qt::SizeHint which
, const QSizeF
& constraint
= QSizeF()) const;
122 void adjustGroupingStrategy();
126 * Somthing has changed in the tree of the GroupingStrategy
129 //void groupRemoved(TaskGroup *item);
130 void changeSizeHint(Qt::SizeHint which
);
131 void dialogGroupingChanged(int index
);
135 Plasma::LayoutAnimator
*m_animator
;
136 QGraphicsLinearLayout
*layout
;
138 Ui::tasksConfig m_ui
;
139 QTimer m_screenTimer
;
141 Plasma::FrameSvg
*m_taskItemBackground
;
142 KColorScheme
*m_colorScheme
;
146 qreal m_bottomMargin
;
148 TaskGroupItem
*m_rootGroupItem
;
149 GroupManager
*m_groupManager
;
150 TaskManager::GroupManager::TaskGroupingStrategy m_groupingStrategy
;
151 bool m_groupWhenFull
;
152 Qt::KeyboardModifier m_groupModifierKey
;
154 int m_currentDesktop
;