GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gncAddress.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gncAddress.h -- an Address object *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 2 of *
7  * the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License*
15  * along with this program; if not, contact: *
16  * *
17  * Free Software Foundation Voice: +1-617-542-5942 *
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19  * Boston, MA 02110-1301, USA [email protected] *
20  * *
21 \********************************************************************/
54 #ifndef GNC_ADDRESS_H_
55 #define GNC_ADDRESS_H_
56 
57 #include "qof.h"
58 #ifdef GNUCASH_MAJOR_VERSION
59 #include "gncBusiness.h"
60 #endif
61 
62 #define GNC_ADDRESS_MODULE_NAME "gncAddress"
63 #define GNC_ID_ADDRESS GNC_ADDRESS_MODULE_NAME
64 
79 typedef struct _gncAddress GncAddress;
80 typedef struct _gncAddressClass GncAddressClass;
81 
82 /* --- type macros --- */
83 #define GNC_TYPE_ADDRESS (gnc_address_get_type ())
84 #define GNC_ADDRESS(o) \
85  (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ADDRESS, GncAddress))
86 #define GNC_ADDRESS_CLASS(k) \
87  (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ADDRESS, GncAddressClass))
88 #define GNC_IS_ADDRESS(o) \
89  (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ADDRESS))
90 #define GNC_IS_ADDRESS_CLASS(k) \
91  (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ADDRESS))
92 #define GNC_ADDRESS_GET_CLASS(o) \
93  (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ADDRESS, GncAddressClass))
94 GType gnc_address_get_type(void);
95 
98 GncAddress *gncAddressCreate (QofBook *book, QofInstance *parent);
99 void gncAddressDestroy (GncAddress *addr);
100 void gncAddressBeginEdit (GncAddress *addr);
101 void gncAddressCommitEdit (GncAddress *addr);
102 
108 void gncAddressSetName (GncAddress *addr, const char *name);
109 void gncAddressSetAddr1 (GncAddress *addr, const char *addr1);
110 void gncAddressSetAddr2 (GncAddress *addr, const char *addr2);
111 void gncAddressSetAddr3 (GncAddress *addr, const char *addr3);
112 void gncAddressSetAddr4 (GncAddress *addr, const char *addr4);
113 void gncAddressSetPhone (GncAddress *addr, const char *phone);
114 void gncAddressSetFax (GncAddress *addr, const char *fax);
115 void gncAddressSetEmail (GncAddress *addr, const char *email);
116 void gncAddressClearDirty (GncAddress *address);
122 const char * gncAddressGetName (const GncAddress *addr);
123 const char * gncAddressGetAddr1 (const GncAddress *addr);
124 const char * gncAddressGetAddr2 (const GncAddress *addr);
125 const char * gncAddressGetAddr3 (const GncAddress *addr);
126 const char * gncAddressGetAddr4 (const GncAddress *addr);
127 const char * gncAddressGetPhone (const GncAddress *addr);
128 const char * gncAddressGetFax (const GncAddress *addr);
129 const char * gncAddressGetEmail (const GncAddress *addr);
132 gboolean gncAddressIsDirty (const GncAddress *addr);
133 
139 int gncAddressCompare (const GncAddress *a, const GncAddress *b);
140 
145 gboolean gncAddressEqual(const GncAddress *a, const GncAddress *b);
146 
147 #define ADDRESS_NAME "name"
148 #define ADDRESS_ONE "number"
149 #define ADDRESS_TWO "street"
150 #define ADDRESS_THREE "locality"
151 #define ADDRESS_FOUR "city"
152 #define ADDRESS_PHONE "phone"
153 #define ADDRESS_FAX "fax"
154 #define ADDRESS_EMAIL "email"
155 #define ADDRESS_OWNER "owner"
156 
157 #endif /* GNC_ADDRESS_H_ */
158 
int gncAddressCompare(const GncAddress *a, const GncAddress *b)
compare two addresses
Definition: gncAddress.c:569
gboolean gncAddressEqual(const GncAddress *a, const GncAddress *b)
Deeply compare two addresses.
Definition: gncAddress.c:579