File indexing completed on 2024-05-26 05:10:29

0001 /***************************************************************************
0002  * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr
0003  * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  ***************************************************************************/
0006 #ifndef SKGIMPORTPLUGINGSB_H
0007 #define SKGIMPORTPLUGINGSB_H
0008 /** @file
0009 * This file is Skrooge plugin for GSB import / export.
0010 *
0011 * @author Stephane MANKOWSKI / Guillaume DE BURE
0012 */
0013 #include "skgimportplugin.h"
0014 
0015 #include <qdom.h>
0016 
0017 /**
0018  * This file is Skrooge plugin for GSB import / export.
0019  */
0020 class SKGImportPluginGsb : public SKGImportPlugin
0021 {
0022     Q_OBJECT
0023     Q_INTERFACES(SKGImportPlugin)
0024 
0025 public:
0026     /**
0027      * Default constructor
0028      * @param iImporter the parent importer
0029      * @param iArg the arguments
0030      */
0031     explicit SKGImportPluginGsb(QObject* iImporter, const QVariantList& iArg);
0032 
0033     /**
0034      * Default Destructor
0035      */
0036     ~SKGImportPluginGsb() override;
0037 
0038     /**
0039      * To know if import is possible with this plugin
0040      */
0041     bool isImportPossible() override;
0042 
0043     /**
0044      * Import a file
0045      * @return an object managing the error.
0046      *   @see SKGError
0047      */
0048     SKGError importFile() override;
0049 
0050     /**
0051      * Return the mime type filter
0052      * @return the mime type filter. Example: "*.csv|CSV file"
0053      */
0054     QString getMimeTypeFilter() const override;
0055 
0056 
0057 private:
0058     Q_DISABLE_COPY(SKGImportPluginGsb)
0059 
0060     static QString getAttribute(const QDomElement& iElement, const QString& iAttribute);
0061 };
0062 
0063 #endif  // SKGIMPORTPLUGINGSB_H