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 EXT_FILTER_MEDIA 0x01
39 #define EXT_FILTER_VIDEO 0x02
40 #define EXT_FILTER_AUDIO 0x04
41 #define EXT_FILTER_PLAYLIST 0x08
42 #define EXT_FILTER_SUBTITLE 0x10
44 #define ADD_FILTER_MEDIA( string ) \
45 string += qtr("Media Files"); \
47 string += EXTENSIONS_MEDIA; \
49 #define ADD_FILTER_VIDEO( string ) \
50 string += qtr("Video Files"); \
52 string += EXTENSIONS_VIDEO; \
54 #define ADD_FILTER_AUDIO( string ) \
55 string += qtr("Audio Files"); \
57 string += EXTENSIONS_AUDIO; \
59 #define ADD_FILTER_PLAYLIST( string )\
60 string += qtr("Playlist Files"); \
62 string += EXTENSIONS_PLAYLIST; \
64 #define ADD_FILTER_SUBTITLE( string )\
65 string += qtr("Subtitles Files"); \
67 string += EXTENSIONS_SUBTITLE; \
69 #define ADD_FILTER_ALL( string ) \
70 string += qtr("All Files"); \
73 #define OPEN_FILE_TAB 0x0
74 #define OPEN_DISC_TAB 0x1
75 #define OPEN_NETWORK_TAB 0x2
76 #define OPEN_CAPTURE_TAB 0x3
78 #define OPEN_AND_PLAY 0x0
79 #define OPEN_AND_STREAM 0x1
80 #define OPEN_AND_SAVE 0x2
87 class DialogsProvider : public QObject
91 static DialogsProvider *getInstance()
96 static DialogsProvider *getInstance( intf_thread_t *p_intf )
99 instance = new DialogsProvider( p_intf );
102 static void killInstance()
104 if( instance ) delete instance;
107 virtual ~DialogsProvider();
110 QStringList showSimpleOpen( QString help = QString(),
111 int filters = EXT_FILTER_MEDIA |
112 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
114 QString path = QString() );
116 friend class QVLCMenu;
117 QSignalMapper *menusMapper;
118 QSignalMapper *menusUpdateMapper;
119 QSignalMapper *SDMapper;
120 void customEvent( QEvent *);
122 DialogsProvider( intf_thread_t *);
123 intf_thread_t *p_intf;
124 static DialogsProvider *instance;
125 void addFromSimple( bool, bool );
128 void doInteraction( intf_dialog_args_t * );
129 void menuAction( QObject *);
130 void menuUpdateAction( QObject *);
131 void SDMenuAction( QString );
133 void playlistDialog();
134 void bookmarksDialog();
135 void mediaInfoDialog();
136 void mediaCodecDialog();
138 void extendedDialog();
139 void messagesDialog();
143 void gotoTimeDialog();
145 void simpleOpenDialog();
146 void simplePLAppendDialog();
147 void simpleMLAppendDialog();
150 void openDialog( int );
151 void openDiscDialog();
152 void openFileDialog();
153 void openNetDialog();
154 void openCaptureDialog();
156 void PLAppendDialog();
157 void MLAppendDialog();
161 void streamingDialog( QString mrl = "", bool b_stream = true );
162 void openThenStreamingDialogs();
163 void openThenTranscodingDialogs();
168 void podcastConfigureDialog();
170 void switchToSkins();