File indexing completed on 2024-05-12 04:51:35

0001 /*
0002     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 #ifndef _K3B_AUDIO_METAINFO_RENAMER_PLUGIN_H_
0006 #define _K3B_AUDIO_METAINFO_RENAMER_PLUGIN_H_
0007 
0008 
0009 #include "k3bprojectplugin.h"
0010 #include <QWidget>
0011 
0012 namespace K3b {
0013     class DataDoc;
0014     class DirItem;
0015     class FileItem;
0016 }
0017 
0018 class QTreeWidgetItem;
0019 
0020 
0021 class K3bAudioMetainfoRenamerPluginWidget : public QWidget, public K3b::ProjectPluginGUIBase
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     explicit K3bAudioMetainfoRenamerPluginWidget( K3b::DataDoc* doc, QWidget* parent = 0 );
0027     ~K3bAudioMetainfoRenamerPluginWidget() override;
0028 
0029     QWidget* qWidget() override { return this; }
0030 
0031     QString title() const override;
0032     QString subTitle() const override;
0033 
0034     void readSettings( const KConfigGroup& ) override;
0035     void saveSettings( KConfigGroup ) override;
0036 
0037     void activate() override;
0038 
0039 private Q_SLOTS:
0040     void slotScanClicked();
0041 
0042 private:
0043     void scanDir( K3b::DirItem*, QTreeWidgetItem* parent );
0044     QString createNewName( K3b::FileItem* );
0045     bool existsOtherItemWithSameName( K3b::FileItem*, const QString& );
0046 
0047     class Private;
0048     Private* d;
0049 };
0050 
0051 
0052 class K3bAudioMetainfoRenamerPlugin : public K3b::ProjectPlugin
0053 {
0054     Q_OBJECT
0055 
0056 public:
0057     K3bAudioMetainfoRenamerPlugin( QObject* parent, const QVariantList& );
0058     ~K3bAudioMetainfoRenamerPlugin() override;
0059 
0060     int pluginSystemVersion() const override { return K3B_PLUGIN_SYSTEM_VERSION; }
0061 
0062     K3b::ProjectPluginGUIBase* createGUI( K3b::Doc*, QWidget* = 0 ) override;
0063 };
0064 
0065 
0066 #endif