2 * SPDX-FileCopyrightText: 2006 Cvetoslav Ludmiloff <ludmiloff@gmail.com>
3 * SPDX-FileCopyrightText: 2006-2010 Peter Penz <peter.penz19@gmail.com>
5 * SPDX-License-Identifier: GPL-2.0-or-later
15 * @brief Base widget for all panels that can be docked on the window borders.
17 * Derived panels should provide a context menu that at least offers the
18 * actions from Panel::customContextMenuActions().
20 class Panel
: public QWidget
25 explicit Panel(QWidget
*parent
= nullptr);
28 /** Returns the current set URL of the active Dolphin view. */
32 * Sets custom context menu actions that are added to the panel specific
33 * context menu actions. Allows an application to apply custom actions to
36 void setCustomContextMenuActions(const QList
<QAction
*> &actions
);
37 QList
<QAction
*> customContextMenuActions() const;
39 QSize
sizeHint() const override
;
43 * This is invoked every time the folder being displayed in the
44 * active Dolphin view changes.
46 void setUrl(const QUrl
&url
);
49 * Refreshes the view to get synchronized with the settings.
51 virtual void readSettings();
55 * Must be implemented by derived classes and is invoked when
56 * the URL has been changed (see Panel::setUrl()).
57 * @return True, if the new URL will get accepted by the derived
58 * class. If false is returned,
59 * the URL will be reset to the previous URL.
61 virtual bool urlChanged() = 0;
65 QList
<QAction
*> m_customContextMenuActions
;