7#include "kactionmenuchangecase.h"
8#include <KActionCollection>
9#include <KLocalizedString>
12class PimCommon::KActionMenuChangeCasePrivate
15 KActionMenuChangeCasePrivate() =
default;
18 QAction *mSentenceCase =
nullptr;
20 QAction *mReverseCase =
nullptr;
23KActionMenuChangeCase::KActionMenuChangeCase(
QObject *parent)
25 , d(new
PimCommon::KActionMenuChangeCasePrivate)
27 setText(
i18n(
"Change Case"));
28 d->mUpperCase =
new QAction(
i18nc(
"@action",
"Uppercase"),
this);
31 d->mSentenceCase =
new QAction(
i18nc(
"@action",
"Sentence case"),
this);
34 d->mLowerCase =
new QAction(
i18nc(
"@action",
"Lowercase"),
this);
37 d->mReverseCase =
new QAction(
i18nc(
"@action",
"Reverse Case"),
this);
40 addAction(d->mUpperCase);
41 addAction(d->mLowerCase);
42 addAction(d->mSentenceCase);
43 addAction(d->mReverseCase);
46KActionMenuChangeCase::~KActionMenuChangeCase() =
default;
48QAction *KActionMenuChangeCase::upperCaseAction()
const
53QAction *KActionMenuChangeCase::sentenceCaseAction()
const
55 return d->mSentenceCase;
58QAction *KActionMenuChangeCase::lowerCaseAction()
const
63QAction *KActionMenuChangeCase::reverseCaseAction()
const
65 return d->mReverseCase;
71 ac->
addAction(QStringLiteral(
"change_to_uppercase"), d->mUpperCase);
72 ac->
addAction(QStringLiteral(
"change_to_sentencecase"), d->mSentenceCase);
73 ac->
addAction(QStringLiteral(
"change_to_lowercase"), d->mLowerCase);
74 ac->
addAction(QStringLiteral(
"change_to_reversecase"), d->mReverseCase);
78#include "moc_kactionmenuchangecase.cpp"
QAction * addAction(const QString &name, const QObject *receiver=nullptr, const char *member=nullptr)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
void triggered(bool checked)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)