]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs_provider.hpp
Some cleanup here and there
[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
30 #include "dialogs/interaction.hpp"
31
32 #include <assert.h>
33 #include <vlc/vlc.h>
34 #include <vlc/intf.h>
35
36 class QEvent;
37 class QSignalMapper;
38 class QVLCMenu;
39
40 class DialogsProvider : public QObject
41 {
42     Q_OBJECT;
43 public:
44     static DialogsProvider *getInstance()
45     {
46         assert( instance );
47         return instance;
48     }
49     static DialogsProvider *getInstance( intf_thread_t *p_intf )
50     {
51         if( !instance )
52             instance = new DialogsProvider( p_intf );
53         return instance;
54     }
55     virtual ~DialogsProvider() {};
56     QTimer *fixed_timer;
57 protected:
58     friend class QVLCMenu;
59     QSignalMapper *menusMapper;
60     QSignalMapper *menusUpdateMapper;
61     void customEvent( QEvent *);
62 private:
63     DialogsProvider( intf_thread_t *);
64     intf_thread_t *p_intf;
65     static DialogsProvider *instance;
66     QStringList showSimpleOpen();
67
68 public slots:
69     void playlistDialog();
70     void bookmarksDialog();
71     void streaminfoDialog();
72     void prefsDialog();
73     void messagesDialog();
74     void simplePLAppendDialog();
75     void simpleMLAppendDialog();
76     void simpleOpenDialog();
77     void openDialog();
78     void PLAppendDialog();
79     void MLAppendDialog();
80     void openDialog( int );
81     void popupMenu( int );
82     void doInteraction( intf_dialog_args_t * );
83     void menuAction( QObject *);
84     void menuUpdateAction( QObject *);
85     void streamingDialog();
86     void openPlaylist();
87     void openDirectory();
88     void openMLDirectory();
89     void quit();
90 };
91
92 #endif