MyMoneyGncReader Class Reference

#include <mymoneygncreader.h>

Inheritance diagram for MyMoneyGncReader:

IMyMoneyStorageFormat
Collaboration diagram for MyMoneyGncReader:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 MyMoneyGncReader ()
virtual ~MyMoneyGncReader ()
void readFile (QIODevice *pDevice, IMyMoneySerialize *storage)
void writeFile (QIODevice *, IMyMoneySerialize *)

Public Attributes

QTextCodec * m_decoder

Protected Member Functions

void convertCommodity (const GncCommodity *)
void convertPrice (const GncPrice *)
void convertAccount (const GncAccount *)
void convertTransaction (const GncTransaction *)
void convertSplit (const GncSplit *)
void saveTemplateTransaction (GncTransaction *t)
void convertSchedule (const GncSchedule *)
void convertFreqSpec (const GncFreqSpec *)
void convertRecurrence (const GncRecurrence *)
void postMessage (const QString &, const unsigned int, const char *)
void postMessage (const QString &, const unsigned int, const char *, const char *)
void postMessage (const QString &, const unsigned int, const char *, const char *, const char *)
void postMessage (const QString &, const unsigned int, const QStringList &)
void setProgressCallback (void(*callback)(int, int, const QString &))
void signalProgress (int current, int total, const QString &="")
void setGncCommodityCount (int i)
void setGncAccountCount (int i)
void setGncTransactionCount (int i)
void setGncScheduleCount (int i)
void setSmallBusinessFound (bool b)
void setBudgetsFound (bool b)
void setLotsFound (bool b)

Protected Attributes

bool m_dropSuspectSchedules
unsigned int m_investmentOption
bool m_useFinanceQuote
bool m_useTxNotes
bool gncdebug
bool xmldebug
bool bAnonymize
bool developerDebug

Static Protected Attributes

static double m_fileHideFactor

Private Member Functions

void setOptions ()
void setFileHideFactor ()
QString convBadValue (QString gncValue) const
MyMoneyTransaction convertTemplateTransaction (const QString &, const GncTransaction *)
void convertTemplateSplit (const QString &, const GncTemplateSplit *)
void terminate ()
QString buildReportSection (const QString &)
bool writeReportToFile (const QValueList< QString > &)
QString createPayee (const QString &)
QString createOrphanAccount (const QString &)
QDate incrDate (QDate lastDate, unsigned char interval, unsigned int intervalCount)
MyMoneyAccount checkConsistency (MyMoneyAccount &parent, MyMoneyAccount &child)
void checkInvestmentOption (QString stockId)
void getPriceSource (MyMoneySecurity stock, QString gncSource)

Private Attributes

IMyMoneyStoragem_storage
XmlReaderm_xr
void(* m_progressCallback )(int, int, const QString &)
map_elementVersions m_versionList
int m_gncCommodityCount
int m_gncAccountCount
int m_gncTransactionCount
int m_gncScheduleCount
bool m_smallBusinessFound
bool m_budgetsFound
bool m_lotsFound
int m_commodityCount
int m_priceCount
int m_accountCount
int m_transactionCount
int m_templateCount
int m_scheduleCount
int m_ccCount
int m_orCount
int m_scCount
QMap< QString, unsigned int > m_currencyCount
QMap< QString, QString > m_mapIds
QString m_rootId
QMap< QString, QString > m_mapEquities
QMap< QString, QString > m_mapSchedules
QMap< QString, QString > m_mapSources
QValueList< QString > m_stockList
QString m_txCommodity
QString m_txPayeeId
QDate m_txDatePosted
QString m_txChequeNo
QValueList< MyMoneySplitm_splitList
QValueList< MyMoneySplitm_liabilitySplitList
QValueList< MyMoneySplitm_otherSplitList
bool m_potentialTransfer
bool m_suspectSchedule
QPtrList< GncTransactionm_templateList
QValueList< QString > m_suspectList
QPtrList< GncMessageArgsm_messageList
GncMessagesm_messageTexts

Friends

class GncObject
class GncFile
class GncDate
class GncCmdtySpec
class GncKvp
class GncLot
class GncCountData
class GncCommodity
class GncPrice
class GncAccount
class GncTransaction
class GncSplit
class GncTemplateTransaction
class GncTemplateSplit
class GncSchedule
class GncFreqSpec
class GncRecurrence
class XmlReader


Detailed Description

MyMoneyGncReader - Main class for this module Controls overall operation of the importer

Constructor & Destructor Documentation

MyMoneyGncReader::MyMoneyGncReader (  ) 

virtual MyMoneyGncReader::~MyMoneyGncReader (  )  [virtual]


Member Function Documentation

void MyMoneyGncReader::readFile ( QIODevice *  pDevice,
IMyMoneySerialize storage 
) [virtual]

Import a GnuCash XML file

Parameters:
pDevice : pointer to GnuCash file
storage : pointer to MyMoneySerialize storage
Returns:
void

Implements IMyMoneyStorageFormat.

void MyMoneyGncReader::writeFile ( QIODevice *  ,
IMyMoneySerialize  
) [inline, virtual]

Implements IMyMoneyStorageFormat.

void MyMoneyGncReader::convertCommodity ( const GncCommodity  )  [protected]

functions to convert gnc objects to our equivalent

void MyMoneyGncReader::convertPrice ( const GncPrice  )  [protected]

void MyMoneyGncReader::convertAccount ( const GncAccount  )  [protected]

void MyMoneyGncReader::convertTransaction ( const GncTransaction  )  [protected]

void MyMoneyGncReader::convertSplit ( const GncSplit  )  [protected]

void MyMoneyGncReader::saveTemplateTransaction ( GncTransaction t  )  [inline, protected]

void MyMoneyGncReader::convertSchedule ( const GncSchedule  )  [protected]

void MyMoneyGncReader::convertFreqSpec ( const GncFreqSpec  )  [protected]

void MyMoneyGncReader::convertRecurrence ( const GncRecurrence  )  [protected]

void MyMoneyGncReader::postMessage ( const QString &  ,
const unsigned  int,
const char *   
) [protected]

to post messages for final report

void MyMoneyGncReader::postMessage ( const QString &  ,
const unsigned  int,
const char *  ,
const char *   
) [protected]

void MyMoneyGncReader::postMessage ( const QString &  ,
const unsigned  int,
const char *  ,
const char *  ,
const char *   
) [protected]

void MyMoneyGncReader::postMessage ( const QString &  ,
const unsigned  int,
const QStringList &   
) [protected]

void MyMoneyGncReader::setProgressCallback ( void(*)(int, int, const QString &)  callback  )  [protected, virtual]

Implements IMyMoneyStorageFormat.

void MyMoneyGncReader::signalProgress ( int  current,
int  total,
const QString &  = "" 
) [protected]

void MyMoneyGncReader::setGncCommodityCount ( int  i  )  [inline, protected]

void MyMoneyGncReader::setGncAccountCount ( int  i  )  [inline, protected]

void MyMoneyGncReader::setGncTransactionCount ( int  i  )  [inline, protected]

void MyMoneyGncReader::setGncScheduleCount ( int  i  )  [inline, protected]

void MyMoneyGncReader::setSmallBusinessFound ( bool  b  )  [inline, protected]

void MyMoneyGncReader::setBudgetsFound ( bool  b  )  [inline, protected]

void MyMoneyGncReader::setLotsFound ( bool  b  )  [inline, protected]

void MyMoneyGncReader::setOptions (  )  [private]

void MyMoneyGncReader::setFileHideFactor (  )  [private]

QString MyMoneyGncReader::convBadValue ( QString  gncValue  )  const [inline, private]

MyMoneyTransaction MyMoneyGncReader::convertTemplateTransaction ( const QString &  ,
const GncTransaction  
) [private]

void MyMoneyGncReader::convertTemplateSplit ( const QString &  ,
const GncTemplateSplit  
) [private]

void MyMoneyGncReader::terminate (  )  [private]

QString MyMoneyGncReader::buildReportSection ( const QString &   )  [private]

bool MyMoneyGncReader::writeReportToFile ( const QValueList< QString > &   )  [private]

QString MyMoneyGncReader::createPayee ( const QString &   )  [private]

Internal utility functions

QString MyMoneyGncReader::createOrphanAccount ( const QString &   )  [private]

QDate MyMoneyGncReader::incrDate ( QDate  lastDate,
unsigned char  interval,
unsigned int  intervalCount 
) [private]

MyMoneyAccount MyMoneyGncReader::checkConsistency ( MyMoneyAccount parent,
MyMoneyAccount child 
) [private]

void MyMoneyGncReader::checkInvestmentOption ( QString  stockId  )  [private]

void MyMoneyGncReader::getPriceSource ( MyMoneySecurity  stock,
QString  gncSource 
) [private]


Friends And Related Function Documentation

friend class GncObject [friend]

friend class GncFile [friend]

friend class GncDate [friend]

friend class GncCmdtySpec [friend]

friend class GncKvp [friend]

friend class GncLot [friend]

friend class GncCountData [friend]

friend class GncCommodity [friend]

friend class GncPrice [friend]

friend class GncAccount [friend]

friend class GncTransaction [friend]

friend class GncSplit [friend]

friend class GncTemplateTransaction [friend]

friend class GncTemplateSplit [friend]

friend class GncSchedule [friend]

friend class GncFreqSpec [friend]

friend class GncRecurrence [friend]

friend class XmlReader [friend]


Member Data Documentation

user options Scheduled Transactions Due to differences in implementation, it is not always possible to import scheduled transactions correctly. Though best efforts are made, it may be that some imported transactions cause problems within kmymoney. An attempt is made within the importer to identify potential problem transactions, and setting this option will cause them to be dropped from the file. A report of which were dropped, and why, will be produced. m_dropSuspectSchedules - drop suspect scheduled transactions

unsigned int MyMoneyGncReader::m_investmentOption [protected]

Investments In kmymoney, all accounts representing investments (stocks, shares, bonds, etc.) must have an associated investment account (e.g. a broker account). The stock account holds the share balance, the investment account a money balance. Gnucash does not do this, so we cannot automate this function. If you have investments, you must select one of the following options. 0 - create a separate investment account for each stock with the same name as the stock 1 - create a single investment account to hold all stocks - you will be asked for a name 2 - create multiple investment accounts - you will be asked for a name for each stock N.B. :- option 2 doesn't really work quite as desired at present

Online quotes The user has the option to use the Finance::Quote system, as used by GnuCash, to retrieve online share price quotes

Tx Notes handling Under some usage conditions, non-split GnuCash transactions may contain residual, usually incorrect, memo data which is not normally visible to the user. When imported into KMyMoney however, due to display differences, this data can become visible. Often, these transactions will have a Notes field describing the real purpose of the transaction. If this option is selected, these notes, if present, will be used to override the extraneous memo data."

bool MyMoneyGncReader::gncdebug [protected]

bool MyMoneyGncReader::xmldebug [protected]

bool MyMoneyGncReader::bAnonymize [protected]

double MyMoneyGncReader::m_fileHideFactor [static, protected]

void(* MyMoneyGncReader::m_progressCallback)(int, int, const QString &) [private]

to hold the callback pointer for the progress bar

counters for reporting

QMap<QString, unsigned int> MyMoneyGncReader::m_currencyCount [private]

QMap<QString, QString> MyMoneyGncReader::m_mapIds [private]

Map gnucash vs. Kmm ids for accounts, equities, schedules, price sources

QString MyMoneyGncReader::m_rootId [private]

QMap<QString, QString> MyMoneyGncReader::m_mapEquities [private]

QMap<QString, QString> MyMoneyGncReader::m_mapSchedules [private]

QMap<QString, QString> MyMoneyGncReader::m_mapSources [private]

A list of stock accounts (gnc ids) which will be held till the end so we can implement the user's investment option

Temporary storage areas for transaction processing

QString MyMoneyGncReader::m_txPayeeId [private]

QString MyMoneyGncReader::m_txChequeNo [private]

In kmm, the order of splits is critical to some operations. These areas will hold the splits until we've read them all

Schedules are processed through 3 different functions, any of which may set this flag

A holding area for template txs while we're waiting for the schedules

Hold a list of suspect schedule ids for later processing?

To hold message data till final report


The documentation for this class was generated from the following file:

Generated on Wed Jan 26 13:09:16 2011 for KMyMoney by  doxygen 1.5.6