9#include "moc_kstandardaction_p.cpp"
11#include <QActionGroup>
12#include <QApplication>
15#include <klocalizedstring.h>
16#include <kstandardshortcut.h>
17#include <kacceleratormanager.h>
19#include "kdualaction.h"
21#include "ktogglefullscreenaction.h"
33 setShortcuts(shortcut);
34 setProperty(
"defaultShortcuts", QVariant::fromValue(shortcut));
35 connect(
this, SIGNAL(triggered()),
this, slot);
57 return (pInfo) ? pInfo->
idAccel : KStandardShortcut::AccelNone;
62 static bool stdNamesInitialized =
false;
64 if (!stdNamesInitialized) {
65 KAcceleratorManager::addStandardActionNames(
stdNames());
66 stdNamesInitialized =
true;
78 sLabel = i18nc(
"go back",
"&Back");
79 if (QApplication::isRightToLeft()) {
85 sLabel = i18nc(
"go forward",
"&Forward");
86 if (QApplication::isRightToLeft()) {
87 iconName =
"go-previous";
92 sLabel = i18nc(
"home page",
"&Home");
95 sLabel = i18nc(
"show help",
"&Help");
100 QString appDisplayName = QGuiApplication::applicationDisplayName();
101 if (appDisplayName.isEmpty()) {
102 appDisplayName = QCoreApplication::applicationName();
104 sLabel = i18n(pInfo->
psLabel, appDisplayName);
111 if (QApplication::isRightToLeft()) {
113 case Prior: iconName =
"go-next-view-page";
break;
114 case Next: iconName =
"go-previous-view-page";
break;
115 case FirstPage: iconName =
"go-last-view-page";
break;
116 case LastPage: iconName =
"go-first-view-page";
break;
132 pAction =
new QAction(parent);
133 pAction->setCheckable(
true);
134 pAction->setChecked(
true);
137 pAction =
new KToggleFullScreenAction(parent);
138 pAction->setCheckable(
true);
141 pAction =
new QAction(parent);
146 pAction =
new QAction(parent);
147 icon = qApp->windowIcon();
152 pAction =
new QAction(parent);
158 pAction->setMenuRole(QAction::QuitRole);
162 pAction->setMenuRole(QAction::PreferencesRole);
166 pAction->setMenuRole(QAction::AboutRole);
170 pAction->setMenuRole(QAction::NoRole);
174 pAction->setText(sLabel);
176 pAction->setToolTip(i18n(pInfo->
psToolTip));
178 pAction->setIcon(icon);
181 if (!
cut.isEmpty()) {
183 pAction->setShortcuts(
cut);
184 pAction->setProperty(
"defaultShortcuts", QVariant::fromValue(
cut));
187 pAction->setObjectName(pInfo->
psName);
194 QObject::connect(pAction, SIGNAL(urlSelected(QUrl)), recvr, slot);
196 QObject::connect(pAction, SIGNAL(triggered(
bool)), recvr, slot, Qt::QueuedConnection);
198 QObject::connect(pAction, SIGNAL(triggered(
bool)), recvr, slot);
202 if (pAction && parent && parent->inherits(
"KisKActionCollection")) {
203 QMetaObject::invokeMethod(parent,
"addAction", Q_ARG(QString, pAction->objectName()), Q_ARG(QAction *, pAction));
212 return (pInfo) ? pInfo->
psName : 0;
215QAction *
openNew(
const QObject *recvr,
const char *slot, QObject *parent)
220QAction *
open(
const QObject *recvr,
const char *slot, QObject *parent)
230QAction *
save(
const QObject *recvr,
const char *slot, QObject *parent)
235QAction *
saveAs(
const QObject *recvr,
const char *slot, QObject *parent)
240QAction *
revert(
const QObject *recvr,
const char *slot, QObject *parent)
245QAction *
print(
const QObject *recvr,
const char *slot, QObject *parent)
250QAction *
printPreview(
const QObject *recvr,
const char *slot, QObject *parent)
255QAction *
close(
const QObject *recvr,
const char *slot, QObject *parent)
260QAction *
mail(
const QObject *recvr,
const char *slot, QObject *parent)
265QAction *
quit(
const QObject *recvr,
const char *slot, QObject *parent)
270QAction *
undo(
const QObject *recvr,
const char *slot, QObject *parent)
275QAction *
redo(
const QObject *recvr,
const char *slot, QObject *parent)
280QAction *
cut(
const QObject *recvr,
const char *slot, QObject *parent)
285QAction *
copy(
const QObject *recvr,
const char *slot, QObject *parent)
290QAction *
paste(
const QObject *recvr,
const char *slot, QObject *parent)
295QAction *
pasteText(
const QObject *recvr,
const char *slot, QObject *parent)
300QAction *
clear(
const QObject *recvr,
const char *slot, QObject *parent)
305QAction *
selectAll(
const QObject *recvr,
const char *slot, QObject *parent)
310QAction *
deselect(
const QObject *recvr,
const char *slot, QObject *parent)
315QAction *
find(
const QObject *recvr,
const char *slot, QObject *parent)
320QAction *
findNext(
const QObject *recvr,
const char *slot, QObject *parent)
325QAction *
findPrev(
const QObject *recvr,
const char *slot, QObject *parent)
330QAction *
replace(
const QObject *recvr,
const char *slot, QObject *parent)
335QAction *
actualSize(
const QObject *recvr,
const char *slot, QObject *parent)
340QAction *
fitToPage(
const QObject *recvr,
const char *slot, QObject *parent)
345QAction *
fitToWidth(
const QObject *recvr,
const char *slot, QObject *parent)
350QAction *
fitToHeight(
const QObject *recvr,
const char *slot, QObject *parent)
355QAction *
zoomIn(
const QObject *recvr,
const char *slot, QObject *parent)
360QAction *
zoomOut(
const QObject *recvr,
const char *slot, QObject *parent)
365QAction *
zoom(
const QObject *recvr,
const char *slot, QObject *parent)
370QAction *
redisplay(
const QObject *recvr,
const char *slot, QObject *parent)
375QAction *
up(
const QObject *recvr,
const char *slot, QObject *parent)
380QAction *
back(
const QObject *recvr,
const char *slot, QObject *parent)
385QAction *
forward(
const QObject *recvr,
const char *slot, QObject *parent)
390QAction *
home(
const QObject *recvr,
const char *slot, QObject *parent)
395QAction *
prior(
const QObject *recvr,
const char *slot, QObject *parent)
400QAction *
next(
const QObject *recvr,
const char *slot, QObject *parent)
405QAction *
goTo(
const QObject *recvr,
const char *slot, QObject *parent)
410QAction *
gotoPage(
const QObject *recvr,
const char *slot, QObject *parent)
415QAction *
gotoLine(
const QObject *recvr,
const char *slot, QObject *parent)
420QAction *
firstPage(
const QObject *recvr,
const char *slot, QObject *parent)
425QAction *
lastPage(
const QObject *recvr,
const char *slot, QObject *parent)
430QAction *
documentBack(
const QObject *recvr,
const char *slot, QObject *parent)
440QAction *
addBookmark(
const QObject *recvr,
const char *slot, QObject *parent)
445QAction *
editBookmarks(
const QObject *recvr,
const char *slot, QObject *parent)
450QAction *
spelling(
const QObject *recvr,
const char *slot, QObject *parent)
465 KStandardShortcut::shortcut(
p->idAccel),
469 action->setObjectName(
p->psName);
471 action->setToolTip(i18n(
p->psToolTip));
474 if (parent && parent->inherits(
"KisKActionCollection")) {
475 QMetaObject::invokeMethod(parent,
"addAction", Q_ARG(QString, action->objectName()), Q_ARG(QAction *, action));
481QAction *
cut(QObject *parent)
506KToggleAction *
showMenubar(
const QObject *recvr,
const char *slot, QObject *parent)
508 KToggleAction *ret =
new KToggleAction(i18n(
"Show &Menubar"), parent);
517 ret->setWhatsThis(i18n(
"Show Menubar<p>"
518 "Shows the menubar again after it has been hidden</p>"));
520 ret->setChecked(
true);
523 QObject::connect(ret, SIGNAL(triggered(
bool)), recvr, slot);
526 if (parent && parent->inherits(
"KisKActionCollection")) {
527 QMetaObject::invokeMethod(parent,
"addAction", Q_ARG(QString, ret->objectName()), Q_ARG(QAction *, ret));
533KToggleAction *
showStatusbar(
const QObject *recvr,
const char *slot, QObject *parent)
535 KToggleAction *ret =
new KToggleAction(i18n(
"Show St&atusbar"), parent);
538 ret->setWhatsThis(i18n(
"Show Statusbar<p>"
539 "Shows the statusbar, which is the bar at the bottom of the window used for status information.</p>"));
541 ret->setChecked(
true);
544 QObject::connect(ret, SIGNAL(triggered(
bool)), recvr, slot);
547 if (parent && parent->inherits(
"KisKActionCollection")) {
548 QMetaObject::invokeMethod(parent,
"addAction", Q_ARG(QString, ret->objectName()), Q_ARG(QAction *, ret));
554KToggleFullScreenAction *
fullScreen(
const QObject *recvr,
const char *slot, QWidget *window, QObject *parent)
556 KToggleFullScreenAction *ret;
558 ret->setWindow(window);
563QAction *
saveOptions(
const QObject *recvr,
const char *slot, QObject *parent)
568QAction *
keyBindings(
const QObject *recvr,
const char *slot, QObject *parent)
573QAction *
preferences(
const QObject *recvr,
const char *slot, QObject *parent)
593QAction *
help(
const QObject *recvr,
const char *slot, QObject *parent)
598QAction *
helpContents(
const QObject *recvr,
const char *slot, QObject *parent)
603QAction *
whatsThis(
const QObject *recvr,
const char *slot, QObject *parent)
608QAction *
tipOfDay(
const QObject *recvr,
const char *slot, QObject *parent)
613QAction *
reportBug(
const QObject *recvr,
const char *slot, QObject *parent)
623QAction *
aboutApp(
const QObject *recvr,
const char *slot, QObject *parent)
628QAction *
aboutKDE(
const QObject *recvr,
const char *slot, QObject *parent)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
AutomaticAction(const QIcon &icon, const QString &text, const QList< QKeySequence > &shortcut, const char *slot, QObject *parent)
QAction * aboutKDE(const QObject *recvr, const char *slot, QObject *parent)
QAction * replace(const QObject *recvr, const char *slot, QObject *parent)
QAction * documentForward(const QObject *recvr, const char *slot, QObject *parent)
QAction * keyBindings(const QObject *recvr, const char *slot, QObject *parent)
QAction * saveAs(const QObject *recvr, const char *slot, QObject *parent)
QAction * goTo(const QObject *recvr, const char *slot, QObject *parent)
KToggleAction * showStatusbar(const QObject *recvr, const char *slot, QObject *parent)
QAction * lastPage(const QObject *recvr, const char *slot, QObject *parent)
QAction * deselect(const QObject *recvr, const char *slot, QObject *parent)
KToggleAction * showMenubar(const QObject *recvr, const char *slot, QObject *parent)
QAction * firstPage(const QObject *recvr, const char *slot, QObject *parent)
QAction * back(const QObject *recvr, const char *slot, QObject *parent)
QAction * print(const QObject *recvr, const char *slot, QObject *parent)
QAction * fitToWidth(const QObject *recvr, const char *slot, QObject *parent)
QAction * findNext(const QObject *recvr, const char *slot, QObject *parent)
KRITAWIDGETUTILS_EXPORT KStandardShortcut::StandardShortcut shortcutForActionId(StandardAction id)
QAction * redo(const QObject *recvr, const char *slot, QObject *parent)
QAction * undo(const QObject *recvr, const char *slot, QObject *parent)
QAction * up(const QObject *recvr, const char *slot, QObject *parent)
QAction * redisplay(const QObject *recvr, const char *slot, QObject *parent)
static QStringList internal_stdNames()
QAction * actualSize(const QObject *recvr, const char *slot, QObject *parent)
QAction * editBookmarks(const QObject *recvr, const char *slot, QObject *parent)
QAction * zoomOut(const QObject *recvr, const char *slot, QObject *parent)
QAction * close(const QObject *recvr, const char *slot, QObject *parent)
QAction * tipOfDay(const QObject *recvr, const char *slot, QObject *parent)
QAction * documentBack(const QObject *recvr, const char *slot, QObject *parent)
QAction * copy(const QObject *recvr, const char *slot, QObject *parent)
QAction * whatsThis(const QObject *recvr, const char *slot, QObject *parent)
QAction * helpContents(const QObject *recvr, const char *slot, QObject *parent)
QAction * preferences(const QObject *recvr, const char *slot, QObject *parent)
QAction * resetConfigurations(const QObject *recvr, const char *slot, QObject *parent)
QAction * reportBug(const QObject *recvr, const char *slot, QObject *parent)
QAction * gotoPage(const QObject *recvr, const char *slot, QObject *parent)
QAction * fitToHeight(const QObject *recvr, const char *slot, QObject *parent)
QAction * selectAll(const QObject *recvr, const char *slot, QObject *parent)
@ SwitchApplicationLanguage
QAction * configureNotifications(const QObject *recvr, const char *slot, QObject *parent)
KRecentFilesAction * openRecent(const QObject *recvr, const char *slot, QObject *parent)
QAction * printPreview(const QObject *recvr, const char *slot, QObject *parent)
QAction * next(const QObject *recvr, const char *slot, QObject *parent)
QAction * spelling(const QObject *recvr, const char *slot, QObject *parent)
QAction * save(const QObject *recvr, const char *slot, QObject *parent)
QAction * paste(const QObject *recvr, const char *slot, QObject *parent)
QAction * mail(const QObject *recvr, const char *slot, QObject *parent)
QAction * configureToolbars(const QObject *recvr, const char *slot, QObject *parent)
QAction * forward(const QObject *recvr, const char *slot, QObject *parent)
QAction * fitToPage(const QObject *recvr, const char *slot, QObject *parent)
QAction * switchApplicationLanguage(const QObject *recvr, const char *slot, QObject *parent)
QAction * aboutApp(const QObject *recvr, const char *slot, QObject *parent)
QAction * zoomIn(const QObject *recvr, const char *slot, QObject *parent)
QAction * pasteText(const QObject *recvr, const char *slot, QObject *parent)
QAction * gotoLine(const QObject *recvr, const char *slot, QObject *parent)
QAction * quit(const QObject *recvr, const char *slot, QObject *parent)
QAction * cut(const QObject *recvr, const char *slot, QObject *parent)
const KStandardActionInfo * infoPtr(StandardAction id)
static constexpr KStandardActionInfo g_rgActionInfo[]
QAction * addBookmark(const QObject *recvr, const char *slot, QObject *parent)
QAction * zoom(const QObject *recvr, const char *slot, QObject *parent)
QAction * open(const QObject *recvr, const char *slot, QObject *parent)
QAction * find(const QObject *recvr, const char *slot, QObject *parent)
QAction * revert(const QObject *recvr, const char *slot, QObject *parent)
QAction * findPrev(const QObject *recvr, const char *slot, QObject *parent)
const char * name(StandardAction id)
KToggleFullScreenAction * fullScreen(const QObject *recvr, const char *slot, QWidget *window, QObject *parent)
QAction * help(const QObject *recvr, const char *slot, QObject *parent)
QAction * clear(const QObject *recvr, const char *slot, QObject *parent)
QAction * openNew(const QObject *recvr, const char *slot, QObject *parent)
QAction * prior(const QObject *recvr, const char *slot, QObject *parent)
QAction * saveOptions(const QObject *recvr, const char *slot, QObject *parent)
QAction * home(const QObject *recvr, const char *slot, QObject *parent)
QList< StandardAction > actionIds()
QAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
static QAction * buildAutomaticAction(QObject *parent, StandardAction id, const char *slot)
QIcon loadIcon(const QString &name)
KStandardShortcut::StandardShortcut idAccel