2 * SPDX-FileCopyrightText: 2008-2012 Peter Penz <peter.penz19@gmail.com>
3 * SPDX-FileCopyrightText: 2010 Christian Muehlhaeuser <muesli@gmail.com>
5 * SPDX-License-Identifier: GPL-2.0-or-later
11 #include "panels/panel.h"
16 class KItemListController
;
17 class PlacesItemModel
;
19 class QGraphicsSceneDragDropEvent
;
23 * @brief Combines bookmarks and mounted devices as list.
25 class PlacesPanel
: public Panel
30 explicit PlacesPanel(QWidget
* parent
);
31 ~PlacesPanel() override
;
32 void proceedWithTearDown();
34 bool eventFilter(QObject
*obj
, QEvent
*event
) override
;
37 void placeActivated(const QUrl
& url
);
38 void placeMiddleClicked(const QUrl
& url
);
39 void errorMessage(const QString
& error
);
40 void storageTearDownRequested(const QString
& mountPath
);
41 void storageTearDownExternallyRequested(const QString
& mountPath
);
42 void showHiddenEntriesChanged(bool shown
);
43 void storageTearDownSuccessful();
46 bool urlChanged() override
;
47 void showEvent(QShowEvent
* event
) override
;
50 void readSettings() override
;
51 void showHiddenEntries(bool shown
);
52 int hiddenListCount();
55 void slotItemActivated(int index
);
56 void slotItemMiddleClicked(int index
);
57 void slotItemContextMenuRequested(int index
, const QPointF
& pos
);
58 void slotViewContextMenuRequested(const QPointF
& pos
);
59 void slotItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
60 void slotItemDropEventStorageSetupDone(int index
, bool success
);
61 void slotAboveItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
62 void slotUrlsDropped(const QUrl
& dest
, QDropEvent
* event
, QWidget
* parent
);
63 void slotStorageSetupDone(int index
, bool success
);
64 void slotShowTooltip();
68 void editEntry(int index
);
71 * Selects the item that matches the URL set
72 * for the panel (see Panel::setUrl()).
76 void triggerItem(int index
, Qt::MouseButton button
);
78 QAction
* buildGroupContextMenu(QMenu
* menu
, int index
);
81 KItemListController
* m_controller
;
82 PlacesItemModel
* m_model
;
85 QUrl m_storageSetupFailedUrl
;
86 Qt::MouseButton m_triggerStorageSetupButton
;
88 int m_itemDropEventIndex
;
89 QMimeData
* m_itemDropEventMimeData
;
90 QDropEvent
* m_itemDropEvent
;
91 QTimer m_tooltipTimer
;
96 #endif // PLACESPANEL_H