]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs_provider.hpp
Cosmetics + Enable menu in playlist
[vlc] / modules / gui / qt4 / dialogs_provider.hpp
1 /*****************************************************************************
2  * dialogs_provider.hpp : Dialogs provider
3  ****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
22
23 #ifndef _DIALOGS_PROVIDER_H_
24 #define _DIALOGS_PROVIDER_H_
25
26 #include <QObject>
27 #include <QTimer>
28 #include <QApplication>
29 #include <vlc/vlc.h>
30 #include <vlc/intf.h>
31 #include "dialogs/interaction.hpp"
32 #include <assert.h>
33
34 class QEvent;
35 class QSignalMapper;
36 class QVLCMenu;
37
38 class DialogsProvider : public QObject
39 {
40     Q_OBJECT;
41 public:
42     static DialogsProvider *getInstance()
43     {
44         assert( instance );
45         return instance;
46     }
47     static DialogsProvider *getInstance( intf_thread_t *p_intf )
48     {
49         if( !instance )
50             instance = new DialogsProvider( p_intf );
51         return instance;
52     }
53     virtual ~DialogsProvider();
54     QTimer *idle_timer;
55     QTimer *fixed_timer;
56 protected:
57     friend class QVLCMenu;
58     QSignalMapper *menusMapper;
59     QSignalMapper *menusUpdateMapper;
60     void customEvent( QEvent *);
61 private:
62     DialogsProvider( intf_thread_t *);
63     intf_thread_t *p_intf;
64     static DialogsProvider *instance;
65     QStringList showSimpleOpen();
66
67 public slots:
68     void playlistDialog();
69     void bookmarksDialog();
70     void streaminfoDialog();
71     void prefsDialog();
72     void messagesDialog();
73     void simpleAppendDialog();
74     void simpleOpenDialog();
75     void openDialog();
76     void openDialog( int );
77     void popupMenu( int );
78     void doInteraction( intf_dialog_args_t * );
79     void menuAction( QObject *);
80     void menuUpdateAction( QObject *);
81     void streamingDialog();
82     void quit();
83 };
84
85
86 #endif