SVN_SILENT made messages (.desktop file)
[kdeartwork.git] / kscreensaver / kpartsaver / kpartsaver.h
blob4b6848efbcacb618031ee6bc5c91e7586356a4ec
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 <QList>
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;
73 inline bool operator==(const Medium& other) { return url == other.url; }
74 inline bool operator!=(const Medium& other) { return !(*this == other); }
77 bool openUrl( const KUrl& url );
79 QList<Medium> m_media;
80 QTimer *m_timer;
81 KParts::ReadOnlyPart *m_part;
82 int m_current;
84 bool m_single;
85 bool m_random;
86 int m_delay;
87 QStringList m_files;
88 QLabel *m_back;
91 #endif