kmymoneyutils.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           kmymoneyutils.h  -  description
00003                              -------------------
00004     begin                : Wed Feb 5 2003
00005     copyright            : (C) 2000-2003 by Michael Edwardes
00006     email                : mte@users.sourceforge.net
00007                            Javier Campos Morales <javi_c@users.sourceforge.net>
00008                            Felix Rodriguez <frodriguez@users.sourceforge.net>
00009                            John C <thetacoturtle@users.sourceforge.net>
00010                            Thomas Baumgart <ipwizard@users.sourceforge.net>
00011                            Kevin Tambascio <ktambascio@users.sourceforge.net>
00012  ***************************************************************************/
00013 
00014 /***************************************************************************
00015  *                                                                         *
00016  *   This program is free software; you can redistribute it and/or modify  *
00017  *   it under the terms of the GNU General Public License as published by  *
00018  *   the Free Software Foundation; either version 2 of the License, or     *
00019  *   (at your option) any later version.                                   *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 #ifndef KMYMONEYUTILS_H
00024 #define KMYMONEYUTILS_H
00025 
00026 // ----------------------------------------------------------------------------
00027 // QT Includes
00028 
00029 #include <qcolor.h>
00030 #include <qfont.h>
00031 
00032 // ----------------------------------------------------------------------------
00033 // KDE Headers
00034 
00035 #include <kguiitem.h>
00036 
00037 // ----------------------------------------------------------------------------
00038 // Project Includes
00039 
00040 #include <kmymoney/mymoneyaccount.h>
00041 #include <kmymoney/mymoneysecurity.h>
00042 #include <kmymoney/mymoneyscheduled.h>
00043 #include <kmymoney/mymoneytransaction.h>
00044 
00049 class KMyMoneyUtils
00050 {
00051 public:
00059   enum categoryTypeE {
00060     none =       0x00,          
00061     liability =  0x01,          
00062     asset =      0x02,          
00063     expense =    0x04,          
00064     income =     0x08,          
00065     equity =     0x10,          
00066     last =       0x20           
00067   };
00068 
00069   enum transactionTypeE {
00074     Unknown,
00075 
00081     Normal,
00082 
00088     Transfer,
00089 
00094     SplitTransaction,
00095 
00101     LoanPayment,
00102 
00108     InvestmentTransaction
00109   };
00110 
00111   enum EnterScheduleResultCodeE {
00112     Cancel = 0,    // cancel the operation
00113     Enter,         // enter the schedule
00114     Skip,          // skip the schedule
00115     Ignore         // ignore the schedule
00116   };
00117 
00118   static const int maxHomePageItems = 5;
00119 
00120   KMyMoneyUtils();
00121   ~KMyMoneyUtils();
00122 
00133   static const QString accountTypeToString(const MyMoneyAccount::accountTypeE accountType);
00134 
00143   static MyMoneyAccount::accountTypeE stringToAccountType(const QString& type);
00144 
00153   static MyMoneySecurity::eSECURITYTYPE stringToSecurity(const QString& txt);
00154 
00165   static const QString securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType);
00166 
00180   static const QString occurenceToString(const MyMoneySchedule::occurenceE occurence);
00181 
00193   static const QString paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType);
00194 
00206   static const QString weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption);
00207 
00219   static const QString scheduleTypeToString(MyMoneySchedule::typeE type);
00220 
00229   static const QString homePageItemToString(const int idx);
00230 
00240   static int stringToHomePageItem(const QString& txt);
00241 
00247   static KGuiItem scheduleNewGuiItem(void);
00248 
00254   static KGuiItem accountsFilterGuiItem(void);
00255 
00267   static bool appendCorrectFileExt(QString& name, const QString& extension);
00268 
00269   static QPixmap billScheduleIcon(int size);
00270   static QPixmap depositScheduleIcon(int size);
00271   static QPixmap transferScheduleIcon(int size);
00272   static QPixmap scheduleIcon(int size);
00273 
00278   static void checkConstants(void);
00279 
00280   static QString variableCSS(void);
00281 
00316   static QString findResource(const char* type, const QString& filename);
00317 
00327   static const MyMoneySplit stockSplit(const MyMoneyTransaction& t);
00328 
00338   static transactionTypeE transactionType(const MyMoneyTransaction& t);
00339 
00350   static void calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const QMap<QString, MyMoneyMoney>& balances);
00351 
00355   static QString nextCheckNumber(const MyMoneyAccount& acc);
00356 
00361   static QString reconcileStateToString(MyMoneySplit::reconcileFlagE flag, bool text = false);
00362 
00370   static MyMoneyTransaction scheduledTransaction(const MyMoneySchedule& schedule);
00371 
00378   static void previouslyUsedCategories(const QString& investmentAccount, QString& feesId, QString& interestId);
00379 
00380 };
00381 
00382 #endif

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