1 /*****************************************************************************
2 * open.hpp : Panels for the open dialogs
3 ****************************************************************************
4 * Copyright (C) 2006 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 _OPENPANELS_H_
26 #define _OPENPANELS_H_
31 #include <QFileDialog>
32 #include "ui/open_file.h"
33 #include "ui/open_disk.h"
34 #include "ui/open_net.h"
35 #include "ui/open_capture.h"
39 class OpenPanel: public QWidget
43 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
47 virtual ~OpenPanel() {};
48 virtual void clear() = 0;
50 intf_thread_t *p_intf;
52 virtual void updateMRL() = 0;
54 void mrlUpdated( QString );
55 void methodChanged( QString method );
58 class FileOpenBox: public QFileDialog
62 FileOpenBox( QWidget *parent, const QString &caption,
63 const QString &directory, const QString &filter ):
64 QFileDialog( parent, caption, directory, filter ) {}
69 class FileOpenPanel: public OpenPanel
73 FileOpenPanel( QWidget *, intf_thread_t * );
74 virtual ~FileOpenPanel();
75 virtual void clear() ;
76 virtual void accept() ;
79 QStringList browse( QString );
80 FileOpenBox *dialogBox;
81 QLineEdit *lineFileEdit;
83 virtual void updateMRL();
87 void toggleSubtitleFrame();
90 class NetOpenPanel: public OpenPanel
94 NetOpenPanel( QWidget *, intf_thread_t * );
95 virtual ~NetOpenPanel();
96 virtual void clear() ;
100 virtual void updateMRL();
102 void updateProtocol(int);
103 void updateAddress();
106 class DiscOpenPanel: public OpenPanel
110 DiscOpenPanel( QWidget *, intf_thread_t * );
111 virtual ~DiscOpenPanel();
112 virtual void clear() ;
116 virtual void updateMRL() ;
120 class CaptureOpenPanel: public OpenPanel
124 CaptureOpenPanel( QWidget *, intf_thread_t * );
125 virtual ~CaptureOpenPanel();
126 virtual void clear() ;
130 virtual void updateMRL();