InvestTransactionEditor Class Reference

#include <investtransactioneditor.h>

Inheritance diagram for InvestTransactionEditor:

TransactionEditor QObject
Collaboration diagram for InvestTransactionEditor:

Collaboration graph

List of all members.

Public Types

enum  priceModeE { PricePerShare = 1, PricePerTransaction }

Public Member Functions

 InvestTransactionEditor ()
 InvestTransactionEditor (TransactionEditorContainer *regForm, KMyMoneyRegister::InvestTransaction *item, const KMyMoneyRegister::SelectedTransactions &list, const QDate &lastPostDate)
virtual ~InvestTransactionEditor ()
virtual bool isComplete (QString &reason) const
virtual QWidgetfirstWidget (void) const
virtual bool fixTransactionCommodity (const MyMoneyAccount &)
void totalAmount (MyMoneyMoney &amount) const
bool setupPrice (const MyMoneyTransaction &t, MyMoneySplit &split)
bool createTransaction (MyMoneyTransaction &t, const MyMoneyTransaction &torig, const MyMoneySplit &sorig, bool skipPriceDialog=false)
priceModeE priceMode (void) const
const MyMoneySecuritysecurity (void) const

Static Public Member Functions

static void dissectTransaction (const MyMoneyTransaction &transaction, const MyMoneySplit &split, MyMoneySplit &assetAccountSplit, QValueList< MyMoneySplit > &feeSplits, QValueList< MyMoneySplit > &interestSplits, MyMoneySecurity &security, MyMoneySecurity &currency, MyMoneySplit::investTransactionTypeE &transactionType)

Protected Slots

void slotCreateSecurity (const QString &name, QString &id)
void slotCreateFeeCategory (const QString &name, QString &id)
void slotCreateInterestCategory (const QString &name, QString &id)
int slotEditInterestSplits (void)
int slotEditFeeSplits (void)
void slotReloadEditWidgets (void)
void slotUpdateActivity (MyMoneySplit::investTransactionTypeE)
void slotUpdateSecurity (const QString &stockId)
void slotUpdateInterestCategory (const QString &id)
void slotUpdateInterestVisibility (const QString &)
void slotUpdateFeeCategory (const QString &id)
void slotUpdateFeeVisibility (const QString &)
void slotUpdateTotalAmount (void)

Protected Member Functions

void createEditWidgets (void)
void loadEditWidgets (KMyMoneyRegister::Action action=KMyMoneyRegister::ActionNone)
void activityFactory (MyMoneySplit::investTransactionTypeE type)
MyMoneyMoney subtotal (const QValueList< MyMoneySplit > &splits) const
bool createPseudoTransaction (MyMoneyTransaction &t, const QValueList< MyMoneySplit > &splits)
int editSplits (const QString &categoryWidgetName, const QString &amountWidgetName, QValueList< MyMoneySplit > &splits, bool isIncome, const char *slotEditSplits)
void updatePriceMode (const MyMoneySplit &split=MyMoneySplit())
void setupFinalWidgets (void)

Private Attributes

MyMoneySplit m_assetAccountSplit
QValueList< MyMoneySplitm_interestSplits
QValueList< MyMoneySplitm_feeSplits
MyMoneySecurity m_security
MyMoneySecurity m_currency
MyMoneySplit::investTransactionTypeE m_transactionType
Private *const d


class InvestTransactionEditorPrivate

Member Enumeration Documentation


Constructor & Destructor Documentation

InvestTransactionEditor::InvestTransactionEditor (  ) 

InvestTransactionEditor::InvestTransactionEditor ( TransactionEditorContainer regForm,
KMyMoneyRegister::InvestTransaction item,
const KMyMoneyRegister::SelectedTransactions list,
const QDate &  lastPostDate 

virtual InvestTransactionEditor::~InvestTransactionEditor (  )  [virtual]

Member Function Documentation

virtual bool InvestTransactionEditor::isComplete ( QString &  reason  )  const [virtual]

This method returns information about the completeness of the data entered. This can be used to control the availability of the 'Enter transaction' action.

Return values:
true if entering the transaction into the engine
false if not enough information is present to enter the transaction into the engine
reason will be filled with a string about the reason why the completeness is not reached. Empty if the return value is true.
See also:

Implements TransactionEditor.

virtual QWidget* InvestTransactionEditor::firstWidget ( void   )  const [virtual]

Returns a pointer to the widget that should receive the focus after the editor has been started.

Implements TransactionEditor.

virtual bool InvestTransactionEditor::fixTransactionCommodity ( const MyMoneyAccount  )  [inline, virtual]

Reimplemented from TransactionEditor.

void InvestTransactionEditor::totalAmount ( MyMoneyMoney amount  )  const

static void InvestTransactionEditor::dissectTransaction ( const MyMoneyTransaction transaction,
const MyMoneySplit split,
MyMoneySplit assetAccountSplit,
QValueList< MyMoneySplit > &  feeSplits,
QValueList< MyMoneySplit > &  interestSplits,
MyMoneySecurity security,
MyMoneySecurity currency,
MyMoneySplit::investTransactionTypeE transactionType 
) [static]

bool InvestTransactionEditor::setupPrice ( const MyMoneyTransaction t,
MyMoneySplit split 

bool InvestTransactionEditor::createTransaction ( MyMoneyTransaction t,
const MyMoneyTransaction torig,
const MyMoneySplit sorig,
bool  skipPriceDialog = false 
) [virtual]

This method creates a transaction based on the contents of the current widgets, the splits in m_split in single selection mode or an existing transaction/split and the contents of the widgets in multi selection mode.

The split referencing the current account is returned as the first split in the transaction's split list.

t reference to created transaction
torig the original transaction
sorig the original split
skipPriceDialog if true the user will not be requested for price information (defaults to false)
false if aborted by user, true otherwise
Usually not used directly. If unsure, use enterTransactions() instead.

Implements TransactionEditor.

priceModeE InvestTransactionEditor::priceMode ( void   )  const

const MyMoneySecurity& InvestTransactionEditor::security ( void   )  const [inline]

void InvestTransactionEditor::slotCreateSecurity ( const QString &  name,
QString &  id 
) [protected, slot]

void InvestTransactionEditor::slotCreateFeeCategory ( const QString &  name,
QString &  id 
) [protected, slot]

void InvestTransactionEditor::slotCreateInterestCategory ( const QString &  name,
QString &  id 
) [protected, slot]

int InvestTransactionEditor::slotEditInterestSplits ( void   )  [protected, slot]

int InvestTransactionEditor::slotEditFeeSplits ( void   )  [protected, slot]

void InvestTransactionEditor::slotReloadEditWidgets ( void   )  [protected, slot]

Reimplemented from TransactionEditor.

void InvestTransactionEditor::slotUpdateActivity ( MyMoneySplit::investTransactionTypeE   )  [protected, slot]

void InvestTransactionEditor::slotUpdateSecurity ( const QString &  stockId  )  [protected, slot]

void InvestTransactionEditor::slotUpdateInterestCategory ( const QString &  id  )  [protected, slot]

void InvestTransactionEditor::slotUpdateInterestVisibility ( const QString &   )  [protected, slot]

void InvestTransactionEditor::slotUpdateFeeCategory ( const QString &  id  )  [protected, slot]

void InvestTransactionEditor::slotUpdateFeeVisibility ( const QString &   )  [protected, slot]

void InvestTransactionEditor::slotUpdateTotalAmount ( void   )  [protected, slot]

void InvestTransactionEditor::createEditWidgets ( void   )  [protected, virtual]

This method creates all necessary widgets for this transaction editor. All signals will be connected to the relevant slots.

Implements TransactionEditor.

void InvestTransactionEditor::loadEditWidgets ( KMyMoneyRegister::Action  action = KMyMoneyRegister::ActionNone  )  [protected, virtual]

This method (re-)loads the widgets with the transaction information contained in m_transaction and m_split.

action preset the edit wigdets for action if no transaction is present

Implements TransactionEditor.

void InvestTransactionEditor::activityFactory ( MyMoneySplit::investTransactionTypeE  type  )  [protected]

MyMoneyMoney InvestTransactionEditor::subtotal ( const QValueList< MyMoneySplit > &  splits  )  const [protected]

bool InvestTransactionEditor::createPseudoTransaction ( MyMoneyTransaction t,
const QValueList< MyMoneySplit > &  splits 
) [protected]

This method creates a transaction to be used for the split fee/interest editor. It has a reference to a phony account and the splits contained in splits .

int InvestTransactionEditor::editSplits ( const QString &  categoryWidgetName,
const QString &  amountWidgetName,
QValueList< MyMoneySplit > &  splits,
bool  isIncome,
const char *  slotEditSplits 
) [protected]

Convenience method used by slotEditInterestSplits() and slotEditFeeSplits().

categoryWidgetName name of the category widget
amountWidgetName name of the amount widget
splits the splits that make up the transaction to be edited
isIncome false for fees, true for interest
slotEditSplits name of the slot to be connected to the focusIn signal of the category widget named categoryWidgetName in case of multiple splits in splits .

void InvestTransactionEditor::updatePriceMode ( const MyMoneySplit split = MyMoneySplit()  )  [protected]

void InvestTransactionEditor::setupFinalWidgets ( void   )  [protected, virtual]

Implements TransactionEditor.

Friends And Related Function Documentation

friend class InvestTransactionEditorPrivate [friend]

Member Data Documentation

Private* const InvestTransactionEditor::d [private]

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

Generated on Wed Jan 26 13:05:39 2011 for KMyMoney by  doxygen 1.5.6