]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs_provider.hpp
6afbefff97cafefc4b9180bf956e292b7843ec16
[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_interface.h>
35
36 #define ADD_FILTER_MEDIA( string )   \
37     string += _("Media Files");      \
38     string += " ( ";                 \
39     string += EXTENSIONS_MEDIA;      \
40     string += ");;";
41 #define ADD_FILTER_VIDEO( string )   \
42     string += _("Video Files");      \
43     string += " ( ";                 \
44     string += EXTENSIONS_VIDEO;      \
45     string += ");;";
46 #define ADD_FILTER_AUDIO( string )   \
47     string += _("Audio Files");      \
48     string += " ( ";                 \
49     string += EXTENSIONS_AUDIO;      \
50     string += ");;";
51 #define ADD_FILTER_PLAYLIST( string )\
52     string += _("Playlist Files");   \
53     string += " ( ";                 \
54     string += EXTENSIONS_PLAYLIST;   \
55     string += ");;";
56 #define ADD_FILTER_ALL( string )     \
57     string += _("All Files");        \
58     string += " (*.*)";
59
60
61 class QEvent;
62 class QSignalMapper;
63 class QVLCMenu;
64
65 class DialogsProvider : public QObject
66 {
67     Q_OBJECT;
68 public:
69     static DialogsProvider *getInstance()
70     {
71         assert( instance );
72         return instance;
73     }
74     static DialogsProvider *getInstance( intf_thread_t *p_intf )
75     {
76         if( !instance )
77             instance = new DialogsProvider( p_intf );
78         return instance;
79     }
80     static void killInstance()
81     {
82         if( instance ) delete instance;
83         instance=NULL;
84     }
85     virtual ~DialogsProvider();
86     QTimer *fixed_timer;
87
88     QStringList showSimpleOpen( QString help = QString(), bool all = true,
89                                 bool video = true, bool audio = true,
90                                 bool subs = true, bool pls = true );
91 protected:
92     friend class QVLCMenu;
93     QSignalMapper *menusMapper;
94     QSignalMapper *menusUpdateMapper;
95     QSignalMapper *SDMapper;
96     void customEvent( QEvent *);
97 private:
98     DialogsProvider( intf_thread_t *);
99     intf_thread_t *p_intf;
100     static DialogsProvider *instance;
101     void addFromSimple( bool, bool );
102
103 public slots:
104     void playlistDialog();
105     void bookmarksDialog();
106     void mediaInfoDialog();
107     void prefsDialog();
108     void extendedDialog();
109     void messagesDialog();
110     void simplePLAppendDialog();
111     void simpleMLAppendDialog();
112     void simpleOpenDialog();
113     void openDialog();
114     void openDialog(int );
115     void openFileDialog();
116     void openNetDialog();
117     void openCaptureDialog();
118     void openDiscDialog();
119     void PLAppendDialog();
120     void MLAppendDialog();
121     void popupMenu( int );
122     void doInteraction( intf_dialog_args_t * );
123     void menuAction( QObject *);
124     void menuUpdateAction( QObject *);
125     void SDMenuAction( QString );
126     void streamingDialog();
127     void openPlaylist();
128     void savePlaylist();
129     void PLAppendDir();
130     void MLAppendDir();
131     void quit();
132     void switchToSkins();
133     void helpDialog();
134     void aboutDialog();
135 };
136
137 #endif