]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/open.hpp
1f2a02583b24d3ae6b3e75539c45e5c374310bbc
[vlc] / modules / gui / qt4 / dialogs / open.hpp
1 /*****************************************************************************
2  * open.hpp : advanced open dialog
3  ****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
8  *
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.
13  *
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.
18  *
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.
22  ******************************************************************************/
23
24 #ifndef _OPEN_DIALOG_H_
25 #define _OPEN_DIALOG_H_
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32
33 #include "util/qvlcframe.hpp"
34 #include "dialogs_provider.hpp"
35 #include "ui/open.h"
36 #include "components/open_panels.hpp"
37
38 class QString;
39 class QTabWidget;
40
41 class OpenDialog : public QVLCDialog
42 {
43     Q_OBJECT;
44 public:
45     static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf,
46                                      int _action_flag = 0, bool modal = false  );
47
48     static void killInstance()
49     {
50         if( instance ) delete instance;
51         instance = NULL;
52     }
53     virtual ~OpenDialog();
54
55     void showTab( int );
56     QString getMRL(){ return mrl; }
57
58 public slots:
59     void selectSlots();
60     void play();
61     void stream( bool b_transode_only = false );
62     void enqueue();
63     void transcode();
64
65 private:
66     OpenDialog( QWidget *parent, intf_thread_t *, bool modal,
67                 int _action_flag = 0 );
68
69     static OpenDialog *instance;
70     input_thread_t *p_input;
71
72     QString mrl;
73     QString mainMRL;
74     QString storedMethod;
75
76     Ui::Open ui;
77     FileOpenPanel *fileOpenPanel;
78     NetOpenPanel *netOpenPanel;
79     DiscOpenPanel *discOpenPanel;
80     CaptureOpenPanel *captureOpenPanel;
81
82     int i_action_flag;
83     QStringList SeparateEntries( QString );
84
85     QPushButton *cancelButton, *selectButton;
86     QPushButton *playButton;
87
88     void finish( bool );
89
90 private slots:
91     void setMenuAction();
92     void cancel();
93     void close();
94     void toggleAdvancedPanel();
95     void updateMRL( QString );
96     void updateMRL();
97     void newCachingMethod( QString );
98     void signalCurrent();
99 };
100
101 #endif