~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to kcontrol/background/bgadvanced.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vi: ts=8 sts=4 sw=4
 
2
 
 
3
   This file is part of the KDE project, module kcmbackground.
 
4
 
 
5
   Copyright (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl>
 
6
   Copyright (C) 2003 Waldo Bastian <bastian@kde.org>
 
7
 
 
8
   This program is free software; you can redistribute it and/or
 
9
   modify it under the terms of the GNU General Public License
 
10
   version 2 as published by the Free Software Foundation.
 
11
 
 
12
   This library is distributed in the hope that it will be useful,
 
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
   Library General Public License for more details.
 
16
 
 
17
   You should have received a copy of the GNU Library General Public License
 
18
   along with this library; see the file COPYING.LIB.  If not, write to
 
19
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
20
   Boston, MA 02110-1301, USA.
 
21
 */
 
22
 
 
23
#ifndef BGADVANCED_H
 
24
#define BGADVANCED_H
 
25
 
 
26
#include <Qt3Support/Q3Dict>
 
27
#include <Qt3Support/Q3CheckListItem>
 
28
 
 
29
#include <kdialog.h>
 
30
 
 
31
class QLineEdit;
 
32
class QSpinBox;
 
33
 
 
34
class BGAdvancedBase;
 
35
class KBackgroundRenderer;
 
36
class KBackgroundProgram;
 
37
 
 
38
class BGAdvancedDialog : public KDialog
 
39
{
 
40
   Q_OBJECT
 
41
public:
 
42
   BGAdvancedDialog(KBackgroundRenderer *_r, QWidget *parent, bool _kdmMode);
 
43
 
 
44
   void setCacheSize(int s);
 
45
   int cacheSize();
 
46
   QColor textColor();
 
47
   void setTextColor(const QColor &color);
 
48
   QColor textBackgroundColor();
 
49
   void setTextBackgroundColor(const QColor &color);
 
50
   bool shadowEnabled();
 
51
   void setShadowEnabled(bool enabled);
 
52
   void setTextLines(int lines);
 
53
   int textLines() const;
 
54
   void setTextWidth(int width);
 
55
   int textWidth() const;
 
56
 
 
57
   void updateUI();
 
58
 
 
59
   void makeReadOnly();
 
60
 
 
61
public Q_SLOTS:
 
62
   void slotAdd();
 
63
   void slotRemove();
 
64
   void slotModify();
 
65
 
 
66
protected:
 
67
   void addProgram(const QString &name);
 
68
   void removeProgram(const QString &name);
 
69
   void selectProgram(const QString &name);
 
70
 
 
71
protected Q_SLOTS:
 
72
   void slotProgramItemClicked(Q3ListViewItem *item);
 
73
   void slotProgramItemDoubleClicked(Q3ListViewItem *item);
 
74
   void slotProgramChanged();
 
75
   void slotEnableProgram(bool b);
 
76
 
 
77
private:
 
78
   KBackgroundRenderer *r;
 
79
 
 
80
   BGAdvancedBase *dlg;
 
81
 
 
82
   QWidget *m_pMonitor;
 
83
   Q3Dict<Q3ListViewItem> m_programItems;
 
84
   QString m_selectedProgram;
 
85
   int m_oldBackgroundMode;
 
86
   bool m_kdmMode;
 
87
};
 
88
 
 
89
/**
 
90
 * Dialog to edit a background program.
 
91
 */
 
92
class KProgramEditDialog: public KDialog
 
93
{
 
94
    Q_OBJECT
 
95
 
 
96
public:
 
97
    explicit KProgramEditDialog(bool kdmMode, const QString &program=QString(),
 
98
                                QWidget *parent=0L, char *name=0L);
 
99
 
 
100
    /** The program name is here in case the user changed it */
 
101
    QString program()const;
 
102
 
 
103
public Q_SLOTS:
 
104
    virtual void accept();
 
105
 
 
106
private:
 
107
    QString m_Program;
 
108
    QLineEdit *m_NameEdit, *m_CommentEdit;
 
109
    QLineEdit *m_ExecEdit, *m_CommandEdit;
 
110
    QLineEdit *m_PreviewEdit;
 
111
    QSpinBox *m_RefreshEdit;
 
112
    KBackgroundProgram *m_Prog;
 
113
    bool m_kdmMode;
 
114
};
 
115
 
 
116
 
 
117
#endif
 
118