2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2001-2012 Match Grun and the Claws Mail team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef __ADDRITEM_H__
25 #define __ADDRITEM_H__
30 #define ADDRITEM_OBJECT(obj) ((AddrItemObject *)obj)
31 #define ADDRITEM_TYPE(obj) (ADDRITEM_OBJECT(obj)->type)
32 #define ADDRITEM_NAME(obj) (ADDRITEM_OBJECT(obj)->name)
33 #define ADDRITEM_ID(obj) (ADDRITEM_OBJECT(obj)->uid)
34 #define ADDRITEM_PARENT(obj) (ADDRITEM_OBJECT(obj)->parent)
35 #define ADDRITEM_SUBTYPE(obj) (ADDRITEM_OBJECT(obj)->subType)
53 ADDRFOLDER_QUERY_RESULTS
63 typedef struct _AddrItemObject AddrItemObject
;
64 struct _AddrItemObject
{
68 AddrItemObject
*parent
;
72 typedef struct _ItemPerson ItemPerson
;
86 typedef struct _ItemEMail ItemEMail
;
93 typedef struct _UserAttribute UserAttribute
;
94 struct _UserAttribute
{
100 typedef struct _ItemFolder ItemFolder
;
104 gboolean isRoot
; /* TRUE if root folder */
105 GList
*listItems
; /* Used for temporary items only */
106 GList
*listFolder
; /* List of contained (child) folders */
107 GList
*listPerson
; /* List of contained persons */
108 GList
*listGroup
; /* List of contained (child) groups */
109 AddressFolderType folderType
; /* Folder type */
110 gpointer
*folderData
; /* Pointer to folder's data */
111 gboolean isHidden
; /* TRUE if folder is hidden */
114 typedef struct _ItemGroup ItemGroup
;
121 /* Function prototypes */
122 ItemEMail
*addritem_create_item_email ( void );
123 ItemEMail
*addritem_copy_item_email ( ItemEMail
*item
);
124 ItemEMail
*addritem_copyfull_item_email ( ItemEMail
*item
);
125 void addritem_email_set_alias ( ItemEMail
*email
, const gchar
*value
);
126 void addritem_email_set_address ( ItemEMail
*email
, const gchar
*value
);
127 void addritem_email_set_remarks ( ItemEMail
*email
, const gchar
*value
);
128 void addritem_free_item_email ( ItemEMail
*item
);
130 UserAttribute
*addritem_create_attribute( void );
131 UserAttribute
*addritem_copy_attribute ( UserAttribute
*item
);
132 void addritem_attrib_set_id ( UserAttribute
*item
, const gchar
*value
);
133 void addritem_attrib_set_name ( UserAttribute
*item
, const gchar
*value
);
134 void addritem_attrib_set_value ( UserAttribute
*item
, const gchar
*value
);
135 void addritem_free_attribute ( UserAttribute
*item
);
137 ItemPerson
*addritem_create_item_person ( void );
138 ItemPerson
*addritem_copy_item_person ( ItemPerson
*item
);
139 void addritem_person_set_picture ( ItemPerson
*person
, const gchar
*value
);
140 gchar
*addritem_person_get_picture ( ItemPerson
*person
);
141 void addritem_person_set_first_name ( ItemPerson
*person
, const gchar
*value
);
142 void addritem_person_set_last_name ( ItemPerson
*person
, const gchar
*value
);
143 void addritem_person_set_nick_name ( ItemPerson
*person
, const gchar
*value
);
144 void addritem_person_set_common_name ( ItemPerson
*person
, const gchar
*value
);
145 void addritem_person_set_external_id ( ItemPerson
*person
, const gchar
*value
);
146 void addritem_person_set_opened ( ItemPerson
*person
, const gboolean value
);
147 void addritem_free_item_person ( ItemPerson
*person
);
148 void addritem_free_list_email ( GList
*list
);
149 void addritem_free_list_attribute ( GList
*list
);
151 ItemGroup
*addritem_create_item_group ( void );
152 ItemGroup
*addritem_copy_item_group ( ItemGroup
*item
);
153 void addritem_free_item_group ( ItemGroup
*group
);
154 void addritem_group_set_name ( ItemGroup
*group
, const gchar
*value
);
156 void addritem_print_item_email ( ItemEMail
*item
, FILE *stream
);
157 void addritem_print_item_person ( ItemPerson
*person
, FILE *stream
);
158 void addritem_print_item_group ( ItemGroup
*group
, FILE *stream
);
159 void addritem_print_item_folder ( ItemFolder
*folder
, FILE *stream
);
161 gboolean
addritem_person_add_email ( ItemPerson
*person
, ItemEMail
*email
);
162 ItemEMail
*addritem_person_remove_email ( ItemPerson
*person
, ItemEMail
*email
);
164 void addritem_person_add_attribute ( ItemPerson
*person
, UserAttribute
*attrib
);
165 void addritem_person_remove_attribute ( ItemPerson
*person
, const gchar
*attrib
);
167 ItemFolder
*addritem_create_item_folder ( void );
168 ItemFolder
*addritem_copy_item_folder ( ItemFolder
*item
);
169 void addritem_folder_set_name ( ItemFolder
*folder
, const gchar
*value
);
170 void addritem_folder_set_remarks ( ItemFolder
*folder
, const gchar
*value
);
171 void addritem_folder_set_hidden ( ItemFolder
*folder
, const gboolean value
);
172 void addritem_free_item_folder ( ItemFolder
*folder
);
174 gboolean
addritem_group_add_email ( ItemGroup
*group
, ItemEMail
*email
);
176 gboolean
addritem_folder_add_person ( ItemFolder
*folder
, ItemPerson
*item
);
177 ItemPerson
*addritem_folder_remove_person( ItemFolder
*group
, ItemPerson
*person
);
179 gboolean
addritem_folder_add_folder ( ItemFolder
*folder
, ItemFolder
*item
);
180 gboolean
addritem_folder_add_group ( ItemFolder
*folder
, ItemGroup
*item
);
181 GList
*addritem_folder_get_person_list ( ItemFolder
*folder
);
182 GList
*addritem_folder_get_group_list ( ItemFolder
*folder
);
184 void addritem_parse_first_last ( ItemPerson
*person
);
185 GList
*addritem_folder_path ( const ItemFolder
*folder
,
186 const gboolean seq
);
187 gchar
*addritem_format_email ( ItemEMail
*email
);
189 #endif /* __ADDRITEM_H__ */