| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2006 Aaron J. Seigo <aseigo@kde.org> |
| 3 | SPDX-FileCopyrightText: 2009 Peter Penz <peter.penz@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef KURLNAVIGATORSCHEMECOMBO_P_H |
| 9 | #define KURLNAVIGATORSCHEMECOMBO_P_H |
| 10 | |
| 11 | #include "kurlnavigatorbuttonbase_p.h" |
| 12 | |
| 13 | #include <QHash> |
| 14 | |
| 15 | class ; |
| 16 | |
| 17 | namespace KDEPrivate |
| 18 | { |
| 19 | /*! |
| 20 | * A combobox listing available schemes. |
| 21 | * |
| 22 | * The widget is used by the URL navigator for offering the available |
| 23 | * schemes for non-local URLs. |
| 24 | * |
| 25 | * \internal |
| 26 | * |
| 27 | * \sa KUrlNavigator |
| 28 | */ |
| 29 | class KUrlNavigatorSchemeCombo : public KUrlNavigatorButtonBase |
| 30 | { |
| 31 | Q_OBJECT |
| 32 | |
| 33 | public: |
| 34 | explicit KUrlNavigatorSchemeCombo(const QString &scheme, KUrlNavigator *parent = nullptr); |
| 35 | |
| 36 | QString currentScheme() const; |
| 37 | |
| 38 | void setSupportedSchemes(const QStringList &schemes); |
| 39 | |
| 40 | QSize sizeHint() const override; |
| 41 | |
| 42 | public Q_SLOTS: |
| 43 | void setScheme(const QString &scheme); |
| 44 | |
| 45 | Q_SIGNALS: |
| 46 | void activated(const QString &scheme); |
| 47 | |
| 48 | protected: |
| 49 | void showEvent(QShowEvent *event) override; |
| 50 | void paintEvent(QPaintEvent *event) override; |
| 51 | |
| 52 | private Q_SLOTS: |
| 53 | void (QAction *action); |
| 54 | |
| 55 | private: |
| 56 | void (); |
| 57 | void initializeCategories(); |
| 58 | |
| 59 | enum SchemeCategory { |
| 60 | CoreCategory, |
| 61 | PlacesCategory, |
| 62 | DevicesCategory, |
| 63 | SubversionCategory, |
| 64 | OtherCategory, |
| 65 | CategoryCount, // mandatory last entry |
| 66 | }; |
| 67 | |
| 68 | QMenu *; |
| 69 | QStringList m_schemes; |
| 70 | QHash<QString, SchemeCategory> m_categories; |
| 71 | }; |
| 72 | |
| 73 | } // namespace KDEPrivate |
| 74 | |
| 75 | #endif |
| 76 | |