Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kcontrol / kdm / background / bgadvanced.h
blobde7342fa70d6cf554a4c5af296d3099fc11063c6
1 /* vi: ts=8 sts=4 sw=4
3 This file is part of the KDE project, module kcmbackground.
5 Copyright (C) 1999 Geert Jansen <g.t.jansen@stud.tue.nl>
6 Copyright (C) 2003 Waldo Bastian <bastian@kde.org>
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.
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.
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.
23 #ifndef BGADVANCED_H
24 #define BGADVANCED_H
26 #include <Qt3Support/Q3Dict>
27 #include <Qt3Support/Q3CheckListItem>
29 #include <kdialog.h>
31 #include "ui_bgadvanced_ui.h"
33 class QLineEdit;
34 class QSpinBox;
36 class KBackgroundRenderer;
37 class KBackgroundProgram;
39 class BGAdvancedBase : public QWidget, public Ui::BGAdvancedBase
41 public:
42 BGAdvancedBase( QWidget *parent ) : QWidget( parent ) {
43 setupUi( this );
47 class BGAdvancedDialog : public KDialog
49 Q_OBJECT
50 public:
51 BGAdvancedDialog(KBackgroundRenderer *_r, QWidget *parent, bool _kdmMode);
53 void setCacheSize(int s);
54 int cacheSize();
55 QColor textColor();
56 void setTextColor(const QColor &color);
57 QColor textBackgroundColor();
58 void setTextBackgroundColor(const QColor &color);
59 bool shadowEnabled();
60 void setShadowEnabled(bool enabled);
61 void setTextLines(int lines);
62 int textLines() const;
63 void setTextWidth(int width);
64 int textWidth() const;
66 void updateUI();
68 void makeReadOnly();
70 public Q_SLOTS:
71 void slotAdd();
72 void slotRemove();
73 void slotModify();
75 protected:
76 void addProgram(const QString &name);
77 void removeProgram(const QString &name);
78 void selectProgram(const QString &name);
80 protected Q_SLOTS:
81 void slotProgramItemClicked(Q3ListViewItem *item);
82 void slotProgramItemDoubleClicked(Q3ListViewItem *item);
83 void slotProgramChanged();
84 void slotEnableProgram(bool b);
86 private:
87 KBackgroundRenderer *r;
89 BGAdvancedBase *dlg;
91 QWidget *m_pMonitor;
92 Q3Dict<Q3ListViewItem> m_programItems;
93 QString m_selectedProgram;
94 int m_oldBackgroundMode;
95 bool m_kdmMode;
98 /**
99 * Dialog to edit a background program.
101 class KProgramEditDialog: public KDialog
103 Q_OBJECT
105 public:
106 explicit KProgramEditDialog(bool kdmMode, const QString &program=QString(),
107 QWidget *parent=0L, char *name=0L);
109 /** The program name is here in case the user changed it */
110 QString program()const;
112 public Q_SLOTS:
113 virtual void accept();
115 private:
116 QString m_Program;
117 QLineEdit *m_NameEdit, *m_CommentEdit;
118 QLineEdit *m_ExecEdit, *m_CommandEdit;
119 QLineEdit *m_PreviewEdit;
120 QSpinBox *m_RefreshEdit;
121 KBackgroundProgram *m_Prog;
122 bool m_kdmMode;
126 #endif