GnuCash  4.11-6-gd65b1226c7+
Data Structures | Macros | Typedefs | Enumerations | Functions
gnc-ui-util.h File Reference

utility functions for the GnuCash UI More...

#include <glib.h>
#include <locale.h>
#include "Account.h"
#include "gncOwner.h"
#include "qof.h"

Go to the source code of this file.

Data Structures

struct  GNCPrintAmountInfo
 

Macros

#define GNC_PREFS_GROUP_OPEN_SAVE   "dialogs.open-save"
 
#define GNC_PREFS_GROUP_EXPORT   "dialogs.export-accounts"
 
#define GNC_PREFS_GROUP_REPORT   "dialogs.report"
 
#define GNC_PREF_AUTO_DECIMAL_POINT   "auto-decimal-point"
 
#define GNC_PREF_AUTO_DECIMAL_PLACES   "auto-decimal-places"
 
#define WLINK   'w'
 
#define FLINK   'f'
 

Typedefs

typedef QofSession *(* QofSessionCB) (void)
 

Enumerations

enum  GNCEquityType { EQUITY_OPENING_BALANCE, EQUITY_RETAINED_EARNINGS, NUM_EQUITY_TYPES }
 

Functions

gchar * gnc_normalize_account_separator (const gchar *separator)
 
gboolean gnc_reverse_balance (const Account *account)
 
gboolean gnc_using_unreversed_budgets (QofBook *book)
 
gboolean gnc_reverse_budget_balance (const Account *account, gboolean unreversed)
 
void gnc_set_use_equity_type_opening_balance_account (QofBook *book)
 
gboolean gnc_using_equity_type_opening_balance_account (QofBook *book)
 
gchar * gnc_get_default_directory (const gchar *section)
 
void gnc_set_default_directory (const gchar *section, const gchar *directory)
 
QofBook * gnc_get_current_book (void)
 
gboolean gnc_is_new_book (void)
 
void gnc_set_current_book_tax_name_type (gboolean name_changed, const gchar *tax_name, gboolean type_changed, const gchar *tax_type)
 
const gchar * gnc_get_current_book_tax_name (void)
 
const gchar * gnc_get_current_book_tax_type (void)
 
void gnc_book_option_num_field_source_change_cb (gboolean num_action)
 Calls gnc_book_option_num_field_source_change to initiate registered callbacks when num_field_source book option changes so that registers/reports can update themselves; sets feature flag.
 
void gnc_book_option_book_currency_selected_cb (gboolean use_book_currency)
 Calls gnc_book_option_book_currency_selected to initiate registered callbacks when currency accounting book option changes to book-currency so that registers/reports can update themselves; sets feature flag.
 
gboolean gnc_book_use_book_currency (QofBook *book)
 Returns TRUE if both book-currency and default gain/loss policy KVPs exist and are valid and trading accounts are not used. More...
 
const gchar * gnc_book_get_book_currency_name (QofBook *book)
 Returns pointer to Book Currency name for book or NULL; determines that both book-currency and default gain/loss policy KVPs exist and that both are valid, a requirement for the 'book-currency' currency accounting method to apply. More...
 
gnc_commodity * gnc_book_get_book_currency (QofBook *book)
 Returns pointer to Book Currency for book or NULL; determines that both book-currency and default gain/loss policy KVPs exist and that both are valid, a requirement for the 'book-currency' currency accounting method to apply. More...
 
const gchar * gnc_book_get_default_gains_policy (QofBook *book)
 Returns pointer to default gain/loss policy for book or NULL; determines that both book-currency and default gain/loss policy KVPs exist and that both are valid, a requirement for the 'book-currency' currency accounting method to apply. More...
 
Accountgnc_book_get_default_gain_loss_acct (QofBook *book)
 Returns pointer to default gain/loss account for book or NULL; determines that both book-currency and default gain/loss policy KVPs exist and that both are valid, a requirement for the 'book-currency' currency accounting method to apply. More...
 
Accountgnc_get_current_root_account (void)
 
gnc_commodity_table * gnc_get_current_commodities (void)
 
gchar * gnc_get_account_name_for_register (const Account *account)
 Get either the full name of the account or the simple name, depending on the configuration parameter general/register/show_leaf_account_names. More...
 
Accountgnc_account_lookup_for_register (const Account *base_account, const gchar *name)
 Retrieve the account matching the given name starting from the descendants of base_account. More...
 
gchar * gnc_get_account_name_for_split_register (const Account *account, gboolean show_leaf_accounts)
 Get either the full name of the account or the simple name, depending on the show_leaf_accounts. More...
 
char * gnc_ui_account_get_tax_info_string (const Account *account)
 
char * gnc_ui_account_get_tax_info_sub_acct_string (const Account *account)
 
const char * gnc_get_reconcile_str (char reconciled_flag)
 
const char * gnc_get_reconcile_valid_flags (void)
 
const char * gnc_get_reconcile_flag_order (void)
 
const char * gnc_get_doclink_valid_flags (void)
 Get a string containing documentation link valid flags. More...
 
const char * gnc_get_doclink_flag_order (void)
 Get a string containing document link flag order. More...
 
const char * gnc_get_doclink_str (char link_flag)
 Get a string representing the document link type. More...
 
Accountgnc_find_or_create_equity_account (Account *root, GNCEquityType equity_type, gnc_commodity *currency)
 
gboolean gnc_account_create_opening_balance (Account *account, gnc_numeric balance, time64 date, QofBook *book)
 
gnc_commodity * gnc_locale_default_currency_nodefault (void)
 Returns the default currency of the current locale, or NULL if no sensible currency could be identified from the locale. More...
 
gnc_commodity * gnc_locale_default_currency (void)
 Returns the default currency of the current locale. More...
 
gnc_commodity * gnc_default_currency (void)
 Return the default currency set by the user. More...
 
gnc_commodity * gnc_account_or_default_currency (const Account *account, gboolean *currency_from_account_found)
 Returns a gnc_commodity that is a currency, suitable for being a Transaction's currency. More...
 
gnc_commodity * gnc_default_report_currency (void)
 Return the default currency for use in reports, as set by the user. More...
 
GNCPrintAmountInfo gnc_default_print_info (gboolean use_symbol)
 
GNCPrintAmountInfo gnc_commodity_print_info (const gnc_commodity *commodity, gboolean use_symbol)
 
GNCPrintAmountInfo gnc_account_print_info (const Account *account, gboolean use_symbol)
 
GNCPrintAmountInfo gnc_split_amount_print_info (Split *split, gboolean use_symbol)
 
GNCPrintAmountInfo gnc_price_print_info (const gnc_commodity *curr, gboolean use_symbol)
 
GNCPrintAmountInfo gnc_share_print_info_places (int decplaces)
 
GNCPrintAmountInfo gnc_default_share_print_info (void)
 
GNCPrintAmountInfo gnc_default_price_print_info (const gnc_commodity *curr)
 
GNCPrintAmountInfo gnc_integral_print_info (void)
 
const char * xaccPrintAmount (gnc_numeric val, GNCPrintAmountInfo info)
 Make a string representation of a gnc_numeric. More...
 
int xaccSPrintAmount (char *buf, gnc_numeric val, GNCPrintAmountInfo info)
 Make a string representation of a gnc_numeric. More...
 
const gchar * printable_value (gdouble val, gint denom)
 
gchar * number_to_words (gdouble val, gint64 denom)
 
gchar * numeric_to_words (gnc_numeric val)
 
gboolean xaccParseAmount (const char *in_str, gboolean monetary, gnc_numeric *result, char **endstr)
 Parses in_str to obtain a numeric result. More...
 
gboolean xaccParseAmountPosSign (const char *in_str, gboolean monetary, gnc_numeric *result, char **endstr, gboolean skip)
 Parses in_str to a gnc_numeric, with a flag to indicate whether the locale's positive sign (or in absence the '+') character is ignored. More...
 
gboolean xaccParseAmountExtended (const char *in_str, gboolean monetary, gunichar negative_sign, gunichar decimal_point, gunichar group_separator, const char *ignore_list, gnc_numeric *result, char **endstr)
 Converts a string to a gnc_numeric. More...
 
const char * gnc_print_amount_with_bidi_ltr_isolate (gnc_numeric val, GNCPrintAmountInfo info)
 Make a string representation of a gnc_numeric. More...
 
gchar * gnc_wrap_text_with_bidi_ltr_isolate (const char *text)
 This function helps with GTK's use of 'Unicode Bidirectional Text Algorithm'. More...
 
void gnc_ui_util_init (void)
 
void gnc_ui_util_remove_registered_prefs (void)
 
gchar * gnc_filter_text_for_control_chars (const gchar *incoming_text)
 Returns the incoming text removed of control characters. More...
 
void gnc_filter_text_set_cursor_position (const gchar *incoming_text, const gchar *symbol, gint *cursor_position)
 Updates cursor_position after removal of currency symbols. More...
 
gchar * gnc_filter_text_for_currency_symbol (const gchar *incoming_text, const gchar *symbol)
 Returns the incoming text removed of a currency symbol. More...
 
gchar * gnc_filter_text_for_currency_commodity (const gnc_commodity *comm, const gchar *incoming_text, const gchar **symbol)
 Returns the incoming text removed of currency symbol. More...
 

Detailed Description

utility functions for the GnuCash UI

Author
Copyright (C) 2000 Dave Peticolas dave@.nosp@m.kron.nosp@m.do.co.nosp@m.m

Definition in file gnc-ui-util.h.