File indexing completed on 2024-05-12 05:14:58
0001 /* 0002 * templatemenuaction.h - menu action to select a template 0003 * Program: kalarm 0004 * SPDX-FileCopyrightText: 2005-2021 David Jarvie <djarvie@kde.org> 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #pragma once 0010 0011 #include <KActionMenu> 0012 #include <QIcon> 0013 #include <QMap> 0014 class QAction; 0015 namespace KAlarmCal { class KAEvent; } 0016 0017 class TemplateMenuAction : public KActionMenu 0018 { 0019 Q_OBJECT 0020 public: 0021 TemplateMenuAction(const QIcon& icon, const QString& label, QObject* parent); 0022 ~TemplateMenuAction() override = default; 0023 0024 Q_SIGNALS: 0025 /** Signal emitted when the action has been selected. 0026 * @param event The template alarm which has been selected, or invalid if none. 0027 */ 0028 void selected(const KAlarmCal::KAEvent&); 0029 0030 private Q_SLOTS: 0031 void slotInitMenu(); 0032 void slotSelected(QAction*); 0033 0034 private: 0035 QMap<QAction*, QString> mOriginalTexts; // menu item texts without added ampersands 0036 }; 0037 0038 // vim: et sw=4: