|
|
|
|
@ -1,3 +1,19 @@
|
|
|
|
|
/********************************************************************\
|
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of *
|
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License*
|
|
|
|
|
* along with this program; if not, write to the Free Software *
|
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
|
|
|
|
\********************************************************************/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* FILE:
|
|
|
|
|
* pricecell.h
|
|
|
|
|
@ -29,23 +45,8 @@
|
|
|
|
|
* dollars with penny accuracy.
|
|
|
|
|
*
|
|
|
|
|
* HISTORY:
|
|
|
|
|
* Copyright (c) 1998 Linas Vepstas
|
|
|
|
|
* Copyright (c) 1998, 1999, 2000 Linas Vepstas
|
|
|
|
|
*/
|
|
|
|
|
/********************************************************************\
|
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of *
|
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License*
|
|
|
|
|
* along with this program; if not, write to the Free Software *
|
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
|
|
|
|
\********************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef __XACC_PRICE_CELL_C__
|
|
|
|
|
#define __XACC_PRICE_CELL_C__
|
|
|
|
|
@ -57,13 +58,11 @@ typedef struct _PriceCell
|
|
|
|
|
{
|
|
|
|
|
BasicCell cell;
|
|
|
|
|
|
|
|
|
|
double amount; /* the amount associated with this cell */
|
|
|
|
|
double amount; /* the amount associated with this cell */
|
|
|
|
|
|
|
|
|
|
int precision; /* precision of printed values */
|
|
|
|
|
int min_trail_zeros; /* minimum number of trailing zeros to print */
|
|
|
|
|
|
|
|
|
|
gncBoolean blank_zero; /* controls printing of zero values */
|
|
|
|
|
gncBoolean monetary; /* controls parsing of values */
|
|
|
|
|
gncBoolean blank_zero; /* controls printing of zero values */
|
|
|
|
|
gncBoolean monetary; /* controls parsing of values */
|
|
|
|
|
gncBoolean shares_value; /* true if a shares values */
|
|
|
|
|
} PriceCell;
|
|
|
|
|
|
|
|
|
|
/* installs a callback to handle price recording */
|
|
|
|
|
@ -77,13 +76,6 @@ double xaccGetPriceCellValue (PriceCell *cell);
|
|
|
|
|
/* updates amount, string format is three decimal places */
|
|
|
|
|
void xaccSetPriceCellValue (PriceCell *cell, double amount);
|
|
|
|
|
|
|
|
|
|
/* sets the precision of the printed value. Defaults to 2 */
|
|
|
|
|
void xaccSetPriceCellPrecision (PriceCell *cell, int precision);
|
|
|
|
|
|
|
|
|
|
/* Sets the mininum number of trailing decimal zeros that must
|
|
|
|
|
* be printed. Defaults to 2. */
|
|
|
|
|
void xaccSetPriceCellMinTrailZeros (PriceCell *cell, int);
|
|
|
|
|
|
|
|
|
|
/* determines whether 0 values are left blank or printed.
|
|
|
|
|
* defaults to true. */
|
|
|
|
|
void xaccSetPriceCellBlankZero (PriceCell *cell, gncBoolean);
|
|
|
|
|
@ -94,6 +86,10 @@ void xaccSetPriceCellBlankZero (PriceCell *cell, gncBoolean);
|
|
|
|
|
*/
|
|
|
|
|
void xaccSetPriceCellMonetary (PriceCell *, gncBoolean);
|
|
|
|
|
|
|
|
|
|
/* The xaccSetPriceCellSharesValue() sets a flag which determines
|
|
|
|
|
* whether the quantity is printed as a shares value or not. */
|
|
|
|
|
void xaccSetPriceCellSharesValue (PriceCell *, gncBoolean);
|
|
|
|
|
|
|
|
|
|
/* updates two cells; the deb cell if amt is negative,
|
|
|
|
|
* the credit cell if amount is positive, and makes the other cell
|
|
|
|
|
* blank. */
|
|
|
|
|
|