1 /*****************************************************************************
2 * open.hpp : Panels for the open dialogs
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 _OPENPANELS_H_
26 #define _OPENPANELS_H_
31 #include <QFileDialog>
33 #include "ui/open_file.h"
34 #include "ui/open_disk.h"
35 #include "ui/open_net.h"
36 #include "ui/open_capture.h"
40 class OpenPanel: public QWidget
44 OpenPanel( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p )
48 virtual ~OpenPanel() {};
49 virtual void clear() = 0;
51 intf_thread_t *p_intf;
53 virtual void updateMRL() = 0;
55 void mrlUpdated( QString );
56 void methodChanged( QString method );
59 class FileOpenBox: public QFileDialog
63 FileOpenBox( QWidget *parent, const QString &caption,
64 const QString &directory, const QString &filter ):
65 QFileDialog( parent, caption, directory, filter ) {}
70 class FileOpenPanel: public OpenPanel
74 FileOpenPanel( QWidget *, intf_thread_t * );
75 virtual ~FileOpenPanel();
76 virtual void clear() ;
77 virtual void accept() ;
80 QStringList browse( QString );
81 FileOpenBox *dialogBox;
82 QLineEdit *lineFileEdit;
84 virtual void updateMRL();
88 void toggleSubtitleFrame();
91 class NetOpenPanel: public OpenPanel
95 NetOpenPanel( QWidget *, intf_thread_t * );
96 virtual ~NetOpenPanel();
97 virtual void clear() ;
101 virtual void updateMRL();
103 void updateProtocol(int);
104 void updateAddress();
107 class DiscOpenPanel: public OpenPanel
111 DiscOpenPanel( QWidget *, intf_thread_t * );
112 virtual ~DiscOpenPanel();
113 virtual void clear() ;
117 virtual void updateMRL() ;
118 virtual void updateButtons() ;
122 class CaptureOpenPanel: public OpenPanel
126 CaptureOpenPanel( QWidget *, intf_thread_t * );
127 virtual ~CaptureOpenPanel();
128 virtual void clear() ;
132 virtual void updateMRL();