• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libtaskmanager

groupmanager.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 
00003 Copyright 2008 Christian Mollekopf <chrigi_1@hotmail.com>
00004 
00005 Permission is hereby granted, free of charge, to any person obtaining a copy
00006 of this software and associated documentation files (the "Software"), to deal
00007 in the Software without restriction, including without limitation the rights
00008 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00009 copies of the Software, and to permit persons to whom the Software is
00010 furnished to do so, subject to the following conditions:
00011 
00012 The above copyright notice and this permission notice shall be included in
00013 all copies or substantial portions of the Software.
00014 
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00018 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00019 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00021 
00022 ******************************************************************/
00023 
00024 #ifndef GROUPMANAGER_H
00025 #define GROUPMANAGER_H
00026 
00027 #include <QtCore/QObject>
00028 
00029 #include <taskmanager/abstractgroupableitem.h>
00030 #include <taskmanager/task.h>
00031 #include <taskmanager/taskitem.h>
00032 #include <taskmanager/taskmanager_export.h>
00033 
00034 namespace TaskManager
00035 {
00036 
00037 class AbstractSortingStrategy;
00038 class AbstractGroupingStrategy;
00039 class GroupManagerPrivate;
00040 
00044 class TASKMANAGER_EXPORT GroupManager: public QObject
00045 {
00046 
00047 Q_OBJECT
00048 public:
00049     GroupManager(QObject *parent);
00050     ~GroupManager();
00051 
00056     GroupPtr rootGroup() const;
00057 
00061     enum TaskGroupingStrategy
00062     {
00063         NoGrouping = 0,
00064         ManualGrouping = 1, //Allow manual grouping
00065         ProgramGrouping = 2 //Group automatically  same programs
00066     };
00067 
00068     TaskGroupingStrategy groupingStrategy() const;
00069     void setGroupingStrategy(TaskGroupingStrategy);
00070     AbstractGroupingStrategy* taskGrouper() const;
00071 
00072 
00076     enum TaskSortingStrategy
00077     {
00078         NoSorting = 0,
00079         ManualSorting = 1,
00080         AlphaSorting = 2,
00081         DesktopSorting = 3
00082     };
00083 
00084     TaskSortingStrategy sortingStrategy() const;
00085     void setSortingStrategy(TaskSortingStrategy);
00086     AbstractSortingStrategy* taskSorter() const;
00087 
00088     bool showOnlyCurrentScreen() const;
00089     void setShowOnlyCurrentScreen(bool);
00090 
00091     bool showOnlyCurrentDesktop() const;
00092     void setShowOnlyCurrentDesktop(bool);
00093 
00094     bool showOnlyMinimized() const;
00095     void setShowOnlyMinimized(bool);
00096 
00097     bool onlyGroupWhenFull() const;
00102     void setOnlyGroupWhenFull(bool state);
00106     void setFullLimit(int limit);
00107 
00111     bool manualGroupingRequest(AbstractGroupableItem* taskItem, TaskGroup* groupItem);
00112     bool manualGroupingRequest(ItemList items);
00113 
00114     bool manualSortingRequest(AbstractGroupableItem* taskItem, int newIndex);
00115 
00119     void setScreen(int screen);
00120 
00121 Q_SIGNALS:
00123     void reload();
00125     void itemRemoved(AbstractGroupableItem*);
00127     void groupRemoved(TaskGroup*);
00128 
00129 public Q_SLOTS:
00133     bool add(TaskPtr);
00134     void remove(TaskPtr);
00135 
00136     void add(StartupPtr);
00137     void remove(StartupPtr);
00138 
00142     void reconnect();
00143 
00144 private:
00145     Q_PRIVATE_SLOT(d, void currentDesktopChanged(int))
00146     Q_PRIVATE_SLOT(d, void taskChanged(TaskPtr, ::TaskManager::TaskChanges))
00147     Q_PRIVATE_SLOT(d, void checkScreenChange())
00148     Q_PRIVATE_SLOT(d, void itemDestroyed())
00149     Q_PRIVATE_SLOT(d, void checkIfFull())
00150 
00151     friend class GroupManagerPrivate;
00152     GroupManagerPrivate * const d;
00153 };
00154 }
00155 #endif

libtaskmanager

Skip menu "libtaskmanager"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal