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
00021 #include "qbimporter.ui.h"
00022 #include "qbanking.h"
00023
00024 #include <list>
00025 #include <string>
00026
00027 #include <qstring.h>
00028
00029 #include <gwenhywfar/logger.h>
00030
00031
00032 class QBImporter: public 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 GWEN_TYPE_UINT32 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 bool import(QBanking *qb,
00053 GWEN_TYPE_UINT32 flags=
00054 QBANKING_IMPORTER_FLAGS_ASK_ALL_DUPES |
00055 QBANKING_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 slotSelectFile();
00065 void slotFileNameChanged(const QString &s);
00066
00067 void slotProfileSelected();
00068
00069 void slotProfileDetails();
00070 void slotProfileEdit();
00071
00072 private:
00073 QBanking *_app;
00074 GWEN_TYPE_UINT32 _flags;
00075 AB_IMEXPORTER_CONTEXT *_context;
00076 bool _aborted;
00077 GWEN_PLUGIN_DESCRIPTION_LIST2 *_importerList;
00078 QString _importerName;
00079 AB_IMEXPORTER *_importer;
00080 GWEN_DB_NODE *_profiles;
00081 GWEN_DB_NODE *_profile;
00082 std::list<QWidget*> _pagesDone;
00083 QString _logText;
00084 GWEN_DB_NODE *_dbData;
00085 GWEN_LOGGER_LEVEL _logLevel;
00086
00087 bool _updateImporterList();
00088 bool _checkFileType(const QString &fname);
00089 bool _readFile(const QString &fname);
00090 bool _importData(AB_IMEXPORTER_CONTEXT *ctx);
00091
00092 bool _doPage(QWidget *p);
00093 bool _undoPage(QWidget *p);
00094
00095 bool enterPage(QWidget *p, bool back);
00096 bool leavePage(QWidget *p, bool back);
00097
00098 bool initSelectSourcePage();
00099 bool doSelectSourcePage(QWidget *p);
00100 bool undoSelectSourcePage(QWidget *p);
00101
00102 bool initSelectImporterPage();
00103 bool doSelectImporterPage(QWidget *p);
00104 bool undoSelectImporterPage(QWidget *p);
00105
00106 bool initSelectProfilePage();
00107 bool doSelectProfilePage(QWidget *p);
00108 bool undoSelectProfilePage(QWidget *p);
00109
00110 bool doWorkingPage(QWidget *p);
00111 bool undoWorkingPage(QWidget *p);
00112
00113 bool doImportPage(QWidget *p);
00114
00115 void save();
00116
00117
00118 };
00119
00120
00121
00122 #endif // AQBANKING_KDE_EDITTRANS_H
00123
00124
00125
00126