GnuCash  5.6-150-g038405b370+
Data Structures | Macros | Enumerations | Functions | Variables
dialog-print-check.c File Reference

Print Checks Dialog. More...

#include <config.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdio.h>
#include <locale.h>
#include <math.h>
#include "qof.h"
#include "gnc-date.h"
#include "gnc-prefs.h"
#include "gnc-numeric.h"
#include "gnc-plugin-page-register.h"
#include "dialog-print-check.h"
#include "dialog-utils.h"
#include "print-session.h"
#include "gnc-ui.h"
#include "gnc-date-format.h"
#include "gnc-ui-util.h"
#include "gnc-path.h"
#include "gnc-filepath-utils.h"
#include "gnc-gkeyfile-utils.h"
#include "gnc-engine.h"
#include "engine-helpers.h"
#include "Split.h"
#include "Transaction.h"

Go to the source code of this file.

Data Structures

struct  check_format_t
 
struct  PrintCheckDialog
 
struct  _trans_amount
 

Macros

#define G_LOG_DOMAIN   "gnc.printing.checks"
 
#define GNC_PREFS_GROUP   "dialogs.checkprinting"
 
#define GNC_PREF_CHECK_FORMAT_GUID   "check-format-guid"
 
#define GNC_PREF_CHECK_POSITION   "check-position"
 
#define GNC_PREF_FIRST_PAGE_COUNT   "first-page-count"
 
#define GNC_PREF_DATE_FORMAT_USER   "date-format-user"
 
#define GNC_PREF_CUSTOM_PAYEE   "custom-payee"
 
#define GNC_PREF_CUSTOM_DATE   "custom-date"
 
#define GNC_PREF_CUSTOM_WORDS   "custom-amount-words"
 
#define GNC_PREF_CUSTOM_NUMBER   "custom-amount-number"
 
#define GNC_PREF_CUSTOM_ADDRESS   "custom-address"
 
#define GNC_PREF_CUSTOM_NOTES   "custom-notes"
 
#define GNC_PREF_CUSTOM_MEMO   "custom-memo"
 
#define GNC_PREF_CUSTOM_TRANSLATION   "custom-translation"
 
#define GNC_PREF_CUSTOM_ROTATION   "custom-rotation"
 
#define GNC_PREF_CUSTOM_UNITS   "custom-units"
 
#define GNC_PREF_PRINT_DATE_FMT   "print-date-format"
 
#define GNC_PREF_DEFAULT_FONT   "default-font"
 
#define GNC_PREF_BLOCKING_CHARS   "blocking-chars"
 
#define GNC_PREF_SPLITS_AMOUNT   "splits-amount"
 
#define GNC_PREF_SPLITS_MEMO   "splits-memo"
 
#define GNC_PREF_SPLITS_ACCOUNT   "splits-account"
 
#define DEFAULT_FONT   "sans 12"
 
#define CHECK_FMT_DIR   "checks"
 
#define CHECK_NAME_EXTENSION   ".chk"
 
#define DEGREES_TO_RADIANS   (G_PI / 180.0)
 
#define BLOCKING_CHAR_OFF   0
 
#define BLOCKING_CHAR_ON   1
 
#define KF_GROUP_TOP   "Top"
 
#define KF_GROUP_POS   "Check Positions"
 
#define KF_GROUP_ITEMS   "Check Items"
 
#define KF_KEY_GUID   "Guid"
 
#define KF_KEY_TITLE   "Title"
 
#define KF_KEY_ROTATION   "Rotation"
 
#define KF_KEY_TRANSLATION   "Translation"
 
#define KF_KEY_FONT   "Font"
 
#define KF_KEY_ALIGN   "Align"
 
#define KF_KEY_BLOCKING   "Blocking_Chars"
 
#define KF_KEY_SHOW_GRID   "Show_Grid"
 
#define KF_KEY_SHOW_BOXES   "Show_Boxes"
 
#define KF_KEY_NAMES   "Names"
 
#define KF_KEY_HEIGHT   "Height"
 
#define KF_KEY_TYPE   "Type"
 
#define KF_KEY_COORDS   "Coords"
 
#define KF_KEY_TEXT   "Text"
 
#define KF_KEY_FILENAME   "Filename"
 
#define KF_KEY_DATE_FORMAT   "DateFormat"
 
#define KF_KEY_SPLITS_AMOUNT   "SplitsAmount"
 
#define KF_KEY_SPLITS_MEMO   "SplitsMemo"
 
#define KF_KEY_SPLITS_ACCOUNT   "SplitsAccount"
 
#define ENUM_CHECK_ITEM_TYPE(_)
 
#define DATE_FMT_HEIGHT   8
 
#define DATE_FMT_SLOP   2
 

Enumerations

enum  format_combo_col { COL_NAME = 0, COL_DATA, COL_SEP }
 
enum  CheckItemType {
  NONE, PAYEE, DATE, NOTES,
  CHECK_NUMBER, MEMO, ACTION, AMOUNT_NUMBER,
  AMOUNT_WORDS, TEXT, ADDRESS, DATE_FORMAT,
  SPLITS_AMOUNT, SPLITS_MEMO, SPLITS_ACCOUNT, PICTURE
}
 

Functions

void gnc_ui_print_check_response_cb (GtkDialog *dialog, gint response, PrintCheckDialog *pcd)
 
void gnc_print_check_format_changed (GtkComboBox *widget, PrintCheckDialog *pcd)
 
void gnc_print_check_position_changed (GtkComboBox *widget, PrintCheckDialog *pcd)
 
void gnc_print_check_save_button_clicked (GtkButton *button, PrintCheckDialog *pcd)
 
void gnc_check_format_title_changed (GtkEditable *editable, GtkWidget *ok_button)
 
gchar * get_check_address (PrintCheckDialog *pcd)
 
 FROM_STRING_DEC (CheckItemType, ENUM_CHECK_ITEM_TYPE)
 
void gnc_ui_print_check_dialog_create (GtkWidget *parent, GList *splits, Account *account)
 
Split printing functions
gchar * get_check_splits_amount (PrintCheckDialog *pcd)
 
gchar * get_check_splits_memo (PrintCheckDialog *pcd)
 
gchar * get_check_splits_account (PrintCheckDialog *pcd)
 

Variables

 check_item_t
 

Detailed Description

Print Checks Dialog.

Author
Copyright (C) 2000 Bill Gribble grib@.nosp@m.bill.nosp@m.gribb.nosp@m.le.c.nosp@m.om
Copyright (C) 2006,2007 David Hampton hampt.nosp@m.on@e.nosp@m.mploy.nosp@m.ees..nosp@m.org

Definition in file dialog-print-check.c.

Macro Definition Documentation

◆ ENUM_CHECK_ITEM_TYPE

#define ENUM_CHECK_ITEM_TYPE (   _)
Value:
_(NONE,) \
_(PAYEE,) \
_(DATE,) \
_(NOTES,) \
_(CHECK_NUMBER,) \
\
_(MEMO,) \
_(ACTION,) \
_(AMOUNT_NUMBER,) \
_(AMOUNT_WORDS,) \
\
_(TEXT,) \
_(ADDRESS,) \
_(DATE_FORMAT,) \
_(SPLITS_AMOUNT,) \
_(SPLITS_MEMO,) \
_(SPLITS_ACCOUNT,) \
_(PICTURE,)

Definition at line 154 of file dialog-print-check.c.

Enumeration Type Documentation

◆ format_combo_col

Enumerator
COL_NAME 

This column holds a copy of the check format name and is what is displayed to the user in the combobox.

It is NULL for separator lines.

COL_DATA 

This column holds a pointer to the check format data read in from a file.

It is NULL for the custom check format and for separator lines.

COL_SEP 

This column contains the value TRUE if this entry specifies a separator line.

Definition at line 122 of file dialog-print-check.c.

123 {
124  COL_NAME = 0,
128  COL_DATA,
132  COL_SEP,
format_combo_col
This column holds a pointer to the check format data read in from a file.
This column contains the value TRUE if this entry specifies a separator line.
This column holds a copy of the check format name and is what is displayed to the user in the combobo...

Function Documentation

◆ FROM_STRING_DEC()

FROM_STRING_DEC ( CheckItemType  ,
ENUM_CHECK_ITEM_TYPE   
)

< What type of item is this?







< The x/y coordinates where this item should be printed. The origin for these coordinates is determined by the print system used.






< Optional. The width and height of this item. Text will be clipped to this size. Pictures will be shrunk to fit if necessary.





< The filename for picture items. Otherwise unused.




< The text to be displayed (for text based items.) Otherwise unused.



< The font to use for text based items. This overrides any font in the check format. Unused for non-text items.


< Optional. Overrides blocking in the check format. Default is no blocking characters are written. Unused for non-text items.

< Optional. Print date format. Only applies to DATE items. Default is no format is written.
< The alignment of a text based item. Only used for text based items when a width is specified.

Definition at line 174 of file dialog-print-check.c.

184 {
185 
186  CheckItemType type;
188  gdouble x, y;
193  gdouble w, h;
198  gchar *filename;
201  gchar *text;
204  gchar *font;
208  gboolean blocking;
213  gboolean print_date_format;
217  PangoAlignment align;