1 /*****************************************************************************
2 * dialogs_provider.hpp : Dialogs provider
3 ****************************************************************************
4 * Copyright (C) 2006-2008 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 QVLC_DIALOGS_PROVIDER_H_
26 #define QVLC_DIALOGS_PROVIDER_H_
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,
76 DialogEvent_Type = QEvent::User + DialogEventType + 1,
77 //PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
78 //PLDockEvent_Type = QEvent::User + DialogEventType + 3;
79 SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4,
85 #include <QStringList>
87 class DialogsProvider : public QObject
90 friend class QVLCMenu;
93 static DialogsProvider *getInstance()
98 static DialogsProvider *getInstance( intf_thread_t *p_intf )
101 instance = new DialogsProvider( p_intf );
104 static void killInstance()
106 if( instance ) delete instance;
109 static bool isAlive()
111 return ( instance != NULL );
113 virtual ~DialogsProvider();
115 QStringList showSimpleOpen( QString help = QString(),
116 int filters = EXT_FILTER_MEDIA |
117 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
119 QString path = QString() );
120 bool isDying() { return b_isDying; }
122 QSignalMapper *menusMapper;
123 QSignalMapper *menusUpdateMapper;
124 QSignalMapper *SDMapper;
125 void customEvent( QEvent *);
128 DialogsProvider( intf_thread_t *);
129 intf_thread_t *p_intf;
130 static DialogsProvider *instance;
133 void openDialog( int );
134 void addFromSimple( bool, bool );
137 void playMRL( const QString & );
139 void playlistDialog();
140 void bookmarksDialog();
141 void mediaInfoDialog();
142 void mediaCodecDialog();
144 void extendedDialog();
145 void synchroDialog();
146 void messagesDialog();
155 void gotoTimeDialog();
156 void podcastConfigureDialog();
157 void toolbarDialog();
160 void openFileGenericDialog( intf_dialog_args_t * );
162 void simpleOpenDialog();
163 void simplePLAppendDialog();
164 void simpleMLAppendDialog();
167 void openDiscDialog();
168 void openFileDialog();
169 void openUrlDialog();
170 void openNetDialog();
171 void openCaptureDialog();
173 void PLAppendDialog();
174 void MLAppendDialog();
180 void streamingDialog( QWidget *parent, QString mrl, bool b_stream = true,
181 QStringList options = QStringList("") );
182 void openAndStreamingDialogs();
183 void openAndTranscodingDialogs();
185 void openAPlaylist();
186 void saveAPlaylist();
188 void loadSubtitlesFile();
192 void menuAction( QObject *);
193 void menuUpdateAction( QObject * );
194 void SDMenuAction( QString );
197 class DialogEvent : public QEvent
200 DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) :
201 QEvent( (QEvent::Type)(DialogEvent_Type) )
203 i_dialog = _i_dialog;
207 virtual ~DialogEvent() { };
210 intf_dialog_args_t *p_arg;