Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CoinsPref.h

Go to the documentation of this file.
00001 /** $Revision: 1.28 $
00002     Last updated: $Date: 2002/09/20 12:21:30 $
00003     
00004     Copyright (C) 2000-2002 Vlad Mereuta <dizzy@users.sourceforge.net>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
00019 
00020 #ifndef __COINS_PREFERENCES__
00021 #define __COINS_PREFERENCES__
00022 
00023 #include <PalmOS.h>
00024 
00025 #include "MiscFunc.h"
00026 
00027 /// possible payment methods for transactions
00028 typedef enum { pm_card=0, pm_cash=1, pm_cheque=2, pm_so=3, pm_dd=4,
00029      pm_transfer=5, pm_online=6, pm_direct_deposit=7, pm_atm=8, pm_other=9 } Payment_method;
00030 
00031 ///structure containing the program preferences
00032 typedef struct {
00033     ///when the scheduled transactions were last updated
00034     DateType last_update;   
00035     ///account types the user wants to see
00036     UInt16 visible_acc_types;
00037     ///default view in the transaction list
00038     UInt16 trans_view;
00039     ///default account for quick transactions (0 if not set)
00040     UInt32 def_acc;
00041     ///default currency used by the program (UID from currency database)
00042     UInt32 def_currency;
00043     ///default payment method in transactions
00044     Payment_method payment_method;
00045     /** field indicating what is the balance displayed for accounts 
00046         it can be 0 for total, 1 for cleared, 2 for available */
00047     unsigned displayed_balance   :2;
00048     ///true if the payee is displayed in transaction list, false otherwise
00049     unsigned disp_payee         :1;
00050     ///true if we want to display a cleared column in the transactions table, false otherwise
00051     unsigned disp_cleared_col   :1;
00052     ///if true the last view will allways be remembered
00053     unsigned remember_trans_view    :1;
00054     ///default cleared state for transactions
00055     unsigned trans_cleared      :1;
00056     ///true if user wants thousands separators to display
00057     unsigned use_thousands_sep  :1;
00058     ///true if user wants pasword check on program start
00059     unsigned check_pass :1;
00060     ///true if user wants the children total to be included in the account balance, even if the account is expanded
00061     unsigned inc_children_total :1;
00062     ///reserved for future extensions
00063     unsigned reserved           :7;
00064 } CoinsPrefType;
00065 
00066 
00067 ///manipulates the program preferences
00068 class CoinsPref 
00069 {
00070  private:
00071     ///the structure holds the app's preferences
00072     CoinsPrefType   coins_pref; 
00073     
00074     ///id for the pref structure above
00075     UInt16  id; 
00076     /// version
00077     Int16   ver;
00078     
00079  public:
00080     /// the constructor sets the values for the id and version
00081     CoinsPref();
00082          
00083     ///@return pointer to the current preferences:
00084     CoinsPrefType* get();
00085     
00086     ///retrieve the preferences into coins_pref
00087     void read();
00088 
00089     ///save the preferences from coins_pref
00090     void save();
00091 
00092 
00093     ///assigns default values to coins_pref
00094     void setDefault();
00095 };
00096 
00097 extern CoinsPref preferences;
00098 
00099 #endif

Generated on Thu Jan 16 23:11:12 2003 for FreeCoins by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002