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

81 lines
2.0 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
2010-07-04 13:34:25 +02:00
#include "library/libraryview.h"
#include "widgets/autoexpandingtreeview.h"
class QAction;
class QMenu;
2010-07-04 01:00:07 +02:00
class QSortFilterProxyModel;
class DeviceManager;
2010-07-04 17:01:24 +02:00
class DeviceProperties;
2010-07-04 01:00:07 +02:00
class MergedProxyModel;
2010-07-04 13:34:25 +02:00
class DeviceItemDelegate : public LibraryItemDelegate {
public:
DeviceItemDelegate(QObject* parent);
static const int kIconPadding;
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
};
class DeviceView : public AutoExpandingTreeView {
Q_OBJECT
public:
DeviceView(QWidget* parent = 0);
2010-07-04 17:01:24 +02:00
~DeviceView();
2010-07-04 01:00:07 +02:00
void SetDeviceManager(DeviceManager* manager);
protected:
void contextMenuEvent(QContextMenuEvent *);
void mouseDoubleClickEvent(QMouseEvent *event);
2010-07-04 01:00:07 +02:00
private slots:
void Connect();
2010-07-04 02:33:34 +02:00
void Disconnect();
void Forget();
2010-07-04 17:01:24 +02:00
void Properties();
2010-07-04 02:33:34 +02:00
void DeviceDisconnected(int row);
2010-07-04 01:00:07 +02:00
private:
2010-07-04 02:58:01 +02:00
QModelIndex MapToDevice(const QModelIndex& merged_model_index) const;
2010-07-04 01:00:07 +02:00
private:
DeviceManager* manager_;
MergedProxyModel* merged_model_;
QSortFilterProxyModel* sort_model_;
2010-07-04 17:01:24 +02:00
boost::scoped_ptr<DeviceProperties> properties_dialog_;
QMenu* menu_;
QAction* connect_action_;
2010-07-04 02:33:34 +02:00
QAction* disconnect_action_;
QAction* forget_action_;
2010-07-04 17:01:24 +02:00
QAction* properties_action_;
2010-07-04 01:00:07 +02:00
QModelIndex menu_index_;
};
#endif // DEVICEVIEW_H