File indexing completed on 2025-01-19 03:50:58

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2022-08-30
0007  * Description : translate metadata batch tool.
0008  *
0009  * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_BQM_TRANSLATE_H
0016 #define DIGIKAM_BQM_TRANSLATE_H
0017 
0018 // Local includes
0019 
0020 #include "batchtool.h"
0021 #include "dmetadata.h"
0022 
0023 using namespace Digikam;
0024 
0025 namespace DigikamBqmTranslatePlugin
0026 {
0027 
0028 class Translate : public BatchTool
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033 
0034     explicit Translate(QObject* const parent = nullptr);
0035     ~Translate()                                            override;
0036 
0037     BatchToolSettings defaultSettings()                     override;
0038 
0039     BatchTool* clone(QObject* const parent = nullptr) const override;
0040 
0041     void registerSettingsWidget()                           override;
0042 
0043 private Q_SLOTS:
0044 
0045     void slotAssignSettings2Widget()                        override;
0046     void slotSettingsChanged()                              override;
0047 
0048     void slotLocalizeChanged();
0049 
0050 private:
0051 
0052     bool toolOperations()                                   override;
0053 
0054     bool insertTranslation(int entry,
0055                            const QString& trLang,
0056                            DMetadata* const meta)                           const;
0057 
0058 private:
0059 
0060     class Private;
0061     Private* const d;
0062 };
0063 
0064 } // namespace DigikamBqmTranslatePlugin
0065 
0066 #endif // DIGIKAM_BQM_TRANSLATE_H