1 /* This file is part of the KDE project
2 Copyright (C) 2004 Max Howell
3 Copyright (C) 2004 Mark Kretschmann <markey@web.de>
4 Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
5 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
6 Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
7 Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License version 2 as published by the Free Software Foundation.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
24 #ifndef FILESELECTOR_WIDGET_H
25 #define FILESELECTOR_WIDGET_H
29 #include <KDirOperator> //some inline functions
30 #include <KToolBar> //baseclass
31 #include <KUrl> //stack allocated
32 #include <KVBox> //baseclass
41 //Hi! I think we ripped this from Kate, since then it's been modified somewhat
44 The KDev file selector presents a directory view, in which the default action is
45 to open the activated file.
46 Additinally, a toolbar for managing the kdiroperator widget + sync that to
47 the directory of the current file is available, as well as a filter widget
48 allowing to filter the displayed files using a name filter.
52 class FileBrowser
: public KVBox
57 explicit FileBrowser( const char *name
= 0, Medium
*medium
= 0 );
60 KUrl
url() const { return m_dir
->url(); }
63 void setUrl( const KUrl
&url
);
64 void setUrl( const QString
&url
);
65 void setFilter( const QString
& );
66 void dropped( const KFileItem
*, QDropEvent
*, const KUrl::List
& );
69 void activate( const KFileItem
* );
70 void gotoCurrentFolder();
71 void prepareContextMenu();
73 void slotViewChanged( KFileView
* );
74 void urlChanged( const KUrl
& );
76 void slotCreatePlaylist();
77 void slotSavePlaylist();
78 void slotAppendToPlaylist();
79 void slotQueueTracks();
81 void slotCopyToCollection();
82 void slotMoveToCollection();
83 void slotOrganizeFiles();
84 void slotMediaDevice();
88 Meta::TrackList
selectedItems();
89 void playlistFromURLs( const KUrl::List
&urls
);
91 KUrlComboBox
*m_combo
;
96 QAction
*m_createPlaylistAction
;
97 QAction
*m_queueTracksAction
;
98 QAction
*m_mediaDeviceAction
;
99 QAction
*m_copyToCollectionAction
;
100 QAction
*m_moveToCollectionAction
;
101 QAction
*m_organizeFilesAction
;
106 #include <kfileitem.h> //KFileItemList
111 class Q3ListViewItem
;
113 ///@author Max Howell
114 ///@short Widget for recursive searching of current FileBrowser location
116 class SearchPane
: public KVBox
121 SearchPane( FileBrowser
*parent
);
125 void urlChanged( const KUrl
& );
126 void searchTextChanged( const QString
&text
);
127 void searchMatches( const KFileItemList
& );
128 void searchComplete();
129 void _searchComplete();
130 void activate( Q3ListViewItem
* );
133 KUrl
searchURL() const { return static_cast<FileBrowser
*>(parentWidget())->url(); }
135 KLineEdit
*m_lineEdit
;
136 KURLView
*m_listView
;
137 KDirLister
*m_lister
;