File indexing completed on 2024-04-14 03:49:06

0001 /*
0002     SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef IMAGECHOOSERWIDGET_H
0007 #define IMAGECHOOSERWIDGET_H
0008 
0009 #include "ui_imagechooserwidget.h"
0010 
0011 class KEduVocExpression;
0012 
0013 namespace Editor
0014 {
0015 class ImageChooserWidget : public QWidget, public Ui::ImageChooserWidget
0016 {
0017     Q_OBJECT
0018 public:
0019     explicit ImageChooserWidget(QWidget *parent = nullptr);
0020 
0021 public Q_SLOTS:
0022     /**
0023      * Update the word
0024      * @param entry
0025      * @param translation
0026      */
0027     void setTranslation(KEduVocExpression *entry, int translation);
0028 
0029     // Q_SIGNALS:
0030     //     /**
0031     //      * Important to let other widgets know that a certain word type is edited (might make conjugations/comparison/declension appear)
0032     //      * @param
0033     //      */
0034     //     void imageChanged(const QString&);
0035 
0036 private Q_SLOTS:
0037     void slotImageChanged(const QString &url);
0038 
0039 protected:
0040     bool eventFilter(QObject *obj, QEvent *event) override;
0041 
0042 private:
0043     /// Column in the document - corresponds to the language (-KV_COL_TRANS)
0044     int m_currentTranslation{-1};
0045     /// Selection in the doc - if more than one row is selected behavior is different
0046     KEduVocExpression *m_entry{nullptr};
0047 };
0048 }
0049 #endif