Warning, file /system/dolphin/src/panels/panel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * SPDX-FileCopyrightText: 2006 Cvetoslav Ludmiloff <ludmiloff@gmail.com> 0003 * SPDX-FileCopyrightText: 2006-2010 Peter Penz <peter.penz19@gmail.com> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef PANEL_H 0009 #define PANEL_H 0010 0011 #include <QUrl> 0012 #include <QWidget> 0013 0014 /** 0015 * @brief Base widget for all panels that can be docked on the window borders. 0016 * 0017 * Derived panels should provide a context menu that at least offers the 0018 * actions from Panel::customContextMenuActions(). 0019 */ 0020 class Panel : public QWidget 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 explicit Panel(QWidget *parent = nullptr); 0026 ~Panel() override; 0027 0028 /** Returns the current set URL of the active Dolphin view. */ 0029 QUrl url() const; 0030 0031 /** 0032 * Sets custom context menu actions that are added to the panel specific 0033 * context menu actions. Allows an application to apply custom actions to 0034 * the panel. 0035 */ 0036 void setCustomContextMenuActions(const QList<QAction *> &actions); 0037 QList<QAction *> customContextMenuActions() const; 0038 0039 QSize sizeHint() const override; 0040 0041 public Q_SLOTS: 0042 /** 0043 * This is invoked every time the folder being displayed in the 0044 * active Dolphin view changes. 0045 */ 0046 void setUrl(const QUrl &url); 0047 0048 /** 0049 * Refreshes the view to get synchronized with the settings. 0050 */ 0051 virtual void readSettings(); 0052 0053 protected: 0054 /** 0055 * Must be implemented by derived classes and is invoked when 0056 * the URL has been changed (see Panel::setUrl()). 0057 * @return True, if the new URL will get accepted by the derived 0058 * class. If false is returned, 0059 * the URL will be reset to the previous URL. 0060 */ 0061 virtual bool urlChanged() = 0; 0062 0063 private: 0064 QUrl m_url; 0065 QList<QAction *> m_customContextMenuActions; 0066 }; 0067 0068 #endif // PANEL_H