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 KUriFilterSearchProviderActions kurifiltersearchprovideractions.h <KIO/KUriFilterSearchProviderActions>
22 *
23 * This class is a manager for web shortcuts
24 *
25 * It will provide a list of web shortcuts against a selected text
26 *
27 * You can set the selected text with setSelectedText() function
28 *
29 * @since 5.16
30 */
31class KIOWIDGETS_EXPORT KUriFilterSearchProviderActions : public QObject
32{
33 Q_OBJECT
34public:
35 /**
36 * Constructs a webshorts menu manager.
37 *
38 * @param parent The QObject parent.
39 */
40
41 explicit KUriFilterSearchProviderActions(QObject *parent = nullptr);
42 ~KUriFilterSearchProviderActions() override;
43
44 /**
45 * @brief return the selected text
46 */
47 QString selectedText() const;
48 /**
49 * @brief Set selected text
50 * @param selectedText the text to search for
51 */
52 void setSelectedText(const QString &selectedText);
53
54 /**
55 * @brief addWebShortcutsToMenu Manage to add web shortcut actions to existing menu.
56 * @param menu menu to add shortcuts to
57 */
58 void addWebShortcutsToMenu(QMenu *menu);
59
60private Q_SLOTS:
61 KIOWIDGETS_NO_EXPORT void slotConfigureWebShortcuts();
62 KIOWIDGETS_NO_EXPORT void slotHandleWebShortcutAction(QAction *action);
63
64private:
65 std::unique_ptr<WebShortcutsMenuManagerPrivate> const d;
66};
67}
68
69#endif // WEBSHORTCUTSMENUMANAGER_H
70

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