plugins.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * plugins.hpp : Plug-ins and extensions listing
00003  ****************************************************************************
00004  * Copyright (C) 2008 the VideoLAN team
00005  * $Id: c61de2af61067cef5654f017c814879283de92fd $
00006  *
00007  * Authors: Jean-Baptiste Kempf <jb (at) 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_PLUGIN_DIALOG_H_
00025 #define QVLC_PLUGIN_DIALOG_H_ 1
00026 
00027 #include "util/qvlcframe.hpp"
00028 #include "util/singleton.hpp"
00029 
00030 #include <vlc_extensions.h>
00031 
00032 #include <QStringList>
00033 #include <QTreeWidgetItem>
00034 #include <QAbstractListModel>
00035 #include <QStyledItemDelegate>
00036 
00037 class QLabel;
00038 class QTabWidget;
00039 class QComboBox;
00040 class QTreeWidget;
00041 class QLineEdit;
00042 class QTextBrowser;
00043 class QListView;
00044 class QStyleOptionViewItem;
00045 class QPainter;
00046 class QKeyEvent;
00047 class PluginTab;
00048 class ExtensionTab;
00049 class ExtensionListItem;
00050 class SearchLineEdit;
00051 class ExtensionCopy;
00052 
00053 
00054 class PluginDialog : public QVLCFrame, public Singleton<PluginDialog>
00055 {
00056     Q_OBJECT
00057 
00058 private:
00059     PluginDialog( intf_thread_t * );
00060     virtual ~PluginDialog();
00061 
00062     QTabWidget *tabs;
00063     PluginTab *pluginTab;
00064     ExtensionTab *extensionTab;
00065 
00066     friend class Singleton<PluginDialog>;
00067 };
00068 
00069 class PluginTab : public QVLCFrame
00070 {
00071     Q_OBJECT
00072 
00073 private:
00074     PluginTab( intf_thread_t *p_intf );
00075     virtual ~PluginTab();
00076 
00077     void FillTree();
00078     QTreeWidget *treePlugins;
00079     SearchLineEdit *edit;
00080 
00081 private slots:
00082     void search( const QString& );
00083 
00084     friend class PluginDialog;
00085 };
00086 
00087 class ExtensionTab : public QVLCFrame
00088 {
00089     Q_OBJECT
00090 
00091 protected:
00092     virtual void keyPressEvent( QKeyEvent *keyEvent );
00093 
00094 private:
00095     ExtensionTab( intf_thread_t *p_intf );
00096     virtual ~ExtensionTab();
00097 
00098 private slots:
00099     void moreInformation();
00100 
00101 private:
00102     QListView *extList;
00103     QPushButton *butMoreInfo;
00104 
00105     friend class PluginDialog;
00106 };
00107 
00108 class PluginTreeItem : public QTreeWidgetItem
00109 {
00110 public:
00111     PluginTreeItem(QStringList &qs_item, int Type = QTreeWidgetItem::Type)
00112             : QTreeWidgetItem (qs_item, Type) {}
00113     virtual ~PluginTreeItem() {}
00114 
00115     virtual bool operator< ( const QTreeWidgetItem & other ) const;
00116 };
00117 
00118 class ExtensionListModel : public QAbstractListModel
00119 {
00120 
00121     Q_OBJECT
00122 
00123 public:
00124     ExtensionListModel( QListView *view, intf_thread_t *p_intf );
00125     virtual ~ExtensionListModel();
00126 
00127     virtual QVariant data( const QModelIndex& index, int role ) const;
00128     virtual QModelIndex index( int row, int column = 0,
00129                                const QModelIndex& = QModelIndex() ) const;
00130     virtual int rowCount( const QModelIndex& = QModelIndex() ) const;
00131 
00132 private slots:
00133     void updateList();
00134 
00135 private:
00136     intf_thread_t *p_intf;
00137     QList<ExtensionCopy*> extensions;
00138 };
00139 
00140 class ExtensionItemDelegate : public QStyledItemDelegate
00141 {
00142 public:
00143     ExtensionItemDelegate( intf_thread_t *p_intf, QListView *view );
00144     virtual ~ExtensionItemDelegate();
00145 
00146     virtual void paint( QPainter *painter,
00147                         const QStyleOptionViewItem &option,
00148                         const QModelIndex &index ) const;
00149     virtual QSize sizeHint( const QStyleOptionViewItem &option,
00150                             const QModelIndex &index ) const;
00151 
00152 private:
00153     QListView *view;
00154     intf_thread_t *p_intf;
00155 };
00156 
00157 class ExtensionInfoDialog : public QVLCDialog
00158 {
00159 public:
00160     ExtensionInfoDialog( const ExtensionCopy& extension,
00161                          intf_thread_t *p_intf, QWidget *parent );
00162     virtual ~ExtensionInfoDialog();
00163 
00164 private:
00165     ExtensionCopy *extension;
00166 };
00167 
00168 #endif
00169 

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