X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fplaylist%2Fplaylist.hpp;h=ae38a279a87a68966c0de59a9d4a1c88e7cbcf8f;hb=fc583e2c34cee848250fa06572b037bb54ed915f;hp=701b913298f680d8803ea52c138c4da77a7b9d22;hpb=bc2e32496eee7fe00608abbc15c39fd56c868010;p=vlc diff --git a/modules/gui/qt4/components/playlist/playlist.hpp b/modules/gui/qt4/components/playlist/playlist.hpp index 701b913298..ae38a279a8 100644 --- a/modules/gui/qt4/components/playlist/playlist.hpp +++ b/modules/gui/qt4/components/playlist/playlist.hpp @@ -1,7 +1,7 @@ /***************************************************************************** * interface_widgets.hpp : Playlist Widgets **************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2006-2009 the VideoLAN team * $Id$ * * Authors: Clément Stenac @@ -19,8 +19,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + * along with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef _PLAYLISTWIDGET_H_ @@ -30,49 +30,120 @@ # include "config.h" #endif -#include #include "qt4.hpp" -#include "dialogs_provider.hpp" + +//#include #include -#include -class PLSelector; -class PLPanel; -class QPushButton; +#include +#include +#include + +class StandardPLPanel; +class LocationBar; +class QSignalMapper; +class SearchLineEdit; +class QModelIndex; +class QStackedWidget; -class PlaylistWidget : public QSplitter +class PlaylistWidget : public QWidget { - Q_OBJECT; + Q_OBJECT public: - PlaylistWidget( intf_thread_t *_p_i, QWidget *parent ) ; + PlaylistWidget( intf_thread_t *_p_i, QWidget * ); virtual ~PlaylistWidget(); + + void forceHide(); + void forceShow(); + QStackedWidget *artContainer; private: - PLSelector *selector; - PLPanel *rightPanel; - QPushButton *addButton; - QLabel *art; - QString prevArt; - QWidget *parent; -protected: + QSplitter *leftSplitter; + QSplitter *split; + StandardPLPanel *mainView; + + QAction *viewActions[ 4 /* StandardPLPanel::VIEW_COUNT*/ ]; + + LocationBar *locationBar; + SearchLineEdit *searchEdit; + intf_thread_t *p_intf; + +protected: virtual void dropEvent( QDropEvent *); virtual void dragEnterEvent( QDragEnterEvent * ); virtual void closeEvent( QCloseEvent * ); - private slots: - void setArt( QString ); -signals: - void rootChanged( int ); + void changeView( const QModelIndex& index ); +}; + +#ifdef Q_WS_MAC +class PlaylistSplitter : public QSplitter +{ +public: + PlaylistSplitter( QWidget *_parent ) : QSplitter( _parent ){} +protected: + virtual QSplitterHandle *createHandle(); }; +#else + #define PlaylistSplitter QSplitter +#endif -class ArtLabel : public QLabel +#ifdef Q_WS_MAC +class SplitterHandle : public QSplitterHandle +{ +public: + SplitterHandle( Qt::Orientation orientation, QSplitter * parent ); + +protected: + virtual void paintEvent ( QPaintEvent * ); + +private: + virtual QSize sizeHint () const; +}; +#endif /* __APPLE__ */ + +class LocationButton : public QPushButton +{ +public: + LocationButton( const QString &, bool bold, bool arrow, QWidget * parent = NULL ); + virtual QSize sizeHint() const; +protected: + virtual void paintEvent ( QPaintEvent * event ); +private: + bool b_arrow; +}; + +class PLModel; +class QHBoxLayout; +class LocationBar : public QWidget { Q_OBJECT - void mouseDoubleClickEvent( QMouseEvent *event ) - { - THEDP->mediaInfoDialog(); - } +public: + LocationBar( PLModel * ); + void setIndex( const QModelIndex & ); + virtual QSize sizeHint() const; +protected: + virtual void resizeEvent ( QResizeEvent * event ); + +private: + void layOut( const QSize& size ); + + PLModel *model; + QSignalMapper *mapper; + QWidgetList buttons; + QList actions; + LocationButton *btnMore; + QMenu *menuMore; + QList widths; + +public slots: + void setRootIndex(); +private slots: + void invoke( int i_item_id ); + +signals: + void invoked( const QModelIndex & ); };