00001 /*************************************************************************** 00002 mymoneyobjectcontainer.h 00003 ------------------- 00004 copyright : (C) 2006 by Thomas Baumgart 00005 email : ipwizard@users.sourceforge.net 00006 ***************************************************************************/ 00007 00008 /*************************************************************************** 00009 * * 00010 * This program is free software; you can redistribute it and/or modify * 00011 * it under the terms of the GNU General Public License as published by * 00012 * the Free Software Foundation; either version 2 of the License, or * 00013 * (at your option) any later version. * 00014 * * 00015 ***************************************************************************/ 00016 00017 #ifndef MYMONEYOBJECTCONTAINER_H 00018 #define MYMONEYOBJECTCONTAINER_H 00019 00020 #ifdef HAVE_CONFIG_H 00021 #include <config.h> 00022 #endif 00023 00024 // ---------------------------------------------------------------------------- 00025 // QT Includes 00026 00027 #include <qobject.h> 00028 #include <qstring.h> 00029 00030 // ---------------------------------------------------------------------------- 00031 // Project Includes 00032 00033 #include <kmymoney/export.h> 00034 #include <kmymoney/mymoneytransaction.h> 00035 #include <kmymoney/mymoneyaccount.h> 00036 #include <kmymoney/mymoneyinstitution.h> 00037 #include <kmymoney/mymoneypayee.h> 00038 #include <kmymoney/mymoneyobject.h> 00039 #include <kmymoney/mymoneysecurity.h> 00040 #include <kmymoney/imymoneystorage.h> 00041 00049 class KMYMONEY_EXPORT MyMoneyObjectContainer : public QObject 00050 { 00051 Q_OBJECT 00052 public: 00053 MyMoneyObjectContainer(); 00054 ~MyMoneyObjectContainer(); 00055 00056 const MyMoneyAccount& account(const QString& id); 00057 const MyMoneyPayee& payee(const QString& id); 00058 const MyMoneySecurity& security(const QString& id); 00059 const MyMoneyInstitution& institution(const QString& id); 00060 const MyMoneySchedule& schedule(const QString& id); 00061 00062 void account(QValueList<MyMoneyAccount>& list); 00063 void payee(QValueList<MyMoneyPayee>& list); 00064 void institution(QValueList<MyMoneyInstitution>& list); 00065 00066 void preloadAccount(const QValueList<MyMoneyAccount>& list); 00067 void preloadPayee(const QValueList<MyMoneyPayee>& list); 00068 void preloadInstitution(const QValueList<MyMoneyInstitution>& list); 00069 void preloadSecurity(const QValueList<MyMoneySecurity>& list); 00070 void preloadSchedule(const QValueList<MyMoneySchedule>& list); 00071 00072 void preloadAccount(const MyMoneyAccount& account); 00073 void preloadSecurity(const MyMoneySecurity& security); 00074 void preloadPayee(const MyMoneyPayee& payee); 00075 void preloadInstitution(const MyMoneyInstitution& institution); 00076 00077 void clear(const QString& id); 00078 void clear(IMyMoneyStorage* storage = 0); 00079 00080 const MyMoneyAccount& accountByName(const QString& name) const; 00081 00087 void refresh(const QString& id); 00088 00089 private: 00090 void assignFraction(MyMoneyAccount* acc); 00091 00092 private: 00093 QMap<QString, MyMoneyObject const *> m_map; 00094 IMyMoneyStorage* m_storage; 00095 }; 00096 00097 #endif 00098 00099