3
// Copyright (C) 2000, 2001 Neil Stevens <multivac@fcmail.com>
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
7
// in the Software without restriction, including without limitation the rights
8
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
// copies of the Software, and to permit persons to whom the Software is
10
// furnished to do so, subject to the following conditions:
12
// The above copyright notice and this permission notice shall be included in
13
// all copies or substantial portions of the Software.
15
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
// Except as contained in this notice, the name(s) of the author(s) shall not be
23
// used in advertising or otherwise to promote the sale, use or other dealings
24
// in this Software without prior written authorization from the author(s).
29
#include <klistview.h>
30
#include <kmainwindow.h>
44
* TronListViewItem is just a QListViewItem, except that it checks
45
* its parent to see if it should be drawn highlighted.
47
class TronListViewItem : public QListViewItem
50
TronListViewItem(QListView *, QListViewItem *, QString = QString::null, QString = QString::null);
51
virtual ~TronListViewItem();
53
static void setColors(QColor _specialfg, QColor _specialbg);
55
virtual void paintCell(QPainter *, const QColorGroup &, int, int, int);
58
static QColor *specialFG, *specialBG;
62
* TronListView handles the drag and drop, and makes sure that only one
63
* item at a time is marked "special".
65
class TronListView : public KListView
70
TronListView(QWidget *, const char * = 0);
71
virtual ~TronListView();
73
void setSpecialItem(TronListViewItem *);
74
TronListViewItem *specialItem(void);
76
virtual void clear(void);
77
virtual void takeItem(QListViewItem *);
80
void dropped(KURL::List, QListViewItem *);
83
virtual bool acceptDrag(QDropEvent *) const;
86
void myDropEvent(QDropEvent *, QListViewItem *);
89
TronListViewItem *special;
93
* Tron is the plugin itself, and is the view. It is *not* the playlist.
94
* It *has* a playlist, MCP *list.
96
class Tron : public KMainWindow, public Plugin
105
virtual Playlist *playlist(void) const;
107
void setColors(QColor _highlightfg, QColor _highlightbg);
119
void setColumns(int);
122
void closeEvent(QCloseEvent *);
123
void hideEvent(QHideEvent *);
124
void showEvent(QShowEvent *);
127
void itemMoved(QListViewItem *, QListViewItem *, QListViewItem *);
128
void itemExecuted(QListViewItem *);
129
void itemDropped(KURL::List, QListViewItem *);
130
void itemSelectionChanged(void);
135
void searchDone(void);
140
void tronadded(PlaylistItem *);
141
void removed(PlaylistItem *);
142
void modified(PlaylistItem *);
143
void current(PlaylistItem *);
144
void moved(PlaylistItem *, PlaylistItem *);
146
void file_opennew(void);
147
void file_open(void);
148
void file_save(void);
149
void file_saveas(void);
151
void edit_remove(void);
152
void edit_adddirectory(void);
153
void edit_find(void);
154
void options_shuffle(void);
155
void options_volume(void);
156
void options_menubar(void);
157
void options_toolbar(void);
158
void options_configuretoolbars(void);
161
static Tron *tronical;
164
void setModified(bool);
166
void addItem(PlaylistItem *item);
167
void initializeItem(PlaylistItem *item);
168
QMap<TronListViewItem *, PlaylistItem *> viewMap;
169
QMap<PlaylistItem *, TronListViewItem *> playMap;
172
TronListView *listView;
174
KAction *edit_removeAction;
175
KToggleAction *options_shuffleAction, *options_volumeAction;
176
KToggleAction *options_toolbarAction, *options_menubarAction;
178
KURL currentPlaylistURL;
179
bool currentPlaylistModified;
182
QListViewItem *findCurrent;