]> git.sesse.net Git - vlc/blobdiff - modules/gui/beos/ListViews.h
Copyright fixes
[vlc] / modules / gui / beos / ListViews.h
index 9e019623f49d1b911953639c1d483965e88f6e97..8fd6f2eb2b3461f8988afcbbd28e2207a7bd065f 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * ListViews.h: BeOS interface list view class prototype
  *****************************************************************************
- * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ListViews.h,v 1.1 2002/09/30 18:30:27 titer Exp $
+ * Copyright (C) 1999, 2000, 2001 VideoLAN (Centrale Réseaux) and its contributors
+ * $Id$
  *
  * Authors: Stephan Aßmus <stippi@yellowbites.com>
  *
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 #include <ListItem.h>
 #include <ListView.h>
+#include <String.h>
+
+enum
+{
+       DISPLAY_PATH    = 0,
+       DISPLAY_NAME,
+};
 
 class InterfaceWindow;
 
@@ -38,9 +45,13 @@ class PlaylistItem : public BStringItem
 
                virtual void            Draw( BView* owner, BRect frame,
                                                                  bool tintedLine,
+                                                                 uint32 mode,
                                                                  bool active = false,
                                                                  bool playing = false );
 
+ private:
+               BString                         fName;  // additional to BStringItem::Text()
+
 };
 
 // DragSortableListView
@@ -73,30 +84,54 @@ class DragSortableListView : public BListView
                                                                          bool complete = false);
 
                                                        // DragSortableListView
+       virtual void                    ModifiersChanged();     // called by window
+
+       virtual void                    MoveItems( BList& items, int32 toIndex );
+       virtual void                    CopyItems( BList& items, int32 toIndex );
+       virtual void                    RemoveItemList( BList& indices );
+                       void                    RemoveSelected(); // uses RemoveItemList()
+                       int32                   CountSelectedItems() const;
+
        virtual BListItem*              CloneItem( int32 atIndex ) const = 0;
        virtual void                    DrawListItem( BView* owner, int32 index,
                                                                                  BRect itemFrame ) const = 0;
        virtual void                    MakeDragMessage( BMessage* message ) const = 0;
 
  private:
-       int32                   fDropIndex;
+                       void                    _SetDropAnticipationRect( BRect r );
+                       void                    _SetDropIndex( int32 index );
+                       void                    _RemoveDropAnticipationRect();
+
+       BRect                                   fDropRect;
+       BMessage                                fDragMessageCopy;
+
+ protected:
+       int32                                   fDropIndex;
 };
 
 // PlaylistView
 class PlaylistView : public DragSortableListView
 {
  public:
-                                                       PlaylistView( BRect frame,
-                                                                                 InterfaceWindow* mainWindow );
+                                                       PlaylistView( intf_thread_t * p_intf,
+                                                                     BRect frame,
+                                                                                 InterfaceWindow* mainWindow,
+                                                                                 BMessage* selectionChangeMessage = NULL );
                                                        ~PlaylistView();
 
                                                        // BListView
        virtual void                    AttachedToWindow();
+       virtual void                    MessageReceived( BMessage* message );
        virtual void                    MouseDown( BPoint where );
        virtual void                    KeyDown( const char* bytes, int32 numBytes );
        virtual void                    Pulse();
+       virtual void                    SelectionChanged();
 
                                                        // DragSortableListView
+       virtual void                    MoveItems( BList& items, int32 toIndex );
+       virtual void                    CopyItems( BList& items, int32 toIndex );
+       virtual void                    RemoveItemList( BList& indices );
+
        virtual BListItem*              CloneItem( int32 atIndex ) const;
        virtual void                    DrawListItem( BView* owner, int32 index,
                                                                                  BRect itemFrame ) const;
@@ -105,11 +140,28 @@ class PlaylistView : public DragSortableListView
                                                        // PlaylistView
                        void                    SetCurrent( int32 index );
                        void                    SetPlaying( bool playing );
+                       void                    RebuildList();
+
+                       void                    SortReverse();
+                       void                    SortByPath();
+                       void                    SortByName();
+
+                       void                    SetDisplayMode( uint32 mode );
+                       uint32                  DisplayMode() const
+                                                               { return fDisplayMode; }
 
  private:
+                       BListItem*              _PlayingItem() const;
+                       void                    _SetPlayingIndex( BListItem* item );
+
+    intf_thread_t * p_intf;
+
        int32                                   fCurrentIndex;
        bool                                    fPlaying;
+       uint32                                  fDisplayMode;
        InterfaceWindow*                fMainWindow;
+       BMessage*                               fSelectionChangeMessage;
+       PlaylistItem*                   fLastClickedItem;
 };
 
 #endif // LIST_VIEWS_H