New address book.
[claws.git] / src / addressitem.h
index 0886a9d87013d7cfd002fc393210d3dfaa6f4edf..80ceb9209d5acf59c26630b91e0488d219c99217 100644 (file)
  */
 
 /*
- * Address item data.
+ * Address item data. Shared among GUI components only.
  */
 
 #ifndef __ADDRESSITEM_H__
 #define __ADDRESSITEM_H__
 
+#include <glib.h>
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkctree.h>
+
+#include "compose.h"
+#include "addrindex.h"
+
 #define ADDRESS_OBJECT(obj)            ((AddressObject *)obj)
 #define ADDRESS_OBJECT_TYPE(obj)       (ADDRESS_OBJECT(obj)->type)
-#define ADDRESS_ITEM(obj)              ((AddressItem *)obj)
+#define ADDRESS_OBJECT_NAME(obj)       (ADDRESS_OBJECT(obj)->name)
 
-#define ADDRESS_ITEM_CAT_UNKNOWN -1
-
-typedef struct _AddressObject  AddressObject;
-typedef struct _AddressItem    AddressItem;
+#define ADAPTER_INTERFACE(obj)         ((AdapterInterface *)obj)
+#define ADAPTER_FOLDER(obj)            ((AdapterFolder *)obj)
+#define ADAPTER_GROUP(obj)             ((AdapterGroup *)obj)
+#define ADAPTER_DSOURCE(obj)           ((AdapterDSource *)obj)
 
-typedef enum
-{
-       ADDR_ITEM,
-       ADDR_GROUP,
-       ADDR_FOLDER,
-       ADDR_VCARD,
-       ADDR_JPILOT,
-       ADDR_CATEGORY,
-       ADDR_LDAP
+typedef enum {
+       ADDR_NONE,
+       ADDR_ITEM_PERSON,
+       ADDR_ITEM_EMAIL,
+       ADDR_ITEM_FOLDER,
+       ADDR_ITEM_GROUP,
+       ADDR_INTERFACE,
+       ADDR_DATASOURCE,
+       ADDR_BOOK,              // Sub-type
+       ADDR_VCARD,             // Sub-type
+       ADDR_JPILOT,            // Sub-type
+       ADDR_CATEGORY,          // Sub-type
+       ADDR_LDAP               // Sub-type
 } AddressObjectType;
 
-struct _AddressObject
+typedef struct _AddressBook_win        AddressBook_win;
+struct _AddressBook_win
 {
+       GtkWidget *window;
+       GtkWidget *menubar;
+       GtkWidget *ctree;
+       GtkWidget *clist;
+       GtkWidget *entry;
+       GtkWidget *statusbar;
+
+       GtkWidget *del_btn;
+       GtkWidget *reg_btn;
+       GtkWidget *lup_btn;
+       GtkWidget *to_btn;
+       GtkWidget *cc_btn;
+       GtkWidget *bcc_btn;
+
+       GtkWidget *tree_popup;
+       GtkWidget *list_popup;
+       GtkItemFactory *tree_factory;
+       GtkItemFactory *list_factory;
+       GtkItemFactory *menu_factory;
+
+       GtkCTreeNode *treeSelected;
+       GtkCTreeNode *opened;
+       GtkCTreeNode *listSelected;
+
+       Compose *target_compose;
+       gint status_cid;
+};
+
+typedef struct _AddressTypeControlItem AddressTypeControlItem;
+struct _AddressTypeControlItem {
+       AddressObjectType objectType;
+       AddressIfType interfaceType;
+       gchar *displayName;
+       gboolean showInTree;
+       gboolean treeExpand;
+       gboolean treeLeaf;
+       gchar *menuCommand;
+       GdkPixmap *iconXpm;
+       GdkBitmap *maskXpm;
+       GdkPixmap *iconXpmOpen;
+       GdkBitmap *maskXpmOpen;
+};
+
+typedef struct _AddressObject  AddressObject;
+struct _AddressObject {
        AddressObjectType type;
+       gchar *name;
 };
 
-struct _AddressItem
-{
+typedef struct _AdapterInterface AdapterInterface;
+struct _AdapterInterface {
        AddressObject obj;
+       AddressInterface *interface;
+       AddressIfType interfaceType;
+       AddressTypeControlItem *atci;
+       gboolean enabled;
+       gboolean haveLibrary;
+       GtkCTreeNode *treeNode;
+};
 
-       gchar *name;
-       gchar *address;
-       gchar *remarks;
-       gchar *externalID;
-       gint  categoryID;
+typedef struct _AdapterDSource AdapterDSource;
+struct _AdapterDSource {
+       AddressObject obj;
+       AddressDataSource *dataSource;
+       AddressObjectType subType;
+};
+
+typedef struct _AdapterFolder AdapterFolder;
+struct _AdapterFolder {
+       AddressObject obj;
+       ItemFolder *itemFolder;
+};
+
+typedef struct _AdapterGroup AdapterGroup;
+struct _AdapterGroup {
+       AddressObject obj;
+       ItemGroup *itemGroup;
+};
+
+typedef struct _AddressFileSelection AddressFileSelection;
+struct _AddressFileSelection {
+       GtkWidget *fileSelector;
+       gboolean cancelled;
 };
 
+AdapterDSource *addressbook_create_ds_adapter  ( AddressDataSource     *ds,
+                                                 AddressObjectType     otype,
+                                                 gchar                 *name );
+
+void addressbook_ads_set_name                  ( AdapterDSource        *adapter,
+                                                 gchar *value );
+
 #endif /* __ADDRESSITEM_H__ */
+
+/*
+* End of Source.
+*/
+