KTextAddons

translatormenu.h
1/*
2 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "texttranslator_export.h"
10#include <QObject>
11#include <QPersistentModelIndex>
12class QMenu;
13
14namespace TextTranslator
15{
16class TEXTTRANSLATOR_EXPORT TranslatorMenu : public QObject
17{
18 Q_OBJECT
19public:
20 explicit TranslatorMenu(QObject *parent = nullptr);
21 ~TranslatorMenu() override;
22
23 [[nodiscard]] QMenu *menu() const;
24
25 [[nodiscard]] bool isEmpty() const;
26
27 [[nodiscard]] const QPersistentModelIndex &modelIndex() const;
28 void setModelIndex(const QPersistentModelIndex &newModelIndex);
29
30 void updateMenu();
31
32Q_SIGNALS:
33 void translate(const QString &from, const QString &to, const QPersistentModelIndex &modelIndex);
34
35private:
36 QPersistentModelIndex mModelIndex;
37 QMenu *const mMenu;
38};
39}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:51:28 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.