1/*
2 SPDX-FileCopyrightText: 2015 Montel Laurent <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KURIFILTERSEARCHPROVIDERACTIONS_H
8#define KURIFILTERSEARCHPROVIDERACTIONS_H
9
10#include "kiowidgets_export.h"
11#include <QObject>
12
13#include <memory>
14
15class QMenu;
16class QAction;
17namespace KIO
18{
19class WebShortcutsMenuManagerPrivate;
20/*!
21 * \class KIO::KUriFilterSearchProviderActions
22 * \inheaderfile KIO/KUriFilterSearchProviderActions
23 * \inmodule KIOWidgets
24 *
25 * \brief This class is a manager for web shortcuts.
26 *
27 * It will provide a list of web shortcuts against a selected text
28 *
29 * You can set the selected text with setSelectedText() function
30 *
31 * \since 5.16
32 */
33class KIOWIDGETS_EXPORT KUriFilterSearchProviderActions : public QObject
34{
35 Q_OBJECT
36public:
37 /*!
38 * Constructs a webshorts menu manager.
39 *
40 * \a parent The QObject parent.
41 */
42 explicit KUriFilterSearchProviderActions(QObject *parent = nullptr);
43 ~KUriFilterSearchProviderActions() override;
44
45 /*!
46 * Returns the selected text
47 */
48 QString selectedText() const;
49 /*!
50 * Set selected text
51 * \a selectedText the text to search for
52 */
53 void setSelectedText(const QString &selectedText);
54
55 /*!
56 * Add web shortcut actions to existing menu.
57 * \a menu menu to add shortcuts to
58 */
59 void addWebShortcutsToMenu(QMenu *menu);
60
61private Q_SLOTS:
62 KIOWIDGETS_NO_EXPORT void slotConfigureWebShortcuts();
63 KIOWIDGETS_NO_EXPORT void slotHandleWebShortcutAction(QAction *action);
64
65private:
66 std::unique_ptr<WebShortcutsMenuManagerPrivate> const d;
67};
68}
69
70#endif // WEBSHORTCUTSMENUMANAGER_H
71

source code of kio/src/widgets/kurifiltersearchprovideractions.h