Fix some copyright headers
[claws.git] / src / addressitem.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
4  *
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.
9  *
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.
14  *
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/>.
17  * 
18  */
19
20 /*
21  * Address item data. Shared among GUI components only.
22  */
23
24 #ifndef __ADDRESSITEM_H__
25 #define __ADDRESSITEM_H__
26
27 #include <glib.h>
28 #include <gtk/gtk.h>
29
30 #include "compose.h"
31 #include "addrindex.h"
32
33 #define ADDRESS_OBJECT(obj)             ((AddressObject *)obj)
34 #define ADDRESS_OBJECT_TYPE(obj)        (ADDRESS_OBJECT(obj)->type)
35 #define ADDRESS_OBJECT_NAME(obj)        (ADDRESS_OBJECT(obj)->name)
36
37 #define ADAPTER_INTERFACE(obj)          ((AdapterInterface *)obj)
38 #define ADAPTER_FOLDER(obj)             ((AdapterFolder *)obj)
39 #define ADAPTER_GROUP(obj)              ((AdapterGroup *)obj)
40 #define ADAPTER_DSOURCE(obj)            ((AdapterDSource *)obj)
41
42 typedef enum {
43         ADDR_NONE,
44         ADDR_ITEM_PERSON,
45         ADDR_ITEM_EMAIL,
46         ADDR_ITEM_FOLDER,
47         ADDR_ITEM_GROUP,
48         ADDR_INTERFACE,
49         ADDR_DATASOURCE,
50         ADDR_BOOK,              /* Sub-type */
51         ADDR_VCARD,             /* Sub-type */
52         ADDR_JPILOT,            /* Sub-type */
53         ADDR_CATEGORY,          /* Sub-type */
54         ADDR_LDAP,              /* Sub-type */
55         ADDR_LDAP_QUERY         /* Sub-type */
56 } AddressObjectType;
57
58 typedef struct _AddressBook_win AddressBook_win;
59 struct _AddressBook_win
60 {
61         GtkWidget *window;
62         GtkWidget *hpaned;
63         GtkWidget *vpaned;
64         GtkWidget *menubar;
65         GtkWidget *ctree;
66         GtkWidget *ctree_swin;
67         GtkWidget *editaddress_vbox;
68         GtkWidget *clist;
69         GtkWidget *entry;
70         GtkWidget *label;
71         GtkWidget *statusbar;
72
73         GtkWidget *help_btn;
74         GtkWidget *edit_btn;
75         GtkWidget *del_btn;
76         GtkWidget *reg_btn;
77         GtkWidget *lup_btn;
78         GtkWidget *to_btn;
79         GtkWidget *cc_btn;
80         GtkWidget *bcc_btn;
81
82         GtkWidget *tree_popup;
83         GtkWidget *list_popup;
84
85         GtkCMCTreeNode *treeSelected;
86         GtkCMCTreeNode *opened;
87         GtkCMCTreeNode *listSelected;
88
89         Compose *target_compose;
90         gint status_cid;
91         GtkUIManager *ui_manager;
92 };
93
94 typedef struct _AddressTypeControlItem  AddressTypeControlItem;
95 struct _AddressTypeControlItem {
96         AddressObjectType objectType;
97         AddressIfType interfaceType;
98         gchar *displayName;
99         gboolean showInTree;
100         gboolean treeExpand;
101         gboolean treeLeaf;
102         gchar *menuCommand;
103         GdkPixbuf *iconXpm;
104         GdkPixbuf *iconXpmOpen;
105 };
106
107 typedef struct _AddressObject   AddressObject;
108 struct _AddressObject {
109         AddressObjectType type;
110         gchar *name;
111 };
112
113 typedef struct _AdapterInterface AdapterInterface;
114 struct _AdapterInterface {
115         AddressObject obj;
116         AddressInterface *interface;
117         AddressIfType interfaceType;
118         AddressTypeControlItem *atci;
119         gboolean enabled;
120         gboolean haveLibrary;
121         GtkCMCTreeNode *treeNode;
122 };
123
124 typedef struct _AdapterDSource AdapterDSource;
125 struct _AdapterDSource {
126         AddressObject obj;
127         AddressDataSource *dataSource;
128         AddressObjectType subType;
129 };
130
131 typedef struct _AdapterFolder AdapterFolder;
132 struct _AdapterFolder {
133         AddressObject obj;
134         ItemFolder *itemFolder;
135 };
136
137 typedef struct _AdapterGroup AdapterGroup;
138 struct _AdapterGroup {
139         AddressObject obj;
140         ItemGroup *itemGroup;
141 };
142
143 typedef struct _AddressFileSelection AddressFileSelection;
144 struct _AddressFileSelection {
145         GtkWidget *fileSelector;
146         gboolean cancelled;
147 };
148
149 AdapterDSource *addressbook_create_ds_adapter   ( AddressDataSource     *ds,
150                                                   AddressObjectType     otype,
151                                                   gchar                 *name );
152
153 void addressbook_ads_set_name           ( AdapterDSource *adapter,
154                                           gchar          *value );
155
156 ItemObjectType addressbook_type2item    ( AddressObjectType abType );
157
158 #endif /* __ADDRESSITEM_H__ */
159
160 /*
161 * End of Source.
162 */
163