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 Steet, Fifth Floor,
21 Boston, MA 02110-1301, USA.
24 #ifndef FILESELECTOR_WIDGET_H
25 #define FILESELECTOR_WIDGET_H
27 #include <kvbox.h> //baseclass
30 #include <kdiroperator.h> //some inline functions
31 #include <ktoolbar.h> //baseclass
32 #include <kurl.h> //stack allocated
36 class KActionCollection
;
42 //Hi! I think we ripped this from Kate, since then it's been modified somewhat
45 The KDev file selector presents a directory view, in which the default action is
46 to open the activated file.
47 Additinally, a toolbar for managing the kdiroperator widget + sync that to
48 the directory of the current file is available, as well as a filter widget
49 allowing to filter the displayed files using a name filter.
53 class FileBrowser
: public KVBox
57 enum MenuId
{ MakePlaylist
, SavePlaylist
, MediaDevice
, AppendToPlaylist
, QueueTrack
, QueueTracks
, SelectAllFiles
, BurnCd
, MoveToCollection
, CopyToCollection
, OrganizeFiles
, EditTags
};
60 explicit FileBrowser( const char *name
= 0, Medium
*medium
= 0 );
63 KUrl
url() const { return m_dir
->url(); }
66 void setUrl( const KUrl
&url
);
67 void setUrl( const QString
&url
);
68 void setFilter( const QString
& );
69 void dropped( const KFileItem
*, QDropEvent
*, const KUrl::List
& );
72 void activate( const KFileItem
* );
73 void contextMenuActivated( int );
74 void gotoCurrentFolder();
75 void prepareContextMenu();
77 void slotViewChanged( KFileView
* );
78 void urlChanged( const KUrl
& );
81 KUrl::List
selectedItems();
82 void playlistFromURLs( const KUrl::List
&urls
);
84 KUrlComboBox
*m_combo
;
92 #include <kfileitem.h> //KFileItemList
100 ///@author Max Howell
101 ///@short Widget for recursive searching of current FileBrowser location
103 class SearchPane
: public KVBox
108 SearchPane( FileBrowser
*parent
);
112 void urlChanged( const KUrl
& );
113 void searchTextChanged( const QString
&text
);
114 void searchMatches( const KFileItemList
& );
115 void searchComplete();
116 void _searchComplete();
117 void activate( Q3ListViewItem
* );
120 KUrl
searchURL() const { return static_cast<FileBrowser
*>(parentWidget())->url(); }
122 KLineEdit
*m_lineEdit
;
123 KURLView
*m_listView
;
124 KDirLister
*m_lister
;