KTextAddons

speechtotextmenu.cpp
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "speechtotextmenu.h"
8#include <KLocalizedString>
9#include <QMenu>
10
11using namespace TextSpeechToText;
12SpeechToTextMenu::SpeechToTextMenu(QObject *parent)
13 : QObject{parent}
14 , mMenu(new QMenu)
15{
16 mMenu->setObjectName(QStringLiteral("menu"));
17 mMenu->setTitle(i18n("Speech to Text…"));
18 mMenu->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-locale")));
19 updateMenu();
20}
21
22SpeechToTextMenu::~SpeechToTextMenu()
23{
24 delete mMenu;
25}
26
27bool SpeechToTextMenu::isEmpty() const
28{
29 return mMenu->isEmpty();
30}
31
32void SpeechToTextMenu::updateMenu()
33{
34 mMenu->clear();
35 // TODO update from specific plugins
36}
37
38QMenu *SpeechToTextMenu::menu() const
39{
40 return mMenu;
41}
42
43#include "moc_speechtotextmenu.cpp"
QString i18n(const char *text, const TYPE &arg...)
QIcon fromTheme(const QString &name)
void clear()
bool isEmpty() const const
void setObjectName(QAnyStringView name)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:47:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.