~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/screensaver/shell/saverview.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
5
 *
 
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.
 
10
 *
 
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
 
15
 *
 
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.
 
20
 */
 
21
 
 
22
#ifndef SAVERVIEW_H
 
23
#define SAVERVIEW_H
 
24
 
 
25
#include <QWeakPointer>
 
26
 
 
27
#include <Plasma/Plasma>
 
28
#include <Plasma/View>
 
29
 
 
30
namespace Plasma
 
31
{
 
32
    class Containment;
 
33
    class WidgetExplorer;
 
34
}
 
35
 
 
36
class SaverView : public Plasma::View
 
37
{
 
38
    Q_OBJECT
 
39
 
 
40
public:
 
41
    SaverView(Plasma::Containment* containment, QWidget *parent);
 
42
    ~SaverView();
 
43
 
 
44
    bool eventFilter(QObject *watched, QEvent *event);
 
45
 
 
46
signals:
 
47
    void hidden();
 
48
 
 
49
protected:
 
50
    void drawBackground(QPainter * painter, const QRectF & rect);
 
51
    void keyPressEvent(QKeyEvent *event);
 
52
    void paintEvent(QPaintEvent *event);
 
53
 
 
54
public slots:
 
55
    void showView();
 
56
    void hideView();
 
57
    void setOpacity(qreal opacity);
 
58
    void adjustSize(int screen);
 
59
 
 
60
    /**
 
61
     * Sets the containment for this view, which will also cause the view
 
62
     * to track the geometry of the containment.
 
63
     *
 
64
     * @arg containment the containment to center the view on
 
65
     */
 
66
    void setContainment(Plasma::Containment *newContainment);
 
67
    void hideWidgetExplorer();
 
68
 
 
69
    void enableSetupMode();
 
70
    void disableSetupMode();
 
71
 
 
72
protected slots:
 
73
    void showWidgetExplorer(); //FIXME actually this is toggle
 
74
    void suppressShowTimeout();
 
75
    void openToolBox();
 
76
    void closeToolBox();
 
77
 
 
78
private:
 
79
    QWeakPointer<Plasma::WidgetExplorer> m_widgetExplorer;
 
80
    QPoint m_appletBrowserDragStart;
 
81
    bool m_suppressShow : 1;
 
82
    bool m_setupMode : 1;
 
83
    bool m_init : 1;
 
84
};
 
85
 
 
86
#endif // multiple inclusion guard