00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef QBANKING_IMPORTER_H
00014 #define QBANKING_IMPORTER_H
00015
00016
00017 class QBanking;
00018 class QBImporter;
00019
00020 #include <q4banking/qbanking.h>
00021
00022 #include "qbimporter.ui.h"
00023
00024 #include <list>
00025 #include <string>
00026
00027 #include <Qt/qstring.h>
00028
00029 #include <gwenhywfar/logger.h>
00030
00031
00032 class Q4BANKING_API QBImporter: public Q3Wizard, public Ui_QBImporterUi {
00033 Q_OBJECT
00034
00035 private:
00036
00037 public:
00038 QBImporter(QBanking *kb,
00039 QWidget* parent=0,
00040 const char* name=0,
00041 bool modal=FALSE);
00042 QBImporter(QBanking *kb,
00043 uint32_t flags,
00044 QWidget* parent=0,
00045 const char* name=0,
00046 bool modal=FALSE);
00047 ~QBImporter();
00048
00049 bool init();
00050 bool fini();
00051
00052 static Q4BANKING_API bool import(QBanking *qb,
00053 uint32_t flags=
00054 Q4BANKING_IMPORTER_FLAGS_ASK_ALL_DUPES |
00055 Q4BANKING_IMPORTER_FLAGS_FUZZY,
00056 QWidget* parent=0);
00057
00058 public slots:
00059 void back();
00060 void next();
00061 void reject();
00062 void accept();
00063
00064 void help();
00065
00066 void slotSelectFile();
00067 void slotFileNameChanged(const QString &s);
00068
00069 void slotProfileSelected();
00070
00071 void slotProfileDetails();
00072 void slotProfileEdit();
00073
00074 private:
00075 QBanking *_app;
00076 uint32_t _flags;
00077 AB_IMEXPORTER_CONTEXT *_context;
00078 bool _aborted;
00079 GWEN_PLUGIN_DESCRIPTION_LIST2 *_importerList;
00080 QString _importerName;
00081 AB_IMEXPORTER *_importer;
00082 GWEN_DB_NODE *_profiles;
00083 GWEN_DB_NODE *_profile;
00084 std::list<QWidget*> _pagesDone;
00085 QString _logText;
00086 GWEN_DB_NODE *_dbData;
00087 GWEN_LOGGER_LEVEL _logLevel;
00088
00089 bool _updateImporterList();
00090 bool _checkFileType(const QString &fname);
00091 bool _readFile(const QString &fname);
00092 bool _importData(AB_IMEXPORTER_CONTEXT *ctx);
00093
00094 bool _doPage(QWidget *p);
00095 bool _undoPage(QWidget *p);
00096
00097 bool enterPage(QWidget *p, bool back);
00098 bool leavePage(QWidget *p, bool back);
00099
00100 bool initSelectSourcePage();
00101 bool doSelectSourcePage(QWidget *p);
00102 bool undoSelectSourcePage(QWidget *p);
00103
00104 bool initSelectImporterPage();
00105 bool doSelectImporterPage(QWidget *p);
00106 bool undoSelectImporterPage(QWidget *p);
00107
00108 bool initSelectProfilePage();
00109 bool doSelectProfilePage(QWidget *p);
00110 bool undoSelectProfilePage(QWidget *p);
00111
00112 bool doWorkingPage(QWidget *p);
00113 bool undoWorkingPage(QWidget *p);
00114
00115 bool doImportPage(QWidget *p);
00116
00117 void save();
00118
00119
00120 };
00121
00122
00123
00124 #endif // AQBANKING_KDE_EDITTRANS_H
00125
00126
00127
00128