File indexing completed on 2023-09-24 11:39:12

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999, 2000 Kurt Granroth <granroth@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #include "kstandardaction.h"
0009 #include "kopenaction_p.h"
0010 #include "kstandardaction_p.h"
0011 #include "moc_kstandardaction_p.cpp"
0012 
0013 #include <KAboutData>
0014 #include <KAcceleratorManager>
0015 #include <KLocalizedString>
0016 #include <KStandardShortcutWatcher>
0017 #include <QGuiApplication>
0018 #include <QLayout>
0019 #include <QMainWindow>
0020 #include <QMenuBar>
0021 
0022 namespace KStandardAction
0023 {
0024 AutomaticAction::AutomaticAction(const QIcon &icon,
0025                                  const QString &text,
0026                                  KStandardShortcut::StandardShortcut standardShortcut,
0027                                  const char *slot,
0028                                  QObject *parent)
0029     : QAction(parent)
0030 {
0031     setText(text);
0032     setIcon(icon);
0033 
0034     const QList<QKeySequence> shortcut = KStandardShortcut::shortcut(standardShortcut);
0035     setShortcuts(shortcut);
0036     setProperty("defaultShortcuts", QVariant::fromValue(shortcut));
0037     connect(KStandardShortcut::shortcutWatcher(),
0038             &KStandardShortcut::StandardShortcutWatcher::shortcutChanged,
0039             this,
0040             [standardShortcut, this](KStandardShortcut::StandardShortcut id, const QList<QKeySequence> &newShortcut) {
0041                 if (id != standardShortcut) {
0042                     return;
0043                 }
0044                 setShortcuts(newShortcut);
0045                 setProperty("defaultShortcuts", QVariant::fromValue(newShortcut));
0046             });
0047 
0048     connect(this, SIGNAL(triggered()), this, slot);
0049 }
0050 
0051 QStringList stdNames()
0052 {
0053     return internal_stdNames();
0054 }
0055 
0056 QList<StandardAction> actionIds()
0057 {
0058     QList<StandardAction> result;
0059 
0060     for (uint i = 0; g_rgActionInfo[i].id != ActionNone; i++) {
0061         result.append(g_rgActionInfo[i].id);
0062     }
0063 
0064     return result;
0065 }
0066 
0067 KStandardShortcut::StandardShortcut shortcutForActionId(StandardAction id)
0068 {
0069     const KStandardActionInfo *pInfo = infoPtr(id);
0070     return (pInfo) ? pInfo->idAccel : KStandardShortcut::AccelNone;
0071 }
0072 
0073 class ShowMenubarActionFilter : public QObject
0074 {
0075 public:
0076     ShowMenubarActionFilter(QAction *parent)
0077         : QObject(parent)
0078         , wasNative(false)
0079         , wasChecked(false)
0080         , wasVisible(false)
0081     {
0082     }
0083 
0084     bool eventFilter(QObject * /*watched*/, QEvent *e) override
0085     {
0086         if (e->type() == QEvent::Show) {
0087             updateAction();
0088         }
0089         return false;
0090     }
0091 
0092     void updateAction()
0093     {
0094         bool allMenuBarsNative = true;
0095         bool hasAnyMenuBar = false;
0096         const auto lstWidget = qApp->topLevelWidgets();
0097         for (QWidget *w : lstWidget) {
0098             QMainWindow *mw = qobject_cast<QMainWindow *>(w);
0099             if (mw) {
0100                 mw->installEventFilter(this); // this is just in case a new main window appeared
0101                                               // if we were filtering it already it is almost a noop
0102                 if (mw->layout() && mw->layout()->menuBar()) {
0103                     QMenuBar *mb = qobject_cast<QMenuBar *>(mw->layout()->menuBar());
0104                     if (mb) {
0105                         hasAnyMenuBar = true;
0106                         if (!mb->isNativeMenuBar()) {
0107                             allMenuBarsNative = false;
0108                         }
0109                     }
0110                 }
0111             }
0112         }
0113 
0114         if (!hasAnyMenuBar) {
0115             return;
0116         }
0117 
0118         QAction *showMenubarAction = static_cast<QAction *>(parent());
0119         if (allMenuBarsNative && !wasNative) {
0120             wasNative = true;
0121             wasChecked = showMenubarAction->isChecked();
0122             wasVisible = showMenubarAction->isVisible();
0123 
0124             showMenubarAction->setChecked(true);
0125             showMenubarAction->setVisible(false);
0126         } else if (!allMenuBarsNative && wasNative) {
0127             showMenubarAction->setChecked(wasChecked);
0128             showMenubarAction->setVisible(wasVisible);
0129         }
0130     }
0131 
0132     bool wasNative;
0133     bool wasChecked;
0134     bool wasVisible;
0135 };
0136 
0137 QAction *_k_createInternal(StandardAction id, QObject *parent)
0138 {
0139     static bool stdNamesInitialized = false;
0140 
0141     if (!stdNamesInitialized) {
0142         KAcceleratorManager::addStandardActionNames(stdNames());
0143         stdNamesInitialized = true;
0144     }
0145 
0146     QAction *pAction = nullptr;
0147     const KStandardActionInfo *pInfo = infoPtr(id);
0148 
0149     // qCDebug(KCONFIG_WIDGETS_LOG) << "KStandardAction::create( " << id << "=" << (pInfo ? pInfo->psName : (const char*)0) << ", " << parent << " )"; // ellis
0150 
0151     if (pInfo) {
0152         QString sLabel;
0153         QString iconName = QLatin1String(pInfo->psIconName);
0154         switch (id) {
0155         case Back:
0156             sLabel = i18nc("go back", "&Back");
0157             if (QGuiApplication::isRightToLeft()) {
0158                 iconName = QStringLiteral("go-next");
0159             }
0160             break;
0161 
0162         case Forward:
0163             sLabel = i18nc("go forward", "&Forward");
0164             if (QGuiApplication::isRightToLeft()) {
0165                 iconName = QStringLiteral("go-previous");
0166             }
0167             break;
0168 
0169         case Home:
0170             sLabel = i18nc("home page", "&Home");
0171             break;
0172         case Preferences:
0173         case AboutApp:
0174         case HelpContents: {
0175             QString appDisplayName = QGuiApplication::applicationDisplayName();
0176             if (appDisplayName.isEmpty()) {
0177                 appDisplayName = QCoreApplication::applicationName();
0178             }
0179             sLabel = pInfo->psLabel.subs(appDisplayName).toString();
0180         } break;
0181         default:
0182             sLabel = pInfo->psLabel.toString();
0183         }
0184 
0185         if (QGuiApplication::isRightToLeft()) {
0186             switch (id) {
0187             case Prior:
0188                 iconName = QStringLiteral("go-next-view-page");
0189                 break;
0190             case Next:
0191                 iconName = QStringLiteral("go-previous-view-page");
0192                 break;
0193             case FirstPage:
0194                 iconName = QStringLiteral("go-last-view-page");
0195                 break;
0196             case LastPage:
0197                 iconName = QStringLiteral("go-first-view-page");
0198                 break;
0199             case DocumentBack:
0200                 iconName = QStringLiteral("go-next");
0201                 break;
0202             case DocumentForward:
0203                 iconName = QStringLiteral("go-previous");
0204                 break;
0205             default:
0206                 break;
0207             }
0208         }
0209 
0210         if (id == Donate) {
0211             const QString currencyCode = QLocale().currencySymbol(QLocale::CurrencyIsoCode).toLower();
0212             if (!currencyCode.isEmpty()) {
0213                 iconName = QStringLiteral("help-donate-%1").arg(currencyCode);
0214             }
0215         }
0216 
0217         QIcon icon = iconName.isEmpty() ? QIcon() : QIcon::fromTheme(iconName);
0218 
0219         switch (id) {
0220         case Open:
0221             pAction = new KOpenAction(parent);
0222             break;
0223         case OpenRecent:
0224             pAction = new KRecentFilesAction(parent);
0225             break;
0226         case ShowMenubar: {
0227             pAction = new KToggleAction(parent);
0228             pAction->setWhatsThis(
0229                 i18n("Show Menubar<p>"
0230                      "Shows the menubar again after it has been hidden</p>"));
0231             pAction->setChecked(true);
0232 
0233             ShowMenubarActionFilter *mf = new ShowMenubarActionFilter(pAction);
0234             const auto lstWidget = qApp->topLevelWidgets();
0235             for (QWidget *w : lstWidget) {
0236                 if (qobject_cast<QMainWindow *>(w)) {
0237                     w->installEventFilter(mf);
0238                 }
0239             }
0240             mf->updateAction();
0241             break;
0242         }
0243         case ShowToolbar:
0244             pAction = new KToggleAction(parent);
0245             pAction->setChecked(true);
0246             break;
0247         case ShowStatusbar:
0248             pAction = new KToggleAction(parent);
0249             pAction->setWhatsThis(
0250                 i18n("Show Statusbar<p>"
0251                      "Shows the statusbar, which is the bar at the bottom of the window used for status information.</p>"));
0252             pAction->setChecked(true);
0253             break;
0254         case FullScreen:
0255             pAction = new KToggleFullScreenAction(parent);
0256             pAction->setCheckable(true);
0257             break;
0258         // Same as default, but with the app icon
0259         case AboutApp: {
0260             pAction = new QAction(parent);
0261             icon = qApp->windowIcon();
0262             break;
0263         }
0264         case HamburgerMenu: {
0265             pAction = new KHamburgerMenu(parent);
0266             break;
0267         }
0268 
0269         default:
0270             pAction = new QAction(parent);
0271             break;
0272         }
0273 
0274         // Set the text before setting the MenuRole, as on OS X setText will do some heuristic role guessing.
0275         // This ensures user menu items get the intended role out of the list below.
0276         pAction->setText(sLabel);
0277 
0278         switch (id) {
0279         case Quit:
0280             pAction->setMenuRole(QAction::QuitRole);
0281             break;
0282 
0283         case Preferences:
0284             pAction->setMenuRole(QAction::PreferencesRole);
0285             break;
0286 
0287         case AboutApp:
0288             pAction->setMenuRole(QAction::AboutRole);
0289             break;
0290 
0291         default:
0292             pAction->setMenuRole(QAction::NoRole);
0293             break;
0294         }
0295 
0296         if (!pInfo->psToolTip.isEmpty()) {
0297             pAction->setToolTip(pInfo->psToolTip.toString());
0298         }
0299         pAction->setIcon(icon);
0300 
0301         QList<QKeySequence> cut = KStandardShortcut::shortcut(pInfo->idAccel);
0302         if (!cut.isEmpty()) {
0303             // emulate KActionCollection::setDefaultShortcuts to allow the use of "configure shortcuts"
0304             pAction->setShortcuts(cut);
0305             pAction->setProperty("defaultShortcuts", QVariant::fromValue(cut));
0306         }
0307         pAction->connect(KStandardShortcut::shortcutWatcher(),
0308                          &KStandardShortcut::StandardShortcutWatcher::shortcutChanged,
0309                          pAction,
0310                          [pAction, shortcut = pInfo->idAccel](KStandardShortcut::StandardShortcut id, const QList<QKeySequence> &newShortcut) {
0311                              if (id != shortcut) {
0312                                  return;
0313                              }
0314                              pAction->setShortcuts(newShortcut);
0315                              pAction->setProperty("defaultShortcuts", QVariant::fromValue(newShortcut));
0316                          });
0317 
0318         pAction->setObjectName(QLatin1String(pInfo->psName));
0319     }
0320 
0321     if (pAction && parent && parent->inherits("KActionCollection")) {
0322         QMetaObject::invokeMethod(parent, "addAction", Q_ARG(QString, pAction->objectName()), Q_ARG(QAction *, pAction));
0323     }
0324 
0325     return pAction;
0326 }
0327 
0328 QAction *create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
0329 {
0330     QAction *pAction = _k_createInternal(id, parent);
0331     if (recvr && slot) {
0332         if (id == OpenRecent) {
0333             // FIXME QAction port: probably a good idea to find a cleaner way to do this
0334             // Open Recent is a special case - provide the selected URL
0335             QObject::connect(pAction, SIGNAL(urlSelected(QUrl)), recvr, slot);
0336         } else if (id == ConfigureToolbars) { // #200815
0337             QObject::connect(pAction, SIGNAL(triggered(bool)), recvr, slot, Qt::QueuedConnection);
0338         } else {
0339             QObject::connect(pAction, SIGNAL(triggered(bool)), recvr, slot);
0340         }
0341     }
0342     return pAction;
0343 }
0344 
0345 const char *name(StandardAction id)
0346 {
0347     const KStandardActionInfo *pInfo = infoPtr(id);
0348     return (pInfo) ? pInfo->psName : nullptr;
0349 }
0350 
0351 QAction *openNew(const QObject *recvr, const char *slot, QObject *parent)
0352 {
0353     return KStandardAction::create(New, recvr, slot, parent);
0354 }
0355 
0356 QAction *open(const QObject *recvr, const char *slot, QObject *parent)
0357 {
0358     return KStandardAction::create(Open, recvr, slot, parent);
0359 }
0360 
0361 KRecentFilesAction *openRecent(const QObject *recvr, const char *slot, QObject *parent)
0362 {
0363     return (KRecentFilesAction *)KStandardAction::create(OpenRecent, recvr, slot, parent);
0364 }
0365 
0366 QAction *save(const QObject *recvr, const char *slot, QObject *parent)
0367 {
0368     return KStandardAction::create(Save, recvr, slot, parent);
0369 }
0370 
0371 QAction *saveAs(const QObject *recvr, const char *slot, QObject *parent)
0372 {
0373     return KStandardAction::create(SaveAs, recvr, slot, parent);
0374 }
0375 
0376 QAction *revert(const QObject *recvr, const char *slot, QObject *parent)
0377 {
0378     return KStandardAction::create(Revert, recvr, slot, parent);
0379 }
0380 
0381 QAction *print(const QObject *recvr, const char *slot, QObject *parent)
0382 {
0383     return KStandardAction::create(Print, recvr, slot, parent);
0384 }
0385 
0386 QAction *printPreview(const QObject *recvr, const char *slot, QObject *parent)
0387 {
0388     return KStandardAction::create(PrintPreview, recvr, slot, parent);
0389 }
0390 
0391 QAction *close(const QObject *recvr, const char *slot, QObject *parent)
0392 {
0393     return KStandardAction::create(Close, recvr, slot, parent);
0394 }
0395 
0396 QAction *mail(const QObject *recvr, const char *slot, QObject *parent)
0397 {
0398     return KStandardAction::create(Mail, recvr, slot, parent);
0399 }
0400 
0401 QAction *quit(const QObject *recvr, const char *slot, QObject *parent)
0402 {
0403     return KStandardAction::create(Quit, recvr, slot, parent);
0404 }
0405 
0406 QAction *undo(const QObject *recvr, const char *slot, QObject *parent)
0407 {
0408     return KStandardAction::create(Undo, recvr, slot, parent);
0409 }
0410 
0411 QAction *redo(const QObject *recvr, const char *slot, QObject *parent)
0412 {
0413     return KStandardAction::create(Redo, recvr, slot, parent);
0414 }
0415 
0416 QAction *cut(const QObject *recvr, const char *slot, QObject *parent)
0417 {
0418     return KStandardAction::create(Cut, recvr, slot, parent);
0419 }
0420 
0421 QAction *copy(const QObject *recvr, const char *slot, QObject *parent)
0422 {
0423     return KStandardAction::create(Copy, recvr, slot, parent);
0424 }
0425 
0426 QAction *paste(const QObject *recvr, const char *slot, QObject *parent)
0427 {
0428     return KStandardAction::create(Paste, recvr, slot, parent);
0429 }
0430 
0431 QAction *clear(const QObject *recvr, const char *slot, QObject *parent)
0432 {
0433     return KStandardAction::create(Clear, recvr, slot, parent);
0434 }
0435 
0436 QAction *selectAll(const QObject *recvr, const char *slot, QObject *parent)
0437 {
0438     return KStandardAction::create(SelectAll, recvr, slot, parent);
0439 }
0440 
0441 QAction *deselect(const QObject *recvr, const char *slot, QObject *parent)
0442 {
0443     return KStandardAction::create(Deselect, recvr, slot, parent);
0444 }
0445 
0446 QAction *find(const QObject *recvr, const char *slot, QObject *parent)
0447 {
0448     return KStandardAction::create(Find, recvr, slot, parent);
0449 }
0450 
0451 QAction *findNext(const QObject *recvr, const char *slot, QObject *parent)
0452 {
0453     return KStandardAction::create(FindNext, recvr, slot, parent);
0454 }
0455 
0456 QAction *findPrev(const QObject *recvr, const char *slot, QObject *parent)
0457 {
0458     return KStandardAction::create(FindPrev, recvr, slot, parent);
0459 }
0460 
0461 QAction *replace(const QObject *recvr, const char *slot, QObject *parent)
0462 {
0463     return KStandardAction::create(Replace, recvr, slot, parent);
0464 }
0465 
0466 QAction *actualSize(const QObject *recvr, const char *slot, QObject *parent)
0467 {
0468     return KStandardAction::create(ActualSize, recvr, slot, parent);
0469 }
0470 
0471 QAction *fitToPage(const QObject *recvr, const char *slot, QObject *parent)
0472 {
0473     return KStandardAction::create(FitToPage, recvr, slot, parent);
0474 }
0475 
0476 QAction *fitToWidth(const QObject *recvr, const char *slot, QObject *parent)
0477 {
0478     return KStandardAction::create(FitToWidth, recvr, slot, parent);
0479 }
0480 
0481 QAction *fitToHeight(const QObject *recvr, const char *slot, QObject *parent)
0482 {
0483     return KStandardAction::create(FitToHeight, recvr, slot, parent);
0484 }
0485 
0486 QAction *zoomIn(const QObject *recvr, const char *slot, QObject *parent)
0487 {
0488     return KStandardAction::create(ZoomIn, recvr, slot, parent);
0489 }
0490 
0491 QAction *zoomOut(const QObject *recvr, const char *slot, QObject *parent)
0492 {
0493     return KStandardAction::create(ZoomOut, recvr, slot, parent);
0494 }
0495 
0496 QAction *zoom(const QObject *recvr, const char *slot, QObject *parent)
0497 {
0498     return KStandardAction::create(Zoom, recvr, slot, parent);
0499 }
0500 
0501 QAction *redisplay(const QObject *recvr, const char *slot, QObject *parent)
0502 {
0503     return KStandardAction::create(Redisplay, recvr, slot, parent);
0504 }
0505 
0506 QAction *up(const QObject *recvr, const char *slot, QObject *parent)
0507 {
0508     return KStandardAction::create(Up, recvr, slot, parent);
0509 }
0510 
0511 QAction *back(const QObject *recvr, const char *slot, QObject *parent)
0512 {
0513     return KStandardAction::create(Back, recvr, slot, parent);
0514 }
0515 
0516 QAction *forward(const QObject *recvr, const char *slot, QObject *parent)
0517 {
0518     return KStandardAction::create(Forward, recvr, slot, parent);
0519 }
0520 
0521 QAction *home(const QObject *recvr, const char *slot, QObject *parent)
0522 {
0523     return KStandardAction::create(Home, recvr, slot, parent);
0524 }
0525 
0526 QAction *prior(const QObject *recvr, const char *slot, QObject *parent)
0527 {
0528     return KStandardAction::create(Prior, recvr, slot, parent);
0529 }
0530 
0531 QAction *next(const QObject *recvr, const char *slot, QObject *parent)
0532 {
0533     return KStandardAction::create(Next, recvr, slot, parent);
0534 }
0535 
0536 QAction *goTo(const QObject *recvr, const char *slot, QObject *parent)
0537 {
0538     return KStandardAction::create(Goto, recvr, slot, parent);
0539 }
0540 
0541 QAction *gotoPage(const QObject *recvr, const char *slot, QObject *parent)
0542 {
0543     return KStandardAction::create(GotoPage, recvr, slot, parent);
0544 }
0545 
0546 QAction *gotoLine(const QObject *recvr, const char *slot, QObject *parent)
0547 {
0548     return KStandardAction::create(GotoLine, recvr, slot, parent);
0549 }
0550 
0551 QAction *firstPage(const QObject *recvr, const char *slot, QObject *parent)
0552 {
0553     return KStandardAction::create(FirstPage, recvr, slot, parent);
0554 }
0555 
0556 QAction *lastPage(const QObject *recvr, const char *slot, QObject *parent)
0557 {
0558     return KStandardAction::create(LastPage, recvr, slot, parent);
0559 }
0560 
0561 QAction *documentBack(const QObject *recvr, const char *slot, QObject *parent)
0562 {
0563     return KStandardAction::create(DocumentBack, recvr, slot, parent);
0564 }
0565 
0566 QAction *documentForward(const QObject *recvr, const char *slot, QObject *parent)
0567 {
0568     return KStandardAction::create(DocumentForward, recvr, slot, parent);
0569 }
0570 
0571 QAction *addBookmark(const QObject *recvr, const char *slot, QObject *parent)
0572 {
0573     return KStandardAction::create(AddBookmark, recvr, slot, parent);
0574 }
0575 
0576 QAction *editBookmarks(const QObject *recvr, const char *slot, QObject *parent)
0577 {
0578     return KStandardAction::create(EditBookmarks, recvr, slot, parent);
0579 }
0580 
0581 QAction *spelling(const QObject *recvr, const char *slot, QObject *parent)
0582 {
0583     return KStandardAction::create(Spelling, recvr, slot, parent);
0584 }
0585 
0586 static QAction *buildAutomaticAction(QObject *parent, StandardAction id, const char *slot)
0587 {
0588     const KStandardActionInfo *p = infoPtr(id);
0589     if (!p) {
0590         return nullptr;
0591     }
0592 
0593     AutomaticAction *action = new AutomaticAction(QIcon::fromTheme(QLatin1String(p->psIconName)), p->psLabel.toString(), p->idAccel, slot, parent);
0594 
0595     action->setObjectName(QLatin1String(p->psName));
0596     if (!p->psToolTip.isEmpty()) {
0597         action->setToolTip(p->psToolTip.toString());
0598     }
0599 
0600     if (parent && parent->inherits("KActionCollection")) {
0601         QMetaObject::invokeMethod(parent, "addAction", Q_ARG(QString, action->objectName()), Q_ARG(QAction *, action));
0602     }
0603 
0604     return action;
0605 }
0606 
0607 QAction *cut(QObject *parent)
0608 {
0609     return buildAutomaticAction(parent, Cut, SLOT(cut()));
0610 }
0611 
0612 QAction *copy(QObject *parent)
0613 {
0614     return buildAutomaticAction(parent, Copy, SLOT(copy()));
0615 }
0616 
0617 QAction *paste(QObject *parent)
0618 {
0619     return buildAutomaticAction(parent, Paste, SLOT(paste()));
0620 }
0621 
0622 QAction *clear(QObject *parent)
0623 {
0624     return buildAutomaticAction(parent, Clear, SLOT(clear()));
0625 }
0626 
0627 QAction *selectAll(QObject *parent)
0628 {
0629     return buildAutomaticAction(parent, SelectAll, SLOT(selectAll()));
0630 }
0631 
0632 KToggleAction *showMenubar(const QObject *recvr, const char *slot, QObject *parent)
0633 {
0634     QAction *ret = KStandardAction::create(ShowMenubar, recvr, slot, parent);
0635     Q_ASSERT(qobject_cast<KToggleAction *>(ret));
0636     return static_cast<KToggleAction *>(ret);
0637 }
0638 
0639 KToggleAction *showStatusbar(const QObject *recvr, const char *slot, QObject *parent)
0640 {
0641     QAction *ret = KStandardAction::create(ShowStatusbar, recvr, slot, parent);
0642     Q_ASSERT(qobject_cast<KToggleAction *>(ret));
0643     return static_cast<KToggleAction *>(ret);
0644 }
0645 
0646 KToggleFullScreenAction *fullScreen(const QObject *recvr, const char *slot, QWidget *window, QObject *parent)
0647 {
0648     KToggleFullScreenAction *ret;
0649     ret = static_cast<KToggleFullScreenAction *>(KStandardAction::create(FullScreen, recvr, slot, parent));
0650     ret->setWindow(window);
0651 
0652     return ret;
0653 }
0654 
0655 QAction *keyBindings(const QObject *recvr, const char *slot, QObject *parent)
0656 {
0657     return KStandardAction::create(KeyBindings, recvr, slot, parent);
0658 }
0659 
0660 QAction *preferences(const QObject *recvr, const char *slot, QObject *parent)
0661 {
0662     return KStandardAction::create(Preferences, recvr, slot, parent);
0663 }
0664 
0665 QAction *configureToolbars(const QObject *recvr, const char *slot, QObject *parent)
0666 {
0667     return KStandardAction::create(ConfigureToolbars, recvr, slot, parent);
0668 }
0669 
0670 QAction *configureNotifications(const QObject *recvr, const char *slot, QObject *parent)
0671 {
0672     return KStandardAction::create(ConfigureNotifications, recvr, slot, parent);
0673 }
0674 
0675 QAction *helpContents(const QObject *recvr, const char *slot, QObject *parent)
0676 {
0677     return KStandardAction::create(HelpContents, recvr, slot, parent);
0678 }
0679 
0680 QAction *whatsThis(const QObject *recvr, const char *slot, QObject *parent)
0681 {
0682     return KStandardAction::create(WhatsThis, recvr, slot, parent);
0683 }
0684 
0685 QAction *tipOfDay(const QObject *recvr, const char *slot, QObject *parent)
0686 {
0687     return KStandardAction::create(TipofDay, recvr, slot, parent);
0688 }
0689 
0690 QAction *reportBug(const QObject *recvr, const char *slot, QObject *parent)
0691 {
0692     return KStandardAction::create(ReportBug, recvr, slot, parent);
0693 }
0694 
0695 QAction *switchApplicationLanguage(const QObject *recvr, const char *slot, QObject *parent)
0696 {
0697     return KStandardAction::create(SwitchApplicationLanguage, recvr, slot, parent);
0698 }
0699 
0700 QAction *aboutApp(const QObject *recvr, const char *slot, QObject *parent)
0701 {
0702     return KStandardAction::create(AboutApp, recvr, slot, parent);
0703 }
0704 
0705 QAction *aboutKDE(const QObject *recvr, const char *slot, QObject *parent)
0706 {
0707     return KStandardAction::create(AboutKDE, recvr, slot, parent);
0708 }
0709 
0710 QAction *deleteFile(const QObject *recvr, const char *slot, QObject *parent)
0711 {
0712     return KStandardAction::create(DeleteFile, recvr, slot, parent);
0713 }
0714 
0715 QAction *renameFile(const QObject *recvr, const char *slot, QObject *parent)
0716 {
0717     return KStandardAction::create(RenameFile, recvr, slot, parent);
0718 }
0719 
0720 QAction *moveToTrash(const QObject *recvr, const char *slot, QObject *parent)
0721 {
0722     return KStandardAction::create(MoveToTrash, recvr, slot, parent);
0723 }
0724 
0725 QAction *donate(const QObject *recvr, const char *slot, QObject *parent)
0726 {
0727     return KStandardAction::create(Donate, recvr, slot, parent);
0728 }
0729 
0730 KHamburgerMenu *hamburgerMenu(const QObject *recvr, const char *slot, QObject *parent)
0731 {
0732     return static_cast<KHamburgerMenu *>(KStandardAction::create(HamburgerMenu, recvr, slot, parent));
0733 }
0734 
0735 }