/******************************************************************************
FILE:  ExpenseTracker.h

SERVICES:  Header file

GENERAL DESCRIPTION:
  ExpenseTracker is a simple daily expense tracking application
  that allows the user to record new expenses as they are accrued
  to a database.  Expenses can be view and updated based on search
  criteria and text reports generated from the contents of the
  database.

PUBLIC CLASSES AND STATIC FUNCTIONS:
	Classes:
    IMenuCtl
    ITextCtl
    IDateCtl
    IStatic
    IDialog
    IDatabase
    IDBMgr
    IDBRecord
    IFileMgr
    IFile

INITIALIZATION & SEQUENCING REQUIREMENTS:

	See Exported Routines

       Copyright © 2002 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
******************************************************************************/
#ifndef EXPENSETRACKER_H
#define EXPENSETRACKER_H

//*****************************************************************************
// INCLUDE FILES
//*****************************************************************************
#include "AEE.h"
#include "AEEAppGen.h"
#include "AEEDate.h"
#include "AEEDB.h"
#include "AEEFile.h"
#include "AEEMenu.h"
#include "AEEShell.h"
#include "AEEText.h"
#include "ET_AmountCtl.h"

//*****************************************************************************
// DEFINITIONS
//*****************************************************************************

#define REPORT_FILE_EXTENSION        ".rpt"               // Report file extension
#define EXPENSETRACKER_DB_FILE       "expense_db"         // Base database file name
#define EXPENSETRACKER_HELP_FILE     "help.txt"           // Help file name
#define EXPENSETRACKER_MIF_FILE      "ExpenseTracker.mif" // MIF file name

#define EXPENSE_LIST_ID             1000                  // Base ID of expense items displayed in the menu control
#define REPORT_LIST_ID              2000                  // Base ID of report file names displayed in the menu control

#define MAX_RES_STRING_BUF_SIZE      256                  // Max buffer size for string buffers
#define MAX_AMOUNT_DIGITS            8                    // Max digits for amount strings                
#define AMOUNT_BUFFER_SIZE           10                   // Max string buffer size for amount strings
#define MAX_DESC_SIZE                16

#define BANNER_DISPLAY_TIMER         750                  // Timeout for banners and splash screens

//*****************************************************************************
// ENUMERATED TYPE DEFINITIONS
//*****************************************************************************

// Enumerate the various application states

typedef enum
{
  APP_STATE_SPLASH,
  APP_STATE_MAIN,
  APP_STATE_ADD,
  APP_STATE_VIEW,
  APP_STATE_VIEW_LIST,
  APP_STATE_EDIT,
  APP_STATE_OPTIONS,
  APP_STATE_LOAD_LIST,
  APP_STATE_REPORT,
  APP_STATE_SAVE_CONFIRM,
  APP_STATE_SAVE,
  APP_STATE_HELP,
  APP_STATE_ABOUT
} EAppStateType;

//*****************************************************************************
// GLOBAL APPLICATION DATA STRUCTURES
//*****************************************************************************
// All the GUI objects and data needed for the Add/Edit dialog

// Main application data structure.

typedef struct _CExpenseTrackerApp
{
  AEEApplet               a;              // Mandatory AEEApplet data member appears first

  EAppStateType           m_eAppState;    // Application State
  AEERect                 m_rScreenRect;  // Screen Rect
  int                     m_nFontHeight;  // Stores the height of the AEE_FONT_BOLD font.  This will
  uint16                  m_nRecordEditNum; // Temporaritly stoes the ID of the record displayed in the edit screen.
                                          // be used frequently for placing objects on the screen
  IDatabase*              m_pDatabase;    // Database

  IImage*                 m_pTitleBarImg; // Pointer to the titlebar bitmap image

  IMenuCtl*               m_pMenu;        // Main Menu
  IMenuCtl*               m_pSK;          // Softkey Menu
  IMenuCtl*               m_pList;        // List Menu
  IDateCtl*               m_pDate;        // Used for creating saved Date strings.
  ITextCtl*               m_pText;        // Text Control
  CAmountCtl*             m_pAmount;      // Amount Custom Control
  IStatic*                m_pIStatic;     // Static Control

  uint16                  m_nTransType;   // Transaction Type
  uint32                  m_nFromDate;    // From Date
  uint32                  m_nToDate;      // To Date

  AEECallback             m_rSaveReportCB;// Callback


} CExpenseTrackerApp;

#endif
