Qt3to4
[kdeartwork.git] / kscreensaver / kpartsaver / kpartsaver.h
blob83c3babe4aafa9bf14f48e71689c3ece32630ba2
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 Steet, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef KPARTSAVER_H_INCLUDED
20 #define KPARTSAVER_H_INCLUDED
23 #include <qwidget.h>
24 #include <qtimer.h>
25 #include <qstring.h>
26 #include <q3valuelist.h>
27 #include <qdialog.h>
28 #include <qpushbutton.h>
29 #include <qradiobutton.h>
30 #include <qspinbox.h>
31 #include <qcheckbox.h>
32 #include <qlabel.h>
34 #include <klocale.h>
35 #include <kapplication.h>
36 #include <kdebug.h>
37 #include <klibloader.h>
38 #include <kconfig.h>
39 #include <kfiledialog.h>
40 #include <kurl.h>
41 #include <kparts/part.h>
42 #include <ktrader.h>
43 #include <kio/jobclasses.h>
44 #include <kio/job.h>
45 #include <kmimetype.h>
47 #include <kscreensaver.h>
49 #include "configwidget.h"
52 class SaverConfig : public ConfigWidget {
53 Q_OBJECT
55 public:
56 SaverConfig( QWidget* parent = 0, const char* name = 0 );
57 ~SaverConfig();
59 protected slots:
60 void apply();
61 void add();
62 void remove();
63 void select();
64 void up();
65 void down();
69 class KPartSaver : public KScreenSaver {
70 Q_OBJECT
72 public:
73 KPartSaver( WId id=0 );
74 virtual ~KPartSaver();
76 public slots:
77 void next( bool random );
78 void queue( KURL url );
79 void timeout();
80 void closeURL();
82 protected:
83 struct Medium {
84 KURL url;
85 bool failed;
86 };
88 bool openURL( KURL url );
90 Q3ValueList<Medium> m_media;
91 QTimer *m_timer;
92 KParts::ReadOnlyPart *m_part;
93 int m_current;
95 bool m_single;
96 bool m_random;
97 int m_delay;
98 QStringList m_files;
99 KLibFactory *m_factory;
100 QLabel *m_back;
103 #endif