File indexing completed on 2024-05-19 05:55:48

0001 /*
0002     SPDX-FileCopyrightText: 2003, 2004 George Staikos <staikos@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KWMAPEDITOR_H
0008 #define KWMAPEDITOR_H
0009 
0010 #include <QMap>
0011 
0012 #include <QTableWidget>
0013 
0014 class KActionCollection;
0015 
0016 class KWMapEditor : public QTableWidget
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     explicit KWMapEditor(QMap<QString, QString> &map, QWidget *parent = nullptr);
0022     ~KWMapEditor() override;
0023 
0024 public Q_SLOTS:
0025     void reload();
0026     void saveMap();
0027     void erase();
0028     void contextMenu(const QPoint &pos);
0029     void addEntry();
0030     void emitDirty();
0031 
0032 private Q_SLOTS:
0033     void copy();
0034 
0035 Q_SIGNALS:
0036     void dirty();
0037 
0038 private:
0039     QMap<QString, QString> &_map;
0040     int _contextRow;
0041     KActionCollection *_ac = nullptr;
0042     QAction *_copyAct = nullptr;
0043 };
0044 
0045 #endif