GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-frequency.h
1 /********************************************************************\
2  * gnc-frequency.h -- GnuCash widget for frequency editing. *
3  * Copyright (C) 2001,2002 Joshua Sled <[email protected]> *
4  * Copyright (C) 2003 Linas Vepstas <[email protected]> *
5  * *
6  * This program is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU General Public License as *
8  * published by the Free Software Foundation; either version 2 of *
9  * the License, or (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License*
17  * along with this program; if not, contact: *
18  * *
19  * Free Software Foundation Voice: +1-617-542-5942 *
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
21  * Boston, MA 02110-1301, USA [email protected] *
22  * *
23 \********************************************************************/
24 
25 #ifndef GNC_FREQUENCY_H
26 #define GNC_FREQUENCY_H
27 
28 #include "gnc-date-edit.h"
29 #include "FreqSpec.h"
30 #include "Recurrence.h"
31 
32 #define GNC_TYPE_FREQUENCY (gnc_frequency_get_type())
33 #define GNC_FREQUENCY(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, GNC_TYPE_FREQUENCY, GncFrequency)
34 #define GNC_FREQENCY_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, GNC_TYPE_FREQUENCY, GncFrequency)
35 #define GNC_IS_FREQUENCY(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, GNC_TYPE_FREQUENCY)
36 
43 typedef struct _GncFrequency
44 {
45  GtkVBox widget;
46  GtkVBox *vb;
47  GtkNotebook *nb;
48  GtkComboBox *freqComboBox;
49  GNCDateEdit *startDate;
50  GtkBuilder *builder;
51 } GncFrequency;
52 
53 typedef struct _GncFrequencyClass
54 {
55  GtkVBoxClass parent_class;
56 
57  void (*changed) (GncFrequency *gf);
59 
61 {
62  int idx;
63  UIFreqType uiFTVal;
64  char *name;
65 };
66 
67 GType gnc_frequency_get_type(void);
68 
72 GtkWidget* gnc_frequency_new(GList *recurrences, const GDate *start_date);
73 GtkWidget* gnc_frequency_new_from_recurrence(GList *recurrences, const GDate *start_date);
74 
75 void gnc_frequency_init(GncFrequency *gf);
76 
82 void gnc_frequency_setup(GncFrequency *gf, GList *recurrences, const GDate *start_date);
83 void gnc_frequency_setup_recurrence(GncFrequency *gf, GList *recurrences, const GDate *start_date);
84 
90 void gnc_frequency_save_to_recurrence(GncFrequency *gf, GList **recurrences, GDate *out_start_date);
91 
96 void gnc_frequency_set_frequency_label_text (GncFrequency *gf, const gchar *txt);
97 
102 void gnc_frequency_set_date_label_text (GncFrequency *gf, const gchar *txt);
103 
104 #endif /* !defined( GNC_FREQUENCY_H ) */
Period / Date Frequency Specification.