external.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * external.hpp : Dialogs from other LibVLC core and other plugins
00003  ****************************************************************************
00004  * Copyright (C) 2009 Rémi Denis-Courmont
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00019  *****************************************************************************/
00020 
00021 #ifndef QVLC_DIALOGS_EXTERNAL_H_
00022 #define QVLC_DIALOGS_EXTERNAL_H_ 1
00023 
00024 #include <QObject>
00025 #include <vlc_common.h>
00026 #include "variables.hpp"
00027 
00028 struct intf_thread_t;
00029 class QProgressDialog;
00030 
00031 class DialogHandler : public QObject
00032 {
00033     Q_OBJECT
00034 
00035     friend class QVLCProgressDialog;
00036 
00037 public:
00038     DialogHandler (intf_thread_t *, QObject *parent);
00039     ~DialogHandler (void);
00040 
00041 private:
00042     intf_thread_t *intf;
00043     static int error (vlc_object_t *, const char *, vlc_value_t, vlc_value_t,
00044                       void *);
00045     QVLCPointer critical;
00046     QVLCPointer login;
00047     QVLCPointer question;
00048     QVLCPointer progressBar;
00049 signals:
00050     void progressBarDestroyed (QWidget *);
00051     void error (const QString&, const QString&);
00052 
00053 private slots:
00054     void displayError (const QString&, const QString&);
00055     void displayCritical (vlc_object_t *, void *);
00056     void requestLogin (vlc_object_t *, void *);
00057     void requestAnswer (vlc_object_t *, void *);
00058     void startProgressBar (vlc_object_t *, void *);
00059     void stopProgressBar (QWidget *);
00060 };
00061 
00062 /* Put here instead of .cpp because of MOC */
00063 #include <QProgressDialog>
00064 
00065 class QVLCProgressDialog : public QProgressDialog
00066 {
00067     Q_OBJECT
00068 public:
00069     QVLCProgressDialog (DialogHandler *parent,
00070                         struct dialog_progress_bar_t *);
00071     virtual ~QVLCProgressDialog (void);
00072 
00073 private:
00074     DialogHandler *handler;
00075     bool cancelled;
00076 
00077     static void update (void *, const char *, float);
00078     static bool check (void *);
00079     static void destroy (void *);
00080 private slots:
00081     void saveCancel (void);
00082 
00083 signals:
00084     void progressed (int);
00085     void described (const QString&);
00086     void destroyed (void);
00087 };
00088 
00089 #endif

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