1 /*****************************************************************************
2 * dialogs_provider.hpp : Dialogs provider
3 ****************************************************************************
4 * Copyright (C) 2006-2007 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Baptiste Kempf <jb@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #ifndef _DIALOGS_PROVIDER_H_
26 #define _DIALOGS_PROVIDER_H_
30 #include <vlc_interface.h>
32 #include "dialogs/interaction.hpp"
36 #include <QApplication>
38 #define ADD_FILTER_MEDIA( string ) \
39 string += qtr("Media Files"); \
41 string += EXTENSIONS_MEDIA; \
43 #define ADD_FILTER_VIDEO( string ) \
44 string += qtr("Video Files"); \
46 string += EXTENSIONS_VIDEO; \
48 #define ADD_FILTER_AUDIO( string ) \
49 string += qtr("Audio Files"); \
51 string += EXTENSIONS_AUDIO; \
53 #define ADD_FILTER_PLAYLIST( string )\
54 string += qtr("Playlist Files"); \
56 string += EXTENSIONS_PLAYLIST; \
58 #define ADD_FILTER_SUBTITLE( string )\
59 string += qtr("Subtitles Files"); \
61 string += EXTENSIONS_SUBTITLE; \
63 #define ADD_FILTER_ALL( string ) \
64 string += qtr("All Files"); \
67 #define EXT_FILTER_MEDIA 0x01
68 #define EXT_FILTER_VIDEO 0x02
69 #define EXT_FILTER_AUDIO 0x04
70 #define EXT_FILTER_PLAYLIST 0x08
71 #define EXT_FILTER_SUBTITLE 0x10
91 class DialogsProvider : public QObject
95 static DialogsProvider *getInstance()
100 static DialogsProvider *getInstance( intf_thread_t *p_intf )
103 instance = new DialogsProvider( p_intf );
106 static void killInstance()
108 if( instance ) delete instance;
111 virtual ~DialogsProvider();
114 QStringList showSimpleOpen( QString help = QString(),
115 int filters = EXT_FILTER_MEDIA |
116 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
118 QString path = QString() );
120 friend class QVLCMenu;
121 QSignalMapper *menusMapper;
122 QSignalMapper *menusUpdateMapper;
123 QSignalMapper *SDMapper;
124 void customEvent( QEvent *);
126 DialogsProvider( intf_thread_t *);
127 intf_thread_t *p_intf;
128 static DialogsProvider *instance;
129 void addFromSimple( bool, bool );
132 void doInteraction( intf_dialog_args_t * );
133 void menuAction( QObject *);
134 void menuUpdateAction( QObject *);
135 void SDMenuAction( QString );
137 void playlistDialog();
138 void bookmarksDialog();
139 void mediaInfoDialog();
140 void mediaCodecDialog();
142 void extendedDialog();
143 void messagesDialog();
147 void gotoTimeDialog();
149 void simpleOpenDialog();
150 void simplePLAppendDialog();
151 void simpleMLAppendDialog();
154 void openDialog( int );
155 void openDiscDialog();
156 void openFileDialog();
157 void openNetDialog();
158 void openCaptureDialog();
160 void PLAppendDialog();
161 void MLAppendDialog();
165 void streamingDialog( QString mrl = "", bool b_stream = true );
166 void openThenStreamingDialogs();
167 void openThenTranscodingDialogs();
172 void podcastConfigureDialog();
174 void switchToSkins();