summaryrefslogtreecommitdiff
path: root/noncore/apps
authorchicken <chicken>2004-11-02 18:23:35 (UTC)
committer chicken <chicken>2004-11-02 18:23:35 (UTC)
commit029fc220470de74b7c1a148c9ea934c17686149f (patch) (side-by-side diff)
tree115de8edc9142615b31d906770cb7978190e7af8 /noncore/apps
parentebdc2d346272bae27c867b855207993985df4450 (diff)
downloadopie-029fc220470de74b7c1a148c9ea934c17686149f.zip
opie-029fc220470de74b7c1a148c9ea934c17686149f.tar.gz
opie-029fc220470de74b7c1a148c9ea934c17686149f.tar.bz2
switching to sqlite3
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/apps/qashmoney/account.h4
-rwxr-xr-xnoncore/apps/qashmoney/budget.h4
-rwxr-xr-xnoncore/apps/qashmoney/memory.h4
-rwxr-xr-xnoncore/apps/qashmoney/preferences.h4
-rwxr-xr-xnoncore/apps/qashmoney/qashmoney.pro2
-rwxr-xr-xnoncore/apps/qashmoney/transaction.h4
6 files changed, 11 insertions, 11 deletions
diff --git a/noncore/apps/qashmoney/account.h b/noncore/apps/qashmoney/account.h
index f77f400..5bad4a1 100755
--- a/noncore/apps/qashmoney/account.h
+++ b/noncore/apps/qashmoney/account.h
@@ -1,100 +1,100 @@
#ifndef ACCOUNT_H
#define ACCOUNT_H
#include <qstring.h>
#include <qlistview.h>
#include <qcombobox.h>
-#include <sqlite.h>
+#include <sqlite3.h>
class Account
{
public:
Account ();
~Account ();
// This function adds a new account to the database. It takes the account name, parent,
// initial balance and the account type, description, credit limit, statementbalancedate
// as three integers, and the statementbalance amount
// The parent is an integer account id. Its -1 if there is no parent
// The account types (so far) are 0=not defined 1=parent checking 2=child checking
void addAccount ( QString, int, float, int, QString, float, int, int, int, float, const char * );
// updates certain parts of an account
void updateAccount ( QString name, QString description, QString currencycode, int accountid );
void setAccountExpanded ( int expanded, int accountid );
int getAccountExpanded ( int id );
// Deletes an account
// Takes the accountid as its parameter
void deleteAccount ( int );
// Returns the number of accounts
int getNumberOfAccounts ();
// returns number of child accounts for a given parent
// this function is useless for child accounts. It will
// always return 0
int getNumberOfChildAccounts ( int );
// This function retrieves all transactions for an account and updates the
// account balance based on the transactions
void updateAccountBalance ( int accountid );
//void changeAccountBalance ( int accountid, float amount );
// updates a parent account
void changeParentAccountBalance ( int parentid );
// Returns the parent account ID for an account
// Takes the account name as its parameter or the account id
int getParentAccountID ( QString accountname );
int getParentAccountID ( int id );
// This takes a QListView and puts parents and children memorys
// into the list view
void displayAccounts ( QListView * );
// This function displays a sorted list of account names in a combobox
// Takes the combobox address for its parameter
int displayParentAccountNames ( QComboBox *, QString );
int getAccountType ( int ); // returns account type for given account id
// The next three collectively return a date or balance
// They take the accountid as their parameters
int getStatementDay ( int );
int getStatementMonth ( int );
int getStatementYear ( int );
float getStatementBalance ( int );
// Returns account description and name
QString getAccountDescription ( int accountid );
QString getCurrencyCode ( int accountid );
QString getAccountName ( int accountid );
QStringList getAccountNames ();
QStringList getAccountIDs ();
QString getAccountBalance ( int accountid );
// returns account credit limit
float getAccountCreditLimit ( int );
// The primary database that stores all our data
- sqlite *adb;
+ sqlite3 *adb;
};
class GreyBackgroundItem : public QListViewItem
{
public:
GreyBackgroundItem ( QListView *parent );
GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3 );
GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4 );
GreyBackgroundItem ( QListView *parent, QString label1, QString label2, QString label3, QString label4, QString label5 );
virtual void paintCell ( QPainter *p, const QColorGroup &cg, int column, int width, int alignment );
};
#endif
diff --git a/noncore/apps/qashmoney/budget.h b/noncore/apps/qashmoney/budget.h
index 16af26a..f82e048 100755
--- a/noncore/apps/qashmoney/budget.h
+++ b/noncore/apps/qashmoney/budget.h
@@ -1,45 +1,45 @@
#ifndef BUDGET_H
#define BUDGET_H
#include <qstring.h>
#include <qstringlist.h>
#include <qlistview.h>
-#include <sqlite.h>
+#include <sqlite3.h>
class Budget
{
public:
Budget ();
~Budget ();
int addBudget ( QString name, int type, QString description, QString currency, int startday, int startmonth, int startyear, int endday, int endmonth, int endyear, int defaultview );
void updateBudget ( QString name, QString description, QString currency, int budgetid );
void deleteBudget ( int budgetid );
int getNumberOfBudgets ();
int getNumberOfLineItems ( int budgetid );
QStringList* getBudgetNames ();
QStringList* getBudgetIDs ();
QStringList getLineItems ( int budgetid );
QStringList getLineItemIDs ( int budgetid );
QString getBudgetName ( int budgetid );
QString getBudgetDescription ( int budgetid );
QString getCurrency ( int budgetid );
QString getBudgetTotal ( int budgetid, int viewtype );
int getLastAdded ();
int addLineItem ( int budgetid, QString lineitemname, float lineitemamount, int lineitemtype );
void updateLineItem ( QString lineitemname, float lineitemamount, int lineitemtype, int budgetid, int lineitemid );
void displayLineItems ( int budgetid, QListView *listview, int month, int year, int viewtype );
void deleteLineItem ( int budgetid, int lineitemid );
int getLineItemTime ( int budgetid, int lineitemid );
float getLineItemAmount ( int budgetid, int lineitemid );
private:
- sqlite *bdb;
+ sqlite3 *bdb;
};
#endif
diff --git a/noncore/apps/qashmoney/memory.h b/noncore/apps/qashmoney/memory.h
index 6f3f100..6e8ae46 100755
--- a/noncore/apps/qashmoney/memory.h
+++ b/noncore/apps/qashmoney/memory.h
@@ -1,45 +1,45 @@
#ifndef MEMORY_H
#define MEMORY_H
#include <qstring.h>
#include <qlistbox.h>
#include <qcombobox.h>
-#include <sqlite.h>
+#include <sqlite3.h>
class Memory : public QObject
{
Q_OBJECT
public:
Memory ();
~Memory ();
// This function adds a new memory to the database. It takes the memory name, parent,
// initial balance, a displayed variable, and the memory type
// The parent is an integer memory id. Its -1 if there is not parent
// The memory types are 0=not defined 1=parent 2=child
void addMemoryItem ( QString );
// Returns the number of checking memorys
int getNumberOfMemoryItems ();
void changeMemoryName ( QString );
// This takes a QListView and puts parents and children memorys
// into the list view
void displayMemoryItems ( QListBox * );
void displayMemoryItems ( QComboBox * );
// The primary database that stores all our data
- sqlite *db;
+ sqlite3 *db;
public slots:
// Deletes a memory item. Takes the memoryid as its parameter
void deleteMemoryItem ( QString );
};
#endif
diff --git a/noncore/apps/qashmoney/preferences.h b/noncore/apps/qashmoney/preferences.h
index 10ec6e9..38579ad 100755
--- a/noncore/apps/qashmoney/preferences.h
+++ b/noncore/apps/qashmoney/preferences.h
@@ -1,53 +1,53 @@
-#include <sqlite.h>
+#include <sqlite3.h>
#include <qstring.h>
#ifndef PREFERENCES_H
#define PREFERENCES_H
class Preferences
{
public:
Preferences ();
~Preferences ();
void addPreferences ();
void initializeColumnPreferences ();
void initializeSortingPreferences ();
// Returns a preference value for the given preferences ID
int getPreference ( int );
int getColumnPreference ( int id );
void getSortingPreference ( int id, int *column, int *direction );
// Convenience for getting date separator with one function
// call. Takes the preference id as its argument
QString getSeparator ( );
// Changes a preference for the given ID
void changePreference ( int , int );
void changeColumnPreference ( int id, int width );
void changeSortingPreference ( int id, int column );
// The primary database that stores all our data
- sqlite *db;
+ sqlite3 *db;
// This function returns a Qstring for the year first date formats
// for displaying. It takes the date numbers
QString getDate ( int, int, int );
QString getDate ( int y, int m );
void setDefaultDatePreferences ();
};
#endif
diff --git a/noncore/apps/qashmoney/qashmoney.pro b/noncore/apps/qashmoney/qashmoney.pro
index 4222a25..faa898b 100755
--- a/noncore/apps/qashmoney/qashmoney.pro
+++ b/noncore/apps/qashmoney/qashmoney.pro
@@ -1,55 +1,55 @@
TEMPLATE = app
CONFIG = qt warn_on
HEADERS = qashmoney.h \
accountdisplay.h \
account.h \
transaction.h \
transactiondisplay.h \
newtransaction.h \
transfer.h \
transferdialog.h \
preferences.h \
preferencedialogs.h \
memory.h \
memorydialog.h \
newaccount.h \
calculator.h \
datepicker.h \
budget.h \
budgetdisplay.h \
currency.h
SOURCES = qashmoney.cpp \
accountdisplay.cpp \
account.cpp \
transaction.cpp \
transactiondisplay.cpp \
newtransaction.cpp \
transfer.cpp \
transferdialog.cpp \
preferences.cpp \
preferencedialogs.cpp \
memory.cpp \
memorydialog.cpp \
newaccount.cpp \
calculator.cpp \
datepicker.cpp \
main.cpp \
budget.cpp \
budgetdisplay.cpp \
currency.cpp
INCLUDEPATH = $(OPIEDIR)/include
DEPENDPATH = $(OPIEDIR)/include
TARGET = qashmoney
DESTDIR = $(OPIEDIR)/bin
unix:LIBS += -lm
-LIBS += -lqpe -lopiecore2 -lsqlite
+LIBS += -lqpe -lopiecore2 -lsqlite3
include ( $(OPIEDIR)/include.pro )
!isEmpty( LIBSQLITE_INC_DIR ) {
INCLUDEPATH = $$LIBSQLITE_INC_DIR $$INCLUDEPATH
}
!isEmpty( LIBSQLITE_LIB_DIR ) {
LIBS = -L$$LIBSQLITE_LIB_DIR $$LIBS
}
diff --git a/noncore/apps/qashmoney/transaction.h b/noncore/apps/qashmoney/transaction.h
index 5871555..3df43a8 100755
--- a/noncore/apps/qashmoney/transaction.h
+++ b/noncore/apps/qashmoney/transaction.h
@@ -1,73 +1,73 @@
#ifndef TRANSACTION_H
#define TRANSACTION_H
#include <qstring.h>
#include <qlistview.h>
#include <qdatetime.h>
-#include <sqlite.h>
+#include <sqlite3.h>
#include "preferences.h"
class Transaction
{
public:
Transaction ();
~Transaction ();
// This function adds a new transaction to the database. It takes the payee, accountid,
// budgetid, number, day, month, year, amount, cleared
void addTransaction ( QString description, QString payee, int accountid, int parentid, int number, int day, int month, int year, float amount, int cleared, int budgetid, int lineitemid );
// This updates an already existing transaction
void updateTransaction ( QString, QString, int, int, int, int, float, int, int, int, int );
// Deletes a transaction. Takes the transid as its parameter
void deleteTransaction ( int );
// Returns the number of transactions
int getNumberOfTransactions ();
// this is an overloaded function that returns the number of
// transactions for an account
int getNumberOfTransactions ( int );
// deletes all transactions for the provided accountid
void deleteAllTransactions ( int accountid );
QString getBudgetTotal ( int budgetid, int lineitemid, int year, int month, int viewtype );
QString getActualTotal ( int budgetid, int year, int month, int viewtype );
// These two functions clear budget ids is either a line item or an entire budget is deleted
void clearBudgetIDs ( int, int );
void clearBudgetIDs ( int );
public slots:
void displayTransactions ( QListView *, int, bool, const char *, QDate );
char ** selectAllTransactions ( QDate fromdate, bool children, const char *limit, int id );
char ** selectNonClearedTransactions ( QDate fromdate, bool children, const char *limit, int id );
QString getPayee ( int );
QString getTransactionDescription ( int );
QString getNumber ( int );
QString getAmount ( int );
QString getAbsoluteAmount ( int );
int getCleared ( int );
void setCleared ( int id, int cleared );
int getBudgetID ( int id );
int getLineItemID ( int id );
int getDay ( int );
int getMonth ( int );
int getYear ( int );
int getAccountID ( int id );
private:
- sqlite *tdb;
+ sqlite3 *tdb;
int rows, columns;
};
#endif