Warning--
[kdeartwork.git] / kscreensaver / kpartsaver / kpartsaver.h
blobcde9447ea81aee3160bfb038f17c30b8809c4690
1 /*
2 * Copyright (C) 2001 Stefan Schimanski <1Stein@gmx.de>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the Free
16 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef KPARTSAVER_H_INCLUDED
20 #define KPARTSAVER_H_INCLUDED
22 #include <kscreensaver.h>
24 #include "ui_configwidget.h"
25 #include <Q3ValueList>
26 class QTimer;
27 class QLabel;
28 namespace KParts { class ReadOnlyPart; }
30 class ConfigWidget : public QDialog, public Ui::ConfigWidget
32 public:
33 ConfigWidget( QWidget *parent ) : QDialog( parent ) {
34 setupUi( this );
39 class SaverConfig : public ConfigWidget {
40 Q_OBJECT
42 public:
43 SaverConfig( QWidget* parent = 0);
44 ~SaverConfig();
46 protected slots:
47 void apply();
48 void add();
49 void remove();
50 void select();
51 void up();
52 void down();
56 class KPartSaver : public KScreenSaver {
57 Q_OBJECT
59 public:
60 KPartSaver( WId id=0 );
61 virtual ~KPartSaver();
63 public slots:
64 void next( bool random );
65 void queue( const KUrl &url );
66 void timeout();
67 void closeUrl();
69 protected:
70 struct Medium {
71 KUrl url;
72 bool failed;
75 bool openUrl( const KUrl& url );
77 Q3ValueList<Medium> m_media;
78 QTimer *m_timer;
79 KParts::ReadOnlyPart *m_part;
80 int m_current;
82 bool m_single;
83 bool m_random;
84 int m_delay;
85 QStringList m_files;
86 QLabel *m_back;
89 #endif