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

Applets

tasks.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Robert Knight <robertknight@gmail.com>          *
00003  *   Copyright (C) 2008 by Alexis Ménard <darktears31@gmail.com>           *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
00019  ***************************************************************************/
00020 
00021 #ifndef TASKS_H
00022 #define TASKS_H
00023 
00024 // Own
00025 #include "ui_tasksConfig.h"
00026 
00027 // Qt
00028 #include <QTimer>
00029 
00030 // KDE
00031 #include <taskmanager/taskmanager.h>
00032 #include <KDialog>
00033 
00034 // Plasma
00035 #include <plasma/applet.h>
00036 
00037 class QGraphicsLinearLayout;
00038 
00039 class KColorScheme;
00040 
00041 namespace Plasma
00042 {
00043     class LayoutAnimator;
00044     class PanelSvg;
00045 } // namespace Plasma
00046 
00047 class WindowTaskItem;
00048 
00049 using TaskManager::StartupPtr;
00050 using TaskManager::TaskPtr;
00051 
00059 class Tasks : public Plasma::Applet
00060 {
00061     Q_OBJECT
00062 public:
00067         explicit Tasks(QObject *parent, const QVariantList &args = QVariantList());
00068         ~Tasks();
00069 
00070         void init();
00071 
00072         void constraintsEvent(Plasma::Constraints constraints);
00073 
00074         Plasma::PanelSvg *itemBackground();
00075         QPixmap *taskAlphaPixmap(const QSize &size);
00076         KColorScheme *colorScheme();
00077 
00078         qreal itemLeftMargin() { return m_leftMargin; }
00079         qreal itemRightMargin() { return m_rightMargin; }
00080         qreal itemTopMargin() { return m_topMargin; }
00081         qreal itemBottomMargin() { return m_bottomMargin; }
00082         void resizeItemBackground(const QSizeF &newSize);
00083 
00084 protected slots:
00085         void configAccepted();
00086         virtual void wheelEvent(QGraphicsSceneWheelEvent *);
00087         void themeRefresh();
00088         void updateActive(WindowTaskItem *task);
00089 
00090 protected:
00091         void createConfigurationInterface(KConfigDialog *parent);
00092 
00093 private slots:
00094         void addWindowTask(TaskPtr);
00095         void removeWindowTask(TaskPtr);
00096 
00097         void addStartingTask(StartupPtr);
00098         void removeStartingTask(StartupPtr);
00099 
00100         void currentDesktopChanged(int);
00101         void taskMovedDesktop(TaskPtr task);
00102         void windowChangedGeometry(TaskPtr task);
00103         void checkScreenChange();
00104 
00105 private:
00106         // creates task representations for existing windows
00107         // and sets up connections to listen for addition or removal
00108         // of windows
00109         void registerWindowTasks();
00110 
00111         // remove all tasks from the taskbar
00112         void removeAllWindowTasks();
00113 
00114         void insertItemBeforeSpacer(QGraphicsWidget * item);
00115         void adjustStretch();
00116 
00117         bool isOnMyScreen(TaskPtr task);
00118         void reconnect();
00119 
00120         QHash<TaskPtr,WindowTaskItem*> m_windowTaskItems;
00121         QHash<StartupPtr,WindowTaskItem*> m_startupTaskItems;
00122         QHash<TaskPtr,WindowTaskItem*>::iterator m_activeTask;
00123 
00124         bool m_showTooltip;
00125         bool m_showOnlyCurrentDesktop;
00126         bool m_showOnlyCurrentScreen;
00127         Plasma::LayoutAnimator *m_animator;
00128         QGraphicsLinearLayout *m_layout;
00129         Ui::tasksConfig m_ui;
00130         QList<TaskPtr> m_geometryTasks;
00131         QTimer m_screenTimer;
00132         QGraphicsWidget *m_spacer;
00133 
00134         Plasma::PanelSvg *m_taskItemBackground;
00135         QPixmap *m_taskAlphaPixmap;
00136         KColorScheme *m_colorScheme;
00137         qreal m_leftMargin;
00138         qreal m_topMargin;
00139         qreal m_rightMargin;
00140         qreal m_bottomMargin;
00141 };
00142 
00143 #endif

Applets

Skip menu "Applets"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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