File indexing completed on 2025-03-09 03:52:14

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 04.10.2009
0007  * Description : A tool for importing images via KIO
0008  *
0009  * SPDX-FileCopyrightText: 2009      by Johannes Wienke <languitar at semipol dot de>
0010  * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_FT_IMPORT_WINDOW_H
0017 #define DIGIKAM_FT_IMPORT_WINDOW_H
0018 
0019 // Qt includes
0020 
0021 #include <QUrl>
0022 
0023 // Local includes
0024 
0025 #include "wstooldialog.h"
0026 #include "dinfointerface.h"
0027 
0028 class KJob;
0029 
0030 namespace KIO
0031 {
0032     class Job;
0033 }
0034 
0035 using namespace Digikam;
0036 
0037 namespace DigikamGenericFileTransferPlugin
0038 {
0039 
0040 /**
0041  * Main dialog used for the import tool.
0042  */
0043 class FTImportWindow : public WSToolDialog
0044 {
0045     Q_OBJECT
0046 
0047 public:
0048 
0049     /**
0050      * Constructor.
0051      *
0052      * @param parent the parent widget
0053      */
0054     explicit FTImportWindow(DInfoInterface* const iface, QWidget* const parent);
0055 
0056     /**
0057      * Destructor.
0058      */
0059     ~FTImportWindow() override;
0060 
0061 private Q_SLOTS:
0062 
0063     /**
0064      * Starts importing the selected images.
0065      */
0066     void slotImport();
0067 
0068     /**
0069      * Reacts on changes in the image list or the target to update button
0070      * activity etc.
0071      */
0072     void slotSourceAndTargetUpdated();
0073 
0074     /**
0075      * Removes the copied image from the image list.
0076      */
0077     void slotCopyingDone(KIO::Job* job, const QUrl& from, const QUrl& to,
0078                          const QDateTime& mtime, bool directory, bool renamed);
0079 
0080     /**
0081      * Re-enables the dialog after the job finished and displays a warning if
0082      * something didn't work.
0083      */
0084     void slotCopyingFinished(KJob* job);
0085 
0086 private:
0087 
0088     class Private;
0089     Private* const d;
0090 };
0091 
0092 } // namespace DigikamGenericFileTransferPlugin
0093 
0094 #endif // DIGIKAM_FT_IMPORT_WINDOW_H