]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/external.hpp
macosx: fixed menubar appearance in fullscreen mode by partially reverting [46c93c9cc...
[vlc] / modules / gui / qt4 / dialogs / external.hpp
1 /*****************************************************************************
2  * external.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_DIALOGS_EXTERNAL_H_
22 #define QVLC_DIALOGS_EXTERNAL_H_ 1
23
24 #include <QObject>
25 #include <vlc_common.h>
26
27 class QVLCVariable : public QObject
28 {
29     Q_OBJECT
30 private:
31     static int callback (vlc_object_t *, const char *,
32                          vlc_value_t, vlc_value_t, void *);
33     vlc_object_t *object;
34     QString name;
35
36 public:
37     QVLCVariable (vlc_object_t *, const char *, int);
38     virtual ~QVLCVariable (void);
39
40 signals:
41     void pointerChanged (vlc_object_t *, void *);
42 };
43
44 struct intf_thread_t;
45 class QProgressDialog;
46
47 class DialogHandler : public QObject
48 {
49     Q_OBJECT
50
51     friend class QVLCProgressDialog;
52
53 public:
54     DialogHandler (intf_thread_t *);
55     ~DialogHandler (void);
56
57 private:
58     intf_thread_t *intf;
59     QVLCVariable message;
60     QVLCVariable login;
61     QVLCVariable question;
62     QVLCVariable progressBar;
63 signals:
64     void progressBarDestroyed (QWidget *);
65
66 private slots:
67     void displayMessage (vlc_object_t *, void *);
68     void requestLogin (vlc_object_t *, void *);
69     void requestAnswer (vlc_object_t *, void *);
70     void startProgressBar (vlc_object_t *, void *);
71     void stopProgressBar (QWidget *);
72 };
73
74 /* Put here instead of .cpp because of MOC */
75 #include <QProgressDialog>
76
77 class QVLCProgressDialog : public QProgressDialog
78 {
79     Q_OBJECT
80 public:
81     QVLCProgressDialog (DialogHandler *parent,
82                         struct dialog_progress_bar_t *);
83     virtual ~QVLCProgressDialog (void);
84
85 private:
86     DialogHandler *handler;
87     bool cancelled;
88
89     static void update (void *, const char *, float);
90     static bool check (void *);
91     static void destroy (void *);
92 private slots:
93     void saveCancel (void);
94
95 signals:
96     void progressed (int);
97     void described (const QString&);
98     void destroyed (void);
99 };
100
101 #endif