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"
40 #define ADD_FILTER_MEDIA( string ) \
41 string += qtr( "Media Files" ); \
43 string += EXTENSIONS_MEDIA; \
45 #define ADD_FILTER_VIDEO( string ) \
46 string += qtr( "Video Files" ); \
48 string += EXTENSIONS_VIDEO; \
50 #define ADD_FILTER_AUDIO( string ) \
51 string += qtr( "Audio Files" ); \
53 string += EXTENSIONS_AUDIO; \
55 #define ADD_FILTER_PLAYLIST( string ) \
56 string += qtr( "Playlist Files" ); \
58 string += EXTENSIONS_PLAYLIST; \
60 #define ADD_FILTER_SUBTITLE( string ) \
61 string += qtr( "Subtitles Files" );\
63 string += EXTENSIONS_SUBTITLE; \
65 #define ADD_FILTER_ALL( string ) \
66 string += qtr( "All Files" ); \
70 EXT_FILTER_MEDIA = 0x01,
71 EXT_FILTER_VIDEO = 0x02,
72 EXT_FILTER_AUDIO = 0x04,
73 EXT_FILTER_PLAYLIST = 0x08,
74 EXT_FILTER_SUBTITLE = 0x10,
81 class DialogsProvider : public QObject
84 friend class QVLCMenu;
87 static DialogsProvider *getInstance()
92 static DialogsProvider *getInstance( intf_thread_t *p_intf )
95 instance = new DialogsProvider( p_intf );
98 static void killInstance()
100 if( instance ) delete instance;
103 static bool isAlive()
105 return ( instance != NULL );
107 virtual ~DialogsProvider();
109 QStringList showSimpleOpen( QString help = QString(),
110 int filters = EXT_FILTER_MEDIA |
111 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
113 QString path = QString() );
114 bool isDying() { return b_isDying; }
116 QSignalMapper *menusMapper;
117 QSignalMapper *menusUpdateMapper;
118 QSignalMapper *SDMapper;
119 void customEvent( QEvent *);
122 DialogsProvider( intf_thread_t *);
123 intf_thread_t *p_intf;
124 static DialogsProvider *instance;
127 void openDialog( int );
128 void addFromSimple( bool, bool );
131 void doInteraction( intf_dialog_args_t * );
132 void playMRL( const QString & );
134 void playlistDialog();
135 void bookmarksDialog();
136 void mediaInfoDialog();
137 void mediaCodecDialog();
139 void extendedDialog();
140 void messagesDialog();
149 void gotoTimeDialog();
150 void podcastConfigureDialog();
151 void toolbarDialog();
154 void openFileGenericDialog( intf_dialog_args_t * );
156 void simpleOpenDialog();
157 void simplePLAppendDialog();
158 void simpleMLAppendDialog();
161 void openDiscDialog();
162 void openFileDialog();
163 void openNetDialog();
164 void openCaptureDialog();
166 void PLAppendDialog();
167 void MLAppendDialog();
173 void streamingDialog( QWidget *parent, QString mrl = "",
174 bool b_stream = true );
175 void openAndStreamingDialogs();
176 void openAndTranscodingDialogs();
178 void openAPlaylist();
179 void saveAPlaylist();
181 void loadSubtitlesFile();
185 void menuAction( QObject *);
186 void menuUpdateAction( QObject * );
187 void SDMenuAction( QString );