kscreensaver.h

00001 /* This file is part of the KDE libraries
00002 
00003     Copyright (c) 2001  Martin R. Jones <mjones@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library 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 GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KSCREENSAVER_H
00022 #define KSCREENSAVER_H
00023 
00024 #include <qwidget.h>
00025 
00026 #include <kdelibs_export.h>
00027 
00028 class QTimer;
00029 class KScreenSaverPrivate;
00030 class KBlankEffectPrivate;
00031 
00059 class KDE_EXPORT KScreenSaver : public QWidget
00060 {
00061     Q_OBJECT
00062 public:
00066     KScreenSaver( WId id=0 );
00067     ~KScreenSaver();
00068 
00069 protected:
00078     void embed( QWidget *widget );
00079 
00080     bool eventFilter( QObject *o, QEvent * );
00081 
00082 private:
00083     KScreenSaverPrivate *d;
00084 };
00085 
00086 
00094 class KBlankEffect : public QObject
00095 {
00096     Q_OBJECT
00097 public:
00098     KBlankEffect( QObject *parent=0 );
00099     ~KBlankEffect();
00100 
00101     enum Effect { Random=-1, Blank=0, SweepRight, SweepDown, Blocks,
00102                   MaximumEffects };
00103 
00112     void blank( QWidget *w, Effect effect=Random );
00113 
00114     typedef void (KBlankEffect::*BlankEffect)();
00115 
00116 signals:
00120     void doneBlank();
00121 
00122 protected slots:
00123     void timeout();
00124 
00125 protected:
00126     void finished();
00127 
00128     void blankNormal();
00129     void blankSweepRight();
00130     void blankSweepDown();
00131     void blankBlocks();
00132 
00133 protected:
00134     static BlankEffect effects[];
00135     KBlankEffectPrivate *d;
00136 };
00137 #endif
00138 
KDE Home | KDE Accessibility Home | Description of Access Keys