GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dialog-utils.h
1 /********************************************************************\
2  * dialog-utils.h -- utility functions for creating dialogs *
3  * for GnuCash *
4  * Copyright (C) 1999-2000 Linas Vepstas *
5  * Copyright (C) 2005 David Hampton <[email protected]> *
6  * *
7  * This program is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License as *
9  * published by the Free Software Foundation; either version 2 of *
10  * the License, or (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License*
18  * along with this program; if not, contact: *
19  * *
20  * Free Software Foundation Voice: +1-617-542-5942 *
21  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
22  * Boston, MA 02110-1301, USA [email protected] *
23  * *
24 \********************************************************************/
25 
26 #ifndef DIALOG_UTILS_H
27 #define DIALOG_UTILS_H
28 
29 #include <gtk/gtk.h>
30 #include "qof.h"
31 
32 void gnc_get_deficit_color (GdkColor *color);
33 void gnc_set_label_color (GtkWidget *label, gnc_numeric value);
34 
35 /********************************************************************\
36  * Returns the window size to use for the given option prefix, *
37  * if window sizes are being saved, otherwise returns 0 for both. *
38  * *
39  * Args: prefix - the option name prefix *
40  * width - pointer to width *
41  * height - pointer to height *
42  * Returns: nothing *
43  \*******************************************************************/
44 void gnc_restore_window_size (const char *prefix, GtkWindow *window);
45 
46 /********************************************************************\
47  * Save the window size into options whose names are determined *
48  * by the string prefix. *
49  * *
50  * Args: prefix - determines the options used to save the values *
51  * width - width of the window to save *
52  * height - height of the window to save *
53  * Returns: nothing *
54 \********************************************************************/
55 void gnc_save_window_size (const char *section, GtkWindow *window);
56 
57 /********************************************************************\
58  * Adjust the window size if it is bigger than the screen size. *
59  * *
60  * Args: window - the window to adjust *
61  * Returns: nothing *
62 \********************************************************************/
63 void gnc_window_adjust_for_screen (GtkWindow * window);
64 
65 gboolean gnc_handle_date_accelerator (GdkEventKey *event,
66  struct tm *tm,
67  const char *date_str);
68 
69 gboolean gnc_builder_add_from_file (GtkBuilder *builder, const char *filename, const char *root);
70 
71 void gnc_builder_connect_full_func (GtkBuilder *builder,
72  GObject *signal_object,
73  const gchar *signal_name,
74  const gchar *handler_name,
75  GObject *connect_object,
76  GConnectFlags flags,
77  gpointer user_data);
78 
92 void gnc_gtk_dialog_add_button (GtkWidget *dialog,
93  const gchar *label,
94  const gchar *stock_id,
95  guint response);
96 
99 gint
100 gnc_dialog_run(GtkDialog *dialog, const gchar *pref_key);
101 
102 /* If this is a new book, this function can be used to display book options
103  * dialog so user can specify options, before any transactions can be
104  * imported/entered, since they can affect how transactions are created
105  * Note: This dialog is modal! */
106 gboolean gnc_new_book_option_display (GtkWidget *parent);
107 
108 #endif /* DIALOG_UTILS_H */