not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / plasma / shells / screensaver / saverview.h
blobc45e3f385e4e64d4a6b0c10f5a6633ca5bce1b92
1 /*
2 * Copyright 2007 Aaron Seigo <aseigo@kde.org>
3 * Copyright 2007 André Duffeck <duffeck@kde.org>
4 * Copyright 2008 Chani Armitage <chanika@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Library General Public License as
8 * published by the Free Software Foundation; either version 2, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details
16 * You should have received a copy of the GNU Library General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef SAVERVIEW_H
23 #define SAVERVIEW_H
25 #include <Plasma/Plasma>
26 #include <Plasma/View>
28 namespace Plasma
30 class AppletBrowser;
31 class Containment;
34 class SaverView : public Plasma::View
36 Q_OBJECT
38 public:
39 SaverView(Plasma::Containment* containment, QWidget *parent);
40 ~SaverView();
42 signals:
43 void hidden();
45 protected:
46 void drawBackground(QPainter * painter, const QRectF & rect);
47 void keyPressEvent(QKeyEvent *event);
48 void showEvent(QShowEvent *event);
49 void paintEvent(QPaintEvent *event);
50 bool eventFilter(QObject *watched, QEvent *event);
52 public slots:
53 void showView();
54 void hideView();
56 /**
57 * Sets the containment for this view, which will also cause the view
58 * to track the geometry of the containment.
60 * @arg containment the containment to center the view on
62 void setContainment(Plasma::Containment *newContainment);
63 void hideAppletBrowser();
65 void enableSetupMode();
66 void disableSetupMode();
68 protected slots:
69 void showAppletBrowser(); //FIXME actually this is toggle
70 void appletBrowserDestroyed();
71 void suppressShowTimeout();
73 private:
74 Plasma::AppletBrowser *m_appletBrowser;
75 QPoint m_appletBrowserDragStart;
76 bool m_suppressShow : 1;
77 bool m_setupMode : 1;
80 #endif // multiple inclusion guard