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" ); \
68 EXT_FILTER_MEDIA = 0x01,
69 EXT_FILTER_VIDEO = 0x02,
70 EXT_FILTER_AUDIO = 0x04,
71 EXT_FILTER_PLAYLIST = 0x08,
72 EXT_FILTER_SUBTITLE = 0x10,
95 class DialogsProvider : public QObject
98 friend class QVLCMenu;
101 static DialogsProvider *getInstance()
106 static DialogsProvider *getInstance( intf_thread_t *p_intf )
109 instance = new DialogsProvider( p_intf );
112 static void killInstance()
114 if( instance ) delete instance;
117 virtual ~DialogsProvider();
120 QStringList showSimpleOpen( QString help = QString(),
121 int filters = EXT_FILTER_MEDIA |
122 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
124 QString path = QString() );
126 QSignalMapper *menusMapper;
127 QSignalMapper *menusUpdateMapper;
128 QSignalMapper *SDMapper;
129 void customEvent( QEvent *);
132 DialogsProvider( intf_thread_t *);
133 intf_thread_t *p_intf;
134 static DialogsProvider *instance;
135 void addFromSimple( bool, bool );
138 void doInteraction( intf_dialog_args_t * );
139 void menuAction( QObject *);
140 void menuUpdateAction( QObject * );
141 void SDMenuAction( QString );
143 void playlistDialog();
144 void bookmarksDialog();
145 void mediaInfoDialog();
146 void mediaCodecDialog();
148 void extendedDialog();
149 void messagesDialog();
156 void gotoTimeDialog();
157 void podcastConfigureDialog();
159 void simpleOpenDialog();
160 void simplePLAppendDialog();
161 void simpleMLAppendDialog();
164 void openDialog( int );
165 void openDiscDialog();
166 void openFileDialog();
167 void openNetDialog();
168 void openCaptureDialog();
170 void PLAppendDialog();
171 void MLAppendDialog();
175 void streamingDialog( QWidget *parent, QString mrl = "",
176 bool b_stream = true );
177 void openThenStreamingDialogs();
178 void openThenTranscodingDialogs();
180 void openAPlaylist();
181 void saveAPlaylist();
183 void switchToSkins();