1 /*****************************************************************************
2 * plugins.hpp : Plug-ins and extensions listing
3 ****************************************************************************
4 * Copyright (C) 2008 the VideoLAN team
7 * Authors: Jean-Baptiste Kempf <jb (at) videolan.org>
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.
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.
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 *****************************************************************************/
24 #ifndef QVLC_PLUGIN_DIALOG_H_
25 #define QVLC_PLUGIN_DIALOG_H_ 1
27 #include "util/qvlcframe.hpp"
28 #include "util/singleton.hpp"
30 #include <vlc_extensions.h>
32 #include <QStringList>
33 #include <QTreeWidgetItem>
34 #include <QAbstractListModel>
35 #include <QStyledItemDelegate>
44 class QStyleOptionViewItem;
49 class ExtensionListItem;
54 class PluginDialog : public QVLCFrame, public Singleton<PluginDialog>
59 PluginDialog( intf_thread_t * );
60 virtual ~PluginDialog();
64 ExtensionTab *extensionTab;
66 friend class Singleton<PluginDialog>;
69 class PluginTab : public QVLCFrame
81 virtual void keyPressEvent( QKeyEvent *keyEvent );
84 PluginTab( intf_thread_t *p_intf );
88 QTreeWidget *treePlugins;
92 void search( const QString& );
94 friend class PluginDialog;
97 class ExtensionTab : public QVLCFrame
102 virtual void keyPressEvent( QKeyEvent *keyEvent );
105 ExtensionTab( intf_thread_t *p_intf );
106 virtual ~ExtensionTab();
109 void moreInformation();
110 void updateButtons();
114 QPushButton *butMoreInfo;
116 friend class PluginDialog;
119 class PluginTreeItem : public QTreeWidgetItem
122 PluginTreeItem(QStringList &qs_item, int Type = QTreeWidgetItem::Type)
123 : QTreeWidgetItem (qs_item, Type) {}
124 virtual ~PluginTreeItem() {}
126 virtual bool operator< ( const QTreeWidgetItem & other ) const;
129 class ExtensionListModel : public QAbstractListModel
135 ExtensionListModel( QListView *view, intf_thread_t *p_intf );
136 virtual ~ExtensionListModel();
138 virtual QVariant data( const QModelIndex& index, int role ) const;
139 virtual QModelIndex index( int row, int column = 0,
140 const QModelIndex& = QModelIndex() ) const;
141 virtual int rowCount( const QModelIndex& = QModelIndex() ) const;
147 intf_thread_t *p_intf;
148 QList<ExtensionCopy*> extensions;
151 class ExtensionItemDelegate : public QStyledItemDelegate
154 ExtensionItemDelegate( intf_thread_t *p_intf, QListView *view );
155 virtual ~ExtensionItemDelegate();
157 virtual void paint( QPainter *painter,
158 const QStyleOptionViewItem &option,
159 const QModelIndex &index ) const;
160 virtual QSize sizeHint( const QStyleOptionViewItem &option,
161 const QModelIndex &index ) const;
165 intf_thread_t *p_intf;
168 class ExtensionInfoDialog : public QVLCDialog
171 ExtensionInfoDialog( const ExtensionCopy& extension,
172 intf_thread_t *p_intf, QWidget *parent );