]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/open.hpp
qt4: use const for QString when possible.
[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 QVLC_OPEN_DIALOG_H_
25 #define QVLC_OPEN_DIALOG_H_ 1
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 "ui/open.h"
35 #include "components/open_panels.hpp"
36
37 enum {
38     OPEN_FILE_TAB,
39     OPEN_DISC_TAB,
40     OPEN_NETWORK_TAB,
41     OPEN_CAPTURE_TAB,
42     OPEN_TAB_MAX
43 };
44
45 enum {
46     OPEN_AND_PLAY,
47     OPEN_AND_ENQUEUE,
48     OPEN_AND_STREAM,
49     OPEN_AND_SAVE,
50     SELECT              /* Special mode to select a MRL (for VLM or similar */
51 };
52
53
54 class QString;
55 class QTabWidget;
56
57 class OpenDialog : public QVLCDialog
58 {
59     Q_OBJECT;
60 public:
61     static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf,
62                                 bool b_rawInstance = false, int _action_flag = 0,
63                                 bool b_selectMode = false, bool b_pl = true );
64
65     static void killInstance()
66     {
67         delete instance;
68         instance = NULL;
69     }
70
71     void showTab( int = OPEN_FILE_TAB );
72     QString getMRL( bool b = true );
73
74 public slots:
75     void selectSlots();
76     void play();
77     void stream( bool b_transode_only = false );
78     void enqueue();
79     void transcode();
80
81 private:
82     OpenDialog( QWidget *parent, intf_thread_t *, bool b_selectMode,
83                 int _action_flag = 0, bool b_pl = true );
84     virtual ~OpenDialog();
85
86     static OpenDialog *instance;
87     input_thread_t *p_input;
88
89     QString optionsMRL;
90     QString storedMethod;
91     QStringList itemsMRL;
92
93     Ui::Open ui;
94     FileOpenPanel *fileOpenPanel;
95     NetOpenPanel *netOpenPanel;
96     DiscOpenPanel *discOpenPanel;
97     CaptureOpenPanel *captureOpenPanel;
98
99     int i_action_flag;
100     bool b_pl;
101     QStringList SeparateEntries( const QString& );
102
103     QPushButton *cancelButton, *selectButton;
104     QPushButton *playButton;
105
106     void finish( bool );
107
108 private slots:
109     void setMenuAction();
110     void cancel();
111     void close();
112     void toggleAdvancedPanel();
113     void updateMRL( const QStringList&, const QString& );
114     void updateMRL();
115     void newCachingMethod( const QString& );
116     void signalCurrent( int );
117     void browseInputSlave();
118 };
119
120 #endif