1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //  $Id: value.h,v 1.1.1.1 2003/10/27 18:51:53 wschweer Exp $
5 //
6 //  (C) Copyright 2000 Werner Schweer (ws@seh.de)
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 //  as published by the Free Software Foundation; version 2 of
11 //  the License, or (at your option) any later version.
12 //
13 //  This program is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 //  GNU General Public License for more details.
17 //
18 //  You should have received a copy of the GNU General Public License
19 //  along with this program; if not, write to the Free Software
20 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 //
22 //=========================================================
23 
24 #ifndef __VALUE_H__
25 #define __VALUE_H__
26 
27 #include <QObject>
28 
29 namespace MusECore {
30 
31 class Xml;
32 
33 //---------------------------------------------------------
34 //   IValue
35 //---------------------------------------------------------
36 
37 class IValue : public QObject {
38       Q_OBJECT
39 
40       int val;
41 
42    signals:
43       void valueChanged(int);
44 
45    public slots:
46       void setValue(int v);
47 
48    public:
49       IValue(QObject* parent=0, const char* name=0);
value()50       int value() const    { return val; }
51       void save(int level, Xml& xml);
52       };
53 
54 //---------------------------------------------------------
55 //   BValue
56 //---------------------------------------------------------
57 
58 class BValue : public QObject {
59       Q_OBJECT
60 
61       bool val;
62 
63 
64 
65    signals:
66       void valueChanged(bool);
67       void valueChanged(int);
68 
69    public slots:
70       void setValue(bool v);
setValue(int v)71       void setValue(int v) { setValue(bool(v)); }
72 
73    public:
74       BValue(QObject* parent=0, const char* name=0);
value()75       bool value() const    { return val; }
76       void save(int level, Xml& xml);
77       };
78 
79 } // namespace MusECore
80 
81 #endif
82 
83