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_
34 #include <vlc_interface.h>
37 #include "dialogs/interaction.hpp"
41 #include <QApplication>
43 #define ADD_FILTER_MEDIA( string ) \
44 string += qtr( "Media Files" ); \
46 string += EXTENSIONS_MEDIA; \
48 #define ADD_FILTER_VIDEO( string ) \
49 string += qtr( "Video Files" ); \
51 string += EXTENSIONS_VIDEO; \
53 #define ADD_FILTER_AUDIO( string ) \
54 string += qtr( "Audio Files" ); \
56 string += EXTENSIONS_AUDIO; \
58 #define ADD_FILTER_PLAYLIST( string ) \
59 string += qtr( "Playlist Files" ); \
61 string += EXTENSIONS_PLAYLIST; \
63 #define ADD_FILTER_SUBTITLE( string ) \
64 string += qtr( "Subtitles Files" );\
66 string += EXTENSIONS_SUBTITLE; \
68 #define ADD_FILTER_ALL( string ) \
69 string += qtr( "All Files" ); \
73 EXT_FILTER_MEDIA = 0x01,
74 EXT_FILTER_VIDEO = 0x02,
75 EXT_FILTER_AUDIO = 0x04,
76 EXT_FILTER_PLAYLIST = 0x08,
77 EXT_FILTER_SUBTITLE = 0x10,
100 class DialogsProvider : public QObject
103 friend class QVLCMenu;
106 static DialogsProvider *getInstance()
111 static DialogsProvider *getInstance( intf_thread_t *p_intf )
114 instance = new DialogsProvider( p_intf );
117 static void killInstance()
119 if( instance ) delete instance;
122 virtual ~DialogsProvider();
125 QStringList showSimpleOpen( QString help = QString(),
126 int filters = EXT_FILTER_MEDIA |
127 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
129 QString path = QString() );
131 QSignalMapper *menusMapper;
132 QSignalMapper *menusUpdateMapper;
133 QSignalMapper *SDMapper;
134 void customEvent( QEvent *);
137 DialogsProvider( intf_thread_t *);
138 intf_thread_t *p_intf;
139 static DialogsProvider *instance;
140 void addFromSimple( bool, bool );
143 void doInteraction( intf_dialog_args_t * );
144 void menuAction( QObject *);
145 void menuUpdateAction( QObject * );
146 void SDMenuAction( QString );
148 void playlistDialog();
149 void bookmarksDialog();
150 void mediaInfoDialog();
151 void mediaCodecDialog();
153 void extendedDialog();
154 void messagesDialog();
163 void gotoTimeDialog();
164 void podcastConfigureDialog();
166 void simpleOpenDialog();
167 void simplePLAppendDialog();
168 void simpleMLAppendDialog();
171 void openDialog( int );
172 void openDiscDialog();
173 void openFileDialog();
174 void openNetDialog();
175 void openCaptureDialog();
177 void PLAppendDialog();
178 void MLAppendDialog();
182 void streamingDialog( QWidget *parent, QString mrl = "",
183 bool b_stream = true );
184 void openThenStreamingDialogs();
185 void openThenTranscodingDialogs();
187 void openAPlaylist();
188 void saveAPlaylist();