Clementine-audio-player-Mac.../src/devices/deviceview.h

61 lines
1.4 KiB
C
Raw Normal View History

/* This file is part of Clementine.
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DEVICEVIEW_H
#define DEVICEVIEW_H
#include <QTreeView>
class QAction;
class QMenu;
2010-07-04 01:00:07 +02:00
class QSortFilterProxyModel;
class DeviceManager;
class MergedProxyModel;
class DeviceView : public QTreeView {
Q_OBJECT
public:
DeviceView(QWidget* parent = 0);
2010-07-04 01:00:07 +02:00
void SetDeviceManager(DeviceManager* manager);
protected:
void contextMenuEvent(QContextMenuEvent *);
private slots:
void Connect();
2010-07-04 02:33:34 +02:00
void Disconnect();
void DeviceDisconnected(int row);
2010-07-04 01:00:07 +02:00
private:
2010-07-04 01:00:07 +02:00
QModelIndex MapToDevice(const QModelIndex& sort_model_index) const;
private:
DeviceManager* manager_;
MergedProxyModel* merged_model_;
QSortFilterProxyModel* sort_model_;
QMenu* menu_;
QAction* connect_action_;
2010-07-04 02:33:34 +02:00
QAction* disconnect_action_;
2010-07-04 01:00:07 +02:00
QModelIndex menu_index_;
};
#endif // DEVICEVIEW_H