summaryrefslogtreecommitdiffstats
path: root/tdescreensaver/kdesavers/banner.h
blob: 6b953e583a74c3e64284147858196c7dc338c340 (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
104
105
106
107
108
109
110
111
112
113
114
//-----------------------------------------------------------------------------
//
// kbanner - Basic screen saver for KDE
//
// Copyright (c)  Martin R. Jones 1996
//

#ifndef __BANNER_H__
#define __BANNER_H__

#include <tqtimer.h>

#include <tdescreensaver.h>
#include <kdialogbase.h>

#define SATURATION 150
#define VALUE 255

class TQLineEdit;
class KColorButton;
class KRandomSequence;

class KBannerSaver : public KScreenSaver
{
    Q_OBJECT
  
public:
    KBannerSaver( WId id );
    virtual ~KBannerSaver();

    void setSpeed( int spd );
    void setFont( const TQString &family, int size, const TQColor &color,
		    bool b, bool i );
    void setMessage( const TQString &msg );
    void setTimeDisplay();
    void setCyclingColor(bool on);
    void setColor( TQColor &color);

private:
    void readSettings();
    void initialize();

protected slots:
    void slotTimeout();

protected:
    TQFont   font;
    TQTimer	timer;
    TQString	fontFamily;
    int		fontSize;
    bool	bold;
    bool	italic;
    TQColor	fontColor;
    bool	cyclingColor;
    int		currentHue;
    bool	needUpdate;
    bool	needBlank;
    TQString	message;
    bool	showTime;
    int		xpos, ypos, step, fsize;
    KRandomSequence *krnd;
    int		speed;
    int		colorContext;
    TQPixmap	pixmap;
    TQSize	pixmapSize;
};


class KBannerSetup : public KDialogBase
{
    Q_OBJECT
  
public:
    KBannerSetup( TQWidget *parent = NULL, const char *name = NULL );

protected:
    void readSettings();
    void fillFontSizes();

private slots:
    void slotFamily( const TQString & );
    void slotSize( int );
    void slotSizeEdit(const TQString &);
    void slotColor(const TQColor &);
    void slotCyclingColor(bool on);
    void slotBold( bool );
    void slotItalic( bool );
    void slotSpeed( int );
    void slotMessage( const TQString & );
    void slotOk();
    void slotHelp();
    void slotTimeToggled(bool on);

private:
    TQWidget *preview;
    KColorButton *colorPush;
    KBannerSaver *saver;
    TQLineEdit *ed;
    TQComboBox* comboSizes;

    TQString message;
    bool    showTime;
    TQString fontFamily;
    int	    fontSize;
    TQColor  fontColor;
    bool    cyclingColor;
    bool    bold;
    bool    italic;
    int	    speed;
    TQValueList<int> sizes;
};

#endif