open.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * open.hpp : advanced open dialog
00003  ****************************************************************************
00004  * Copyright (C) 2006-2007 the VideoLAN team
00005  * $Id: db2efbb67feb28438e2c0baec3f1525fe516a7c6 $
00006  *
00007  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  ******************************************************************************/
00023 
00024 #ifndef QVLC_OPEN_DIALOG_H_
00025 #define QVLC_OPEN_DIALOG_H_ 1
00026 
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030 
00031 #include <vlc_common.h>
00032 #include <vlc_url.h>
00033 
00034 #include "util/qvlcframe.hpp"
00035 #include "ui/open.h"
00036 #include "components/open_panels.hpp"
00037 
00038 enum {
00039     OPEN_FILE_TAB,
00040     OPEN_DISC_TAB,
00041     OPEN_NETWORK_TAB,
00042     OPEN_CAPTURE_TAB,
00043     OPEN_TAB_MAX
00044 };
00045 
00046 enum {
00047     OPEN_AND_PLAY,
00048     OPEN_AND_ENQUEUE,
00049     OPEN_AND_STREAM,
00050     OPEN_AND_SAVE,
00051     SELECT              /* Special mode to select a MRL (for VLM or similar */
00052 };
00053 
00054 
00055 class QString;
00056 class QTabWidget;
00057 
00058 class OpenDialog : public QVLCDialog
00059 {
00060     Q_OBJECT
00061 public:
00062     static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf,
00063                                 bool b_rawInstance = false, int _action_flag = 0,
00064                                 bool b_selectMode = false, bool b_pl = true );
00065 
00066     static void killInstance()
00067     {
00068         delete instance;
00069         instance = NULL;
00070     }
00071 
00072     void showTab( int = OPEN_FILE_TAB );
00073     QString getMRL( bool b = true );
00074 
00075 public slots:
00076     void selectSlots();
00077     void play();
00078     void stream( bool b_transode_only = false );
00079     void enqueue();
00080     void transcode();
00081 
00082 private:
00083     OpenDialog( QWidget *parent, intf_thread_t *, bool b_selectMode,
00084                 int _action_flag = 0, bool b_pl = true );
00085     virtual ~OpenDialog();
00086 
00087     static OpenDialog *instance;
00088     input_thread_t *p_input;
00089 
00090     QString optionsMRL;
00091     QString storedMethod;
00092     QStringList itemsMRL;
00093 
00094     Ui::Open ui;
00095     FileOpenPanel *fileOpenPanel;
00096     NetOpenPanel *netOpenPanel;
00097     DiscOpenPanel *discOpenPanel;
00098     CaptureOpenPanel *captureOpenPanel;
00099 
00100     int i_action_flag;
00101     bool b_pl;
00102     QStringList SeparateEntries( const QString& );
00103 
00104     QPushButton *cancelButton, *selectButton;
00105     QToolButton *playButton;
00106 
00107     void finish( bool );
00108 
00109 private slots:
00110     void setMenuAction();
00111     void cancel();
00112     void close();
00113     void toggleAdvancedPanel();
00114     void updateMRL( const QStringList&, const QString& );
00115     void updateMRL();
00116     void newCachingMethod( const QString& );
00117     void signalCurrent( int );
00118     void browseInputSlave();
00119 };
00120 
00121 #endif

Generated on Tue May 25 08:04:57 2010 for VLC by  doxygen 1.5.6