1 /*****************************************************************************
2 * ListViews.h: BeOS interface list view class prototype
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
5 * $Id: ListViews.h,v 1.3 2003/02/01 12:01:11 stippi Exp $
7 * Authors: Stephan Aßmus <stippi@yellowbites.com>
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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
30 class InterfaceWindow;
33 class PlaylistItem : public BStringItem
36 PlaylistItem( const char* name );
37 virtual ~PlaylistItem();
39 virtual void Draw( BView* owner, BRect frame,
42 bool playing = false );
46 // DragSortableListView
47 class DragSortableListView : public BListView
50 DragSortableListView( BRect frame,
53 = B_SINGLE_SELECTION_LIST,
61 virtual ~DragSortableListView();
64 virtual void Draw( BRect updateRect );
65 virtual bool InitiateDrag( BPoint point, int32 index,
67 virtual void MessageReceived( BMessage* message );
68 virtual void MouseMoved( BPoint where, uint32 transit,
69 const BMessage* dragMessage );
70 virtual void MouseUp( BPoint where );
71 virtual void WindowActivated( bool active );
72 virtual void DrawItem( BListItem *item, BRect itemFrame,
73 bool complete = false);
75 // DragSortableListView
76 virtual void ModifiersChanged(); // called by window
78 virtual void MoveItems( BList& items, int32 toIndex );
79 virtual void CopyItems( BList& items, int32 toIndex );
80 virtual void RemoveItemList( BList& indices );
81 void RemoveSelected(); // uses RemoveItemList()
83 virtual BListItem* CloneItem( int32 atIndex ) const = 0;
84 virtual void DrawListItem( BView* owner, int32 index,
85 BRect itemFrame ) const = 0;
86 virtual void MakeDragMessage( BMessage* message ) const = 0;
89 void _SetDropAnticipationRect( BRect r );
90 void _SetDropIndex( int32 index );
91 void _RemoveDropAnticipationRect();
94 BMessage fDragMessageCopy;
101 class PlaylistView : public DragSortableListView
104 PlaylistView( BRect frame,
105 InterfaceWindow* mainWindow,
107 BMessage* selectionChangeMessage = NULL );
111 virtual void AttachedToWindow();
112 virtual void MessageReceived( BMessage* message );
113 virtual void MouseDown( BPoint where );
114 virtual void KeyDown( const char* bytes, int32 numBytes );
115 virtual void Pulse();
116 virtual void SelectionChanged();
118 // DragSortableListView
119 virtual void MoveItems( BList& items, int32 toIndex );
120 virtual void CopyItems( BList& items, int32 toIndex );
121 virtual void RemoveItemList( BList& indices );
123 virtual BListItem* CloneItem( int32 atIndex ) const;
124 virtual void DrawListItem( BView* owner, int32 index,
125 BRect itemFrame ) const;
126 virtual void MakeDragMessage( BMessage* message ) const;
129 void SetCurrent( int32 index );
130 void SetPlaying( bool playing );
136 InterfaceWindow* fMainWindow;
137 BMessage* fSelectionChangeMessage;
139 VlcWrapper* fVlcWrapper;
142 #endif // LIST_VIEWS_H