summaryrefslogtreecommitdiffstats
path: root/tdescreensaver/tdepartsaver/tdepartsaver.h
blob: feba06ed78db925e06711e7ef7d5a1b73b973c28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
 * Copyright (C) 2001 Stefan Schimanski <[email protected]>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this program; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef KPARTSAVER_H_INCLUDED
#define KPARTSAVER_H_INCLUDED


#include <tqwidget.h>
#include <tqtimer.h>
#include <tqstring.h>
#include <tqvaluelist.h>
#include <tqdialog.h>
#include <tqpushbutton.h>
#include <tqradiobutton.h>
#include <tqspinbox.h>
#include <tqcheckbox.h>
#include <tqlabel.h>

#include <klocale.h>
#include <tdeapplication.h>
#include <kdebug.h>
#include <tdeconfig.h>
#include <tdefiledialog.h>
#include <kurl.h>
#include <tdeparts/part.h>
#include <ktrader.h>
#include <tdeio/jobclasses.h>
#include <tdeio/job.h>
#include <kmimetype.h>

#include <tdescreensaver.h>

#include "configwidget.h"


class SaverConfig : public ConfigWidget {
Q_OBJECT
  

 public:
    SaverConfig( TQWidget* parent = 0, const char* name = 0 );
    ~SaverConfig(); 

 protected slots:
    void apply();    
    void add();
    void remove();
    void select();
    void up();
    void down();
};


class KPartSaver : public KScreenSaver {
Q_OBJECT
  

 public:
    KPartSaver( WId id=0 );
    virtual ~KPartSaver();

 public slots:
    void next( bool random );
    void queue( KURL url );
    void timeout();
    void closeURL();

 protected:    
    struct Medium {
	KURL url;
	bool failed;
    };   

    bool openURL(  KURL url );    

    TQValueList<Medium> m_media;
    TQTimer *m_timer;
    KParts::ReadOnlyPart *m_part;
    int m_current; 
    
    bool m_single;
    bool m_random;
    int m_delay;
    TQStringList m_files;
    TQLabel *m_back;
};

#endif