]> git.sesse.net Git - vlc/blob - modules/gui/qt4/variables.hpp
Qt: Missing include in previous commit
[vlc] / modules / gui / qt4 / variables.hpp
1 /*****************************************************************************
2  * variables.hpp : Dialogs from other LibVLC core and other plugins
3  ****************************************************************************
4  * Copyright (C) 2009 RĂ©mi Denis-Courmont
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19  *****************************************************************************/
20
21 #ifndef QVLC_VARIABLES_H_
22 #define QVLC_VARIABLES_H_ 1
23
24 #ifdef HAVE_CONFIG_H
25 # include <config.h>
26 #endif
27
28 #include <QObject>
29 #include <vlc_common.h>
30
31 class QVLCVariable : public QObject
32 {
33     Q_OBJECT
34 private:
35     static int callback (vlc_object_t *, const char *,
36                          vlc_value_t, vlc_value_t, void *);
37     vlc_object_t *object;
38     QString name;
39     virtual void trigger (vlc_value_t, vlc_value_t) = 0;
40
41 public:
42     QVLCVariable (vlc_object_t *, const char *, int, bool);
43     ~QVLCVariable (void);
44 };
45
46 class QVLCPointer : public QVLCVariable
47 {
48     Q_OBJECT
49 private:
50     virtual void trigger (vlc_value_t, vlc_value_t);
51
52 public:
53     QVLCPointer (vlc_object_t *, const char *, bool inherit = false);
54     bool addCallback (QObject *, const char *,
55                       Qt::ConnectionType type = Qt::AutoConnection);
56
57 signals:
58     void pointerChanged (void *);
59 };
60
61 class QVLCInteger : public QVLCVariable
62 {
63     Q_OBJECT
64 private:
65     virtual void trigger (vlc_value_t, vlc_value_t);
66
67 public:
68     QVLCInteger (vlc_object_t *, const char *, bool inherit = false);
69     bool addCallback (QObject *, const char *,
70                       Qt::ConnectionType type = Qt::AutoConnection);
71
72 signals:
73     void integerChanged (int64_t);
74 };
75
76 class QVLCBool : public QVLCVariable
77 {
78     Q_OBJECT
79 private:
80     virtual void trigger (vlc_value_t, vlc_value_t);
81
82 public:
83     QVLCBool (vlc_object_t *, const char *, bool inherit = false);
84     bool addCallback (QObject *, const char *,
85                       Qt::ConnectionType type = Qt::AutoConnection);
86
87 signals:
88     void boolChanged (bool);
89 };
90
91 class QVLCFloat : public QVLCVariable
92 {
93     Q_OBJECT
94 private:
95     virtual void trigger (vlc_value_t, vlc_value_t);
96
97 public:
98     QVLCFloat (vlc_object_t *, const char *, bool inherit = false);
99     bool addCallback (QObject *, const char *,
100                       Qt::ConnectionType type = Qt::AutoConnection);
101
102 signals:
103     void floatChanged (float);
104 };
105
106 class QVLCString : public QVLCVariable
107 {
108     Q_OBJECT
109 private:
110     virtual void trigger (vlc_value_t, vlc_value_t);
111
112 public:
113     QVLCString (vlc_object_t *, const char *, bool inherit = false);
114     bool addCallback (QObject *, const char *,
115                       Qt::ConnectionType type = Qt::AutoConnection);
116
117 signals:
118     void stringChanged (QString);
119 };
120 #endif