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$
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 _OPEN_DIALOG_H_
00025 #define _OPEN_DIALOG_H_
00026 
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030 
00031 #include <vlc_common.h>
00032 
00033 #include "util/qvlcframe.hpp"
00034 #include "dialogs_provider.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, bool b_selectMode = false  );
00064 
00065     static void killInstance()
00066     {
00067         if( instance ) delete instance;
00068         instance = NULL;
00069     }
00070     virtual ~OpenDialog();
00071 
00072     void showTab( int = OPEN_FILE_TAB );
00073     QString getMRL(){ return mrl; }
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 );
00085 
00086     static OpenDialog *instance;
00087     input_thread_t *p_input;
00088 
00089     QString mrl;
00090     QString mainMRL;
00091     QString storedMethod;
00092 
00093     Ui::Open ui;
00094     FileOpenPanel *fileOpenPanel;
00095     NetOpenPanel *netOpenPanel;
00096     DiscOpenPanel *discOpenPanel;
00097     CaptureOpenPanel *captureOpenPanel;
00098 
00099     int i_action_flag;
00100     QStringList SeparateEntries( QString );
00101 
00102     QPushButton *cancelButton, *selectButton;
00103     QPushButton *playButton;
00104 
00105     void finish( bool );
00106 
00107 private slots:
00108     void setMenuAction();
00109     void cancel();
00110     void close();
00111     void toggleAdvancedPanel();
00112     void updateMRL( QString );
00113     void updateMRL();
00114     void newCachingMethod( QString );
00115     void signalCurrent();
00116     void browseInputSlave();
00117 };
00118 
00119 #endif

Generated on Wed Aug 13 08:02:38 2008 for VLC by  doxygen 1.5.1