|
GnuCash 2.4.99
|
00001 /* 00002 * gnc-amount-edit.h -- amount editor widget 00003 * 00004 * Copyright (C) 2000 Dave Peticolas <dave@krondo.com> 00005 * All rights reserved. 00006 * 00007 * GnuCash is free software; you can redistribute it and/or modify it 00008 * under the terms of the GNU Library General Public License as 00009 * published by the Free Software Foundation; either version 2 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * Gnucash is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, contact: 00019 * 00020 * Free Software Foundation Voice: +1-617-542-5942 00021 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 00022 * Boston, MA 02110-1301, USA gnu@gnu.org 00023 * 00024 */ 00025 /* 00026 @NOTATION@ 00027 */ 00028 00029 #ifndef GNC_AMOUNT_EDIT_H 00030 #define GNC_AMOUNT_EDIT_H 00031 00032 #include "qof.h" 00033 #include "gnc-ui-util.h" 00034 00035 #define GNC_TYPE_AMOUNT_EDIT (gnc_amount_edit_get_type()) 00036 #define GNC_AMOUNT_EDIT(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, GNC_TYPE_AMOUNT_EDIT, GNCAmountEdit) 00037 #define GNC_AMOUNT_EDIT_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, GNC_TYPE_AMOUNT_EDIT, GNCAmountEditClass) 00038 #define GNC_IS_AMOUNT_EDIT(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, GNC_TYPE_AMOUNT_EDIT) 00039 00040 typedef struct 00041 { 00042 GtkEntry entry; 00043 00044 gboolean need_to_parse; 00045 00046 GNCPrintAmountInfo print_info; 00047 00048 gnc_numeric amount; 00049 00050 int fraction; 00051 00052 gboolean evaluate_on_enter; 00053 00054 } GNCAmountEdit; 00055 00056 typedef struct 00057 { 00058 GtkEntryClass parent_class; 00059 00060 /* Signals for notification/filtering of changes */ 00061 void (*amount_changed) (GNCAmountEdit *gae); 00062 } GNCAmountEditClass; 00063 00064 GType gnc_amount_edit_get_type (void); 00065 00066 GtkWidget *gnc_amount_edit_new (void); 00067 00068 GtkWidget *gnc_amount_edit_gtk_entry (GNCAmountEdit *gae); 00069 00070 void gnc_amount_edit_set_amount (GNCAmountEdit *gae, 00071 gnc_numeric amount); 00072 void gnc_amount_edit_set_damount (GNCAmountEdit *gae, 00073 double amount); 00074 00075 gnc_numeric gnc_amount_edit_get_amount (GNCAmountEdit *gae); 00076 double gnc_amount_edit_get_damount (GNCAmountEdit *gae); 00077 00078 gint gnc_amount_edit_expr_is_valid (GNCAmountEdit *gae, gnc_numeric *amount, 00079 gboolean empty_ok); 00080 gboolean gnc_amount_edit_evaluate (GNCAmountEdit *gae); 00081 00082 void gnc_amount_edit_set_print_info (GNCAmountEdit *gae, 00083 GNCPrintAmountInfo print_info); 00084 00085 void gnc_amount_edit_set_fraction (GNCAmountEdit *gae, int fraction); 00086 00087 void gnc_amount_edit_set_evaluate_on_enter (GNCAmountEdit *gae, 00088 gboolean evaluate_on_enter); 00089 #endif
1.7.4