ofximporterplugin.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           ofxiimporterplugin.h
00003                              -------------------
00004     begin                : Sat Jan 01 2005
00005     copyright            : (C) 2005 by Ace Jones
00006     email                : Ace Jones <acejones@users.sourceforge.net>
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef OFXIMPORTERPLUGIN_H
00019 #define OFXIMPORTERPLUGIN_H
00020 
00021 // ----------------------------------------------------------------------------
00022 // KDE Includes
00023 
00024 // ----------------------------------------------------------------------------
00025 // QT Includes
00026 
00027 #include <qstringlist.h>
00028 
00029 // ----------------------------------------------------------------------------
00030 // Library Includes
00031 
00032 #include <libofx/libofx.h>
00033 
00034 // ----------------------------------------------------------------------------
00035 // Project Includes
00036 
00037 #include "../kmymoneyplugin.h"
00038 class KOnlineBankingStatus;
00039 
00043 class OfxImporterPlugin : public KMyMoneyPlugin::Plugin, public KMyMoneyPlugin::ImporterPlugin, public KMyMoneyPlugin::OnlinePlugin
00044 {
00045 Q_OBJECT
00046 public:
00047     OfxImporterPlugin(QObject *parent = 0, const char *name = 0, const QStringList& = QStringList());
00048 
00049     ~OfxImporterPlugin();
00050 
00057   virtual QString formatName(void) const;
00058 
00066   virtual QString formatFilenameFilter(void) const;
00067 
00076   virtual bool isMyFormat( const QString& filename ) const;
00077 
00085   virtual bool import( const QString& filename );
00086 
00094   virtual QString lastError(void) const;
00095 
00096   QWidget* accountConfigTab(const MyMoneyAccount& acc, QString& name);
00097 
00098   MyMoneyKeyValueContainer onlineBankingSettings(const MyMoneyKeyValueContainer& current);
00099 
00100   const MyMoneyAccount& account(const QString& key, const QString& value) const;
00101 
00102   void protocols(QStringList& protocolList) const;
00103 
00104   bool mapAccount(const MyMoneyAccount& acc, MyMoneyKeyValueContainer& settings);
00105   bool updateAccount(const MyMoneyAccount& acc, bool moreAccounts);
00106 
00107 protected slots:
00108   void slotImportFile(void);
00109   void slotImportFile(const QString& url);
00110 
00111 protected:
00112     void createActions(void);
00113     void addnew(void) { m_statementlist.push_back(MyMoneyStatement()); }
00114     MyMoneyStatement& back(void) { return m_statementlist.back(); }
00115     bool isValid(void) const { return m_valid; }
00116     void setValid(void) { m_valid = true; }
00117     void addInfo(const QString& _msg ) { m_infos+=_msg; }
00118     void addWarning(const QString& _msg )  { m_warnings+=_msg; }
00119     void addError(const QString& _msg )  { m_errors+=_msg; }
00120     const QStringList& infos(void) const { return m_infos; }
00121     const QStringList& warnings(void) const { return m_warnings; }
00122     const QStringList& errors(void) const { return m_errors; }
00123     bool storeStatements(QValueList<MyMoneyStatement>& statements);
00124     bool importStatement(const MyMoneyStatement& s);
00125 
00126 
00127     static int ofxTransactionCallback( struct OfxTransactionData, void* );
00128     static int ofxStatementCallback( struct OfxStatementData, void* );
00129     static int ofxAccountCallback( struct OfxAccountData, void* );
00130     static int ofxStatusCallback( struct OfxStatusData, void* );
00131     static int ofxSecurityCallback( struct OfxSecurityData, void* );
00132 
00133 private:
00134   bool m_valid;
00135   bool m_preferName;
00136   QValueList<MyMoneyStatement> m_statementlist;
00137   QValueList<MyMoneyStatement::Security> m_securitylist;
00138   QString m_fatalerror;
00139   QStringList m_infos;
00140   QStringList m_warnings;
00141   QStringList m_errors;
00142   KOnlineBankingStatus* m_statusDlg;
00143 };
00144 
00145 #endif

Generated on Wed Jan 26 13:03:18 2011 for KMyMoney by  doxygen 1.5.6