these connections work better with the phonon engine
[amarok.git] / src / filebrowser.h
blobf73296e9e64b5d284af015d3b40c390e9c50fb44
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
27 #include "Meta.h"
29 #include <KDirOperator> //some inline functions
30 #include <KToolBar> //baseclass
31 #include <KUrl> //stack allocated
32 #include <KVBox> //baseclass
35 class KLineEdit;
36 class KFileItem;
37 class KFileView;
38 class KUrlComboBox;
39 class Medium;
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
54 Q_OBJECT
56 public:
57 explicit FileBrowser( const char *name = 0, Medium *medium = 0 );
58 ~FileBrowser();
60 KUrl url() const { return m_dir->url(); }
62 public slots:
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& );
68 private slots:
69 void activate( const KFileItem* );
70 void gotoCurrentFolder();
71 void prepareContextMenu();
72 void selectAll();
73 void slotViewChanged( KFileView* );
74 void urlChanged( const KUrl& );
76 void slotCreatePlaylist();
77 void slotSavePlaylist();
78 void slotAppendToPlaylist();
79 void slotQueueTracks();
80 void slotEditTags();
81 void slotCopyToCollection();
82 void slotMoveToCollection();
83 void slotOrganizeFiles();
84 void slotMediaDevice();
85 void slotBurnCd();
87 private:
88 Meta::TrackList selectedItems();
89 void playlistFromURLs( const KUrl::List &urls );
91 KUrlComboBox *m_combo;
92 KDirOperator *m_dir;
93 KLineEdit *m_filter;
94 Medium *m_medium;
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
107 #include <QRegExp>
109 class KDirLister;
110 class KURLView;
111 class Q3ListViewItem;
113 ///@author Max Howell
114 ///@short Widget for recursive searching of current FileBrowser location
116 class SearchPane : public KVBox
118 Q_OBJECT
120 public:
121 SearchPane( FileBrowser *parent );
123 private slots:
124 void toggle( bool );
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* );
132 private:
133 KUrl searchURL() const { return static_cast<FileBrowser*>(parentWidget())->url(); }
135 KLineEdit *m_lineEdit;
136 KURLView *m_listView;
137 KDirLister *m_lister;
138 QRegExp m_filter;
139 KUrl::List m_dirs;
142 #endif