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_
33 #include <vlc_common.h>
34 #include <vlc_interface.h>
37 #include "dialogs/interaction.hpp"
38 #include "dialogs/open.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,
84 class DialogsProvider : public QObject
87 friend class QVLCMenu;
90 static DialogsProvider *getInstance()
95 static DialogsProvider *getInstance( intf_thread_t *p_intf )
98 instance = new DialogsProvider( p_intf );
101 static void killInstance()
103 if( instance ) delete instance;
106 static bool isAlive()
108 return ( instance != NULL );
110 virtual ~DialogsProvider();
112 QStringList showSimpleOpen( QString help = QString(),
113 int filters = EXT_FILTER_MEDIA |
114 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
116 QString path = QString() );
117 bool isDying() { return b_isDying; }
119 QSignalMapper *menusMapper;
120 QSignalMapper *menusUpdateMapper;
121 QSignalMapper *SDMapper;
122 void customEvent( QEvent *);
125 DialogsProvider( intf_thread_t *);
126 intf_thread_t *p_intf;
127 static DialogsProvider *instance;
128 void addFromSimple( bool, bool );
132 void doInteraction( intf_dialog_args_t * );
133 void menuAction( QObject *);
134 void menuUpdateAction( QObject * );
135 void SDMenuAction( QString );
136 void playMRL( const QString & );
138 void playlistDialog();
139 void bookmarksDialog();
140 void mediaInfoDialog();
141 void mediaCodecDialog();
143 void extendedDialog();
144 void messagesDialog();
153 void gotoTimeDialog();
154 void podcastConfigureDialog();
156 void simpleOpenDialog();
157 void simplePLAppendDialog();
158 void simpleMLAppendDialog();
161 void openDialog( int );
162 void openFileGenericDialog( intf_dialog_args_t * );
163 void openDiscDialog();
164 void openFileDialog();
165 void openNetDialog();
166 void openCaptureDialog();
168 void PLAppendDialog();
169 void MLAppendDialog();
174 void streamingDialog( QWidget *parent, QString mrl = "",
175 bool b_stream = true );
176 void openThenStreamingDialogs();
177 void openThenTranscodingDialogs();
179 void openAPlaylist();
180 void saveAPlaylist();
182 void loadSubtitlesFile();