add more spacing
[personal-kdebase.git] / workspace / libs / taskmanager / taskactions.h
blob6e79c904f81c5b538412e3839ed89907cdd83926
1 /*****************************************************************
3 Copyright 2008 Christian Mollekopf <chrigi_1@hotmail.com>
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 ******************************************************************/
24 #ifndef TASKACTIONS_H
25 #define TASKACTIONS_H
27 // Qt
28 #include <QtGui/QMenu>
29 #include <QtGui/QAction>
31 // Own
32 #include <taskmanager/groupmanager.h>
33 #include <taskmanager/task.h>
34 #include <taskmanager/taskgroup.h>
35 #include <taskmanager/taskitem.h>
36 #include <taskmanager/taskmanager_export.h>
38 namespace TaskManager
41 enum GroupableAction { MaximizeAction = 0,
42 MinimizeAction,
43 ToCurrentDesktopAction,
44 ToDesktopAction,
45 ShadeAction,
46 CloseAction,
47 ViewFullscreenAction,
48 KeepBelowAction
51 enum TaskAction { ResizeAction = 0,
52 MoveAction
55 enum GroupingAction { LeaveGroupAction = 0
58 /**
59 * Factory method to create standard actions for groupable items.
61 * @param action the action to create
62 * @param item the groupable item to associate it with
63 * @param parent the parent for the action
64 * @param desktop the desktop to associate the action with, only used for ToDesktopAction
66 QAction *standardGroupableAction(GroupableAction action, AbstractItemPtr item, QObject *parent = 0, int desktop = 0);
68 /**
69 * Factory method to create standard actions for groupable items.
71 * @param action the action to create
72 * @param task the task to associate it with
73 * @param parent the parent for the action
75 QAction *standardTaskAction(TaskAction action, TaskItem *task, QObject *parent = 0);
77 /**
78 * Factory method to create standard actions for groupable items.
80 * @param action the action to create
81 * @param item the groupable item to associate it with
82 * @param strategy the GroupManager used to coorinate the grouping
83 * @param parent the parent for the action
85 QAction* standardGroupingAction(GroupingAction action, AbstractItemPtr item,
86 GroupManager *strategy, QObject *parent = 0);
88 /** The ToDesktop menu */
89 class TASKMANAGER_EXPORT DesktopsMenu : public QMenu
91 Q_OBJECT
92 public:
93 DesktopsMenu(QWidget *parent, AbstractItemPtr task);
96 /** Menu with the actions that the groupingStrategy provides*/
97 class TASKMANAGER_EXPORT GroupingStrategyMenu : public QMenu
99 Q_OBJECT
100 public:
101 GroupingStrategyMenu(QWidget *parent, AbstractGroupableItem *task, GroupManager *strategy);
104 /** The Advanced menu */
105 class TASKMANAGER_EXPORT AdvancedMenu : public QMenu
107 Q_OBJECT
108 public:
109 AdvancedMenu(QWidget *parent, AbstractItemPtr task);
112 /** The standard menu*/
113 class TASKMANAGER_EXPORT BasicMenu : public QMenu
115 Q_OBJECT
116 public:
117 BasicMenu(QWidget *parent, GroupPtr task, GroupManager *strategy, QList <QAction*> visualizationActions = QList <QAction*>());
118 BasicMenu(QWidget *parent, TaskItem* task, GroupManager *strategy, QList <QAction*> visualizationActions = QList <QAction*>());
121 /** A Menu that shows a list of all tasks of the group, and shows a BasicMenu on right click on an item*/
122 class TASKMANAGER_EXPORT GroupPopupMenu : public QMenu
124 Q_OBJECT
125 public:
126 GroupPopupMenu(QWidget *parent, GroupPtr task, GroupManager *strategy);
130 } // TaskManager namespace
133 #endif