]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/playlist.hpp
Qt: PlaylistWidget parenting and code cleanup/simplifications
[vlc] / modules / gui / qt4 / components / playlist / playlist.hpp
index 850fea0cfef2f504f487e418597dd93951cf11cb..869f0a9395c5285331110f3948f5315de7c599ab 100644 (file)
@@ -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 <zorglub@videolan.org>
@@ -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_
 
 #include "qt4.hpp"
 
-#include "dialogs_provider.hpp" /* Media Info from ArtLabel */
-#include "components/interface_widgets.hpp"
+#include "dialogs_provider.hpp"              /* Media Info from ArtLabel */
+#include "components/interface_widgets.hpp"  /* CoverArt */
 //#include <vlc_playlist.h>
 
 #include <QSplitter>
-#include <QLabel>
 
 class PLSelector;
-class PLPanel;
+class StandardPLPanel;
 class QPushButton;
-class CoverArtLabel;
-class ArtLabel;
-
-class PlaylistWidget : public QSplitter
-{
-    Q_OBJECT;
-public:
-    PlaylistWidget( intf_thread_t *_p_i );
-    virtual ~PlaylistWidget();
-private:
-    PLSelector *selector;
-    PLPanel *rightPanel;
-    QPushButton *addButton;
-    ArtLabel *art;
-protected:
-    intf_thread_t *p_intf;
-    virtual void dropEvent( QDropEvent *);
-    virtual void dragEnterEvent( QDragEnterEvent * );
-    virtual void closeEvent( QCloseEvent * );
-};
 
 class ArtLabel : public CoverArtLabel
 {
-    Q_OBJECT
 public:
     ArtLabel( QWidget *parent, intf_thread_t *intf )
             : CoverArtLabel( parent, intf ) {};
+
     virtual void mouseDoubleClickEvent( QMouseEvent *event )
     {
         THEDP->mediaInfoDialog();
@@ -76,39 +55,22 @@ public:
     }
 };
 
-enum PLEventType {
-    ItemAddedEv = QEvent::User,
-    ItemRemovedEv
-};
-
-class PLEMEvent : public QEvent
-{
-public:
-    PLEMEvent( int t, int i, int p )
-        : QEvent( (QEvent::Type)t ), item(i), parent(p) {}
-    int item;
-    int parent;
-};
-
-class PlaylistEventManager : public QObject
+class PlaylistWidget : public QSplitter
 {
-    Q_OBJECT;
-
+    Q_OBJECT
 public:
-    PlaylistEventManager( playlist_t* );
-    ~PlaylistEventManager();
-
-signals:
-    void itemAdded( int i_item, int i_parent );
-    void itemRemoved( int i_id );
-
+    PlaylistWidget( intf_thread_t *_p_i, QWidget * );
+    virtual ~PlaylistWidget();
 private:
-    static int itemAddedCb ( vlc_object_t *, const char *,
-                              vlc_value_t, vlc_value_t, void * );
-    static int itemRemovedCb ( vlc_object_t *, const char *,
-                                vlc_value_t, vlc_value_t, void * );
-    void trigger( vlc_value_t, int );
-    void customEvent( QEvent* );
-    playlist_t *pl;
+    PLSelector      *selector;
+    ArtLabel        *art;
+    StandardPLPanel *rightPanel;
+    QPushButton     *addButton;
+protected:
+    intf_thread_t *p_intf;
+    virtual void dropEvent( QDropEvent *);
+    virtual void dragEnterEvent( QDragEnterEvent * );
+    virtual void closeEvent( QCloseEvent * );
 };
+
 #endif