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 placeActivatedInNewTab(const QUrl
&url
);
39 void placeActivatedInNewActiveTab(const QUrl
&url
);
40 void errorMessage(const QString
& error
);
41 void storageTearDownRequested(const QString
& mountPath
);
42 void storageTearDownExternallyRequested(const QString
& mountPath
);
43 void showHiddenEntriesChanged(bool shown
);
44 void storageTearDownSuccessful();
47 bool urlChanged() override
;
48 void showEvent(QShowEvent
* event
) override
;
51 void readSettings() override
;
52 void showHiddenEntries(bool shown
);
53 int hiddenListCount();
56 void slotItemActivated(int index
);
57 void slotItemMiddleClicked(int index
);
58 void slotItemContextMenuRequested(int index
, const QPointF
& pos
);
59 void slotViewContextMenuRequested(const QPointF
& pos
);
60 void slotItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
61 void slotItemDropEventStorageSetupDone(int index
, bool success
);
62 void slotAboveItemDropEvent(int index
, QGraphicsSceneDragDropEvent
* event
);
63 void slotUrlsDropped(const QUrl
& dest
, QDropEvent
* event
, QWidget
* parent
);
64 void slotStorageSetupDone(int index
, bool success
);
65 void slotShowTooltip();
68 enum class TriggerItemModifier
{ None
, ToNewTab
, ToNewActiveTab
, ToNewWindow
};
72 void editEntry(int index
);
75 * Selects the item that matches the URL set
76 * for the panel (see Panel::setUrl()).
80 void triggerItem(int index
, TriggerItemModifier modifier
);
82 QAction
* buildGroupContextMenu(QMenu
* menu
, int index
);
85 KItemListController
* m_controller
;
86 PlacesItemModel
* m_model
;
89 QUrl m_storageSetupFailedUrl
;
90 TriggerItemModifier m_triggerStorageSetupModifier
;
92 int m_itemDropEventIndex
;
93 QMimeData
* m_itemDropEventMimeData
;
94 QDropEvent
* m_itemDropEvent
;
95 QTimer m_tooltipTimer
;
100 #endif // PLACESPANEL_H