~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kdm/kcm/background/bgadvanced.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

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 <QHash>
 
27
 
 
28
#include <kdialog.h>
 
29
 
 
30
#include "ui_bgadvanced_ui.h"
 
31
 
 
32
// class QLineEdit;
 
33
// class QSpinBox;
 
34
class QTreeWidgetItem;
 
35
 
 
36
class KBackgroundRenderer;
 
37
class KBackgroundProgram;
 
38
 
 
39
class BGAdvancedBase : public QWidget, public Ui::BGAdvancedBase {
 
40
public:
 
41
    BGAdvancedBase(QWidget *parent) : QWidget(parent) {
 
42
        setupUi(this);
 
43
    }
 
44
};
 
45
 
 
46
class BGAdvancedDialog : public KDialog {
 
47
    Q_OBJECT
 
48
public:
 
49
    BGAdvancedDialog(KBackgroundRenderer *_r, QWidget *parent);
 
50
 
 
51
#if 0
 
52
    void setCacheSize(int s);
 
53
    int cacheSize();
 
54
#endif
 
55
 
 
56
    void updateUI();
 
57
 
 
58
    void makeReadOnly();
 
59
 
 
60
#if 0
 
61
public Q_SLOTS:
 
62
    void slotAdd();
 
63
    void slotRemove();
 
64
    void slotModify();
 
65
#endif
 
66
 
 
67
protected:
 
68
    void addProgram(const QString &name);
 
69
#if 0
 
70
    void removeProgram(const QString &name);
 
71
#endif
 
72
    void selectProgram(const QString &name);
 
73
 
 
74
protected Q_SLOTS:
 
75
    void slotProgramItemClicked(QTreeWidgetItem *item);
 
76
#if 0
 
77
    void slotProgramItemDoubleClicked(QTreeWidgetItem *item);
 
78
#endif
 
79
    void slotProgramChanged();
 
80
    void slotEnableProgram(bool b);
 
81
 
 
82
private:
 
83
    KBackgroundRenderer *r;
 
84
 
 
85
    BGAdvancedBase *dlg;
 
86
 
 
87
    QWidget *m_pMonitor;
 
88
    QHash<QString, QTreeWidgetItem *> m_programItems;
 
89
    QString m_selectedProgram;
 
90
    int m_oldBackgroundMode;
 
91
};
 
92
 
 
93
#if 0
 
94
/**
 
95
 * Dialog to edit a background program.
 
96
 */
 
97
class KProgramEditDialog: public KDialog {
 
98
    Q_OBJECT
 
99
 
 
100
public:
 
101
    explicit KProgramEditDialog(const QString &program = QString(),
 
102
                                QWidget *parent = 0L, char *name = 0L);
 
103
 
 
104
    /** The program name is here in case the user changed it */
 
105
    QString program()const;
 
106
 
 
107
public Q_SLOTS:
 
108
    virtual void accept();
 
109
 
 
110
private:
 
111
    QString m_Program;
 
112
    QLineEdit *m_NameEdit, *m_CommentEdit;
 
113
    QLineEdit *m_ExecEdit, *m_CommandEdit;
 
114
    QLineEdit *m_PreviewEdit;
 
115
    QSpinBox *m_RefreshEdit;
 
116
    KBackgroundProgram *m_Prog;
 
117
};
 
118
#endif
 
119
 
 
120
#endif