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

« back to all changes in this revision

Viewing changes to khotkeys/kcm_hotkeys/conditions/conditions_widget.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
#ifndef CONDITIONS_WIDGET_H
 
2
#define CONDITIONS_WIDGET_H
 
3
/* Copyright (C) 2009 Michael Jansen <kde@michael-jansen.biz>
 
4
 
 
5
   This library is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU Library General Public
 
7
   License as published by the Free Software Foundation; either
 
8
   version 2 of the License, or (at your option) any later version.
 
9
 
 
10
   This library is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
   Library General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU Library General Public License
 
16
   along with this library; see the file COPYING.LIB.  If not, write to
 
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
   Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#include <QtCore/QMap>
 
22
#include <QtGui/QWidget>
 
23
 
 
24
 
 
25
#include "ui_conditions_widget.h"
 
26
 
 
27
class QAction;
 
28
class QTreeWidgetItem;
 
29
 
 
30
namespace KHotKeys {
 
31
    class Condition_list;
 
32
    class Condition;
 
33
}
 
34
 
 
35
 
 
36
/**
 
37
 * @author Michael Jansen <kde@michael-jansen.biz>
 
38
 */
 
39
class ConditionsWidget : public QWidget
 
40
    {
 
41
    Q_OBJECT
 
42
 
 
43
public:
 
44
 
 
45
    /**
 
46
     * Default constructor
 
47
     */
 
48
    ConditionsWidget(QWidget *parent = NULL);
 
49
 
 
50
    /**
 
51
     * Destructor
 
52
     */
 
53
    virtual ~ConditionsWidget();
 
54
 
 
55
    void copyFromObject();
 
56
    void copyToObject();
 
57
 
 
58
    void setConditionsList(KHotKeys::Condition_list *list);
 
59
 
 
60
    //! Are there uncommited changes?
 
61
    bool hasChanges() const;
 
62
 
 
63
Q_SIGNALS:
 
64
 
 
65
    void changed(bool);
 
66
 
 
67
private Q_SLOTS:
 
68
 
 
69
    void slotNew(QAction*);
 
70
    void slotEdit();
 
71
    void slotDelete();
 
72
 
 
73
private:
 
74
 
 
75
    // Emit the changed(bool) signal if our changed status changes
 
76
    void emitChanged(bool);
 
77
 
 
78
    //! The original
 
79
    KHotKeys::Condition_list *_conditions_list;
 
80
 
 
81
    //! The working copy
 
82
    KHotKeys::Condition_list *_working;
 
83
 
 
84
    //! User Interface Definition
 
85
    Ui::ConditionsWidget ui;
 
86
 
 
87
    //! Are there uncommited changes?
 
88
    bool _changed;
 
89
 
 
90
    //! Map between treewidgetitems and conditions
 
91
    QMap<QTreeWidgetItem*, KHotKeys::Condition*> _items;
 
92
 
 
93
};
 
94
 
 
95
 
 
96
#endif /* #ifndef CONDITIONS_WIDGET_H */