Plasma
saverview.h
Go to the documentation of this file.00001 /* 00002 * Copyright 2007 Aaron Seigo <aseigo@kde.org> 00003 * Copyright 2007 André Duffeck <duffeck@kde.org> 00004 * Copyright 2008 Chani Armitage <chanika@gmail.com> 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 as 00008 * published by the Free Software Foundation; either version 2, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details 00015 * 00016 * You should have received a copy of the GNU Library General Public 00017 * License along with this program; if not, write to the 00018 * Free Software Foundation, Inc., 00019 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef SAVERVIEW_H 00023 #define SAVERVIEW_H 00024 00025 #include <Plasma/Plasma> 00026 #include <Plasma/View> 00027 00028 namespace Plasma 00029 { 00030 class AppletBrowser; 00031 class Containment; 00032 } 00033 00034 class SaverView : public Plasma::View 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 SaverView(Plasma::Containment* containment, QWidget *parent); 00040 ~SaverView(); 00041 00042 signals: 00043 void hidden(); 00044 00045 protected: 00046 void drawBackground(QPainter * painter, const QRectF & rect); 00047 void keyPressEvent(QKeyEvent *event); 00048 void showEvent(QShowEvent *event); 00049 void paintEvent(QPaintEvent *event); 00050 bool eventFilter(QObject *watched, QEvent *event); 00051 00052 public slots: 00053 void showView(); 00054 void hideView(); 00055 00062 void setContainment(Plasma::Containment *newContainment); 00063 void hideAppletBrowser(); 00064 00065 void enableSetupMode(); 00066 void disableSetupMode(); 00067 00068 protected slots: 00069 void showAppletBrowser(); //FIXME actually this is toggle 00070 void appletBrowserDestroyed(); 00071 void suppressShowTimeout(); 00072 00073 private: 00074 Plasma::AppletBrowser *m_appletBrowser; 00075 QPoint m_appletBrowserDragStart; 00076 bool m_suppressShow : 1; 00077 bool m_setupMode : 1; 00078 }; 00079 00080 #endif // multiple inclusion guard