1 /*****************************************************************************
2 * dialogs_provider.hpp : Dialogs provider
3 ****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
23 #ifndef _DIALOGS_PROVIDER_H_
24 #define _DIALOGS_PROVIDER_H_
28 #include <QApplication>
30 #include "dialogs/interaction.hpp"
34 #include <vlc_interface.h>
36 #define EXT_FILTER_MEDIA 0x01
37 #define EXT_FILTER_VIDEO 0x02
38 #define EXT_FILTER_AUDIO 0x04
39 #define EXT_FILTER_PLAYLIST 0x08
40 #define EXT_FILTER_SUBTITLE 0x10
42 #define ADD_FILTER_MEDIA( string ) \
43 string += _("Media Files"); \
45 string += EXTENSIONS_MEDIA; \
47 #define ADD_FILTER_VIDEO( string ) \
48 string += _("Video Files"); \
50 string += EXTENSIONS_VIDEO; \
52 #define ADD_FILTER_AUDIO( string ) \
53 string += _("Audio Files"); \
55 string += EXTENSIONS_AUDIO; \
57 #define ADD_FILTER_PLAYLIST( string )\
58 string += _("Playlist Files"); \
60 string += EXTENSIONS_PLAYLIST; \
62 #define ADD_FILTER_SUBTITLE( string )\
63 string += _("Subtitles Files"); \
65 string += EXTENSIONS_SUBTITLE; \
67 #define ADD_FILTER_ALL( string ) \
68 string += _("All Files"); \
71 #define OPEN_FILE_TAB 0x0
72 #define OPEN_DISC_TAB 0x1
73 #define OPEN_NETWORK_TAB 0x2
74 #define OPEN_CAPTURE_TAB 0x3
80 class DialogsProvider : public QObject
84 static DialogsProvider *getInstance()
89 static DialogsProvider *getInstance( intf_thread_t *p_intf )
92 instance = new DialogsProvider( p_intf );
95 static void killInstance()
97 if( instance ) delete instance;
100 virtual ~DialogsProvider();
103 QStringList showSimpleOpen( QString help = QString(),
104 int filters = EXT_FILTER_MEDIA |
105 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
107 QString path = QString() );
109 friend class QVLCMenu;
110 QSignalMapper *menusMapper;
111 QSignalMapper *menusUpdateMapper;
112 QSignalMapper *SDMapper;
113 void customEvent( QEvent *);
115 DialogsProvider( intf_thread_t *);
116 intf_thread_t *p_intf;
117 static DialogsProvider *instance;
118 void addFromSimple( bool, bool );
121 void playlistDialog();
122 void bookmarksDialog();
123 void mediaInfoDialog();
124 void mediaCodecDialog();
126 void extendedDialog();
127 void messagesDialog();
128 void simplePLAppendDialog();
129 void simpleMLAppendDialog();
130 void simpleOpenDialog();
132 void openDialog(int );
133 void openFileDialog();
134 void openNetDialog();
135 void openCaptureDialog();
136 void openDiscDialog();
137 void PLAppendDialog();
138 void MLAppendDialog();
139 void doInteraction( intf_dialog_args_t * );
140 void menuAction( QObject *);
141 void menuUpdateAction( QObject *);
142 void SDMenuAction( QString );
143 void streamingDialog( QString mrl = "");
144 void openThenStreamingDialogs();
150 void switchToSkins();
151 void gotoTimeDialog();