Plasma
desktop.h
Go to the documentation of this file.00001 /* 00002 * Copyright 2007 by Aaron Seigo <aseigo@kde.org> 00003 * Copyright 2008 by Alexis Ménard <darktears31@gmail.com> 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU Library General Public License version 2, 00008 * or (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 Library General Public 00016 * License 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 PLASMA_DESKTOP_H 00022 #define PLASMA_DESKTOP_H 00023 00024 #include <QGraphicsItem> 00025 #include <QList> 00026 #include <QObject> 00027 #include <QStyleOptionGraphicsItem> 00028 #include <QTimer> 00029 00030 #include <KDialog> 00031 #include <KIcon> 00032 00033 #include <Plasma/Containment> 00034 #include <Plasma/Animator> 00035 00036 #include "desktoplayout.h" 00037 00038 class QAction; 00039 class QTimeLine; 00040 00041 namespace Plasma 00042 { 00043 class AppletBrowser; 00044 class Svg; 00045 } 00046 00047 /*class Tool : public QObject, public QGraphicsItem 00048 { 00049 Q_OBJECT 00050 00051 public: 00052 explicit Tool(QGraphicsItem *parent = 0); 00053 QRectF boundingRect() const; 00054 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); 00055 00056 };*/ 00057 00058 class DefaultDesktop : public Plasma::Containment 00059 { 00060 Q_OBJECT 00061 00062 public: 00063 DefaultDesktop(QObject *parent, const QVariantList &args); 00064 void constraintsEvent(Plasma::Constraints constraints); 00065 00066 QList<QAction*> contextualActions(); 00067 00068 protected: 00069 void dropEvent(QGraphicsSceneDragDropEvent *event); 00070 00071 protected Q_SLOTS: 00072 void runCommand(); 00073 00074 void lockScreen(); 00075 void logout(); 00076 00077 void addPanel(); 00078 00079 void onAppletAdded(Plasma::Applet *, const QPointF &); 00080 void onAppletRemoved(Plasma::Applet *); 00081 void onAppletGeometryChanged(); 00082 void refreshWorkingArea(); 00083 00084 private: 00085 QAction *m_lockDesktopAction; 00086 QAction *m_appletBrowserAction; 00087 QAction *m_addPanelAction; 00088 QAction *m_runCommandAction; 00089 QAction *m_setupDesktopAction; 00090 QAction *m_lockScreenAction; 00091 QAction *m_logoutAction; 00092 QAction *m_separator; 00093 00094 DesktopLayout *m_layout; 00095 bool dropping; 00096 }; 00097 00098 #endif // PLASMA_PANEL_H