aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authornobody <nobody@localhost>2003-06-29 00:20:00 +0800
committernobody <nobody@localhost>2003-06-29 00:20:00 +0800
commit6205e8cad4ef2c93093b06e579ad26bd6b6505bd (patch)
treee521429188462e4446c632b5bd4b6f333e589995 /addressbook
parent5a8e20476b93515b8e69f7e1c8f659ab3dc55a8f (diff)
downloadgsoc2013-evolution-GDM2_2_4_4_0.tar
gsoc2013-evolution-GDM2_2_4_4_0.tar.gz
gsoc2013-evolution-GDM2_2_4_4_0.tar.bz2
gsoc2013-evolution-GDM2_2_4_4_0.tar.lz
gsoc2013-evolution-GDM2_2_4_4_0.tar.xz
gsoc2013-evolution-GDM2_2_4_4_0.tar.zst
gsoc2013-evolution-GDM2_2_4_4_0.zip
This commit was manufactured by cvs2svn to create tag 'GDM2_2_4_4_0'.GDM2_2_4_4_0
svn path=/tags/GDM2_2_4_4_0/; revision=21592
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/.cvsignore6
-rw-r--r--addressbook/ChangeLog64
-rw-r--r--addressbook/ChangeLog.pre-1-416758
-rw-r--r--addressbook/E-CARD-NEEDED-FIELDS9
-rw-r--r--addressbook/Makefile.am9
-rw-r--r--addressbook/backend/.cvsignore6
-rw-r--r--addressbook/backend/Makefile.am1
-rw-r--r--addressbook/backend/ebook/.cvsignore25
-rw-r--r--addressbook/backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in29
-rw-r--r--addressbook/backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in29
-rw-r--r--addressbook/backend/ebook/Makefile.am186
-rw-r--r--addressbook/backend/ebook/TODO2
-rw-r--r--addressbook/backend/ebook/docs/rfc2047.txt843
-rw-r--r--addressbook/backend/ebook/docs/rfc2425.txt1851
-rw-r--r--addressbook/backend/ebook/docs/rfc2426.txt2355
-rw-r--r--addressbook/backend/ebook/docs/vcard-21.txt1544
-rw-r--r--addressbook/backend/ebook/e-book-listener.c797
-rw-r--r--addressbook/backend/ebook/e-book-listener.h110
-rw-r--r--addressbook/backend/ebook/e-book-marshal.list5
-rw-r--r--addressbook/backend/ebook/e-book-types.h53
-rw-r--r--addressbook/backend/ebook/e-book-util.c808
-rw-r--r--addressbook/backend/ebook/e-book-util.h94
-rw-r--r--addressbook/backend/ebook/e-book-view-listener.c449
-rw-r--r--addressbook/backend/ebook/e-book-view-listener.h82
-rw-r--r--addressbook/backend/ebook/e-book-view.c352
-rw-r--r--addressbook/backend/ebook/e-book-view.h63
-rw-r--r--addressbook/backend/ebook/e-book.c1700
-rw-r--r--addressbook/backend/ebook/e-book.h170
-rw-r--r--addressbook/backend/ebook/e-card-compare.c706
-rw-r--r--addressbook/backend/ebook/e-card-compare.h72
-rw-r--r--addressbook/backend/ebook/e-card-cursor.c239
-rw-r--r--addressbook/backend/ebook/e-card-cursor.h53
-rw-r--r--addressbook/backend/ebook/e-card-pairs.h118
-rw-r--r--addressbook/backend/ebook/e-card-simple.c1344
-rw-r--r--addressbook/backend/ebook/e-card-simple.h234
-rw-r--r--addressbook/backend/ebook/e-card-types.h101
-rw-r--r--addressbook/backend/ebook/e-card.c2807
-rw-r--r--addressbook/backend/ebook/e-card.h209
-rw-r--r--addressbook/backend/ebook/e-destination.c1695
-rw-r--r--addressbook/backend/ebook/e-destination.h140
-rw-r--r--addressbook/backend/ebook/e-vcard.c925
-rw-r--r--addressbook/backend/ebook/e-vcard.h108
-rw-r--r--addressbook/backend/ebook/evolution-ldif-importer.c592
-rw-r--r--addressbook/backend/ebook/evolution-vcard-importer.c214
-rw-r--r--addressbook/backend/ebook/load-gnomecard-addressbook.c77
-rw-r--r--addressbook/backend/ebook/load-pine-addressbook.c159
-rw-r--r--addressbook/backend/ebook/test-card.c193
-rw-r--r--addressbook/backend/ebook/test-client-list.c65
-rw-r--r--addressbook/backend/ebook/test-client.c191
-rw-r--r--addressbook/backend/ebook/tests/.cvsignore2
-rw-r--r--addressbook/backend/ebook/tests/Makefile.am1
-rw-r--r--addressbook/backend/ebook/tests/vcard/.cvsignore3
-rw-r--r--addressbook/backend/ebook/tests/vcard/1.vcf12
-rw-r--r--addressbook/backend/ebook/tests/vcard/10.vcf12
-rw-r--r--addressbook/backend/ebook/tests/vcard/2.vcf10
-rw-r--r--addressbook/backend/ebook/tests/vcard/3.vcf13
-rw-r--r--addressbook/backend/ebook/tests/vcard/4.vcf11
-rw-r--r--addressbook/backend/ebook/tests/vcard/5.vcf32
-rw-r--r--addressbook/backend/ebook/tests/vcard/6.vcf12
-rw-r--r--addressbook/backend/ebook/tests/vcard/7.vcf11
-rw-r--r--addressbook/backend/ebook/tests/vcard/8.vcf11
-rw-r--r--addressbook/backend/ebook/tests/vcard/9.vcf9
-rw-r--r--addressbook/backend/ebook/tests/vcard/Makefile.am6
-rw-r--r--addressbook/backend/ebook/tests/vcard/README41
-rw-r--r--addressbook/backend/ebook/tests/vcard/dump-vcard.c32
-rw-r--r--addressbook/backend/idl/.cvsignore6
-rw-r--r--addressbook/backend/idl/Makefile.am4
-rw-r--r--addressbook/backend/idl/addressbook.idl214
-rw-r--r--addressbook/backend/pas/.cvsignore13
-rw-r--r--addressbook/backend/pas/Makefile.am101
-rw-r--r--addressbook/backend/pas/TODO2
-rw-r--r--addressbook/backend/pas/evolutionperson.schema212
-rw-r--r--addressbook/backend/pas/pas-backend-card-sexp.c489
-rw-r--r--addressbook/backend/pas/pas-backend-card-sexp.h55
-rw-r--r--addressbook/backend/pas/pas-backend-file.c1617
-rw-r--r--addressbook/backend/pas/pas-backend-file.h32
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c3555
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.h32
-rw-r--r--addressbook/backend/pas/pas-backend-summary.c1092
-rw-r--r--addressbook/backend/pas/pas-backend-summary.h70
-rw-r--r--addressbook/backend/pas/pas-backend.c518
-rw-r--r--addressbook/backend/pas/pas-backend.h140
-rw-r--r--addressbook/backend/pas/pas-book-factory.c595
-rw-r--r--addressbook/backend/pas/pas-book-factory.h53
-rw-r--r--addressbook/backend/pas/pas-book-view.c269
-rw-r--r--addressbook/backend/pas/pas-book-view.h64
-rw-r--r--addressbook/backend/pas/pas-book.c1026
-rw-r--r--addressbook/backend/pas/pas-book.h194
-rw-r--r--addressbook/backend/pas/pas-card-cursor.c139
-rw-r--r--addressbook/backend/pas/pas-card-cursor.h56
-rw-r--r--addressbook/backend/pas/pas-marshal.list1
-rw-r--r--addressbook/conduit/.cvsignore9
-rw-r--r--addressbook/conduit/Makefile.am42
-rw-r--r--addressbook/conduit/address-conduit.c1908
-rw-r--r--addressbook/conduit/e-address.conduit.in9
-rw-r--r--addressbook/gui/.cvsignore6
-rw-r--r--addressbook/gui/Makefile.am1
-rw-r--r--addressbook/gui/component/.cvsignore14
-rw-r--r--addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in123
-rw-r--r--addressbook/gui/component/Makefile.am107
-rw-r--r--addressbook/gui/component/addressbook-component.c641
-rw-r--r--addressbook/gui/component/addressbook-component.h32
-rw-r--r--addressbook/gui/component/addressbook-config.c1766
-rw-r--r--addressbook/gui/component/addressbook-config.h36
-rw-r--r--addressbook/gui/component/addressbook-storage.c731
-rw-r--r--addressbook/gui/component/addressbook-storage.h82
-rw-r--r--addressbook/gui/component/addressbook.c1182
-rw-r--r--addressbook/gui/component/addressbook.h17
-rw-r--r--addressbook/gui/component/apps_evolution_addressbook.schemas42
-rw-r--r--addressbook/gui/component/component-factory.c72
-rw-r--r--addressbook/gui/component/e-address-popup.c1258
-rw-r--r--addressbook/gui/component/e-address-popup.h88
-rw-r--r--addressbook/gui/component/e-address-widget.c559
-rw-r--r--addressbook/gui/component/e-address-widget.h82
-rw-r--r--addressbook/gui/component/e-cardlist-model.c229
-rw-r--r--addressbook/gui/component/e-cardlist-model.h42
-rw-r--r--addressbook/gui/component/ldap-config.glade2664
-rw-r--r--addressbook/gui/component/select-names/.cvsignore15
-rw-r--r--addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl114
-rw-r--r--addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in31
-rw-r--r--addressbook/gui/component/select-names/Makefile.am115
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.c651
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.h66
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c1207
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.h68
-rw-r--r--addressbook/gui/component/select-names/e-select-names-factory.c59
-rw-r--r--addressbook/gui/component/select-names/e-select-names-factory.h30
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.c775
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.h70
-rw-r--r--addressbook/gui/component/select-names/e-select-names-marshal.list3
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.c829
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.h91
-rw-r--r--addressbook/gui/component/select-names/e-select-names-popup.c395
-rw-r--r--addressbook/gui/component/select-names/e-select-names-popup.h36
-rw-r--r--addressbook/gui/component/select-names/e-select-names-section.etspec7
-rw-r--r--addressbook/gui/component/select-names/e-select-names-table-model.c369
-rw-r--r--addressbook/gui/component/select-names/e-select-names-table-model.h51
-rw-r--r--addressbook/gui/component/select-names/e-select-names-text-model.c847
-rw-r--r--addressbook/gui/component/select-names/e-select-names-text-model.h53
-rw-r--r--addressbook/gui/component/select-names/e-select-names.c845
-rw-r--r--addressbook/gui/component/select-names/e-select-names.etspec7
-rw-r--r--addressbook/gui/component/select-names/e-select-names.h103
-rw-r--r--addressbook/gui/component/select-names/e-simple-card-bonobo.c216
-rw-r--r--addressbook/gui/component/select-names/e-simple-card-bonobo.h71
-rw-r--r--addressbook/gui/component/select-names/recipient.glade45
-rw-r--r--addressbook/gui/component/select-names/select-names.glade452
-rw-r--r--addressbook/gui/contact-editor/.cvsignore11
-rw-r--r--addressbook/gui/contact-editor/Makefile.am60
-rw-r--r--addressbook/gui/contact-editor/contact-editor.glade2317
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.c603
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.h71
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.c284
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-fullname.h71
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-marshal.list2
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c2753
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.h136
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c465
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.h40
-rw-r--r--addressbook/gui/contact-editor/e-contact-save-as.c218
-rw-r--r--addressbook/gui/contact-editor/e-contact-save-as.h41
-rw-r--r--addressbook/gui/contact-editor/fulladdr.glade446
-rw-r--r--addressbook/gui/contact-editor/fullname.glade674
-rw-r--r--addressbook/gui/contact-editor/test-editor.c142
-rw-r--r--addressbook/gui/contact-list-editor/.cvsignore6
-rw-r--r--addressbook/gui/contact-list-editor/Makefile.am55
-rw-r--r--addressbook/gui/contact-list-editor/contact-list-editor.glade313
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list4
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c1044
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.etspec7
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.h107
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.c260
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.h52
-rw-r--r--addressbook/gui/merging/.cvsignore7
-rw-r--r--addressbook/gui/merging/Makefile.am25
-rw-r--r--addressbook/gui/merging/e-card-duplicate-detected.glade212
-rw-r--r--addressbook/gui/merging/e-card-merging-book-commit-duplicate-detected.glade212
-rw-r--r--addressbook/gui/merging/e-card-merging.c198
-rw-r--r--addressbook/gui/merging/e-card-merging.h29
-rw-r--r--addressbook/gui/search/.cvsignore7
-rw-r--r--addressbook/gui/search/Makefile.am27
-rw-r--r--addressbook/gui/search/addresstypes.xml83
-rw-r--r--addressbook/gui/search/e-addressbook-search-dialog.c159
-rw-r--r--addressbook/gui/search/e-addressbook-search-dialog.h65
-rw-r--r--addressbook/gui/widgets/.cvsignore19
-rw-r--r--addressbook/gui/widgets/Makefile.am167
-rw-r--r--addressbook/gui/widgets/e-addressbook-marshal.list11
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c697
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.h85
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.c518
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.h47
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c413
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.h44
-rw-r--r--addressbook/gui/widgets/e-addressbook-treeview-adapter.c627
-rw-r--r--addressbook/gui/widgets/e-addressbook-treeview-adapter.h44
-rw-r--r--addressbook/gui/widgets/e-addressbook-util.c635
-rw-r--r--addressbook/gui/widgets/e-addressbook-util.h65
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c2081
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.etspec51
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.h149
-rw-r--r--addressbook/gui/widgets/e-minicard-control.c357
-rw-r--r--addressbook/gui/widgets/e-minicard-control.h8
-rw-r--r--addressbook/gui/widgets/e-minicard-label.c508
-rw-r--r--addressbook/gui/widgets/e-minicard-label.h86
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.c449
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.h73
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c585
-rw-r--r--addressbook/gui/widgets/e-minicard-view.h94
-rw-r--r--addressbook/gui/widgets/e-minicard-widget-test.c117
-rw-r--r--addressbook/gui/widgets/e-minicard-widget.c264
-rw-r--r--addressbook/gui/widgets/e-minicard-widget.h76
-rw-r--r--addressbook/gui/widgets/e-minicard.c1093
-rw-r--r--addressbook/gui/widgets/e-minicard.h125
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.c85
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.h35
-rw-r--r--addressbook/gui/widgets/gal-view-factory-treeview.c86
-rw-r--r--addressbook/gui/widgets/gal-view-factory-treeview.h35
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.c220
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.h45
-rw-r--r--addressbook/gui/widgets/gal-view-treeview.c227
-rw-r--r--addressbook/gui/widgets/gal-view-treeview.h43
-rw-r--r--addressbook/gui/widgets/test-minicard-label.c129
-rw-r--r--addressbook/gui/widgets/test-minicard-view.c203
-rw-r--r--addressbook/gui/widgets/test-minicard.c120
-rw-r--r--addressbook/gui/widgets/test-reflow.c199
-rw-r--r--addressbook/printing/.cvsignore9
-rw-r--r--addressbook/printing/Makefile.am57
-rw-r--r--addressbook/printing/e-contact-print-envelope.c247
-rw-r--r--addressbook/printing/e-contact-print-envelope.h32
-rw-r--r--addressbook/printing/e-contact-print-style-editor.c149
-rw-r--r--addressbook/printing/e-contact-print-style-editor.h73
-rw-r--r--addressbook/printing/e-contact-print-types.h73
-rw-r--r--addressbook/printing/e-contact-print.c1236
-rw-r--r--addressbook/printing/e-contact-print.glade2018
-rw-r--r--addressbook/printing/e-contact-print.h36
-rw-r--r--addressbook/printing/medbook.ecps30
-rw-r--r--addressbook/printing/phonelist.ecps29
-rw-r--r--addressbook/printing/smallbook.ecps30
-rw-r--r--addressbook/printing/test-contact-print-style-editor.c93
-rw-r--r--addressbook/printing/test-print.c88
-rw-r--r--addressbook/tools/.cvsignore3
-rw-r--r--addressbook/tools/Makefile.am33
-rw-r--r--addressbook/tools/evolution-addressbook-export-list-cards.c780
-rw-r--r--addressbook/tools/evolution-addressbook-export-list-folders.c99
-rw-r--r--addressbook/tools/evolution-addressbook-export.c162
-rw-r--r--addressbook/tools/evolution-addressbook-export.h81
245 files changed, 0 insertions, 96251 deletions
diff --git a/addressbook/.cvsignore b/addressbook/.cvsignore
deleted file mode 100644
index 09980ae6ba..0000000000
--- a/addressbook/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
deleted file mode 100644
index 801f39ac6c..0000000000
--- a/addressbook/ChangeLog
+++ /dev/null
@@ -1,64 +0,0 @@
-2003-06-25 Gilbert Fang <gilbert.fang@sun.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_real_focus_in_event): new function,
- override the event handler for focus_in_event, set the first item
- be focused if no focused item at all. Fixes bug 41826.
-
-2003-06-18 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (fill_in_field): in the
- EUrlEntry case just reassign widget. it'll be handled by the
- GtkEditable code below. Fixes #43841.
-
-2003-06-14 Larry Ewing <lewing@ximian.com>
-
- * gui/backend/ebook/e-card-simple.c:
- * gui/backend/ebook/e-card.c:
- * gui/backend/ebook/evolution-ldif-importer.c:
- * gui/backend/ebook/load-pine-addressbook.c:
- * gui/backend/ebook/test-card.c:
- * gui/backend/pas/pas-backend-card-sexp.c:
- * gui/backend/pas/pas-backend-ldap.c: Fix lots of leaks, update
- for correct use of g_object_get. Some cleanups.
-
-2003-06-13 Larry Ewing <lewing@ximian.com>
-
- * gui/component/addressbook.c:
- * gui/component/e-cardlist-model.c:
- * gui/component/select-names/e-select-names-text-model.c:
- * gui/contact-editor/e-contact-editor.c:
- * gui/contact-editor/e-contact-save-as.c:
- * gui/contact-list-editor/e-contact-list-editor.c:
- * gui/widgets/e-addressbook-table-adapter.c:
- * gui/widgets/e-addressbook-util.c:
- * gui/widgets/e-addressbook-view.c:
- * gui/widgets/e-minicard-view.c:
- * gui/widgets/e-minicard.c: Fix lots of leaks, update for correct
- use of g_object_get. Some misc cleanups.
-
- * printing/e-contact-print.c: update for correct use of
- g_object_get.
-
-2003-06-05 Not Zed <NotZed@Ximian.com>
-
- ** For #42691.
-
- * gui/component/select-names/Makefile.am (%.server.in): implicit
- rule for .in file.
- (BUILT_SOURCES): added server_DATA.
-
- * gui/component/Makefile.am (%.server.in): use implicit rule for
- .in file.
- (BUILT_SOURCES): added, just server_DATA.
- (CLEANFILES): added
-
- * backend/ebook/Makefile.am (BUILT_SOURCES): add server_DATA.
-
-2003-06-04 Rodrigo Moya <rodrigo@ximian.com>
-
- * backend/ebook/ebook.c (e_book_do_response_open): adapted to
- changes in EComponentListener API.
-
-** See ChangeLog.pre-1-4 for older changes
-
diff --git a/addressbook/ChangeLog.pre-1-4 b/addressbook/ChangeLog.pre-1-4
deleted file mode 100644
index b1c12cb82f..0000000000
--- a/addressbook/ChangeLog.pre-1-4
+++ /dev/null
@@ -1,16758 +0,0 @@
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (func_beginswith): use the more
- convoluted (but more correct) query if evolutionPerson is
- supported. Fixes #42825.
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-destination.c (use_default_book_cb): handle the
- case where @book == NULL, which can happen if there was a problem
- opening the default book. Should fix #43005.
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (ensure_completion_uris_exist): fix the initial run case. the
- config upgrade code creates all elements so we can't just check
- for NULL - we have to check if the string is empty. Fixes #43213.
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (set_colors): if we've got focus,
- set the background of the rect to bg[NORMAL], and the fill color
- of the text and label to text[NORMAL]. This will make the
- background a different color than the canvas, but won't make it
- use the selected background. fixes #42472
-
-2003-05-19 Chris Toshok <toshok@ximian.com>
-
- * gui/merging/e-card-merging.c (e_card_merging_book_commit_card):
- add a g_object_ref(card), to match the one in
- e_card_merging_book_add_card. Fixes #43175.
-
-2003-05-19 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c: Added HIG-appropriate
- HIG-appropriate spacing, padding, accelerators. Fixes bug #41210
-
- * gui/component/ldap-config.glade: HIG-ified the various dialogs
- (including the settings pages, the config druid, and the edit dialog)
- in this glade file. This fixes bugs #41140, #41137, #41130
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- Changed button order, and added HIG-appropriate spacing/padding.
- Fixes bug #41232.
-
- * gui/merging/e-card-duplicate-detected.glade: Changed button
- order, and added HIG-appropriate spacing/padding. Fixes bug
- #41229 and #41231.
-
-2003-05-19 Sean Gao <sean.gao@sun.com>
-
- * gui/component/addressbook-component.c (xfer_folder): remove the
- summary if @remove_source is TRUE. Fixes 38084.
-
-2003-05-16 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: Added
- HIG-appropriate spacing, padding, capitalization and accelerators.
- Fixes bug #41254
-
-2003-05-16 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/fulladdr.glade: Added HIG-appropriate
- spacing, padding, capitalization and accelerators. Fixes bug #41251
-2003-05-14 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/fullname.glade: Added HIG-appropriate
- spacing, padding, caps, title and accelerators. Fixes bug #41249,
- and also bug #41250..
-
-2003-05-16 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Added HIG-appropriate
- spacing, padding, capitalization and accelerators. Fixes bug #41248.
-
-
-2003-05-16 Rodney Dawes <dobey@ximian.com>
-
- * addressbook/backend/ebook/Makefile.am: Move the tools to a
- more appropriate directory, privlibexecdir
-
-2003-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): backing out a tiny
- porting of jpr's fix - we need to set the book on the
- EAddressbookView, or else it won't do queries, and it won't show
- any cards. Fixes #43023, #43090.
-
-2003-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/merging/e-card-merging.c (free_lookup): new function, split
- out the duplicated teardown code from final_cb and final_id_cb.
- also, unref the card.
- (final_id_cb): call free_lookup.
- (final_cb): same.
- (e_card_merging_book_add_card): ref the card. fixes bug #43016.
-
-2003-05-14 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (full_addr_clicked):
- replace the text_buffer_delete/text_buffer_insert with
- set_buffer_set_text. call widget_changed if they clicked OK, so
- we actually mark the dialog changed.
- (fill_in_field): make this handle GtkTextViews, because for some
- reason that escapes rational thought GtkTextView's don't implement
- GtkEditable. fixes #42606.
- (extract_field): same.
-
-2003-05-14 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_reflow): set
- the clip_height on reflow so the name of the field is as high as
- the field's value. makes it possible to click anywhere to the
- left of a tall field (like an address) and have it select the
- field. Fixes #42625.
-
-2003-05-14 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (address_mailing_changed):
- handle the case where we haven't filled in the address yet. fixes
- #42620.
-
-2003-05-14 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook.c (addressbook_view_unref): clear the
- view
- (book_open_cb): track the book in the view, don't unref the book
- (set_prop): set the book
- (retrieve_shell_view_interface_from_control): get the shell view
- every time
- (set_folder_bar_label): release and unref the shell view
-
- * gui/component/addressbook-storage.h: add proto
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_cleanup): unref the storage
-
- * gui/component/addressbook-component.c (owner_unset_cb): clean up
- storage
-
- * backend/ebook/e-book.c (e_book_load_uri): track the listener
- signal
- (e_book_dispose): unref the listener and disconnect the signal
-
-2003-05-13 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_set_separator): strlen ->
- g_utf8_strlen.
- (e_select_names_text_model_insert): same.
- (e_select_names_text_model_insert_length): big change, make this
- work with multibyte utf8.
- (e_select_names_text_model_delete): same. this could possibly use
- a tighter loop + a memmove, but this works.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_get_textification): make sure our truncation
- to MAX_LENGTH characters uses utf8 characters, not bytes.
- (e_select_names_model_name_pos): track e-text-model change.
- pos/length are now in utf8 character terms, so use g_utf8_strlen
- instead of strlen.
- (e_select_names_model_text_pos): same.
-
-2003-05-13 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_dispose):
- rename addressbook_destroy to this, and guard against multiple
- calls.
- (e_addressbook_table_adapter_class_init): GtkObject -> GObject,
- and destroy -> dispose.
- (e_addressbook_table_adapter_init): GtkObject -> GObject.
-
-2003-05-12 Sean Gao <sean.gao@sun.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): terminate g_build_filename with
- NULL.
-
-2003-05-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #42048 ]
- * gui/widgets/e-addressbook-view.c (e_contact_print_button):
- button => response.
- (e_addressbook_view_print): connect to "response", not "clicked".
-
-2003-05-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41245 ]
- * gui/component/select-names/select-names.glade: fix
- spacing/border widths as per HIG.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): set the border width/spacing on widgets we
- create here.
-
-2003-05-09 Jeremy Katz <katzj@redhat.com>
-
- * printing/e-contact-print.c (e_contact_print_response): Use glib
- macro to case from pointer to int.
-
- * printing/e-contact-print-envelope.c: Add missing #include.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): Use
- E_SELECT_NAMES_COMPLETION to avoid warning
-
-2003-05-06 Chris Toshok <toshok@ximian.com>
-
- [ really commit this, fixes bug #41910 ]
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_remove_row): change from model_changed to
- row_deleted here. model_changed causes the table to free its
- ETableSelection, which is what we iterate over when deleting
- contacts.
- (e_contact_list_model_add_destination): no need to be calling
- model_changed here either.
-
-2003-04-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41255 ]
- * gui/contact-list-editor/contact-list-editor.glade: use stock
- buttons for Add/Remove.
-
-2003-04-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41144 ]
- * gui/component/ldap-config.glade: use stock buttons for the
- Add/Delete buttons. Switch from "Delete" to "Remove", though, as
- "Remove" fits much better with the one for "Add". Also, add our
- stock-edit-24.png icon for "Edit".
-
-2003-04-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41211 ]
- * gui/component/e-address-popup.c (e_address_popup_no_matches):
- call e_button_new_with_stock_icon to create our button and give it
- the right icon.
-
-2003-04-29 Gilbert Fang <gilbert.fang@sun.com>
-
- * tools/evolution-addressbook-export-list-cards.c
- (set_pre_defined_field): remove duplicate HOME_COUNTRY field add.
-
-2003-04-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41843]
- * tools/evolution-addressbook-export-list-cards.c
- (e_card_simple_csv_get_name): use e_card_simple_get_ecard_field
- instead of e_card_simple_get_name, so the return value won't be
- localized.
-
-2003-04-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #41779 ]
- * gui/component/e-address-popup.c (mini_wizard_container_add): we
- don't need to call gtk_widget_destroy on the old child, since
- gtk_container_remove will unref it for us.
-
-2003-04-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #37351 ]
- * gui/widgets/e-addressbook-view.c (table_drag_data_get): the row
- the signal is called with is already the model row, not the view
- row, so don't call e_table_view_to_model_row on it.
-
-2003-04-23 Chris Toshok <toshok@ximian.com>
-
- [ either mostly or entirely fixes #33708 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_done): new function, factor it out of
- _seq_complete_cb because we need to run the same code in a couple
- of places.
- (e_select_names_completion_got_book_view_cb): treat an error from
- a book as getting a "sequence_complete", and decrement the count
- of pending complete signals.
- (e_select_names_completion_got_book_view_cb): remove the increment
- of pending_completion_seq from here.
- (e_select_names_completion_seq_complete_cb): factor out the body
- of e_select_names_completion_done from here, and call it.
- (e_select_names_completion_start_query): increment
- pending_completion_seq here. remove the async variable, as we can
- now use pending_completion_seq for that purpose (it's > 0 iff
- async would have been TRUE).
-
-2003-04-19 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40954 ]
- * backend/pas/pas-backend-file.c (pas_backend_file_dispose): guard
- against NULL bf->priv->summary (happens if the initial load_uri
- failed).
- (pas_backend_file_load_uri): always set bf->priv->uri, since it's
- used in _get_uri, which is called when the backend goes away.
- This only happened before if you tried to load a folder that
- didn't exist.
-
-2003-04-19 Chris Toshok <toshok@ximian.com>
-
- [ fixes #40694 ]
- * gui/component/select-names/e-select-names-bonobo.c
- (control_activate_cb): just grab focus if @activate == TRUE.
- we'll do all merging/unmerging in the focus handler.
- (widget_focus_cb): handle the merging here.
- (e_bonobo_control_automerge_ui): store off the widget (so we can
- grab focus on it) and connect to "activate".
-
-2003-04-18 Rodney Dawes <dobey@ximian.com>
-
- * gui/component/select-names/Makefile.am: Add missing -DPREFIX
-
-2003-04-18 Rodney Dawes <dobey@ximian.com>
-
- [ fixes #21499 ]
- * gui/component/Makefile.am:
- * gui/component/addressbook.c:
- * gui/component/select-names/e-select-names-bonobo.c:
- * gui/contact-editor/Makefile.am:
- * gui/contact-editor/e-contact-editor.c:
- * gui/contact-list-editor/Makefile.am:
- * gui/contact-list-editor/e-contact-list-editor.c:
- Use PREFIX instead of EVOLUTION_DATADIR for bonobo_ui_util_set_ui ()
-
-2003-04-15 Chris Toshok <toshok@ximian.com>
-
- [ fixes #41252 ]
- * gui/contact-editor/fulladdr.glade: change title from "Check
- Address" to "Full Address".
-
-2003-04-09 Chris Toshok <toshok@ximian.com>
-
- [ fixes #40727 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): if the query text is
- either shorter than the cached query_text or they don't match,
- don't just set can_reuse_cached_cards to FALSE. we also need to
- invalidate the cache.
-
-2003-04-08 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/e-destination.c (d): Remove all debugging
- messages.
-
-2003-04-08 Dan Winship <danw@ximian.com>
-
- * gui/component/ldap-config.glade: Remove color specifications
- from the druid so it will use theme colors.
-
- * gui/component/addressbook-config.c
- (addressbook_add_server_druid): Use g_signal_connect_after for
- "prepare" signal (to work around b.g.o 81869)
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ fixes #7103 ]
- * gui/widgets/e-minicard-label.c (e_minicard_label_class_init):
- init style_set. and add the signal.
- (e_minicard_label_realize): include e_minicard_label_construct's
- code here, and call set_colors after we create the sub-items.
- (e_minicard_label_unrealize): indent, and remove dead code.
- (e_minicard_label_event): indent, and call set_colors instead of
- setting the colors manually.
- (set_colors): new function, set our colors based on the current
- style.
- (e_minicard_label_style_set): new function, just call set_colors.
- (e_minicard_label_new): e_minicard_label_construct doesn't exist
- anymore.
-
- * gui/widgets/e-minicard-label.h (struct _EMinicardLabelClass):
- add style_set signal.
-
- * gui/widgets/e-minicard.c (set_selected): little tweaks in the
- coloring.
- (e_minicard_unrealize): reindent, and remove some unused code.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): add background.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): init
- widget_class->style_class.
- (e_minicard_view_widget_style_set): new function, just set the
- background's fill_color_gdk to base[GTK_STATE_NORMAL].
- (e_minicard_view_widget_realize): store off the background canvas
- item so we can set the color later.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40901 ]
- * gui/component/ldap-config.glade: HIG-ify the ldap server edit
- dialog's button layout.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39763 ]
- * gui/component/select-names/e-select-names-bonobo.c (copy_cb):
- verb callback for EditCopy
- (cut_cb): verb callback for EditCut.
- (paste_cb): verb callback for EditPaste.
- (select_all_cb): verb callback for SelectAll.
- (free_closure): new function
- (merge_menu_items): same
- (unmerge_menu_items): same
- (control_set_frame_cb): same
- (control_activate_cb): same
- (widget_focus_cb): same
- (e_bonobo_control_automerge_ui): new function, sets up focus
- signals on the widget passed in to merge/unmerge the passed in
- ui/verbs.
- (impl_SelectNames_get_entry_for_section): call
- e_bonobo_control_automerge_ui for this entry.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (mini_wizard_new): change the
- ok/cancel button layout to be higified.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- [ last portion of #40046 fix ]
- * gui/component/select-names/e-select-names-popup.c
- (remove_recipient_cb): ifdef this out to quiet the compiler.
- (remove_all_recipients_cb): same.
- (toggle_html_mail_cb): same.
- (populate_popup_card): change the #if 0 to #if
- TOO_MANY_MENU_ITEMS.
- (popup_menu_list): nuke, as it's handled by populate_popup_card.
- (populate_popup_nocard): rename popup_menu_nocard to this, and
- implement it as in populate_popup_card.
- (e_select_names_populate_popup): we don't need the card, since we
- don't check if it's a list here anymore. also, remove the #if 0
- surrounding the nocard case.
-
-2003-04-07 Not Zed <NotZed@Ximian.com>
-
- Fixes #40252.
-
- * conduit/address-conduit.c: Change the LOG macro to a
- single arg macro which copies its arg. Fix all callers. Change
- WARN and INFO to simply g_warning/g_message. Init G_LOG_DOMAIN
- before including anything.
-
-2003-04-07 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): add tools.
-
-2003-04-07 Gilbert Fang <gilbert.fang@sun.com>
-
- [ fixes bug #23036 ]
- * tools/evolution-addressbook-export.c,
- tools/evolution-addressbook-export-list-cards.c,
- tools/evolution-addressbook-export-list-folders.c: : new and
- improved export utility.
-
-2003-04-07 Dan Winship <danw@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.server.in.in: Clean up
- server names.
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- Likewise
-
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in:
- Likewise. Also mark the evolution:menu_name for i18n.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- Likewise
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_event): set
- "handle_popup" on the field to be TRUE if it's got focus, FALSE if
- not.
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- doh, set the im_context on the field name too so we get the Input
- Method submenu in the contxt menu.
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct): set
- the im_context on the field's EText.
- (e_minicard_label_event): remove a huge swath of #if 0'd code.
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40715 ]
- * gui/merging/e-card-merging.c (final_id_cb): add this callback,
- to unref the book/free the closure after calling the user's
- callback.
- (final_cb): same.
- (doit): use final{_id}_cb
- (cancelit): same.
- (response): don't free the lookup struct here.
- (match_query_callback): same.
- (e_card_merging_book_add_card): ref the book.
- (e_card_merging_book_commit_card): same.
-
- * gui/component/e-address-popup.c (card_picker_init): make sure to
- set the "text" attribute on the cell renderer so the text actually
- shows up. also, g_object_connect -> g_signal_connect *sigh*.
- Lastly, get rid of the scrolled window and just make the window
- size to show the text.
-
- * gui/widgets/e-minicard.c (e_minicard_style_set): only call
- set_selected if we're realized (we create all the canvas objects
- that set_selected manipulates in our realize method.)
-
-2003-04-03 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/Makefile.am (INCLUDES): add
- EVOLUTION_IMAGESDIR
-
-2003-04-02 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c: change all
- this around so that we populate the existing popup. This means we
- get the select names popup stuff on top of the normal EEntry popup
- foo.
-
- * gui/component/select-names/e-select-names-popup.h
- (e_select_names_populate_popup): rename e_select_names_popup to
- this.
-
- * gui/component/select-names/e-select-names-manager.c
- (populate_popup_cb): rename popup_cb here, and
- e_select_names_popup -> e_select_names_populate_popup.
- (e_select_names_manager_entry_new): popup -> populate_popup.
-
-2003-04-02 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-marshal.list: add NONE:OBJECT
-
- * gui/widgets/e-minicard.c (e_minicard_class_init): add style_set
- signal.
- (e_minicard_style_set): just call set_selected with the currently
- selected flag, so we recolor properly.
-
- * gui/widgets/e-minicard.h (struct _EMinicardClass): add style_set
- signal.
-
-2003-04-01 Rodrigo Moya <rodrigo@ximian.com>
-
- * backend/ebook/evolution-ldif-importer.c (load_file_fn):
- * backend/ebook/evolution-vcard-importer.c (load_file_fn): added
- "folder_type" parameter to EvolutionImporterLoadFileFn.
-
-2003-03-31 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c (get_local_book_uri): new function,
- just return the local uri.
- (set_default_book_uri_local): use get_local_book_uri.
- (e_book_default_book_open): only try and reload the default book
- if it's not already the local book.
-
-2003-03-31 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (card_removed): it emits a list now
-
-2003-03-31 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Remove folder-selector button
- initialization.
- (e_select_names_new): Initialize folder-selector button here,
- using the passed-in EvolutionShellClient rather than depending on
- a global variable.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): take an
- EvolutionShellClient and pass it to e_select_names_new().
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_activate_dialog): get a pointer to the shell
- from bonobo-activation, create a shell_client, and pass it to
- e_select_names_manager_activate_dialog.
-
- * backend/ebook/e-book-util.c (e_book_get_default_book_uri):
- constify return value
-
-2003-03-30 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-vcard.[ch]: braindead, and *extremely* forgiving
- vcard parser. not for public consumption yet.
-
-2003-03-30 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39381 (again) ]
- * gui/component/e-address-popup.c (edit_contact_info_cb): add
- "GtkWidget *button" first arg, so we don't crash.
-
-2003-03-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40403 ]
- * backend/ebook/e-card.c (e_card_get_vobject): revert the fix for
- 28945, as was done on the 1.2 branch. this is because the "fix"
- actually breaks internal use of contact lists. We need to make
- the exporting of contacts DTRT, instead of fixing it here.
-
-2003-03-28 Chris Toshok <toshok@ximian.com>
-
- [ fix the contact editor so that the only time the address is
- parsed is when the user types in the address GtkTextView. ]
- * gui/contact-editor/e-contact-editor.c (address_mailing_changed):
- make this use delivery addresses instead of labels.
- (full_addr_clicked): same.
- (find_address_mailing): same.
-
- * backend/ebook/e-card-simple.c
- (e_card_simple_set_delivery_address): make this operate similar to
- e_card_simple_set_address: it sets both the delivery address and
- the label for the address.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #19178 ]
- * backend/ebook/evolution-ldif-importer.c (ebook_open): use
- e_book_load_address_book_by_uri on the passed in uri.
- (load_file_fn): pass the uri.
-
- * backend/ebook/evolution-vcard-importer.c (ebook_open): use
- e_book_load_address_book_by_uri on the passed in uri.
- (load_file_fn): pass the uri.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34651 ]
- * gui/component/select-names/e-select-names.c
- (select_entry_changed): strcmp -> g_utf8_collate.
- (update_query): encode the string we pass for the query.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34085 ]
- * gui/contact-list-editor/e-contact-list-editor.c
- (table_drag_data_received_cb): only successfully complete the drag
- if they dropped a valid vcard (or vcard list). Call
- gtk_drag_finish.
-
-2003-03-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): $evolution_uidir
- -> $evolutionuidir
-
-2003-03-26 Philip Zhao <philip.zhao@sun.com>
-
- [ fixes bug #39170 ]
- * backend/pas/pas-backend.c (pas_backend_create_card): remove
- 'return'.
- (pas_backend_remove_cards): same.
- (pas_backend_modify_card): same.
- (pas_backend_check_connection): same.
- (pas_backend_get_vcard): same.
- (pas_backend_get_cursor): same.
- (pas_backend_get_book_view): same.
- (pas_backend_get_completion_view): same.
- (pas_backend_get_changes): same.
- (pas_backend_authenticate_user): same.
- (pas_backend_get_supported_fields): same.
- (pas_backend_get_supported_auth_methods): same.
-
-2003-03-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): append the
- second line to the address if necessary
- (ecard_from_remote_record): split the address line in two if
- necessary
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: set the
- dialog to "Visible: No" so it doesn't flash when we bring it up.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #40026 ]
- * gui/contact-editor/e-contact-editor.c (set_field): add
- EContactEditor arg, and block/unblock signals around the
- gtk_entry_set_text, since that generates a "changed" signal which
- causes problems.
- (set_phone_field): take and pass along an EContactEditor arg.
- (set_fields): pass editor to set_field.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/arrow.png: nuke.
-
- * gui/contact-editor/Makefile.am (EXTRA_DIST): remove images_DATA
- (images_DATA): nuke, don't need it anymore.
-
- * gui/contact-editor/e-contact-editor.c
- (connect_arrow_button_signal): rename _replace_button to this. we
- no longer create an image, as it's a GtkArrow in the .glade file
- now.
- (connect_arrow_button_signals): rename _replace_buttons to this.
- no longer pass the arrow.png's to _replace_button.
- (e_contact_editor_init): _replace_buttons ->
- connect_arrow_button_signals.
- (_arrow_pressed): remove some dead code, and some args that aren't
- used.
- (_phone_arrow_pressed): track change to _arrow_pressed.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #31786 ]
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fix some gtk warnings.
- (set_advanced_button_state): the advanced dialog isn't present in
- the glade file anymore, so ifdef everything dealing with it.
- (addressbook_edit_server_dialog): same.
-
- * gui/component/ldap-config.glade: remove all the unused Advanced
- UI stuff to lessen the amount of strings needing translation.
-
-2003-03-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #32113 ]
- * backend/ebook/e-destination.h: add include_email arg to
- e_destination_get_textrep.
-
- * backend/ebook/e-destination.c (e_destination_get_textrep): add
- include_email arg. if it's TRUE, and if there's an email address to
- add
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_value_at): use e_destination_get_textrep so we don't
- display QP text, and pass TRUE for include_email.
-
- * gui/widgets/e-minicard.c (add_field): same.
- (remodel): same.
-
- * gui/widgets/e-addressbook-treeview-adapter.c (adapter_get_value): same.
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_value_at): same.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): pass FALSE for
- include_email.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_get_textification): pass FALSE for
- include_email.
- (e_select_names_model_get_string): same.
- (e_select_names_model_replace): same.
- (e_select_names_model_name_pos): same.
- (e_select_names_model_text_pos): same.
-
-2003-03-19 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- Replace "evolution:menu-name" prop with "evolution:menu_name". [#39692]
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in: Likewise.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-table-model.c
- (e_select_names_table_model_col_count): up the column count by one
- for the underline.
- (e_select_names_table_model_value_at): add handling for underline.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (email_menu_add_option): fix use
- of deprecated gtk_menu_append.
- (card_picker_selection_changed): change this to be used with the
- "changed" signal on GtkTreeSelection.
- (free_str): yeah, gross. i know.
- (card_picker_init): this needed some fixing, so the strings don't
- go away after we insert them into the model. also, connect to the
- "changed" GtkTreeSelection signal instead of using the nonexistant
- gtk_tree_selection_set_func.
- (e_address_popup_construct): gtk_style_unref -> g_object_unref.
- (popup_size_allocate_cb): nuke.
- (e_address_popup_ambiguous_email_add): use gtk_window_set_position
- and let the window manager place the window instead of doing it
- ourself.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- [ Fixes addressbook bug #39730 ]
- * gui/component/ldap-config.glade: add response ids to the search
- base dialog.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_destroy): use g_object_unref, not
- gtk_widget_destroy, on the GladeXML.
- (addressbook_add_server_druid): call gtk_window_set_type_hint
- GDK_WINDOW_TYPE_HINT_DIALOG so this window looks like a dialog.
- (editor_modify_cb): no more apply button.
- (edit_dialog_apply_clicked): nuked.
- (edit_dialog_close_clicked): rename to _cancal_clicked.
- (edit_dialog_ok_clicked): call gtk_widget_destroy here instead of
- calling _cancel_clicked.
- (addressbook_edit_server_dialog): no more apply button, and
- close_button -> cancel_button. Also, set the hint to
- GDK_WINDOW_TYPE_HINT_DIALOG.
- (ldap_dialog_new): fix compiler warning.
- (addressbook_dialog_create_sources_table): same.
-
-2003-03-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-section.etspec: use
- alternating-row-colors="false"
-
- * gui/component/select-names/e-select-names.h: nuke prototypes for
- e_select_names_get_source/section.
-
- * gui/component/select-names/e-select-names.c (set_book): remove
- the signal disconnect from here.
- (addressbook_model_set_uri): same.
- (e_select_names_init): connect to the search_result signal on the
- addressbook model.
- (e_select_names_child_free): disconnect the changed_id signal.
- (e_select_names_add_section): set the underline column so the
- recipient tables look like they did when they were EEntry.
- (e_select_names_add_section): store off the changed_id.
- (e_select_names_get_section): nuke.
- (e_select_names_get_source): nuke.
-
-2003-03-18 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (addrconduit_load_configuration): kill
- warning by sinking objects
-
-2003-03-18 Not Zed <NotZed@Ximian.com>
-
- * gui/component/select-names/e-select-names.c (set_book,
- addressbook_model_set_uri): disconnect/keep track of search result
- signal id.
- (e_select_names_init): Keep track of various signals, particularly
- status signal.
- (e_select_names_dispose): disconnect from any signals that are
- still active. Fixes crash for #38202.
-
-2003-03-13 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): use set_entry_changed_signal_email
- for the email entry so the email gets saved out.
- (set_entry_changed_signal_email): new function, analogous to
- set_entry_changed_signal_phone, but for email.
-
-2003-03-12 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #20210 ]
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): change "Edit Contact Info" to "View Contact
- Info", as you can't always edit the contact (if the book is read
- only).
- (popup_menu_list): same, but for a contact list.
-
-2003-03-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #39507 ]
- * gui/component/select-names/e-select-names.c (search_result): new
- function, sync the models after we do a search.
- (addressbook_model_set_uri): connect to search_result.
-
-2003-03-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): fix compiler warnings about deprecated
- functions.
- (e_select_names_child_free): unref the table model.
- (remove_address): re-enable.
- (section_right_click_cb): this is an ETable callback now.
- (e_select_names_add_section): remove a gross gross awful hack, and
- make the recipient tables ETables instead EEntry's. We lose the
- nice underlining, but we can add that back in as another ETable
- style (like strikeout and bold), and we also fix the longstanding
- scrolling problems (like bug #25148) and can finally remove
- addresses by double clicking on them (which is also a bug
- someplace I think.. dunno the # offhand.)
-
- * gui/component/select-names/e-select-names-table-model.c
- (clear_info): always set the count to -1, regardless of what
- model->data is.
-
- * gui/component/select-names/e-select-names-model.c: remove some
- unused enums.
-
- * gui/component/select-names/Makefile.am (etspec_DATA): add
- e-select-names-section.etspec
-
- * gui/component/select-names/e-select-names-section.etspec: new
- file, spec for the To:/Cc:/Bcc: etable's in the select-names
- dialog.
-
-2003-03-11 Not Zed <NotZed@Ximian.com>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): Updated phone
- number. Bug #37204.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_send_card_list):
- re-enable in build, include e-destination.h. For #39256.
-
-2003-03-06 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/load-pine-addressbook.c (ebook_create): Likewise.
- * backend/ebook/load-gnomecard-addressbook.c (ebook_create): Likewise.
- * backend/ebook/evolution-vcard-importer.c (ebook_create): Likewise.
- * backend/ebook/evolution-ldif-importer.c (ebook_create): Likewise.
- * backend/ebook/test-client.c (get_cursor_cb): Likewise.
- (ebook_create): Likewise.
- * gui/widgets/e-minicard.c (e_minicard_set_property): Likewise.
- (card_modified_cb): Likewise.
- (e_minicard_event): Likewise.
- * gui/widgets/gal-view-minicard.c (column_width_changed): Likewise.
- * gui/widgets/test-minicard-view.c (ebook_create): Likewise.
- * gui/widgets/gal-view-treeview.c (column_width_changed): Likewise.
-
-2003-03-05 Not Zed <NotZed@Ximian.com>
-
- * gui/component/addressbook-component.c (bonobo_main_quit_cb):
- removed.
- (owner_unset_cb): Basically a noop, the shell does the quit, we
- just note we have no owner anymore.
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- Fixes #37881
-
- * gui/component/select-names/e-simple-card-bonobo.c
- (impl_SimpleCard_get): if we get a null value, send back the empty
- string
-
-2003-03-04 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/e-select-names.etspec: reflect prior column addition
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): set the arg properly
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- add Icscalendar to field list
-
- * backend/pas/pas-backend-ldap.c: add icscalendar to prop list
-
- * backend/ebook/e-card.h: add icscalendar data member
-
- * backend/ebook/e-card.c: add icscalendar to list and its parse
- routine
- (e_card_get_vobject): add icscalendar prop value
- (parse_icscalendar): parse routine
- (e_card_class_init): add icscalendar arg
- (e_card_destroy): destroy icscalendar member
- (e_card_set_arg): set icscalendar
- (e_card_init): init icscalendar
- (e_card_get_arg): return icscalendar
-
- * backend/ebook/e-card-simple.c (field_data): add icscalendar
-
- * backend/ebook/e-card-simple.h: ditto
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_new): Don't set the "modal" property through
- g_object_new().
- (e_select_names_init): Explictly make the dialog modal here.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (create_minicard_view): No need
- to do any reparenting here; the widget is created with no parent.
-
-2003-03-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Instead of using gtk_widget_unparent(),
- remove the widget from the container using gtk_container_remove().
- This fixes a bunch of crashers in all the places using the
- ESelectNames widget/control.
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * gui/contact-editor/Makefile.am: Build libecontacteditor as an
- uninstalled shared library.
-
- * gui/contact-list-editor/Makefile.am: Likewise for
- libecontactlisteditor
-
- * gui/merging/Makefile.am: and libecardmerging
-
- * gui/search/Makefile.am: and libeaddressbooksearch
-
- * gui/widgets/Makefile.am: and libeminicard
-
- * printing/Makefile.am: and libecontactprint
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- Update for new library names (and get rid of libtool portability
- warnings).
-
-2003-02-28 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send, e_card_send): Remove
- these from here; talking to the mailer doesn't really belong at
- the libebook level anyway.
-
- * backend/ebook/Makefile.am: Remove Evolution-Composer CORBA
- stuff, which fixes some linking problems on OS X.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_send_card_list,
- e_addressbook_send_card): Move from e-card.c and rename.
-
- * gui/widgets/Makefile.am: move Evolution-Composer CORBA stuff
- here
-
- * gui/widgets/e-addressbook-view.c (send_as, send_to,
- e_addressbook_view_send, e_addressbook_view_send_to): Update for
- new function names.
-
- * gui/contact-list-editor/e-contact-list-editor.c (file_send_as_cb,
- file_send_to_cb): Likewise
-
- * gui/contact-editor/e-contact-editor.c (file_send_as_cb,
- file_send_to_cb): Likewise
-
-2003-02-27 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): use g_signal_connect
- here, not swapped... although since we pass the widget as the
- closure it really doesn't matter.
- (load_uri_auth_cb): use a GtkDialog here.
- (search_result): same.
-
- * gui/component/select-names/e-simple-card-bonobo.h: add prototype
- for e_simple_card_bonobo_construct to fix warning.
-
- * gui/widgets/e-addressbook-view.c (create_alphabet): remove call
- to gtk_widget_set_usize.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): gtk_window_set_policy =>
- gtk_window_set_resizable.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): same.
-
-2003-02-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: link to libversit libtool object
-
-2003-02-27 Rodney Dawes <dobey@ximian.com>
-
- * backend/ebook/Makefile.am: Fix for server files from Antonio Xu
-
-2003-02-26 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_load_uri): if we fail to activate
- factories for a given protocol, return.
-
- * gui/component/ldap-config.glade: remove the two unused custom
- widgets to cut down on gtk warning spam.
-
-2003-02-21 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am (libebook_la_LIBADD): depend on
- libversit.la, libcamel.la, libename.la, and libeutil.la.
- (test_client_LDADD, test_client_list_LDADD, test_card_LDADD,
- evolution_vcard_importer_LDADD, evolution_ldif_importer_LDADD,
- load_pine_addressbook_LDADD, load_gnomecard_addressbook_LDADD):
- Remove those dependencies from here, since they're pulled in by
- libebook.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- Remove libebook's dependencies
-
- * gui/component/select-names/Makefile.am
- (libeselectnames_la_LIBADD): add this
-
- * gui/widgets/Makefile.am (various disabled *_test_LDADD): cleanup
-
- * printing/Makefile.am (contact_print_test_LDADD,
- contact_print_style_editor_test_LDADD): cleanup
-
-2003-02-20 Dan Winship <danw@ximian.com>
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- s/libemiscwidgets.a/libemiscwidgets.la/
-
- * gui/widgets/Makefile.am: Likewise (in a bunch of commented-out
- test programs)
-
-2003-02-19 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-model.c: Make parent_class static.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: Likewise
-
- * gui/widgets/e-addressbook-table-adapter.c: Likewise
-
-2003-02-19 Chris Toshok <toshok@ximian.com>
-
- [ fix #38074 ]
- * gui/component/e-address-popup.c (add_contacts_cb): first arg is
- a GtkWidget. duh.
-
-2003-02-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/contact-editor/Makefile.am (INCLUDES): Use $(evolutionuidir)
- instead of $(evolution_uidir). [Pointed out by Grzegorz Goawski.]
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): if we can complete solely
- from our cached cards, call e_completion_end_search from here when
- we're done.
-
-2003-02-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (ensure_completion_uris_exist): plug memory leak (always free
- val).
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_search_timeout): move the bulk of the
- non-summary searching stuff here. we aggregate up to our
- threshold, then send them to the front end and register a timeout
- to do another batch. This keeps us from totally spamming the UI,
- making things a bit more responsive.
- (pas_backend_file_search): set up the closure and call the timeout
- in an idle func.
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): indent properly.
-
-2003-02-16 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (unlink_model):
- disconnect search_started and search_result.
- (addressbook_compare): if we're loading, just compare model
- positions (so we just append while loading).
- (remove_card): use e_reflow_model_item_removed.
- (search_started): new function, set loading = TRUE.
- (search_result): new function, set loading = FALSE and emit
- "comparison_changed".
- (e_addressbook_reflow_adapter_init): init loading and the new
- signal ids.
- (e_addressbook_reflow_adapter_construct): connect "search_started"
- and "search_result".
-
- * gui/widgets/e-addressbook-model.h (struct
- _EAddressbookModelClass): add search_started signal.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_class_init): new signal "search_started".
- (book_view_loaded): emit "search_started" after "model_changed".
- (remove_card): simplify this, and use CARD_REMOVED all the time,
- instead of just in the single card case.
-
-2003-02-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_search_timeout): split out the bulk of the
- non-summary searching logic to here. we do 1 "card_threshold"
- sized lump per timeout.
- (pas_backend_file_search): use pas_backend_file_search_timeout.
-
-2003-02-10 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #33066 ]
- * gui/contact-editor/e-contact-editor.c
- (set_urlentry_changed_signal_field): new function
- (set_entry_changed_signals): call
- set_urlentry_changed_signal_field for entry-web, entry-caluri, and
- entry-fburl.
- (fill_in_field): add handling for EUrlEntry's.
- (extract_field): same.
- (enable_widget): same.
- (e_contact_editor_create_date): show the widget.
- (e_contact_editor_create_web): same, create a url entry.
- (set_urlentry_changed_signal_field): new function
-
- * gui/contact-editor/contact-editor.glade: entry-web,
- entry-caluri, and entry-fburl are all custom widgets now.
-
-2003-02-10 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am: Install load-pine-addressbook and
- load-gnomecard-addressbook into ${privdatadir}/tools. Install
- evolution-vcard-importer and evolution-ldif-importer into
- ${privlibexecdir}.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in:
- Removed.
-
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in:
- Removed.
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in:
- New. Specify an absolute path for the executable, using
- @LIBEXECDIR@.
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in:
- Likewise.
-
-2003-02-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (sexp_initials): gone.
- (match_initials): gone.
- (book_query_sexp): remove the primary handling.
- (book_query_score): same.
-
- * backend/ebook/e-card.c (e_card_set_property):
- g_value_get_pointer => g_value_get_object for "category_list".
-
- * backend/ebook/e-book.c (struct _EBookPrivate): add a comment.
-
- * backend/pas/pas-backend-ldap.c (func_beginswith): performance at
- the cost of a tiny bit of correctness. If the ldap server doesn't
- support evolutionPerson don't query on fileAs, use sn (since
- that's effectively what gets used in the display when fileAs isn't
- supported.)
-
-2003-02-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: lots of
- changes here. should be a big performance gain. god i hope this
- is finally right.
-
-2003-02-08 Chris Toshok <toshok@ximian.com>
-
- [ huge change, all for 1 little performance problem :) fixes #18207 ]
- * gui/widgets/e-addressbook-model.c (get_view): use
- e_book_check_static_capability here to make things a little
- prettier.
- (remove_card): complain about my life, and add code to use one
- "model_changed" signal if we get back a list of cards instead of
- multiple "card_removed" signals.
-
- * gui/widgets/e-addressbook-model.h: little clean up.
-
- * gui/widgets/e-addressbook-view.c (delete): write a bulk-remove
- case for this. if the backend supports it, send all the ids at
- once. otherwise loop over the ids.
- (e_addressbook_view_delete_selection): fake a CardAndBook
- structure and call delete, instead of duplicating the code in 2
- places.
-
- * gui/component/addressbook.c (delete_contact_cb): don't call
- e_contact_editor_confirm_delete here, it's handled by the
- EAddressbookView.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_construct): fix a
- compiler warning about a stupid crash.
-
- * backend/pas/pas-book.h (PASOperation): RemoveCard ->
- RemoveCards.
- (PASRemoveCardsReques): char *id -> GList *ids.
- (PASRequest): PASRemoveCardRequest -> PASRemoveCardsRequest.
-
- * backend/pas/pas-book.c (pas_book_queue_remove_cards): build up a
- GList from the id sequence.
- (pas_book_respond_remove): notifyCardRemoved ->
- notifyCardsRemoved.
- (impl_GNOME_Evolution_Addressbook_Book_removeCards): rename.
- (pas_book_free_request): free the idlist for RemoveCards.
- (pas_book_class_init): removeCard -> removeCards.
-
- * backend/pas/pas-book-view.h: change prototype for
- pas_book_view_notify_remove, and add prototype for
- pas_book_view_notify_remove_1.
-
- * backend/pas/pas-book-view.c (pas_book_view_notify_remove_1):
- build up a list and call pas_book_view_notify_remove.
- (pas_book_view_notify_remove): build up the corba id sequence and
- call BookViewListener::notifyCardsRemoved.
-
- * backend/pas/pas-backend.h: remove_card -> remove_cards.
-
- * backend/pas/pas-backend.c (pas_backend_remove_cards): rename
- from _remove_card.
- (process_client_requests): RemoveCard -> RemoveCards and
- _remove_card -> _remove_cards.
-
- * backend/pas/pas-backend-ldap.c (check_schema_support):
- g_strcasecmp -> g_ascii_strcasecmp.
- (remove_card_handler): _remove => _remove_1.
- (modify_card_modify_handler): same.
- (pas_backend_ldap_process_remove_cards): rename from _remove_card.
- (pas_backend_ldap_class_init): _remove_card -> _remove_cards.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_class_init):
- remove_card -> remove_cards.
- (pas_backend_file_get_static_capabilities): add "bulk-removes".
- (pas_backend_file_process_remove_cards): rewrite this function
- largely, so that it handles lists of ids. first we loop through
- and for every successful deletion we build a list of deleted
- ECards. Then for each view we build a list (a subset of the
- deleted ECard list) and pass back that list to the view.
- (pas_backend_file_process_modify_card): use _remove_1 instead of
- _remove.
- (ecard_matches_search): new function.
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_match_vcard): rewrite in terms of
- _match_ecard.
- (pas_backend_card_sexp_match_ecard): new function, the guts from
- _match_vcard.
-
- * backend/pas/pas-backend-card-sexp.h: add prototype for
- pas_backend_card_sexp_match_ecard.
-
- * backend/idl/addressbook.idl: the card removal stuff now takes
- CardIdList.
-
- * backend/ebook/e-book.c (e_book_get_static_capabilities): cache
- successful capability queries (since they're static).
- (e_book_check_static_capability): new, convenience function to
- check if a particular capability is supported.
- (e_book_remove_card_by_id): build a single element GList and call
- e_book_remove_cards.
- (e_book_remove_cards): build up a CORBA sequence from the GList
- and call Book::removeCards.
- (e_book_dispose): free the cached capabilities string.
-
- * backend/ebook/e-book.h: add new prototypes for
- e_book_check_static_capability and e_book_remove_cards.
-
- * backend/ebook/e-book-view.h (struct _EBookViewClass): rename
- "card_removed" signal to "cards_removed".
-
- * backend/ebook/e-book-view.c (e_book_view_do_removed_event): id
- -> ids, and free the id list.
- (e_book_view_check_listener_queue): CardRemovedEvent ->
- CardsRemovedEvent.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): free the id list.
- (e_book_view_listener_queue_idlist_event): new function, used for
- cards_removed.
- (e_book_view_listener_queue_status_event): id -> ids.
- (e_book_view_listener_queue_sequence_event): same.
- (e_book_view_listener_queue_message_event): same.
- (impl_BookViewListener_notify_cards_removed): call
- queue_idlist_event.
- (e_book_view_listener_dispose): free the id list.
- (e_book_view_listener_class_init): track change to idl call.
-
- * backend/ebook/e-book-view-listener.h
- (EBookViewListenerOperation): CardRemovedEvent ->
- CardsRemovedEvent.
- (EBookViewListenerResponse): char *id -> GList *ids.
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_remove_cards): rename from remove_card.
-
-2003-02-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c (email_table_save_card_cb):
- check the status, not the book, and unref the book here.
- (contact_editor_cb): same.
- (start_query): unref the book in the failure case.
- (add_card_idle_cb): addressbook_load_default_book returns void
- now.
- (edit_contact_info_cb): same.
- (e_address_popup_query): same.
-
- * gui/component/addressbook.c (control_activate_cb): track change
- to addressbook_load_uri return type.
- (set_prop): same.
- (addressbook_load_uri): return type is void now.
- (addressbook_load_default_book): same.
-
- * gui/component/addressbook.h:
- addressbook_load_uri/addressbook_load_default_book return void
- now.
-
- * conduit/address-conduit.c (start_addressbook_server):
- e_book_load_default_book returns void now.
-
- * backend/ebook/e-book-util.h: track changes to return types.
-
- * backend/ebook/e-book-util.c (e_book_load_address_book_by_uri):
- fallout from change to e_book_load_uri. return type for this
- function is void now too.
- (e_book_use_address_book_by_uri): same.
- (e_book_use_default_book): same.
- (e_book_load_default_book): same.
- (got_uri_book_cb): if unsuccessful and book is non-NULL, unref it
- here.
- (got_default_book_cb): same.
-
- * backend/ebook/e-book.c (e_book_load_uri): no longer return a
- gboolean. any error is communicated to the callback.
-
- * backend/ebook/e-book.h: e_book_load_uri no longer returns a
- gboolean (it's void.)
-
- * backend/ebook/evolution-ldif-importer.c (ebook_create): track
- change to the e_book_load_uri family of functions.
-
- * backend/ebook/test-client-list.c (ebook_create): same.
-
- * backend/ebook/test-client.c (ebook_create): same.
-
- * backend/ebook/load-pine-addressbook.c (ebook_create): same.
-
- * backend/ebook/evolution-vcard-importer.c (ebook_create): same.
-
-2003-02-06 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am (e-book-marshal.c, e-book-marshal.h):
- Use different tmp file names so these rules can be executed in
- parallel without interfering with each otehr.
-
- * backend/pas/Makefile.am: Make the ORBit compilation work
- properly with parallel makes (i.e. make sure it does not spawn
- multiple orbit-idl processes on the same IDL file at the same
- time).
- * gui/component/select-names/Makefile.am: Likewise.
- * backend/ebook/Makefile.am: Likewise.
-
-2003-02-06 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-config.c (main):
- s/PACKAGE/GETTEXT_PACKAGE/ in gettext setup.
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am (INCLUDES): Remove cruft.
- (libebookincludedir): Use privincludedir.
-
- * backend/ebook/e-book-util.c: #include <string.h>
- * backend/ebook/e-card-compare.c: Likewise
- * backend/ebook/load-pine-addressbook.c: Likewise
- * backend/ebook/test-client.c: Likewise
-
- * backend/ebook/evolution-vcard-importer.c: #include
- <e-book-util.h>
- (factory_fn): Fix this to actually return the importer.
-
- * backend/ebook/evolution-ldif-importer.c (parseLine): #include
- <e-book-util.h> and <bonobo/bonobo-main.h>. Use g_ascii_strcmp.
-
- * backend/ebook/e-card.c (e_card_email_match_single_string):
- (e_card_email_find_number): s/g_str/g_ascii_str/
- * backend/ebook/e-destination.c (e_destination_equal): Likewise.
- Also, add an "else return FALSE;"
-
-
- * backend/pas/Makefile.am (INCLUDES): Remove cruft
- (ldapschemadir): Use privdatadir
- (pasincludedir): Use privincludedir.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_activate):
- Remove unused variable.
- * backend/pas/pas-book-view.c (pas_book_view_new): Likewise
-
-
- * printing/Makefile.am (ecpsdir): Define in terms of privdatadir.
- (gladedir): Defined in configure.in now.
-
- * printing/e-contact-print.c: #include <string.h>
-
- * printing/test-print.c: #include <bonobo/bonobo-main.h>
- * printing/test-contact-print-style-editor.c: Likewise
-
-
- * gui/contact-editor/Makefile.am (INCLUDES): Remove some cruft.
- rename ICONSDIR to IMAGESDIR.
- (images_DATA): Install arrow.png in imagesdir instead of
- privdatadir.
-
- * gui/contact-editor/e-contact-quick-add.c: #include <string.h>
-
- * gui/contact-editor/e-contact-editor.c: #include <string.h>
- (e_contact_editor_init): s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR/
- (e_contact_editor_new): s/gtk_object_ref/g_object_ref/
- (_replace_button): Look in imagesdir, not privdatadir
- (_phone_arrow_pressed): Remove call to deprecated
- gtk_check_menu_item_set_show_toggle.
- (_email_arrow_pressed): Likewise
- (_address_arrow_pressed): Likewise
- (set_address_field): Remove unused variable
- (enable_widget):
- s/gtk_entry_set_editable/gtk_editable_set_editable/
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init):
- s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR
- (e_contact_editor_address_set_property):
- s/gtk_entry_set_editable/gtk_editable_set_editable/
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init):
- s/EVOLUTION_ICONSDIR/EVOLUTION_IMAGESDIR
- (e_contact_editor_fullname_set_property): Likewise.
-
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): Remove cruft,
- s/ICONSDIR/IMAGESDIR/
- (gladedir, etspecdir): Remove definitions.
-
- * gui/contact-list-editor/e-contact-list-editor.c: #include
- <string.h>
- (e_contact_list_editor_init): s/ICONSDIR/IMAGESDIR/
- (e_contact_list_editor_new): s/gtk_object_ref/g_object_ref/
-
- * gui/contact-list-editor/e-contact-list-model.c: #include <string.h>
-
-
- * gui/merging/Makefile.am (INCLUDES): Remove cruft.
- * gui/search/Makefile.am (ruledir): Define in terms of privdatadir
-
-
- * gui/widgets/Makefile.am (INCLUDES): Remove cruft.
- (gladedir, etspecdir): Remove definitions.
- (glade_DATA): Empty, so remove it.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: #include <string.h>
- (addressbook_get_property): Remove unused variable
-
- * gui/widgets/e-addressbook-view.c: #include <string.h>
- (get_selection_model): Add a g_return_val_if_reached.
-
- * gui/widgets/e-minicard.c: #include string.h, gtkmain.h,
- gnome-canvas-pixbuf.h
- (field_changed): s/gtk_object_unref/g_object_unref/
- (get_left_width): Remove unused variable
-
- * gui/widgets/e-minicard-control.c: #include <string.h>
- (pstream_load, pstream_save): Use g_ascii_strcasecmp
-
- * gui/widgets/e-minicard-view.c: #include <string.h>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_new): s/gtk_type_new/g_object_new/
-
-
- * gui/component/select-names/Makefile.am (INCLUDES): Remove cruft.
- (serverdir, gladedir, etspecdir): Remove definitions
-
- * gui/component/select-names/e-select-names.c: #include <string.h>
-
- * gui/component/select-names/e-select-names-popup.c
- (init_html_mail): Remove deprecated
- gtk_check_menu_item_set_show_toggle call.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_free):
- s/gtk_timeout_remove/g_source_remove/
-
-
- * gui/component/Makefile.am (INCLUDES): Remove cruft, rename
- ICONSDIR to IMAGESDIR.
- (serverdir, gladedir): Remove defintions.
-
- * gui/component/addressbook-component.c (IS_CONTACT_TYPE): use
- g_ascii_strcasecmp
- (add_creatable_item): s/ICONSDIR/IMAGESDIR/
-
- * gui/component/component-factory.c: #include <string.h>
-
- * gui/component/e-address-widget.c: Likewise.
- (e_address_widget_destroy): s/gtk_idle_remove/g_source_remove/
- (e_address_widget_schedule_query): s/gtk_idle_add/g_idle_add/
-
-
- * conduit/Makefile.am (INCLUDES): Remove cruft
-
-2003-02-05 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-config.c (main): Replace deprecated
- glade_gnome_init() with glade_init().
-
- * gui/contact-editor/test-editor.c (main): Likewise.
-
- * printing/test-contact-print-style-editor.c (main): Likewise.
-
- * printing/test-print.c (main): Likewise.
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- [ pull forward Jack Jia's fix for #34900 ]
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as): use
- a weak ref for the file selector.
- (e_contact_list_save_as): same.
- (destroy_it): rewrite this as a weak ref notify function.
- (close_it): remove frees of the info (it's freed in the weak ref
- function).
- (save_it): same.
-
-2003-02-03 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): pull
- forward Jack Jia's fix for #33672, but convert it to use unlink
- instead of the gnome-vfs stuff.
-
-2003-01-27 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: add a scrolled window
- (SHADOW_IN) around the address textview.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: rename the category
- entry to entry-categories.
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): use the specialized "changed" signal
- handlers for entry-company and entry-fullname.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: i need to sleep more.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (componentdir): need to assign this
- here or else the lib doesn't get built.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c (e_contact_start_new_page): begin the
- new page after showing the last one.
- (complete_sequence): beginpage before we start printing.
- (e_contact_print_response): GtkDialog-ify this.
- (e_contact_print_dialog_new): "clicked" -> "response".
- (e_contact_print_card_dialog_new): same.
- (e_contact_print_card_list_dialog_new): same.
-
-2003-01-26 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (CONDUIT_SUBDIR): enable this, as building the
- conduit works if you have gnome-pilot2.
-
-2003-01-25 Chris Toshok <toshok@ximian.com>
-
- * conduit/address-conduit.c: GObjectify the stuff in here that
- refers to addressbook objects. the gnome-pilot stuff is still
- GtkObject for the moment.
-
-2003-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am (iconsdir): Remove definition; this is
- now in configure.in.
- * gui/contact-editor/Makefile.am (iconsdir): Likewise.
- * gui/contact-list-editor/Makefile.am (iconsdir): Likewise.
-
-2003-01-23 Sean Gao <Sean.Gao@Sun.COM>
-
- [ fixes bug #34898 ]
- * gui/widgets/e-minicard.c (field_changed): handle modifications
- to email addresses in contact lists.
-
-2003-01-23 Sean Gao <Sean.Gao@Sun.COM>
-
- [ fixes bug #36375 ]
- * backend/pas/pas-backend-ldap.c: use PHONE_OTHER_FAX instead of
- PHONE_OTHER for "other_fax".
-
-2003-01-23 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #31014, roll this in from the 1.2 branch ]
- * backend/pas/pas-backend-ldap.c: use "categories" instead of
- "category" for the ECard field so the UI/get_supported_fields stuff
- actually thinks its usable in the contact editor..
-
-2003-01-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): fix
- for bug 34883 broke ssl transactions (at least those where we were
- connecting to port 636). Move it to after the SSL stanza.
-
-2003-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/Makefile.am (componentdir): Remove
- definition; no need to set it here since it's now defined in
- configure.in
- * gui/component/Makefile.am (componentdir): Likewise.
-
-2003-01-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/Makefile.am (gladedir): Version using
- $(BASE_VERSION).
- (etspecdir): Likewise.
- (iconsdir): Likewise.
-
- * gui/contact-list-editor/Makefile.am (iconsdir): Version using
- $(BASE_VERSION).
- (gladedir): Likewise.
-
- * gui/merging/Makefile.am (gladedir): Version using $(BASE_VERSION).
-
- * gui/search/Makefile.am (ruledir): Version using $(BASE_VERSION).
-
- * gui/component/Makefile.am (INCLUDES): Update EVOLUTION_IMAGESDIR
- to be versioned through $(BASE_VERSION).
-
- * gui/widgets/e-addressbook-view.c (init_collection): Use
- EVOLUTION_GALVIEWSDIR.
-
- * gui/widgets/Makefile.am (INCLUDES): Define EVOLUTION_GALVIEWSDIR
- and update EVOLUTION_IMAGESDIR.
-
-2003-01-21 Radek Doulik <rodo@ximian.com>
-
- * printing/e-contact-print.c (e_contact_print_button): don't use
- gnome_print_multipage_new_from_sizes and add warning
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): Change dialog from
- Yes/No/Cancel to Discard/Cancel/Save to match the HIG.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Change dialog from OK/Cancel
- to Cancel/OK to match the HIG.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): Change
- dialog from Overwrite/Cancel to Cancel/Overwrite to match the HIG.
-
- * gui/contact-editor/e-contact-quick-add.c
- (build_quick_add_dialog): Fix typo s/reponse/response/. Also
- change the dialog to be Edit/Cancel/OK instead of OK/Edit/Cancel
- to match the HIG.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_confirm_delete): Make alert cancel/delete
- instead of delete/cancel to match the HIG.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): Make dialog Cancel/OK instead of
- OK/Cancel to match the HIG.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): Make dialog Cancel/OK instead of
- OK/Cancel to match the HIG.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Make dialog Cancel/OK instead of OK/Cancel
- to match the HIG.
-
-2003-01-14 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am (EXTRA_DIST): Add $(schema_DATA).
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (control_activate_cb): try to load
- the uri again if it failed previously.
- (book_open_cb): set failed_to_load based on the response.
- (set_prop): initialize failed_to_load to FALSE before we kick off
- the first load.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): if the load_uri fails, remove
- it from the hashtable and free it, so we'll try to load it again
- from scratch the next time it's requested instead of serving up a
- backend that doesn't function.
-
- * backend/pas/pas-backend.c (pas_backend_get_uri): we need to be
- able to get the uri from backends that aren't loaded (so we can
- remove them from the hashtable.)
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (query_ldap_root_dse): doh, fix
- build error.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c: #include
- gtklabel.h, fixes an unresolved symbol.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (query_ldap_root_dse): build up
- the list of supported auth_methods.
- (pas_backend_ldap_process_get_supported_auth_methods): respond
- with the list of auth methods we've built up.
- (pas_backend_ldap_dispose): unref the auth_method list.
- (pas_backend_ldap_class_init): hook up
- pas_backend_ldap_process_get_supported_auth_methods.
-
- * backend/pas/pas-backend.c
- (pas_backend_get_supported_auth_methods): new function.
- (process_client_requests): add clause for GetSupportedAuthMethods.
-
- * backend/pas/pas-backend.h: add prototype for
- pas_backend_get_supported_auth_methods, and add it to the class
- vtable.
-
- * backend/pas/pas-book.h: add GetSupportedAuthMethods enum member
- and PASGetSupportedAuthMethodsRequest. and add prototype for
- pas_book_respond_get_supported_auth_methods.
-
- * backend/pas/pas-book.c
- (pas_book_queue_get_supported_auth_methods): new function.
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods):
- new function.
- (pas_book_respond_get_supported_auth_methods): new function.
- (pas_book_free_request): add clause for GetSupportedAuthMethods.
- (pas_book_class_init): hook up getSupportedAuthMethods.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): fields ->
- list.
- (e_book_listener_queue_get_supported_auth_methods_response): new
- function.
- (impl_BookListener_response_get_supported_auth_methods): new
- function.
- (e_book_listener_class_init): hook up
- epv->notifySupportedAuthMethods.
-
- * backend/ebook/e-book-listener.h: add
- GetSupportedAuthMethodsResponse enum member, and change the field
- name from "fields" to list (and use it for both GetSupportedFields
- and GetSupportedAuthMethods)
-
- * backend/ebook/e-book.c (e_book_get_supported_auth_methods): new
- function.
- (e_book_do_response_get_supported_auth_methods): new function.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_get_supported_auth_methods.
-
- * backend/idl/addressbook.idl: add getSupportedAuthMethods IDL
- call.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c (backend_last_client_gone_cb):
- deal with backends that might not have loaded successfully
- (they'll have a NULL uri).
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (e_select_names_bonobo_new): call e_select_names_bonobo_construct
- on the newly created object.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am: addressbook-config.etspec is gone.
-
- * gui/component/addressbook-config.c: make the sources table be a
- gtktreeview instead of an etable.
-
- * gui/component/ldap-config.glade: remove all references to
- gnome-hint.png
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (column_width_changed): fix
- parameter types here (this signal isn't generated from an ETable.)
-
- * gui/widgets/gal-view-factory-minicard.c: include e-util.h
-
- * gui/widgets/e-minicard.h: include gnome-canvas.h here.
-
- * gui/widgets/e-addressbook-table-adapter.c: #include
- e-destination.h here.
-
- * gui/widgets/e-minicard.c: same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.[ch]: remove the select
- names stuff (the Related Contacts button/entry.)
-
- * gui/contact-editor/contact-editor.glade: same.
-
-2003-01-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in:
- comment out the factory oaf_server, and change the location of the
- SelectNames controls to be
- OAFIID:GNOME_Evolution_Addressbook_Factory so the normal
- addressbook.so will create them.
-
- * gui/component/select-names/Makefile.am
- (libeselectnames_la_SOURCES): remove the
- e-select-names-factory.[ch] stuff for the time being.
-
- * gui/component/component-factory.c (factory): we're now (for the
- time being) the factory for the select names control.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: oops, don't include
- e-treeview-selection-model.h unless we're building the treeview.
-
-2003-01-08 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): Fix to build.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/apps_evolution_addressbook.schemas: add in the
- schema entry for minimum_query_length.
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.h: add
- E_ADDRESSBOOK_VIEW_TREEVIEW to the enum, ifdef'ed out.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): add ifdefed treeview code.
- (init_collection): same.
- (display_view): same.
- (get_selection_model): same.
- (treeview_row_activated): same.
- (create_treeview_view): same.
- (change_view_type): same.xo
- (e_addressbook_view_print): same.
- (e_addressbook_view_print_preview): same.
-
- * gui/widgets/Makefile.am: add in the treeview sources (commented
- out).
-
-2003-01-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (gal_view_minicard_edit): add
- parent arg.
-
- * gui/widgets/e-addressbook-treeview-adapter.[ch]: new files, for
- a GtkTreeView view of contacts.
-
- * gui/widgets/gal-view-treeview.[ch]: same
-
- * gui/widgets/gal-view-favroty-treeview.[ch]: same
-
-2003-01-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: $(datadir)/evolution/images instead
- of $(datadir)/images/evolution.
- * gui/contact-editor/Makefile.am: Likewise.
- * gui/contact-list-editor/Makefile.am (iconsdir): Likewise.
- * gui/widgets/Makefile.am: Likewise.
-
-2002-01-08 Dan Winship <danw@ximian.com>
-
- Move PASBook request handling into PASBackend itself since all
- existing backends do it exactly the same way. (Part of 32866).
-
- * backend/pas/pas-backend.h (PASBackendClass): add new methods for
- the various pas book requests.
-
- * backend/pas/pas-backend.c: Add a clients list to
- PASBackendPrivate.
- (pas_backend_create_card, etc): Add these to invoke the new
- methods.
- (process_client_requests, book_destroy_cb): Moved here and
- slightly rewritten from pas-backend-file.
- (last_client_gone): Now static.
- (add_client, remove_client): Default implementations, based on
- pas-backend-file, that add the client to/remove it from the
- backend's clients list and connect to its requests_queued signal.
- (pas_backend_init, pas_backend_dispose): Deal with the clients
- list.
-
- * backend/pas/pas-backend-file.c (struct _PASBackendFilePrivate):
- Remove GList *clients.
- (pas_backend_file_process_client_requests,
- pas_backend_file_book_destroy_db, pas_backend_file_add_client,
- pas_backend_file_remove_client): Gone.
- (pas_backend_file_class_init): Remove add_client/remove_client
- method initializations, add initializations for processing the
- various book requests.
-
- * backend/pas/pas-backend-ldap.c (struct _PASBackendLDAPPrivate):
- Remove GList *clients.
- (pas_backend_ldap_process_create_card, etc): Make these take the
- specific PAS*Request types rather than a generic PASRequest.
- (pas_backend_ldap_process_client_requests,
- pas_backend_ldap_book_destroy_db, pas_backend_ldap_add_client,
- pas_backend_ldap_remove_client): Gone.
- (pas_backend_ldap_class_init): Remove add_client/remove_client
- method initializations, add initializations for processing the
- various book requests.
-
-2003-01-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: fix the SYNTAX for the
- telephone attributes, and make the fax attributes more closely
- mirror those from core.schema. Fixes the schema for openldap-2.1.
-
-2003-01-06 Dan Winship <danw@ximian.com>
-
- * backend/idl/Makefile.am: remove idldir def (defined by
- configure.in now)
-
- * gui/component/select-names/Makefile.am: Likewise
-
-2003-01-01 Chris Toshok <toshok@ximian.com>
-
- [ fixes the non-ui portion of #36183 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): use the entry's
- minimum_query_length instead of a constant here.
- (e_select_names_completion_set_minimum_query_length): new
- function, set the entry's minimum_query_length.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): set the minimum_query length
- after setting the completion books.
- (read_completion_settings_from_db): rename
- read_completion_books_from_db to this, and read the
- minimum_query_length too.
- (db_listener): rename uris_listener to this, and listen for
- changes on both the uris and minimum_query_length settings.
-
- * gui/component/select-names/e-select-names-completion.h: add
- prototype for e_select_names_completion_set_minimum_query_length.
-
- * gui/component/select-names/e-select-names-manager.h: add
- minimum_query_length to struct _ESelectNamesManager.
-
-2002-12-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): Made it return an
- EvolutionConfigControl instead of a BonoboControl (and removed a
- bogus EvolutionConfigControl -> BonoboControl cast).
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #34897 ]
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_value_at): don't free the return of
- e_card_simple_get_const, as this causes a double free later on.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/e-address-popup.c: convert the clist in here to a
- GtkTreeView. your guess is as good as mine if it works (i can't
- test it at present) but it compiles.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (jump_to_letters):
- g_string_sprintfa -> g_string_append_printf.
- (create_alphabet): same.
- (create_minicard_view): remove gtk_widget_{push,pop}_visual.
-
- * gui/widgets/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
-2002-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_realize): drop use of
- "font" arg.
- (get_left_width): use pango to calculate this instead of a GdkFont.
-
- * gui/widgets/e-minicard-view.c: drop include of e-unicode.h.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- don't need to create the font anymore.
-
- * gui/search/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_new): use g_object_new instead of
- gtk_type_new.
-
- * gui/merging/Makefile.am (INCLUDES): add -D*_DISABLE_DEPRECATED.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/contact-list-editor/e-contact-list-editor.c (is_named):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (fill_in_info): same.
-
- * gui/contact-editor/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (e_contact_list_save_as): same.
-
- * gui/contact-editor/e-contact-quick-add.c (clicked_cb): strdup
- (or not, if we don't need to save the value) instead of using the
- e_utf8 functions.
- (build_quick_add_dialog): same.
-
- * gui/contact-editor/e-contact-editor.c (phone_entry_changed):
- strdup (or not, if we don't need to save the value) instead of
- using the e_utf8 functions.
- (file_as_set_style): same.
- (name_entry_changed): same.
- (full_name_clicked): same.
- (categories_clicked): same.
- (set_field): same.
- (fill_in_field): same.
- (fill_in_single_field): same.
- (extract_field): same.
- (extract_single_field): same.
-
- * gui/contact-editor/e-contact-editor-fullname.c (extract_field):
- just strdup, it's already utf8.
-
- * gui/contact-editor/e-contact-editor-address.c (extract_field):
- they're all entries, use GTK_ENTRY foo here.
-
- * gui/component/select-names/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): remove the extra
- utf8_from_locale_string stuff.
-
- * gui/component/select-names/e-select-names-popup.c
- (set_uiinfo_label): gtk_container_children ->
- gtk_container_get_children, and remove the extra utf8 stuff.
-
- * gui/component/Makefile.am (INCLUDES): add
- -D*_DISABLE_DEPRECATED.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_init_source_uri): g_string_sprintfa ->
- g_string_append_printf.
-
- * gui/component/addressbook-config.c (focus_help):
- gtk_notebook_set_page -> gtk_notebook_set_current_page.
- (addressbook_source_dialog_set_source): same.
- (auth_optionmenu_activated): gtk_container_children ->
- gtk_container_get_children.
- (ssl_optionmenu_activated): same.
- (ssl_optionmenu_selected): same, and gtk_notebook_set_page ->
- gtk_notebook_set_current_page.
- (scope_optionmenu_activated): same.
- (set_advanced_button_state): same.
- (addressbook_ldap_init): hook "response" to gtk_widget_destroy to
- make the dialog go away when clicked.
- (addressbook_ldap_auth): same.
- (addressbook_root_dse_query): same.
- (do_ldap_root_dse_query): same.
- (addressbook_config_control_new): fix return type and cast.
- (main): remove call to gtk_widget_push_visual.
-
- * gui/component/addressbook-config.h:
- addressbook_config_control_new returns a BonoboObject, not a
- BonoboControl.
-
- * gui/component/addressbook.c: remove e-unicode.h include.
-
- * backend/pas/Makefile.am (INCLUDES): Add
- -DLIBGNOME_DISABLE_DEPRECATED.
-
- * backend/ebook/Makefile.am (INCLUDES): Add
- -DLIBGNOME_DISABLE_DEPRECATED.
-
- * backend/ebook/e-card.c (e_card_get_property): remove misleading
- comment.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (build_card_from_entry):
- g_strcasecmp -> g_ascii_strcasecmp.
- (FIND_INSERT): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri):
- g_dirname -> g_path_get_dirname.
-
- * backend/pas/Makefile.am (INCLUDES): add
- -DG_DISABLE_DEPRECATED.
-
- * backend/ebook/Makefile.am (INCLUDES): add
- -DG_DISABLE_DEPRECATED.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (uris_listener): oops, use strcmp, not !strcmp here.
-
-2002-12-17 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bug #35135 ]
- * backend/ebook/e-book-util.c (set_default_book_uri_local): don't
- free the default_book_uri here, it's done in set_default_book_uri.
- (set_default_book_uri): break some stuff out from
- set_default_book_uri_from_bonobo_conf to here so it can be used
- both from that function and the bonobo listener.
- (default_folder_listener): set the new default book uri.
- (set_default_book_uri_from_bonobo_conf): install the bonobo conf
- listener so we'll get updates.
-
-2002-12-16 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): Use
- evolution_shell_client_corba_objref() instead of BONOBO_OBJREF()
- to get the Shell CORBA object.
-
-2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/component/addressbook-config.c: Don't #include
- <e-util/e-html-utils.h>
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.[ch]: GObject-ize this.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (load_uri_auth_cb): pass
- "Addressbook" to e_passwords*.
- (addressbook_authenticate): same.
-
-2002-12-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (search_cb): remove
- PENDING_PORT_WORK.
- (addressbook_search_activated): same.
- (addressbook_query_changed): same.
-
- * gui/component/Makefile.am (libevolution_addressbook_la_LIBADD):
- add libfilter.la back in.
-
-2002-12-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/widgets/e-minicard-control.c: #define MINICARD_CONTROL_ID.
-
-2002-12-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- connect ::response to gtk_widget_destroy so the dialog goes away.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct):
- don't use font_gdk anymore on EText. it doesn't exist.
-
-2002-12-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (text_height): this
- uses pango now.
- (addressbook_height): same.
-
-2002-12-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_commit_card): use e_card_set_book
- instead of basically duplicating its code here.
- (e_book_add_card): same.
-
-2002-12-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/e-cardlist-model.c: #include <string.h>.
-
- * gui/component/addressbook-storage.c: #include <string.h>,
- <ctype.h>, <unistd.h>.
-
- * gui/component/addressbook-factory.c: Removed.
-
- * gui/component/addressbook-component.c: #include
- <bonobo/bonobo-main.h>, <unistd.h> and <string.h>.
- (create_view): addressbook_new_control() instead of
- addressbook_factory_new_control().
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table): Removed unused variable.
- (e_select_names_add_section): Removed unused variable.
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_in_cb): Use g_source_remove() here instead of
- gtk_timeout_remove().
-
- * gui/component/component-factory.c: New.
-
- * gui/widgets/e-minicard-control.c
- (e_minicard_control_factory_init): Removed.
- (e_minicard_control_control_factory): Removed.
- (e_minicard_control_new): New.
-
- * gui/component/e-address-widget.c
- (e_address_widget_factory_init): Removed.
- (e_address_widget_new_control): Renamed from
- e_address_widget_factory_new_control(), made public.
- (e_address_widget_factory): Removed.
-
- * gui/component/e-address-popup.c (e_address_popup_new_control):
- New.
- (e_address_popup_factory_new_control): Removed.
- (e_address_popup_factory): Removed.
- (e_address_popup_factory_init): Removed.
-
- * gui/component/addressbook-config.c
- (addressbook_config_register_factory): Removed.
- (addressbook_config_create_control): New.
-
- * gui/component/addressbook-component.c
- (addressbook_component_factory_init): Removed.
- (addressbook_component_get_object): New.
- (owner_set_cb): Do not call addressbok_config_register_factory().
-
- * gui/component/addressbook.c (addressbook_factory_init): Removed.
- (addressbook_new_control): Renamed from
- addressbook_factory_new_control().
-
-2002-12-05 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/component/select-names/e-select-names.etspec: Use collate
- for sorting rather than the normal string sort. This fixes bug
- #26335 without causing bug #33933 :-)
-
-2002-11-30 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): only
- enable the LDAPv3 stuff if TLS is being used. Also, deal with
- naming errors returned from query_ldap_root_dse, as some servers
- (older openldap servers among others i'm sure) don't have a root
- dse at all.
-
-2002-12-02 Not Zed <NotZed@Ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_contact_print_button):
- gnomedialog -> gtkdialog stuff. print dialog is a gtkdialog now.
-
- * gui/contact-editor/e-contact-editor.c: include gtkstock.h
-
-
-2002-11-27 Not Zed <NotZed@Ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c: #include gtkstock.h
-
-2002-11-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c (column_width_changed): the
- detail is supposed to go after the signal id, not at the end of
- the parameter list.
-
-2002-11-28 Chris Toshok <toshok@ximian.com>
- [ roll forward from 1.2 branch, partial fix for #31763 ]
- * gui/component/select-names/select-names.glade: add the Find
- button back in.
-
-2002-11-28 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (create_minicard_view): remove
- the button_press_event handler (that did nothing). this makes it
- so button presses actually get to the canvas (and therefore we can
- now drag the lines in the reflow widget).
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c: add include for
- gtkstock.h.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_add_destination): add pre_change call.
- (e_contact_list_model_remove_row): same.
- (e_contact_list_model_remove_all): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_new): ref/sink the contact list editor so
- we don't get the floating unref warning from gtk.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_new):
- ref/sink the contact editor so we don't get the floating unref
- warning from gtk.
- (e_contact_editor_init): use g_build_filename instead of
- g_concat_dir_and_file.
-
- * gui/widgets/e-minicard-label.c
- (e_minicard_label_resize_children): use MAX (value, 0) to make
- sure we aren't passing negative values for clip-widths.
-
- * gui/widgets/e-minicard.c (e_minicard_realize): use MAX (value,
- 0) to make sure we aren't passing negative values for widths.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- use g_build_filename.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- [ roll forward from 1.2 branch ]
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_vcard): never pass NULL as the vcard
- to the corba call, it causes a crash. This particular bug bit us
- when we opened a card that contained an unresolvable related
- contact.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- [ roll forward from 1.2 branch, Fixes addressbook bug #28945 ]
- * backend/ebook/e-card.c (e_card_get_vobject): if the email
- property is xml, get the real address from the e-destination.
- Fixes saving contact lists.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_reflow): remove redundant
- setting of y2.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): show the table.
-
- * gui/component/select-names/e-select-names-completion.c: remove
- an unnecessary #include.
-
- * gui/component/addressbook-storage.c (addressbook_storage_setup):
- use g_build_filename.
-
- * gui/component/addressbook-component.c (remove_folder): use
- g_build_filename.
- (add_creatable_item): same.
- (ensure_completion_uris_exist): same, and use the right gconf
- paths for completion uris.
-
-2002-11-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (read_completion_books_from_db): use new schema for
- completion/uris.
- (uris_listener): same.
-
- * gui/component/select-names/e-select-names.h: Convert to
- GtkDialog from GnomeDialog.
-
- * gui/component/select-names/e-select-names.c: Convert to
- GtkDialog from GnomeDialog.
- (folder_selected): use new schema for last_used_uri.
- (e_select_names_init): same.
- (e_select_names_set_default): use pango markup to set
- bold/not-bold.
- (e_select_names_add_section): don't bother creating an EEntry, we
- can use pango and a normal label. This also keeps us from
- wrapping "contacts ->" at the '-'.
-
- * gui/component/apps_evolution_addressbook.schemas: new file.
-
- * gui/component/Makefile.am: add the schema stuff.
-
-2002-11-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (query_for_supported_bases):
- show the etable.
- (addressbook_add_server_druid): show_all before returning the
- dialog, so the druid shows up.
-
-2002-11-23 Chris Toshok <toshok@ximian.com>
-
- [ roll forward from the 1.2 branch. fixes #25540, part of #29630,
- as well as other selection issues in the contact editor and ACL
- issues in the ldap backend ]
- * backend/pas/pas-backend-ldap.c (check_schema_support): reset the
- schema check state to FALSE if the read returned nothing (and the
- user had not authenticated). we'll requery if/when they auth.
- (query_ldap_root_dse): free the schema dn before assigning over
- it.
- (pas_backend_ldap_connect): added a diagnostic warning about the
- root dse query failing in anonymous mode (if it in fact did fail.)
- (pas_backend_ldap_process_authenticate_user): if we successfully
- authed, requery the root dse to pick up any attributes that might
- be protected, and retry the schema query if that failed before.
-
- * gui/contact-editor/e-contact-editor.c (full_name_clicked): set
- the dialog's editable state based on the new field
- "fullname_editable", and only do the Ok button handling if this
- flag is TRUE.
- (full_addr_clicked): set the dialog's editable state based on the
- editable state for the particular address (from
- editor->address_editable[]). also, only do the Ok button handling
- if this flag is TRUE.
- (_address_arrow_pressed): use the address_editable array to
- determine whether the address text and the mailing address
- checkbutton are sensitive.
- (enable_writable_fields): figure out if fullname_editable is
- TRUE/FALSE, also, init the address_editable flags based on the
- field list, and handle the address checkbutton.
-
- * gui/contact-editor/fulladdr.glade: change the label names to
- label-<name> to match {entry,combo}-<name>.
-
- * gui/contact-editor/fullname.glade: same.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_class_init): rename ARG_IS_READ_ONLY to
- ARG_EDITABLE, to reflect the correct sense of the flag.
- (e_contact_editor_fullname_set_arg): same, and make the labels
- sensitive/insensitive depending on the editable state of the
- dialog.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_class_init): rename ARG_IS_READ_ONLY to
- ARG_EDITABLE, to reflect the correct sense of the flag.
- (e_contact_editor_address_set_arg): same, and make the labels
- sensitive/insensitive depending on the editable state of the
- dialog.
-
-2002-11-22 Chris Toshok <toshok@ximian.com>
-
- [ roll forward Sean.Gao@sun.com's fix for #16870 from the 1.2
- branch ]
- * backend/ebook/evolution-ldif-importer.c (getNextLDIFEntry):
- check for both LR and CRLF as empty line markers.
-
-2002-11-22 Chris Toshok <toshok@ximian.com>
-
- [ rolling forward fix for #34254 from 1.2 branch ]
- * backend/ebook/evolution-vcard-importer.c (check_file_is_vcard):
- use g-ascii_strncasecmp instead of strncmp.
- (support_format_fn): use g_ascii_strcasecmp instead of strcmp.
-
-2002-11-20 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.h: roll forward the scope fix.
-
-2002-11-20 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: roll forward the fix for
- the contact editor.
-
-2002-11-21 Not Zed <NotZed@Ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_changed): Pass type to bonobo_ctonrol_set_property, and
- also NULL terminate the valist.
-
- * gui/component/select-names/e-select-names-text-model.c
- (changed_cb): Fix signature for signal.
-
-2002-11-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in,
- * gui/component/select-names/Makefile.am: Same changes as below
- for the SelectNames component.
-
-2002-11-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): show the custom table.
-
-2002-11-18 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c (gal_view_minicard_attach):
- remove the cast to (int) - column_width is a double.
-
- * gui/widgets/e-minicard.c (e_minicard_class_init): the height
- property is only readable, not readwrite.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): make column_width a double
- property.
- (e_minicard_view_widget_set_property): don't cast to (int).
- column_width is double in the e-minicard-view.
- (e_minicard_view_widget_realize): same.
- (e_minicard_view_widget_get_property): use g_value_set_double for
- column_width.
-
-2002-11-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/Makefile.am (servers_DATA): oops,
- missed some "oaf"'s.
-
-2002-11-16 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_build_phone_ui): sink the popup.
- (e_contact_editor_build_email_ui): same.
- (e_contact_editor_build_address_ui): same.
-
- * gui/component/addressbook-config.c (ldap_dialog_new): show
- everything from dialog->page down, so custom widgets show up.
-
-2002-11-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: Added rule to generate
- GNOME_Evolution_Addressbook.server.in from
- GNOME_Evolution_Addressbook.server.in.in, substituting
- @LIBEXECDIR@.
-
- * GNOME_Evolution_Addressbook.server.in.in: Renamed from
- GNOME_Evolution_Addressbook.server.in. Added @LIBEXECDIR@ before
- the location of the executable.
-
- * gui/component/select-names/select-names.glade: Ported to Glade
- 2.
-
- * gui/component/select-names/recipient.glade: Ported to Glade 2.
-
-2002-11-15 Rodney Dawes <dobey@ximian.com>
-
- * gui/component/addressbook-component.c: Use bonobo_main_quit.
-
-2002-11-14 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-factory-minicard.c: clean this up a tad.
-
- * gui/widgets/e-addressbook-view.c (init_collection): re-enable
- this.
- (setup_menus): same.
-
- * gui/widgets/gal-view-minicard.[ch]: more GObject work.
-
-2002-11-12 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_popup_position): push_in
- = FALSE, no clue why... :)
- (_arrow_pressed): call g_signal_stop_emission here, seems to fix
- things.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): fix warnings.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): fix warning.
-
- * gui/component/addressbook.c (forget_passwords_cb): remove the
- PENDING_PORT ifdef.
- (load_uri_auth_cb): same.
- (addressbook_authenticate): same.
-
- * gui/component/addressbook-factory.c (main): same.
-
- * gui/component/addressbook-storage.c (load_source_data): be
- silent about text nodes if they contain nothing but whitespace.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): guard
- against multiple invocations.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): change signature
- to that of a weak ref notify function.
- (cursor_destroy): same.
- (pas_backend_ldap_book_destroy_cb): same.
- (get_cursor_handler): ::destroy -> weak_ref.
- (pas_backend_ldap_process_get_book_view): same.
- (pas_backend_ldap_add_client): same.
-
- * backend/pas/pas-backend-file.c (cursor_destroy): change
- signature to that of a weak ref notify function.
- (view_destroy): same.
- (pas_backend_file_book_destroy_cb): same.
- (pas_backend_file_process_get_cursor): ::destroy -> weak_ref.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_completion_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_add_client): same.
-
- * backend/ebook/test-client.c (get_cursor_cb): unref the book and
- exit here.
- (get_card_cb): pass a query string to get_cursor.
-
- * backend/ebook/e-book-view.c (e_book_view_class_init): correct
- marshaller for "card_added".
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/test-reflow.c (destroy_callback): change signature
- to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard.c (destroy_callback): change signature
- to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard-view.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/test-minicard-label.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_init): ifdef
- out the call to gnome_canvas_set_scroll_region. It doesn't seem
- necessary judging from the rest of the code, and it also crashes
- the addressbook if it's in.
-
- * gui/widgets/e-minicard-widget-test.c (destroy_callback): change
- signature to that of a weak ref notify function.
- (main): ::destroy -> weak_ref.
-
- * gui/widgets/e-minicard-control.c (free_struct): change signature
- to that of a weak ref notify function.
- (e_minicard_control_factory): ::destroy -> weak_ref.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init):
- ::destroy -> weak_ref.
- (e_addressbook_view_print): same.
- (free_closure): change signature to that of a weak ref notify
- function.
- (e_contact_print_destroy): same.
- (invisible_destroyed): same.
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): convert from GnomeDialog to
- GtkDialog.
- (e_addressbook_show_multiple_cards): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (prompt_to_save_changes): change response ids to use
- GTK_RESPONSE_.
-
- * gui/component/select-names/e-select-names-manager.c
- (clear_widget): new function.
- (e_select_names_manager_activate_dialog): ::destroy -> weak_ref.
-
- * gui/component/select-names/e-select-names.c (clear_widget):
- change signature to that of a weak ref notify function.
- (e_select_names_init): ::destroy -> weak_ref.
-
- * gui/component/e-address-popup.c (mini_wizard_destroy_cb): change
- signature to that of a weak ref notify function.
- (mini_wizard_new): ::destroy -> weak_ref.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_destroy): change signature to that of a
- weak ref notify function.
- (ldap_config_control_destroy_callback): same.
- (addressbook_add_server_druid): ::destroy -> weak_ref.
- (addressbook_edit_server_dialog): same.
- (ldap_config_control_new): same.
-
- * gui/component/addressbook.c (destroy_callback): change signature
- to that of a a weak ref notify function.
- (addressbook_factory_new_control): ::destroy -> weak_ref.
-
- * gui/merging/e-card-merging.c (response): rename clicked to this,
- and destroy the dialog here.
- (match_query_callback): ::clicked -> ::response
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- convert.
-
- * gui/merging/e-card-duplicate-detected.glade: same.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_arrow_pressed): change
- around a little, still ifdefed though.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): same.
- (save_it): deal with the GtkDialog response ids.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_confirm_delete): just build the dialog here
- (using gtk_message_dialog*).
-
- * gui/contact-editor/Makefile.am (glade_DATA): remove
- file-exists.glade and e-contact-editor-confirm-delete.glade.
-
-2002-11-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): guard
- against multiple invocations.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): change signature
- to that of weak ref's notify function - also, don't use the type
- check macros on the freed GObject.
- (cursor_destroy): same.
- (pas_backend_ldap_book_destroy_cb): same.
- (pas_backend_ldap_add_client): use weak_ref insteead of ::destroy.
- (get_cursor_handler): same.
- (pas_backend_ldap_process_get_book_view): same.
-
- * backend/pas/pas-backend-file.c (cursor_destroy): change
- signature to that of weak ref's notify function - also, don't use
- the type check macros on the freed GObject.
- (pas_backend_file_book_destroy_cb): same.
- (view_destroy): same.
- (pas_backend_file_process_get_cursor): use weak_ref instead of
- ::destroy.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_completion_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_add_client): same.
-
-2002-11-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_dispose): guard against multiple
- invocations.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): same.
-
- * backend/pas/pas-book.c (pas_book_dispose): same.
-
- * backend/pas/pas-book-view.c (pas_book_view_dispose): same.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_dispose): same.
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_dispose): same.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_dispose): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_dispose): same.
-
- * backend/ebook/e-book-listener.c (e_book_listener_dispose): guard
- against multiple invocations.
-
- * backend/ebook/e-card.c (e_card_dispose): same.
-
- * backend/ebook/e-card-simple.c (e_card_simple_dispose): same.
-
- * backend/ebook/e-card-cursor.c (e_card_cursor_dispose): same.
-
- * backend/ebook/e-book.c (e_book_dispose): same.
-
- * backend/ebook/e-book-view-listener.c (e_book_view_listener_dispose): same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (free_data): guard against
- multiple invocations.
- (remove_book_view): same.
- (addressbook_dispose): same.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_dispose):
- same.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_dispose): same.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_dispose): same.
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_dispose):
- same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_property): oops, missed these casts.
-
- * gui/component/addressbook.c (get_master_list): remove the
- PENDING_PORT_WORK ifdef, just ported ECategoriesMasterList.
- (make_suboptions): same.
-
- * gui/contact-editor/e-contact-editor.c (categories_clicked):
- same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/test-reflow.c: port work.
-
- * gui/widgets/test-minicard-view.c: port work.
-
- * gui/widgets/e-minicard.[ch]: port work.
-
- * gui/widgets/e-minicard-widget.c: port work.
-
- * gui/widgets/e-minicard-view.c: port work.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_size_allocate): gtk_->g_ change i missed.
- (e_minicard_view_widget_reflow): same.
-
- * gui/widgets/e-minicard-label.c: port work.
-
- * gui/widgets/e-minicard-control.c (get_prop): gtk_->g_ change i
- missed.
-
- * gui/widgets/e-addressbook-view.c (setup_menus): ifdef this
- PENDING_PORT_WORK for now.
- (has_email_address_1): gtk_->g_ change i missed.
- (print): remove the PENDING_PORT_WORK from here, as the print_*
- symbols now resolve.
- (delete): gtk_->g_ changes.
- (new_card): same.
- (new_list): same.
- (sources): same.
- (create_minicard_view): same.
- (table_double_click): same.
- (create_table_view): same.
- (e_contact_print_destroy): same.
- (e_contact_print_button): same.
- (e_addressbook_view_print): same, and remove the PENDING_PORT_WORK
- ifdef.
- (e_addressbook_view_print_preview): same.
- (do_remove): gtk_->g_ changes.
- (e_addressbook_view_save_state): same.
- (view_transfer_cards): same.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView):
- GtkObject -> GObject.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- GnomeDialog -> GtkDialog.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_set_value_at): a gtk_->g_ change i missed.
- (e_addressbook_table_adapter_class_init): gtk_type_class ->
- g_type_class_peek_parent.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_property): use g_object_get_property for
- aggregated properties.
- (e_addressbook_reflow_adapter_class_init): gtk_type_class ->
- g_type_class_peek_parent.
-
- * gui/merging/e-card-merging.c (match_query_callback): some misc
- gtk_->g_ changes i missed.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-model.h: parent class
- is GObjectClass.
-
- * gui/component/select-names/e-simple-card-bonobo.c
- (impl_dispose): guard against multiple invocations, and chain
- dispose.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_dispose): guard against multiple invocations.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_dispose): guard against multiple
- invocations.
- (e_select_names_text_model_set_source): fix casts.
-
- * gui/component/select-names/e-select-names-table-model.c
- (e_select_names_table_model_add_source): remove the GTK_OBJECT
- cast, fixes a warning.
- (clear_info): guard against multiple invocations from ::dispose.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_dispose): same.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_dispose): same.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_dispose): guard against multiple invocations.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: convert to glade-2
-
- * gui/contact-list-editor/e-contact-list-editor.c: port work.
-
- * gui/contact-list-editor/e-contact-list-model.[ch]: port work.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.[ch]: port work.
-
- * gui/contact-editor/e-contact-editor-fullname.[ch]: port work.
-
- * gui/contact-editor/e-contact-editor.[ch]: port work.
-
- * gui/contact-editor/e-contact-quick-add.c: port work.
-
- * gui/contact-editor/e-contact-save-as.c: port work.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c
- (set_default_book_uri_from_config_db): prepend /apps/Evolution to
- config db paths.
-
- * gui/component/select-names/e-select-names-manager.c (read_completion_books_from_db): same.
- (uris_listener): same.
-
-2002-11-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: more porting work.
-
- * e-contact-editor-fullname.[ch]: more porting work.
-
- * e-contact-editor.c: more porting work.
-
- * e-contact-quick-add.c: more porting work.
-
- * e-contact-save-as.c: more porting work.
-
- * test-editor.c: more porting work.
-
- * e-contact-editor-confirm-delete.glade, file-exists.glade,
- fulladdr.glade, fullname.glade: run these through
- libglade-convert.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): add
- lots of libs back in since they're building now.
-
- * gui/component/addressbook-config.c: more porting work.
-
- * gui/component/addressbook.c: more porting work.
-
- * gui/component/e-address-popup.[ch]: more porting work.
-
- * gui/component/e-address-widget.[ch]: more porting work.
-
- * gui/component/e-cardlist-model.[ch]: more porting work.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-completion.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-manager.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-popup.c: more
- porting work.
-
- * gui/component/select-names/e-select-names-table-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names-text-model.[ch]: more
- porting work.
-
- * gui/component/select-names/e-select-names.[ch]: more
- porting work.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/Makefile.am: tests are linking now, and link in
- libcamel.la.
-
- * backend/ebook/e-destination.c (e_destination_get_name): un-ifdef
- since camel is compiling.
- (e_destination_get_email): same.
- (e_destination_get_address): same.
- (e_destination_get_textrep): same.
-
- * backend/ebook/e-card-compare.c (name_fragment_match): use e_utf8_casefold_*.
- (name_fragment_match_with_synonyms): same.
- (e_card_compare_name_to_string_full): same.
- (e_card_compare_name): same.
-
-2002-11-07 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.h: add prototypes for e_utf8_casefold_collate{_len}
-
- * backend/ebook/e-book-util.c (e_utf8_casefold_collate_len): move
- utf8_casefold_collate_len here.
- (e_utf8_casefold_collate): move utf8_casefold_collate here.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print-envelope.c: port this to
- gnome2/gnomeprint2.
-
- * printing/e-contact-print-style-editor.c: same.
-
- * printing/e-contact-print.c: same.
-
- * printing/test-contact-print-style-editor.c: same.
-
- * printing/test-print.c: same.
-
- * printing/e-contact-print.glade: libglade-convert to libglade-2.
-
- * printing/Makefile.am (contact_print_test_LDADD)
- (contact_print_style_editor_test_LDADD): remove libcamel.la from
- these for the time being to get things linking.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard.[ch]: gobjectify this.
- (e_minicard_class_init): change the
- min/max values of the width/height paramspecs so that they can
- actually be set to something other than 0.0.
-
- * gui/widgets/e-minicard-widget.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-view.[ch]: gobjectify this.
- (set_empty_message): don't need e_utf8_from_locale_string anymore.
-
- * gui/widgets/e-minicard-view-widget.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-label.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-view.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-table-adapter.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-reflow-adapter.[ch]: gobjectify this.
-
- * gui/widgets/e-addressbook-model.[ch]: gobjectify this.
-
- * gui/widgets/e-minicard-control.c (e_minicard_control_factory):
- fix bonobo_persist_stream_new api change.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_add_destination): get rid of the
- gtk_object_sink here.
-
- * gui/component/ldap-config.glade: glade-2 version of this file.
-
- * gui/component/e-address-popup.c (e_address_popup_refresh_names):
- don't need e_utf8_to_gtk_string anymore.
-
- * gui/component/addressbook.c (make_suboptions): don't need
- e_utf8_to_locale_string anymore.
-
- * gui/component/addressbook-config.c
- (addressbook_dialog_get_source): get rid of the e_utf8 gtk_entry
- functions.
- (addressbook_source_dialog_set_source): same.
- (general_tab_check): same.
- (port_changed_func): same.
- (connecting_tab_check): same.
- (query_for_supported_bases): same.
- (display_name_check): same.
- (display_name_page_prepare): same.
- (edit_source_clicked): same.
- (addressbook_config_create_new_source): same.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c
- (pas_backend_card_sexp_class_init): use g_type_class_peek_parent.
-
- * backend/pas/pas-card-cursor.c (pas_card_cursor_class_init): same.
-
- * backend/pas/pas-book-view.c (pas_book_view_class_init): same.
-
- * backend/pas/pas-book-factory.c (pas_book_factory_class_init): same.
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_class_init): same.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_class_init): same.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_class_init): same.
-
- * backend/ebook/e-book-marshal.list: ENUM -> INT.
-
- * backend/ebook/e-book-view.c (e_book_view_dispose): guard against
- this being called multiple times.
- (e_book_view_class_init): ENUM -> INT in the sequence_complete
- signal.
-
- * backend/ebook/e-book.c (e_book_do_response_open): un-ifdef the
- component_died signal stuff.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_expand_uri): call
- g_build_filename, not g_build_path.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-destination.[ch]: fix the gnome-xml headers.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/gal-view-minicard.c: fix the gnome-xml headers.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): convert from gtk signals and args
- to GSignal and GObject properties.
- (e_addressbook_view_dispose): rename _destroy to this.
- (e_addressbook_view_set_property): rework _set_arg to this.
- (e_addressbook_view_get_property): rework _get_arg to this.
- (display_view): if we're here we need to choose a view, regardless
- of whether or not the GAL_IS_VIEW_* macros tell us which type it
- is.
-
- * gui/widgets/e-addressbook-table-adapter.c: fix the gnome-xml
- headers.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_class_init): use INT, not ENUM in the signal here.
-
- * gui/component/addressbook-config.c: another big gtk_* -> g_*
- renaming.
-
- * gui/component/addressbook.c: same.
-
- * gui/component/e-address-popup.c: same.
-
- * gui/component/e-address-widget.c: same.
-
- * gui/component/e-cardlist-model.c: fix the gnome-xml headers, and
- more gtk_* -> g_* renaming.
-
- * gui/component/addressbook-component.c (owner_set_cb): use
- evolution_shell_client_corba_objref as per ettore's change to
- EvolutionShellClient..
- (create_view): fix the call to bonobo_control_set_property.
- (create_component): gtk_signal_connect -> g_signal_connect.
-
- * gui/component/addressbook-storage.c: fix the gnome-xml
- headers.
- (addressbook_storage_setup): use
- evolution_shell_client_corba_objref as per ettore's change to
- EvolutionShellClient..
- (addressbook_get_other_contact_storage): gtk_signal_connect ->
- g_signal_connect.
- (load_source_data): root->childs -> root->childrens.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.c: fix some #include's.
-
-2002-11-06 Chris Toshok <toshok@ximian.com>
-
- * Makefile.am (SUBDIRS): only build the backend and gui dirs for
- now. printing and conduits are no-man's land at present.
-
- * addressbook/gui/merging/e-card-merging.[ch]: Port to
- GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/.cvsignore: ignore the new .server file.
-
- * gui/component/Makefile.am: typical port stuff. switch the .oaf
- to .server, and leave out a lot of libs so we can actually get
- things linking.
-
- * gui/component/GNOME_Evolution_Addressbook.server.in: rename
- .oaf.in here.
-
- * gui/component/addressbook-component.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-config.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-factory.c: Port to GObject/gnome2.
-
- * gui/component/addressbook-storage.c: Port to GObject/gnome2.
-
- * gui/component/addressbook.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-address-popup.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-address-widget.[ch]: Port to GObject/gnome2.
-
- * gui/component/e-cardlist-model.h: Port to GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/.cvsignore: ignore the marshal generated
- stuff.
-
- * gui/contact-list-editor/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it...
-
- * gui/contact-list-editor/e-contact-list-editor.[ch]: Port to
- GObject/gnome2.
-
- * gui/contact-list-editor/e-contact-list-model.[ch]: Port to
- GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/.cvsignore: ignore the marshal generated
- stuff.
-
- * gui/contact-editor/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it...
-
- * gui/contact-editor/e-contact-editor-address.[ch]: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-editor-fullname.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-editor.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-quick-add.c: Port to GObject/gnome2.
-
- * gui/contact-editor/e-contact-save-as.[ch]: Port to GObject/gnome2.
-
- * gui/contact-editor/test-editor.c: Port to GObject/gnome2.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: Port to
- GObject/gnome2.
-
- * gui/widgets/e-addressbook-table-adapter.c: Port to
- GObject/gnome2.
-
- * gui/widgets/e-addressbook-util.c: Port to GObject/gnome2.
-
- * gui/widgets/e-addressbook-view.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-control.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-label.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-view-widget.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-view.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-widget-test.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard-widget.c: Port to GObject/gnome2.
-
- * gui/widgets/e-minicard.[ch]: Port to GObject/gnome2.
-
- * gui/widgets/gal-view-factory-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/gal-view-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard-label.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard-view.c: Port to GObject/gnome2.
-
- * gui/widgets/test-minicard.c: Port to GObject/gnome2.
-
- * gui/widgets/test-reflow.c: Port to GObject/gnome2.
-
- * gui/widgets/Makefile.am: typical port stuff. add marshaller
- generation foo, dist it...
-
- * gui/widgets/.cvsignore: ignore the marshaller stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-simple-card-bonobo.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-text-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-table-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-popup.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-model.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-manager.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-factory.c: Port to
- GObject/gnome2.
-
- * gui/component/select-names/e-select-names-completion.[ch]: Port
- to GObject/gnome2.
-
- * gui/component/select-names/e-select-names-bonobo.[ch]: Port to
- GObject/gnome2.
-
- * gui/component/select-names/Makefile.am: typical port stuff. add
- marshaller generation foo, dist it, and switch the .oaf to .server
-
- * gui/component/select-names/.cvsignore: ignore the marshaller
- stuff.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/.cvsignore: ignore the generated marshaller files.
-
- * backend/ebook/e-destination.c (e_destination_dispose): rename
- e_destination_destroy.
- (e_destination_equal): ifdef this out for now, PENDING_PORT_WORK.
- (e_destination_get_name): same.
- (e_destination_get_email): same.
- (e_destination_get_address): same.
- (e_destination_get_textrep): same.
-
- * backend/ebook/Makefile.am: don't build the executables
- (importers and loaders) for now. Also, s/oaf/server, and use
- INTLTOOL_SERVER_RULE.
-
- * backend/ebook/e-book-util.c (e_book_get_config_database):
- un-#ifdef this.
- (e_book_default_book_open): un-#ifdef ths code in here that relies
- on the e_config_listener.
-
-2002-11-05 Dan Winship <danw@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (send_pending_adds): copy a
- memleak fix from pas-backend-ad.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card.c: g_date_* => g_date_get_*, fixes
- G_DISABLE_DEPRECATED build.
-
- * backend/ebook/e-book-listener.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
- * backend/ebook/e-book-view-listener.[ch]: remove the servant crap
- i'd c&p'ed and put in here.
-
- * backend/pas/pas-book-factory.[ch]: subclass from BonoboObject,
- and remove the servant crap from here too. whee.
-
- * backend/pas/pas-card-cursor.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
- * backend/pas/pas-book.[ch]: remove the servant crap i'd c&p'ed
- and put in here.
-
- * backend/pas/pas-book-view.[ch]: remove the servant crap i'd
- c&p'ed and put in here.
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.[ch]: port to gnome 2.
-
- * backend/pas/pas-backend-file.[ch]: same.
-
- * backend/pas/pas-backend-file.[ch]: same.
-
- * backend/pas/pas-backend-ldap.[ch]: same.
-
- * backend/pas/pas-backend-summary.[ch]: same.
-
- * backend/pas/pas-backend.[ch]: same.
-
- * backend/pas/pas-book-factory.[ch]: same.
-
- * backend/pas/pas-book-view.[ch]: same.
-
- * backend/pas/pas-book.[ch]: same.
-
- * backend/pas/pas-card-cursor.[ch]: same.
-
- * backend/pas/pas-marshal.list: list of marshallers.
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add pas-marshal.c
- also add the marshal building foo.
-
- * backend/pas/.cvsignore: ignore pas-marshal.[ch]
-
-2002-11-05 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/test-client-list.c (main): don't call
- bonobo_activation_init directly.
-
- * backend/ebook/test-client.c (get_card_cb): don't unref the card
- here since we never reffed it.
- (main): no need to call bonobo_activation_init, as
- gnome_program_init did it for us.
-
- * backend/ebook/e-card-simple.c (e_card_simple_get_property):
- s/g_value_{set,get}_pointer/g_value_{set,get}_object
-
- * backend/ebook/e-book-util.c (set_default_book_uri_local): make
- sure to terminate args with NULL for g_build_filename.
-
- * backend/ebook/e-book-listener.c: nuke e_book_listener_get_type
- and use the BONOBO_TYPE_FUNC_FULL macro.
-
- * backend/ebook/e-book-listener.h: add the epv to
- EBookListenerClass so BONOBO_TYPE_FUNC_FULL works.
-
- * backend/ebook/e-book-view-listener.c: nuke
- e_book_view_listener_get_type and use the BONOBO_TYPE_FUNC_FULL
- macro.
-
- * backend/ebook/e-book-view-listener.h: add the epv to
- EBookViewListenerClass so BONOBO_TYPE_FUNC_FULL works.
-
-2002-11-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-types.h: just include glib.h instead of the
- gtk stuff.
-
- * backend/ebook/e-book-listener.[ch]: convert to
- GObject/bonobo-activation/etc/etc.
- * e-book-util.[ch]: same.
- * e-book-view-listener.[ch]: same.
- * e-book-view.[ch]: same.
- * e-book.[ch]: same.
- * e-card-compare.[ch]: same.
- * e-card-cursor.[ch]: same.
- * e-card-simple.[ch]: same.
- * e-card.[ch]: same.
- * e-destination.[ch]: same.
- * evolution-ldif-importer.c: same.
- * evolution-vcard-importer.c: same.
- * load-gnomecard-addressbook.c: same.
- * load-pine-addressbok.c: same.
- * test-card.c: same.
- * test-client-list.c: same.
- * test-client.c: same.
-
- * backend/ebook/Makefile.am: add e-book-marshal.c to SOURCES, add
- e-book-marshal.[ch] to CLEANFILES, and add e-book-marshal.list to
- EXTRA_DIST. Also, remove the camel libs from the test LDADD's,
- and leave e-destination.[ch] out of the build.
-
- * backend/ebook/.cvsignore: ignore e-book-marshal.[ch]
-
- * backend/ebook/e-book-marshal.list: marshallers for e-book.
-
-2002-10-28 Larry Ewing <lewing@ximian.com>
-
- * backend/ebook/e-card.c (addPropValueUTF8): never set the charset
- on an item without also encoding it. Mime messages don't like
- parts with multiple charsets.
-
-2002-10-25 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy):
- Disconnect from the book's backend_died signal.
-
-2002-10-24 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/Makefile.am: install evolutionperson.schema to
- $(datadir)/evolution.
-
-2002-10-24 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29144 ]
- * gui/component/addressbook-config.c (edit_dialog_store_change):
- use e_table_memory_storage_change instead of remove/insert, so the
- selection is maintained.
-
-2002-10-22 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (folder_selected): Set /Addressbook/select_names_uri in the
- configdb to the selected folder.
- (e_select_names_init): Look for /Addressbook/select_names_uri
- before /DefaultFolders/contacts_uri for the initial folder. So the
- select names dialog now starts up using the same folder you used
- last time, which is useful when you have an LDAP company directory
- (which can't be your default contacts folder because it's
- read-only).
-
-2002-10-21 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (IS_CONTACT_TYPE): fix the
- sense of a strcmp
-
-2002-10-20 Chris Toshok <toshok@ximian.com>
-
- [ fix for #23764 ]
- * gui/widgets/e-addressbook-view.c (jump_to_letters): handle
- multiple letters associated with a single button.
- (button_toggled): closure->letter -> closure->letters.
- (free_closure): free closure->letters.
- (create_alphabet): init closure->letters.
-
-2002-10-20 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29067 ]
- * backend/pas/pas-backend-file.c (pas_backend_file_search): we
- need to create a card_sexp even when doing summary queries since
- it's used to check modifications of cards in the view.
-
-2002-10-20 Chris Toshok <toshok@ximian.com>
-
- [ fixes #32144 ]
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as):
- convert the name to the gtk locale before saving.
- (e_contact_list_save_as): same.
-
-2002-10-19 Chris Toshok <toshok@ximian.com>
-
- [ probable fix for #25477, and memory leak fix ]
- * gui/contact-editor/e-contact-editor.c (supported_fields_cb): if
- the dialog isn't in the list of all dialogs it's been destroyed so
- just return here.
-
- * backend/ebook/e-book.c
- (e_book_do_response_get_supported_fields): plug leak of
- resp->fields.
-
-2002-10-15 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c (e_card_email_match_string): Return right
- away rather than crashing if card->email is NULL.
- (e_card_email_find_number): Likewise.
-
-2002-10-10 Kjartan Maraas <kmaraas@gnome.org>
-
- [ Fix #7094, #7064, #7095, #31944, #31945 ]
- * gui/component/Makefile.am: Hook up new etspec file.
- * gui/component/addressbook-config.c: Remove ETable spec.
- * gui/component/addressbook-config.etspec: New file.
- * gui/component/ldap-config.glade: Fix typo.
- * gui/component/select-names/e-select-names.c: Remove inline spec.
- * gui/component/select-names/e-select-names.etspec: New file.
- * gui/contact-list-editor/Makefile.am: Hook up etspec.
- * gui/contact-list-editor/e-contact-list-editor.c: Remove inline spec.
- * gui/contact-list-editor/e-contact-list-editor.etspec: New file.
- * gui/widgets/Makefile.am: Hook up new spec.
- * gui/widgets/e-addressbook-view.c: Remove inline spec.
- * gui/widgets/e-addressbook-view.etspec: New file.
-
-2002-10-02 Chris Toshok <toshok@ximian.com>
-
- [ Fix #28392 ]
- * gui/widgets/e-addressbook-view.c (do_popup_menu): #if 0 out the
- gal_view submenu, since it's not spec'ed to be there anyway (as
- per bug #16250).
-
-2002-09-30 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #31321 ]
- * backend/ebook/e-card.c (e_card_get_vobject): add VERSION:2.1 to
- exported vCards.
-
-2002-09-30 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #31434 ]
- * backend/pas/pas-backend-file.c (do_summary_query): always
- retrieve the card from the db. use the summary strictly for
- matching, not for storing all information. This fixes completion
- of contact lists, since only 3 addresses were being stored and
- contact lists can have more.
-
-2002-09-30 Aaron Weber <aaron@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_show_multiple_cards): rephrase string on l. 213
-
-2002-09-30 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send): update for
- Composer_setHeaders change.
-
-2002-09-27 Chris Toshok <toshok@ximian.com>
-
- [ fixes #27521 ]
- * gui/contact-editor/e-contact-quick-add.c (editor_closed_cb):
- always unref the contact editor when we get the editor_closed
- signal.
-
-2002-09-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (check_schema_support): set the
- timeout to 30 seconds.
- (query_ldap_root_dse): same, and also return the ldap_error since
- this function is the one that actually causes openldap to
- connect() to the ldap host.
- (pas_backend_ldap_connect): check the return value of
- query_ldap_root_dse, and error out if it's not SUCCESS.
-
-2002-09-26 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Change
- folder type to "contacts/ldap".
- (addressbook_storage_add_source): Likewise.
- (create_ldap_folder): Check for type being "contacts" not
- ldap contacts, since the ldap-specific type doesn't appear in the
- menu.
-
-2002-09-25 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (folder_types): Rename
- "ldap-contacts" to "contacts/ldap" and add "contacts/public".
- (IS_CONTACT_TYPE): update for new types.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Use "contacts/*" for selector_types.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_transfer_cards):
- Likewise.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: add
- "evolution:config_item:type" = "contacts/ldap" to the LDAP sources
- control so it comes up by default when you open Preferences in an
- LDAP folder.
-
-2002-09-23 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c (addressbook_destroy):
- free adapter->priv.
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy): free
- model->query.
-
- * gui/component/select-names/e-select-names-manager.c
- (load_completion_books): use e_book_expand_uri here, and free the
- expanded uri after calling addressbook_load_uri, plugging a leak.
-
- * gui/component/select-names/e-select-names.c (set_book): unref
- esn->model before we unref esn. fixes an edge case memory
- corruption bug.
- (clear_widget): utility function to set a widget's ref to NULL
- when it's destroyed.
- (e_select_names_init): hook the status_message, categories option
- menu, and select_entry to clear_widget.
- (addressbook_model_set_uri): use e_book_expand_uri.
-
-2002-09-23 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: add libeutil to the link and link with
- libcamel instead of libcamel-static.la
-
-2002-09-22 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.h: oops, add
- cached_folder_list to struct _ESelectNamesManager.
-
-2002-09-22 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #30481 ]
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): initialize the select names dialog with the
- default contacts folder.
-
-2002-09-22 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #28165, 29171 ]
- * gui/component/select-names/e-select-names-manager.c
- (uris_listener): check to see if the value has really changed.
- the way the preferences dialog works is such that we'll get called
- when any of the Folder Options are changed (default folders,
- offline stuff, etc.) we really only want to tear down and build
- back up the completion books if the autocomplete folder setting
- changed.
- (read_completion_books_from_db): cache the folder list, and call
- load_completion_books.
- (load_completion_books): new function, loads from the
- cached_folder_list.
- (e_select_names_manager_init): init cached_folder_list to NULL.
- (e_select_names_manager_destroy): g_free (cached_folder_list).
-
-2002-09-20 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #30483 ]
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): argh, contains => beginswith.
-
-2002-09-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item):
- don't add the user creatable item for ldap-contact folders atm,
- since it results in their being duplicate New Contact and New
- Contact List menu items.
-
-2002-09-17 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/component/ldap-config.glade: Fix a typo.
-
-2002-09-13 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bug #30250 ]
- * backend/ebook/e-destination.c (e_destination_get_name): handle
- "Unnamed Lists" here by setting their name to _("Unnamed List').
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c (is_named): new
- function, return TRUE if the name field is filled in.
- (prompt_to_save_changes): return TRUE if the list isn't named
- (meaning it's not saveable.)
- (command_state_changed): saving requires a name.
- (add_email_cb): always call command_state_changed.
- (remove_entry_cb): same.
- (list_name_changed_cb): same.
- (visible_addrs_toggled_cb): same.
- (table_drag_data_received_cb): same.
-
-2002-09-12 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): return
- g_strdup("true"), not "true".
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): institute an arbitrary
- minimum limit on the number of characters before we actually try
- to autocomplete. It's 3, btw.
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes the other half of #17336 ]
- * gui/contact-editor/e-contact-quick-add.c (quick_add_set_name):
- parse the name when we're asked to set it, so the full name
- doesn't get stored as (potentially) "Last, First" in the card.
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes part of #17336 ]
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_init): get the window title from the
- .glade file, and supply a suitable wm icon.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_init): same.
-
-2002-09-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes #30208 ]
- * gui/component/addressbook.c (load_uri_auth_cb): if the user
- clicked cancel in the password dialog, let them off the hook and
- bind anonymously. Otherwise (if they failed to auth), prompt them
- for the password again.
- (addressbook_authenticate): new function, split out 99% of the
- auth machinery here so it can be called multiple times. Also,
- call the callback with E_BOOK_STATUS_CANCELLED if the user clicked
- the cancel button in the dialog.
- (load_uri_cb): call addressbook_authenticate if the book has auth
- enabled.
- (addressbook_load_uri): use g_new0.
-
-2002-09-05 Anna Dirks <anna@ximian.com>
- * gui/component/GNOME_Evolution_Addressbook.oaf.in : Changed the
- description of the Directory Servers page of the settings dialog
- to be a little less wordy {This page can be used to configure blah-->
- Configure blah.}
-
-
-2002-09-04 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #29904 ]
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): we need to activate
- either a contact list editor or contact editor depending on if
- it's a list (this screams for a utility function.)
-
-2002-09-04 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): Pass FALSE to
- evolution_storage_new: the Other Contacts storage doesn't support
- shared folders.
-
-2002-09-04 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Pass
- NULL as @unpopulate_folder_context_menu_fn to
- evolution_shell_component_new().
-
-2002-09-03 Mike Kestner <mkestner@ximian.com>
-
- * gui/component/select-names/e-select-names.c (e_select_names_destroy):
- unref the "without", adapter, and model, then chain up the GnomeDialog
- destroy function.
-
-2002-09-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Use
- ldap-settings.png instead of evolution-contacts.png.
-
-2002-09-03 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29699 ]
- * gui/component/addressbook-config.c
- (addressbook_add_server_druid): call _set_source with a NULL
- source to fill in dialog settings that are set from the option
- menus (like the SSL setting).
-
-2002-09-03 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (delete_contact_cb): Fix typo
- [`view>view' instead of `view->view']. Also, cast to
- GTK_WINDOW instead of GTK_WIDGET as it should be.
-
-2002-08-30 Dan Winship <danw@ximian.com>
-
- * backend/idl/addressbook.idl (CallStatus): add QueryRefused, for
- when the backend refuses to perform a query. (part of #25782)
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_convert_status): translate
- GNOME_Evolution_Addressbook_BookViewListener_QueryRefused.
-
- * gui/component/addressbook.c (search_result): Handle
- E_BOOK_VIEW_STATUS_QUERY_REFUSED.
-
-2002-08-30 Chris Toshok <toshok@ximian.com>
-
- [ fixes #27923]
- * backend/pas/pas-backend-summary.c: up the version to 4_0 (4000).
- (pas_backend_summary_load_item): handle wants_html{_set}, list,
- and list_show_addresses.
- (pas_backend_summary_save_item): same.
- (pas_backend_summary_add_card): same.
- (pas_backend_summary_get_summary_vcard): same.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item): call
- evolution_shell_component_add_user_creatable_item twice here, once
- for the "contacts" folder type, and once for "ldap-contacts".
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes #20347 ]
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init): hook
- up the backend_died signal.
- (backend_died): new function, pop up an error dialog saying the
- backend died.
-
- * gui/widgets/e-addressbook-model.c (backend_died): new function,
- emit the backend_died signal.
- (e_addressbook_model_class_init): create the backend_died signal.
- (e_addressbook_model_init): init backend_died_id
- (e_addressbook_model_set_arg): disconnect the backend_died signal
- from the old book and hook it up to the new book.
-
- * gui/widgets/e-addressbook-model.h: add the backend_died signal.
-
- * backend/ebook/e-book.c (backend_died_cb): new function, emit the
- backend_died signal.
- (e_book_do_response_open): create the component listener and hook
- up the backend_died signal.
- (e_book_destroy): disconnect the component listener and unref it.
-
- * backend/ebook/e-book.h: add backend_died signal.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-card-sexp.c (is_helper): use strcasecmp
- here, since all the other helpers use case insensitive
- comparisons.
-
- * backend/pas/pas-backend-summary.c (is_helper): same.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (category_ber): return NULL if
- the list is empty.
- (pas_backend_ldap_connect): always try to use ldapv3, not just
- when we want to use tls.
-
-2002-08-29 Chris Toshok <toshok@ximian.com>
-
- [ fixes #25038 ]
- * gui/contact-editor/Makefile.am (INCLUDES): need to have
- EVOLUTION_ICONSDIR defined.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): same.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- set the window icon to the contact mini icon.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): set the window icon to the new
- contact list icon.
-
- * gui/widgets/e-minicard.c (LIST_ICON_FILENAME): change to (the
- prettier, imo) "contact-list-16.png"
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_search): spew
- the filter we're using for the search.
-
-2002-08-28 Mike Kestner <mkestner@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c : stop the
- EBookViews before unreffing.
-
-2002-08-28 Dan Winship <danw@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add an
- evolution:shell_component_launch_order and rename
- evolution:shell_component_icon.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ oops, merged the .h and .glade file back to the HEAD from the
- 1-0 branch, but missed the .c file. ]
- * gui/component/select-names/e-select-names.c (status_message): set
- the status label's text.
- (e_select_names_init): get the status message widget from the
- glade ui.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes #19286 ]
- * gui/component/addressbook.c (delete_contact_cb): confirm
- deletion of contacts when using the menubar or toolbar.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes #28897 ]
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_clear_book_data): set book_data to NULL
- after clearing/freeing the list. fixes a crash.
-
-2002-08-28 Chris Toshok <toshok@ximian.com>
-
- [ fixes #20348 ]
- * backend/pas/evolutionperson.schema: deprecate "categories" in
- favor of "category". evolution no longer uses "categories".
-
- * backend/pas/pas-backend-ldap.c (category_populate): new
- function, "category" is the new name, and it's multivalued so we
- need the complex-prop stuff..
- (category_ber): new function, same.
- (category_compare): new function, same.
-
- * gui/component/addressbook.c (addressbook_search_activated): the
- text is "Category is" so we should use "is" instead of "contains"
- for the query.
-
-2002-08-27 Chris Toshok <toshok@ximian.com>
-
- [ Fixes #14835 ]
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_search):
- notify_complete with InvalidQuery if the parse fails.
-
-2002-08-27 Chris Toshok <toshok@ximian.com>
-
- [ fixes #26907 ]
- * gui/component/addressbook.c (addressbook_search_activated): use
- beginswith for email.
-
-2002-08-26 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c (complete_sequence): change prototype
- for complete_sequence to match sequence_complete.
- (e_contact_print_button): same.
-
-2002-08-26 Chris Toshok <toshok@ximian.com>
-
- [ fixes #29446 ]
- * gui/component/addressbook-config.c (scope_optionmenu_activated):
- searching_modify_func can be NULL (since we don't require changes
- to enable the "Next" button on this page when you create a
- directory server.)
-
-2002-08-26 Chris Toshok <toshok@ximian.com>
-
- [ Fixes (almost certainly) #24649, #25494, #27351, and other LDAP search crashes ]
- * backend/pas/pas-backend-ldap.c (view_destroy): use an EList
- instead of a GList to store the book_view's so we don't have weird
- issues with modifying the list while it's being traversed.
- (find_book_view): same.
- (create_card_handler): same.
- (remove_card_handler): same.
- (modify_card_modify_handler): same.
- (poll_ldap): same, and also ref the book_view before calling
- ldap_search_op_timeout (and therefore send_pending_adds).
- (ldap_search_handler): same.
- (ldap_op_add): warn about conflicting ldap msgid's (shouldn't ever
- happen..)
- (homephone_populate): make this a bit more robust (if values[0] ==
- NULL, values[1] won't be valid).
- (business_populate): same.
- (build_card_from_entry): break out of the prop_info loop when we
- get a match, and only set the simple field if the value != NULL.
- (ldap_search_dtor): free all the pending adds stuff.
- (pas_backend_ldap_process_get_book_view): g_list_prepend =>
- e_list_append.
- (pas_backend_ldap_remove_client): simplify the removing of the
- book (use g_list_remove instead of searching and then using
- g_list_remove_link.)
- (pas_backend_ldap_destroy): unref the book_views list.
- (pas_backend_ldap_init): initialize the EList for book_views.
-
-2002-08-25 Mike Kestner <mkestner@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (remove_book_view): stop the
- view before unref, in case the listener has pending events.
-
-2002-08-20 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): not sure what i was
- thinking here... the EBook isn't valid if we couldn't open it, so
- we can't turn around and query it for its capabilities.
-
-2002-08-19 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.h: add the
- listener_id slot.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): store off the listener_id.
- (e_select_names_manager_destroy): remove the bonobo listener -
- fixes a crash when modifying the completion folders after you
- bring up a compose window.
- (e_select_names_manager_entry_new): another random timeout change
- - make the completion at 100ms.
-
-2002-08-19 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-view.c (pas_book_view_notify_complete):
- take and pass the CallStatus to our listener.
-
- * backend/pas/pas-book-view.h: change the prototype for
- notify_complete to include the CallStatus.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_seq_complete_cb): add the status arg.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): init the search_result signal.
- (e_addressbook_view_init): connect to the model's search_result
- signal.
- (emit_search_result): emit our search_result signal.
- (search_result): call emit_search_result.
-
- * gui/widgets/e-addressbook-view.h (struct
- _EAddressbookViewClass): add the search_result signal.
-
- * gui/widgets/e-addressbook-model.c (sequence_complete): emit both
- a "search_result" as well as the "stop_state_changed" signal.
- (e_addressbook_model_class_init): init the search_result signal.
-
- * gui/widgets/e-addressbook-model.h: add search_result signal.
-
- * gui/component/addressbook.c (search_result): pop up a dialog
- telling the user why the search failed or was truncated.
- (addressbook_factory_new_control): connect to the "search_result"
- signal on the view.
-
- * conduit/address-conduit.c (sequence_complete): add the status
- parameter to sequence_complete.
-
- * backend/idl/addressbook.idl: add BookViewListener_CallStatus,
- and change notifySequenceComplete to take a CallStatus.
-
- * backend/pas/pas-backend-ldap.c (create_card_handler): pass
- status back in the notify_complete call.
- (remove_card_handler): same.
- (modify_card_modify_handler): same
- (ldap_search_handler): same, and parse out the ldap return code so
- we can report limits being properly.
-
- * backend/pas/pas-backend-file.c (do_summary_query): pass status
- back in the notify_complete call.
- (pas_backend_file_search): same, and get rid of the
- status_message, as the status is passed back properly.
- (pas_backend_file_search): pass status
- back in the notify_complete call.
- (pas_backend_file_changes): same.
- (pas_backend_file_process_create_card): same.
- (pas_backend_file_process_remove_card): same.
- (pas_backend_file_process_modify_card): same.
-
- * backend/ebook/e-book-util.c (simple_query_sequence_complete_cb):
- add status parameter.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_status_event): change name from
- _queue_empty_event, and take a status arg.
- (e_book_view_listener_queue_id_event): init resp->status (to
- SUCCESS).
- (e_book_view_listener_queue_sequence_event): same.
- (e_book_view_listener_queue_message_event): same.
- (impl_BookViewListener_notify_sequence_complete): call
- queue_status_event, and convert the corba status to
- EBookViewStatus.
- (e_book_view_listener_convert_status): new function, conver the
- corba status to EBookViewStatus.
-
- * backend/ebook/e-book-view-listener.h: add a "status" slot to
- EBookViewListenerResponse.
-
- * backend/ebook/e-book-view.h: change prototype for
- sequence_complete signal.
-
- * backend/ebook/e-book-view.c (e_book_view_do_complete_event):
- sequence_complete takes a parameter now (EBookViewStatus).
- (e_book_view_class_init): add the enum arg to the signal.
-
- * backend/ebook/e-book-types.h: add EBookViewStatus enum.
-
-2002-08-19 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_get_static_capabilities): add
- "cache-completions" here, since file completion results are
- blanket cached (as they're generated from a summary).
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_cursor): there should be no search
- limit on the get_cursor_request, as it's meant to match every card
- it can.
- (ldap_search_handler): parse the ldap result in the
- RES_SEARCH_RESULT case. we'll want more here soon, so we can
- notify the front end if the result was truncated due to either the
- size or time limit being exceeded.
- (pas_backend_ldap_process_get_book_view): in the case of a
- completion view, we hardcode (yeah yeah, i know, but really) the
- search limit to MIN (100, user-specified-limit).
- (pas_backend_ldap_search): each view has its own limit now,
- defaulting from the user specified one for normal searches but
- possibly different for completion views. use the view's limit
- here.
-
-2002-08-19 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): add an "addresses" property, to get the
- "Dan Winship <danw@ximian.com>" form, as opposed to "text", which
- gets you what's displayed, which might be just "Dan Winship".
- (entry_set_property_fn): When setting, just reuse the "text" code,
- since it should properly cardify everything for us anyway.
- (impl_SelectNames_get_entry_for_section): Add the property.
-
-2002-08-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fix c&p error that was
- losing the ssl setting.
-
-2002-08-16 Iain <iain@ximian.com>
-
- * backends/e-book/evolution-ldif-importer.c (ebook_create): Use the
- default EBook instead of the local one.
-
- * backends/e-book/evolution-vcard-importer.c (ebook_create): Ditto.
-
-2002-08-16 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (book_view_notify_status): new
- function to save a little typing.
- (find_book_view): same.
- (pas_backend_ldap_connect): reorder things a bit - set the version
- to VERSION3 *before* doing TLS, as tls requires v3, and if we're
- doing ldaps://, do tls a little differently (not sure if this is
- strictly necessary, but the openldap source did it.. *shrug*).
- also, guard the schema check as this function can be called
- multiple times for the same server (if the server goes down or
- times us out.)
- (pas_backend_ldap_reconnect): new function, reconnect and if
- necessary reauth the user.
- (pas_backend_ldap_process_create_card): use
- find_book_view/book_view_notify_status/pas_backend_ldap_reconnect.
- (pas_backend_ldap_process_remove_card): same.
- (pas_backend_ldap_process_modify_card): same.
- (pas_backend_ldap_process_get_vcard): same.
- (pas_backend_ldap_process_get_cursor): same.
- (pas_backend_ldap_search): same.
- (poll_ldap): reconnect if ldap_result returns -1.
- (pas_backend_ldap_process_authenticate_user): ick ick ick save off
- the dn/passwd we auth with so we can use them to reauthenticate.
-
-2002-08-16 Chris Toshok <toshok@ximian.com>
-
- [ fix 27333 ]
- * gui/widgets/e-addressbook-model.c (get_view): "local" ->
- "do-initial-query".
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_get_static_capabilities): "local" ->
- "local,do-initial-query".
-
- * gui/widgets/e-addressbook-model.c (get_view): "local" ->
- "do-initial-query".
-
- * gui/component/addressbook.c (book_open_cb): Only assume the
- addressbook is local if "local" appears in its static
- capabilities. We still use the ldap special case, but be nicer to
- other networked backends.
-
-2002-08-12 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (user_create_new_item_cb):
- If invoked from a non-contact folder, add the contact to the
- default contact folder, not the local one. If invoked from a
- contact folder, don't append "addressbook.db" to the URI, let
- ebook do the right thing. Fixes #28327 and #28325.
-
- * backend/idl/addressbook.idl (CallStatus): Add NoSuchBook.
- (Initially intended as part of a fix for #28327, but the other
- changes make it so the error code never ends up getting used any
- more, but it's still good to have.)
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- Handle NO_SUCH_BOOK.
-
- * backend/ebook/e-book-types.h (EBookStatus): Add
- E_BOOK_STATUS_NO_SUCH_BOOK.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): add case for NoSuchBook.
-
- * backend/ebook/e-book-util.c (e_book_load_local_address_book):
- Kill this. Nothing should ever explicitly load the local
- addressbook.
- (e_book_use_default_book): Replaces e_book_use_local_address_book,
- using the default book instead.
- (e_book_default_book_open): Fall back to local contact folder on
- E_BOOK_STATUS_NO_SUCH_BOOK too.
- (e_book_query_address_default): Use default book, not local.
-
- * gui/component/e-address-widget.c (query_idle_fn): Use the
- default book, not the local book.
-
- * gui/component/select-names/e-select-names-popup.c
- (edit_contact_info_cb): Use the default book, not the local book.
-
- * backend/ebook/e-destination.c (e_destination_cardify): Use the
- default book, not the local book.
- (e_destination_touch): Query the default book, not the local book.
-
- * backend/ebook/e-card-compare.c (e_card_locate_match,
- e_card_locate_match_full): Use the default book, not the local
- book.
-
-2002-08-08 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (pas_backend_summary_init):
- initialize summary->upgraded to quiet valgrind.
-
-2002-08-06 Dan Winship <danw@ximian.com>
-
- * backend/ebook/test-client.c (TEST_VCARD): Use "\r" rather than
- including literal CRs in the string, which confuses gcc on OS X.
-
- * backend/ebook/test-card.c (TEST_VCARD): Likewise.
-
-2002-08-01 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #25958 ]
- * gui/component/addressbook.c (alphabet_state_changed): use
- FULL_NAME in the case where we're untoggling a letter, and... well
- use FULL_NAME in the other case too - we should never pop up the
- advanced dialog.
-
-2002-08-01 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): no more search_entry.
-
- * gui/component/select-names/e-select-names.c (update_query): no
- more search_entry, search_entry => select_entry, and add file_as
- to the query since some entries don't have names (like the Ximian,
- Inc. default card.)
- (e_select_names_init): no more search_entry, and add an "activate"
- handler on select_entry that updates the query.
-
-2002-08-01 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): remove folders and folders_by_uri, and the 2
- listeners.
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_destroy): remove the hash_table_destroys of
- folders and folders_by_uri, since they no longer exist. same for
- other_contacts_listener and local_listener.
-
-2002-08-01 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Use
- "contact-list-16.png" for the "New Contact List" item.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Change
- the order so that "New Contact" is first and "New Contact List" is
- next.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item): Pass
- "contacts" as the @folder_type to
- evolution_shell_component_add_user_creatable_item().
-
-2002-07-31 Chris Toshok <toshok@ximian.com>
-
- [ roll in the following change from the 1.0 branch.]
- * backend/pas/pas-backend-ldap.c:
- (prop_info): change the CALURI and FBURL ecard attributes to map to the
- RFC 2739 specified attributes.
- (check_schema_support): check to see if calEntry is supported.
- (add_objectclass_mod): insert calEntry if it's supported.
- * backend/pas/evolutionperson.schema: deprecate freeBusyURI
- and calendarURI.
-
-2002-07-31 Ettore Perazzoli <ettore@ximian.com>
-
- [Patch by Jacob Berkman <jacob@ximian.com>, fixes #25968]
-
- * backend/ebook/e-book.c (activate_factories_for_uri): Don't
- double free protocol and query.
-
-2002-07-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (save_string): don't save
- empty strings.
- (pas_backend_summary_save): print out the errno when we fail.
-
-2002-07-26 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Don't set up the ContactNew and
- ContactNewList verbs.
- (update_command_state): Don't set the sensitivity of
- /commands/ContactNew and /commands/ContactNewList anymore.
- (new_contact_cb): Removed.
- (new_contact_list_cb): Removed.
-
-2002-07-24 Peter Williams <peterw@ximian.com>
-
- * conduit/Makefile.am (libeaddress_conduit_la_LIBADD): Change
- libversit.la -> libversit.a for danw's changes.
-
-2002-07-24 Dan Winship <danw@ximian.com>
-
- * conduit/Makefile.am (libeaddress_conduit_la_LIBADD):
- s/libversit_lt/libversit/
-
-2002-07-22 Dan Winship <danw@ximian.com>
-
- * backend/pas/Makefile.am: Split pas-backend-file and
- pas-backend-ldap out of libpas and build them as separate (noinst)
- libraries libpasfile.a and libpasldap.a. This gets the db3 and
- LDAP dependencies out of libpas, and people trying to create an
- addressbook backend shouldn't be calling functions from the
- existing backends anyway so there's no reason to install them.
-
-2002-07-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/select-names.glade: remove the option
- menu and browse button, and add a custom widget placeholder for
- the folder-selector.
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): move the "append /addressbook.db"
- stuff here.
- (e_addressbook_create_ebook_table): remove the code setting
- initial uri from here.
- (e_select_names_folder_free): gone.
- (e_select_names_option_activated): gone.
- (add_menu_item): gone.
- (update_option_menu): gone.
- (new_folder): gone.
- (removed_folder): gone.
- (folder_browse): gone.
- (hookup_listner): gone.
- (add_additional_select_names_uris): gone.
- (e_select_names_hookup_listners): gone.
- (e_addressbook_create_folder_selector): new function, create the
- folder selector button.
- (folder_selected): new function, callback for the folder selector.
- just calls addresbook_model_set_uri.
- (e_select_names_init): get the folder selector and initialize it
- to show /local/Contacts. also, set the model's uri here to the
- same folder. nuke the code involving the old option menu and
- browse button.
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * backend/ebook/Makefile.am: Install libebook-static.la.
- Also change --all-static to -all-static, which is the right flag.
-
- * backend/pas/Makefile.am: Install the PAS headers in
- $(includedir)/evolution/pas. Install libpas.a
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * gui/component/select-names/Makefile.am (idl_DATA): Install the
- SelectNames IDL and ancillary changes.
-
-2002-07-12 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (free_summary_item): free the
- full_name (as well as given_name. oops.)
- (pas_backend_summary_new): new summaries are version 3.0 now.
- (pas_backend_summary_load_item): all loaded summaries should be
- 3.0+, as we fail to load versions lower than that.
- (pas_backend_summary_load_header): if the summary isn't version
- 3.0 fail out, as we need to rebuild the entire file to cache the
- full_name fields.
- (pas_backend_summary_save_item): save out the full_name.
- (pas_backend_summary_add_card): put the item's full_name in the
- card.
-
-2002-07-12 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Make the
- ENTRY_PROPERTY_ID_SIMPLE_CARD_LIST case not crash, although
- there's still something wrong.
-
-2002-07-10 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_start_query): e_book_get_book_view =>
- e_book_get_completion_view, so the backends have the option of
- using a pregenerated summary.
-
-2002-07-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-summary.c (clear_items): actually remove
- the items from the pointer array too, so an error while loading
- doesn't leave the memory summary corrupted.
- (pas_backend_summary_load_header): bleah, load the num_items and
- summary_mtime in the right order :) Also, set upgraded to TRUE if
- we loaded a v1.0 summary.
- (pas_backend_summary_open): make this return a gboolean, return
- TRUE if the summary is already open (priv->fp != NULL). return
- FALSE in error conditions.
- (pas_backend_summary_load): if summary_open returns FALSE, return
- FALSE, also set the dirty flag to FALSE after we load, and if the
- summary was upgraded write it out.
- (pas_backend_summary_save): update the in memory mtime to that of
- the file when we save.
- (summary_flush_func): if we're not dirty, do nothing and return.
- (pas_backend_summary_is_up_to_date): make sure we've opened the
- summary.
- (pas_backend_summary_get_summary_vcard): fix compiler warning.
-
-2002-07-10 Peter Williams <peterw@ximian.com>
-
- * backend/ebook/e-book-view-listener.h: Oops, missed this one.
-
- * backend/ebook/Makefile.am (libebookinclude_HEADERS): Also
- put addressbook.h here because several headers reference it.
-
-2002-07-08 Peter Williams <peterw@ximian.com>
-
- * backend/ebook/e-book.h: Normalize includes to <ebook/foo.h>, so
- that the installed headers will work sanely.
-
- * backend/ebook/e-card-cursor.h:
- * backend/ebook/e-book-view.h:
- * backend/ebook/e-card-simple.h:
- * backend/ebook/e-card.h:
- * backend/ebook/e-destination.h: Same.
-
- * printing/Makefile.am (INCLUDES): add -Iaddressbook/backend
- to access the ebook headers. Also the builddir version to get
- the generated addressbook.h
-
- * conduit/Makefile.am (INCLUDES): Same.
-
- * gui/widgets/Makefile.am (INCLUDES): Same builddir fix.
-
- * gui/merging/e-card-merging.c: Fix an ebook #include.
-
- * gui/merging/Makefile.am (INCLUDES): Same idea.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): Same.
-
- * gui/contact-editor/Makefile.am (INCLUDES): Same builddir
- change.
-
-2002-07-10 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Pass
- zero as the @sorting_priority to evolution_storage_new_folder().
- (addressbook_storage_add_source): Likewise.
-
-2002-07-10 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: add Book.getCompletionView.
-
- * backend/ebook/e-book.c (e_book_get_completion_view): new
- function, basically c&p of e_book_get_book_view, but call
- getCompletionView.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_get_completion_view.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_client_requests): add a
- GetCompletionView case here that just calls the same code as
- GetBookView (since we don't build summaries for the ldap backend.)
-
- * backend/pas/pas-backend-file.c (do_summary_query): add
- @completion_search. If it's TRUE, just create the vcards from the
- summary using pas_backend_summary_get_summary_vcard instead of
- looking them up from the db.
- (pas_backend_file_search): add @completion_search and pass it on
- to do_summary_query.
- (pas_backend_file_process_get_book_view): pass FALSE to
- pas_backend_file_search.
- (pas_backend_file_process_get_completion_view): new function,
- basically c&p pas_backend_file_process_get_book_view, but pass
- TRUE to pas_backend_file_search.
- (pas_backend_file_process_client_requests): add a case for
- GetCompletionView.
- (pas_backend_file_load_uri): track the change to the summary api -
- create the summary filename
-
- * backend/pas/pas-book.c (pas_book_queue_get_completion_view): new
- function, queue a GetCompletionView request to our queue.
- (impl_GNOME_Evolution_Addressbook_Book_getCompletionView): new
- function, call pas_book_queue_get_completion_view.
- (pas_book_respond_get_completion_view): new function, just call
- notifyViewRequested.
- (pas_book_free_request): add a case for GetCompletionView.
- (pas_book_get_epv): fill in epv->getCompletionView.
-
- * backend/pas/pas-book.h: add a GetCompletionView PASOperation,
- and a new structure (PASGetCompletionViewRequest). Also, add
- get_completion_view to PASRequest.
-
- * backend/pas/pas-backend-summary.c (clear_items): remove the
- items from the hash table.
- (pas_backend_summary_new): db_path -> summary_path.
- (pas_backend_summary_destroy): db_.path -> summary_path, and
- destroy the hash table.
- (pas_backend_summary_init): db_path = summary_path, and initialize
- the id_to_item hashtable.
- (pas_backend_summary_load_header): handle the upgrading from
- version 1.0 to version 2.0 (the addition of an mtime field in the
- header)
- (pas_backend_summary_load_item): version 1.0 and 2.0 have the same
- format for items.
- (pas_backend_summary_open): new function. open the summary so we
- can load the header (and get the mtime).
- (pas_backend_summary_load): rework this a bit since the header has
- already been loaded, and also add the items to the hashtable.
- (pas_backend_summary_add_card): add the new item to the hashtable.
- (pas_backend_summary_remove_card): remove the item from the hash
- table.
- (pas_backend_summary_is_up_to_date): new function, chekc @t
- against the summary's mtime.
- (pas_backend_summary_get_summary_vcard): create a vcard from the
- fields we have in the summary.
-
- * backend/pas/pas-backend-summary.h: add prorotypes for
- pas_backend_summary_is_up_to_date and
- pas_backend_summary_get_summary_vcard.
-
-2002-07-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Pass
- NULL @custom_icon_name to evolution_storage_new_folder().
- (addressbook_storage_add_source): Likewise. [Note we could be
- passing a nice custom here. ;-)]
-
-2002-07-02 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (add_creatable_item): New
- arg @tooltip; pass it to
- evolution_shell_component_add_user_creatable_item() [which now has
- a @tooltip arg].
-
-2002-06-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add
- pas-backend-summary.[ch].
-
- * backend/pas/pas-backend-file.c (string_to_dbt): move this to the
- top of the file so it can be used in..
- (build_summary): loop over the db, adding cards ot the summary.
- (do_summary_query): call pas_backend_summary_search and loop over
- the returned id's looking them up in the db.
- (pas_backend_file_search): call
- pas_backend_summary_is_summary_query, and either call
- do_summary_query if it's a query over just the set of attributes
- in the summary or use the old, slow method if not.
- (pas_backend_file_process_create_card): call
- pas_backend_summary_add_card.
- (pas_backend_file_process_remove_card): call
- pas_backend_summary_remove_card.
- (pas_backend_file_process_modify_card): call remove_card/add_card.
- (pas_backend_file_load_uri): try to load the summary file, and if
- it doesn't exist create it.
- (pas_backend_file_destroy): unref the summary.
-
- * backend/pas/pas-backend-summary.[ch]: new files, reading and
- writing (and querying) summaries.
-
-2002-06-27 Sean Atkinson <sean@cantab.net>
-
- * gui/component/addressbook-config.c (query_for_supported_bases):
- don't unref selection_model (otherwise 3 clicks of
- "Show Supported Bases" crashes if LDAP server isn't running).
-
-2002-06-25 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (create_component):
- reorder the adding of creatable items so the default is a new
- contact, not a new contact list.
-
-2002-06-21 Sean Atkinson <sean@cantab.net>
-
- * gui/component/addressbook-config.c (addressbook_edit_server_dialog):
- remove source argument (get it from the dialog).
- (edit_source_clicked): same.
- (sources_table_double_click): added to edit server by double-clicking.
- (ldap_dialog_new): use sources_table_double_click.
-
-2002-06-17 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_save_as):
- pass NULL to e_contact_list_save_as. modality sucks. fixes
- broken build.
- (save_as): same.
-
-2002-06-15 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #26130 ]
- * gui/contact-editor/e-contact-editor.c (file_save_as_cb): pass
- ce->app as parent_window.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (file_save_as_cb): same .
-
- * gui/contact-editor/e-contact-save-as.c (e_contact_list_save_as):
- if a parent_window is specified, the file selector should be
- modal/transient for that window.
- (e_contact_save_as): same.
-
- * gui/contact-editor/e-contact-save-as.h: track prototype changes
- (addition of GtkWindow *parent_window to both calls.)
-
-2002-06-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): use
- ldap_unbind_ext.
- (create_card_handler): don't leak the new vcard.
- (pas_backend_ldap_process_authenticate_user): don't leak the dn.
-
-2002-06-14 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): up the
- max threshold to 3000 cards from 1000 cards.. seems to improve
- performance a bit. also remove the g_list_reverse since it
- doesn't matter what order the cards arrive to the gui.
- (pas_backend_file_changes): plug memory leaks.
-
-2002-06-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (compare_email_addresses): Made
- "" compare as not equal to "" for addresses.
- (use_common_book_cb): Don't bother checking for nickname here
- since we don't use it as a match later. Don't add "" as an
- address to the list of query parts.
-
-2002-06-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- Don't enable fields if the editor isn't editable and the
- widget_field_mappings lists this field as being desensitize for
- read only.
-
-2002-06-11 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug #17332 ]
- * backend/ebook/e-book.c (e_book_get_static_capabilities): we
- shouldn't ever return NULL here. in error cases we need to return
- g_strdup("");
-
-2002-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_event): Made
- double clicking on read only folders not do anything.
-
-2002-06-10 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_expand_uri): Made expand_uri
- a bit more robust and readable.
- (e_book_get_default_book_uri): Made e_book_get_default_book_uri
- use e_book_expand_uri if using the bonobo_config value.
-
- * gui/component/e-address-popup.c (start_query): Handle the
- failure state here by acting as if there are no matches.
-
-2002-06-05 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): Call
- e_minicard_selected in the GDK_BUTTON_RELEASE case here.
- (e_minicard_drag_begin): Set E_REFLOW (parent)->maybe_in_drag =
- FALSE if it's an EReflow.
-
-2002-06-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_book_ready): Commented out this unused
- function.
-
- * gui/component/select-names/e-select-names-manager.c
- (open_book_cb): Ref if we're keeping the book. Don't unref if
- we're not keeping the book.
- (clean_cb): Commented out this unused function.
-
-2002-06-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (init_collection): Set the
- title of our GalVIewCollection.
-
-2002-05-29 Anna Marie Dirks <anna@ximian.com>
-
- * gui/component/select-names/select-names.glade: Changed some spacing
- and expanding behavior to make this dialog behave more like I intended
- to.
-
-2002-05-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (CONFIG_CONTROL_FACTORY_ID):
- put this back in, accidentally got snipped with the hacking going
- on in here.
-
-2002-05-24 Chris Toshok <toshok@ximian.com>
-
- [ part of #25047 ]
- * gui/component/addressbook-config.c: remove the autocompletion
- config control from here, as it lives in the shell now.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: same.
-
-2002-05-24 Chris Toshok <toshok@ximian.com>
-
- [ #24189 ]
- * gui/component/select-names/e-select-names-manager.c
- (focus_out_cb): ifdef out the body of this because it only works
- with a single completion book. not sure what to do here, but it
- doesn't impact most usage scenarios.
- (completion_popup_cb): same.
- (e_select_names_manager_entry_new): add the books that have been
- loaded successfully by the time this entry is created.
- (open_book_cb): add the opened book to the entries that have
- already been created, and store it in our list so that entries
- that are created in the future can catch up.
- (read_completion_books_from_db): slurp in the folder list from the
- config db and load all the uris.
- (uris_listener): listener function - when there's a change it
- calls _clear_books on all the created entries, and clears our
- list. It then re-reads the books from the db.
- (e_select_names_manager_new): create our bonobo listener and call
- read_completion_books_from_db.
- (e_select_names_manager_init): init completion_books.
- (e_select_names_manager_destroy): free our list of
- completion_books.
-
- * gui/component/select-names/e-select-names-manager.h: switch from
- a single EBook to a GList of completion_books here.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_add_book): deal with the case where
- there's an active query (by effectively restarting it.) This is
- quite a contrived edge case.
- (e_select_names_completion_clear_books): stop the current query
- and clear our list of books.
- (e_select_names_completion_new): track change to prototype, and
- axe the majority of this method since an EBook* isn't passed
- anymore.
- (e_select_names_completion_clear_book_data): split this code out
- from the destroy method so it can be called from _clear_books.
-
- * gui/component/select-names/e-select-names-completion.h: the
- constructor no longer takes an EBook -- pass in as many as you
- want using _add_book. Also, add prototype for _clear_books.
-
- * gui/component/addressbook.c (load_uri_cb): when
- storing/retrieving passwords, use the cleaned (without params)
- version of the uri, so changing things like download limit don't
- cause the user to be prompted for a password again.
-
- * gui/component/addressbook-component.c
- (ensure_completion_uris_exist): new function - probably doesn't
- belong in this file. Make sure the basic local Contacts folder
- exists in the completion uris.
- (addressbook_component_factory_init): call
- ensure_completion_uris_exist.
-
- * backend/ebook/e-book-util.h: add prototype for
- e_book_get_default_book_uri.
-
- * backend/ebook/e-book-util.c (e_book_get_default_book_uri): new
- function, just return the default contacts uri.
- (e_book_load_default_book): change
- to use e_book_get_default_book_uri.
-
-2002-05-23 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_root_dse_query):
- fix parameter/local variable overloading.
-
-2002-05-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (load_uri_cb): Don't try to invoke
- e_book_get_uri() on NULL. Fixes #25069.
-
-2002-05-17 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- make sure we map status -> string correctly (add missing strings).
-
- * backend/ebook/e-book-types.h (EBookStatus): add the missing
- AUTHENTICATION_REQUIRED status code, to map to the idl response.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): make sure we map all idl status
- codes to EBookStatus statuses.
-
-2002-05-20 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Pass
- FALSE for @sync_offline to evolution_storage_new_folder().
- (addressbook_storage_add_source): Pass FALSE for @sync_offline to
- evolution_storage_new_folder().
-
-2002-05-16 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (request_quit): New, quit
- handler for the EvolutionShellComponent.
- (add_creatable_item): Set it up.
-
- * gui/contact-editor/e-contact-list-editor.c
- (e_contact_list_editor_request_close_all): New.
- (e_contact_list_editor_new): Put the contact editor in a static
- list and gtk_object_weakref() it.
- (contact_list_editor_destroy_notify): New, GtkDestroyNotify
- function for the contact editors.
-
- * gui/contact-editor/e-contact-editor.c
- (e_contact_editor_request_close_all): New.
- (e_contact_editor_new): Put the contact editor in a static list
- and gtk_object_weakref() it.
- (contact_editor_destroy_notify): New, GtkDestroyNotify function
- for the contact editors.
-
-2002-05-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Pass
- NULL as @request_quit_fn.
-
-2002-05-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/idl/addressbook.idl: Removed an incorrect comment here.
-
-2002-05-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- Enable the dropdown widgets even if the contact is not editable so
- that you can view any email address, phone number, or postal
- address on read only contacts.
-
-2002-05-10 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- Added SimpleCard interface.
-
- * gui/component/select-names/Makefile.am: Added
- e-simple-card-bonobo.c and e-simple-card-bonobo.h.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Added SIMPLE_CARD_LIST arg.
-
- * gui/component/select-names/e-simple-card-bonobo.c,
- gui/component/select-names/e-simple-card-bonobo.h: New class to
- represent an ECardSimple across Bonobo.
-
-2002-05-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Added "first_email" property.
-
-2002-05-09 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): Pass %FALSE as
- @has_shared_folders to evolution_storage_new().
-
-2002-05-08 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: link against the libtool version of
- libversit
-
-2002-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_control_new): oops, add the NULL back at the
- end of possible_types.
-
-2002-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_ldap_init):
- bleah, need to pass the GtkWindow here so we can pop up the a
- modal parented dialog (gtk modal dialogs suck?).
- (addressbook_ldap_auth): same.
- (addressbook_root_dse_query): same.
- (do_ldap_root_dse_query): same.
- (addressbook_config_control_new): add "ldap-contacts" to the list
- of possible types.
-
-2002-05-07 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c (create_ldap_folder):
- s/ldap_config/addressbook_config/
-
-2002-05-03 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): finally
- remove the #if 0's and use the oaf query stuff to get backends
- that handle specific protocols.
-
-2002-05-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_folder_list_changed_callback): Call
- evolution_config_control_changed when the EFolderList changes.
-
-2002-05-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Updated this
- to have the ConfigControlFactory have an addressbookwide generic
- name and added OAFIID:GNOME_Evolution_Addressbook_ConfigControl.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES),
- gui/component/addressbook-component.c,
- gui/component/addressbook-storage.c, gui/component/addressbook.c:
- Replaced ldap-config.c and ldap-config.h with addressbook-config.c
- andaddressbook-config.h.
-
- * gui/component/addressbook-config.c,
- gui/component/addressbook-config.h: Based on ldap-config.c and
- ldap-config.h. Added a folder list control. Made this a multi
- factory.
-
- * gui/component/ldap-config.c, gui/component/ldap-config.h:
- Replaced these with addressbook-config.c and addressbook-config.h.
-
-2002-05-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (selection_change):
- Desensitize the to, cc, and bcc buttons if there's no selection
- here. Fixes Ximian bug #21482.
-
-2002-05-01 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (verbs): Changed
- some of these to bind to the ContactListEditor verbs since they're
- marked as that in the ui file. Fixes Ximian bug #13034.
-
-2002-04-30 JP Rosevear <jpr@ximian.com>
-
- * gui/component/Makefile.am (EXTRA_DIST): fix
-
-2002-04-30 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-model.c,
- gui/widgets/e-addressbook-model.h
- (e_addressbook_model_peek_card): Added this function so that there
- would be less duplication of cards during run time when
- duplication is unnecessary.
-
- * gui/widgets/e-addressbook-view.c: Cleaned up get_card_list and a
- number of associated functions to be much more uniform and
- simpler.
- (get_has_email_address): Don't show the "Send Message to Contact"
- menu item if there are no email addresses in the listed contacts.
- Fixes bug #1298.
-
-2002-04-30 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send): Changed this to set a
- subject when sending a contact. This makes the signature be set
- properly also.
-
-2002-04-26 Jeffrey Stedfast <fejj@ximian.com>
-
- * printing/Makefile.am: Don't link to libibex anymore.
-
- * conduit/Makefile.am: Same.
-
- * backend/ebook/Makefile.am: Again here.
-
- * gui/component/Makefile.am: And finally here.
-
-2002-04-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_child_free): Unref the text_model here instead of
- the model, since the model never gets set. Removed the model
- field since it's no longer used.
-
-2002-04-24 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/ldap-config.c: Updated this for the new
- e_table_memory_store_insert function prototype.
-
-2002-04-24 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/component/select-names/select-names.glade (folder_browse):
- Added a "Browse..." button to switch to a different addressbook
- folder.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_transfer_cards):
- Moved extern EvolutionShellClient out of this function so that
- it'd be more readable.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Coded handling of the
- select_entry to search within the displayed contacts.
-
- * gui/component/select-names/select-names.glade: Updated this
- dialog to have an entry-select instead of an entry-find.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/select-names.glade: Updated this
- dialog to match the redesign.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (do_popup_menu): Make unused
- menu items disappear instead of graying out.
-
-2002-04-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c,
- gui/widgets/e-addressbook-reflow-adapter.h: Removed
- e_addressbook_reflow_adapter_right_click and
- e_addressbook_reflow_adapter_base_right_click.
-
- * gui/widgets/e-addressbook-view.c: Handle right click menu for
- both types of view. Merged right click on white space with right
- click on main area. General clean up.
-
- * gui/widgets/e-minicard-view-widget.c,
- gui/widgets/e-minicard-view-widget.h: Removed a couple unnecessary
- functions. Added e_minicard_view_widget_get_view. Added
- right_click signal.
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h:
- Added the right_click signal and the e_minicard_view_get_card_list
- function.
-
-2002-04-22 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.h: Removed an unused
- variable here.
-
- * gui/widgets/e-addressbook-view.c (table_right_click,
- table_white_space_event): Added a current view submenu to the
- popup menu here.
-
-2002-04-22 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_drag_begin):
- Allow GDK_ACTION_COPY also, since the composer for example does
- not accept MOVE's. Completes bug #8448.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/ldap-config.glade: change order of scope option
- menu to match how it's stored.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: change ldap
- config control text so it fits in the config dialog.
-
- * gui/component/ldap-config.c: #ifdef lots of stuff HAVE_LDAP so
- it'll build/run in either case.
- (addressbook_source_dialog_destroy): rename
- addressbook_add_server_druid_destroy to this, and free lots more
- stuff.
- (addressbook_add_server_druid):
- addressbook_add_server_druid_destroy ->
- addressbook_source_dialog_destroy.
- (do_schema_query): add 3 second timeout to schema query.
- (addressbook_edit_server_dialog): hook up destroy signal.
- (config_control_new): if HAVE_LDAP isn't defined, put up a label
- saying so.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (INCLUDES): add LDAP_CFLAGS to INCLUDES
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): no more
- source->type.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/ldap-config.c (addressbook_dialog_get_source):
- fill in source->ssl.
- (addressbook_source_dialog_set_source): set up auth/scope/ssl
- option menus properly.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_init_source_uri): always include the
- limit/ssl in the uri so we don't need to rely on defaults
- everywhere.
- (ldap_source_foreach): store the ssl option.
-
- * gui/component/addressbook-storage.h: reorder SSLType to match
- the UI.
-
- * backend/pas/pas-backend-ldap.c: (struct _PASBackendLDAPPrivate)
- add field for ldap_timeout.
- (pas_backend_ldap_connect): reorder things a bit - we need to
- start tls before the root dse query, if we can.
- (pas_backend_ldap_load_uri): track the way ssl parameters are
- given in the uri, and parse out the timeout.
-
- * gui/component/ldap-config.c (port_changed_func): use the
- symbolic SSL name instead of an integer constant.
-
-2002-04-18 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (get_ldap_library_info): fix
- memory leaks.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: remove the
- Addressbook_ConfigControl stuff to LDAP_ConfigControl.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES):
- remove addressbook-config.* and add ldap-config.*
- (glade_DATA): same.
- (evolution_addressbook_LDADD): add LDAP_LIBS.
-
- * gui/component/addressbook-component.c (owner_set_cb):
- addressbook_config_register_factory =>
- ldap_config_register_factory.
-
- * gui/component/addressbook.c (book_open_cb): remove source->type
- check - they're always LDAP.
- (load_uri_cb): same.
-
- * gui/component/addressbook-storage.c (ldap_unparse_ssl): new
- function.
- (ldap_parse_ssl): new function.
- (addressbook_storage_init_source_uri): use a more flexible scheme
- to build up the uri's, and add in the ssl parameter.
- (load_source_data): fill in source->ssl, and remove source->type
- assignment.
- (addressbook_source_copy): copy source->ssl, and remove
- source->type copy.
- (create_ldap_folder): addressbook_create_new_source =>
- ldap_config_create_new_source.
-
- * gui/component/addressbook-storage.h: remove
- AddressbookSourceType (it was always LDAP), and add
- AddressbookLDAPSSLType.
-
-2002-04-18 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_load_default_book): Append
- /addressbook.db to the end of the default URI if it starts with
- file:
-
- * backend/ebook/e-book.c (e_book_load_uri_step): Fix this to not
- loop forever if you have more than one backend.
-
-2002-04-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_create_categories): Changed this to use
- ECategoriesMasterListOptionMenu.
-
- * gui/component/select-names/e-select-names.c
- (section_right_click_cb),
- gui/widgets/e-addressbook-reflow-adapter.c,
- gui/widgets/e-addressbook-view.c: Updated these to match the new
- EPopupMenu.
-
-2002-04-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c: Include
- addressbook-config.h here as this file uses it.
-
- * gui/component/select-names/e-select-names.c (SPEC, SPEC2): Made
- this dialog searchable by typing in the ETable.
-
- * gui/widgets/e-addressbook-model.c: Include e-addressbook-util.h
- here.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click),
- gui/widgets/e-addressbook-view.c (table_right_click): Fixed a
- memory leak here by using "selection-done" signal.
-
- * gui/widgets/e-addressbook-reflow-adapter.c,
- gui/widgets/e-addressbook-reflow-adapter.h,
- gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard-view.c:
- Added a right click menu for areas that aren't cards.
-
-2002-04-09 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-util.c (e_book_load_default_book): Update
- for new-and-improved consistent default folder uri.
-
- * gui/component/addressbook.c (addressbook_load_default_book): Use
- e_book_load_default_book rather than duplicating most of its logic
- here.
- (load_uri_cb): Modify to work as a callback for
- addressbook_load_default_book as well as addressbook_load_uri.
-
-2002-04-08 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-component.c (create_view): Add
- view_info arg, but don't do anything with it.
-
-2002-04-06 JP Rosevear <jpr@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: add
- config_item:type
-
-2002-04-04 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: link to the static libversit
-
-2002-04-04 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_transfer_cards):
- Update for evolution_shell_client_user_select_folder API change.
-
-2002-04-04 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Remove AddressbookConfig,
- ContactNew, ContactNewList EPixmap entries.
-
- * gui/component/addressbook-factory.c (main): Print out a
- debugging message just before the main loop starts, for debugging
- purposes.
-
-2002-04-02 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-card-simple.h: Fix spelling of
- E_CARD_SIMPLE_PHONE_ID_TTYTDD and E_CARD_SIMPLE_FIELD_PHONE_TTYTDD
- (they previously ended with "TTD" instead of "TDD")
-
- * backend/ebook/e-card-simple.c: Update for spelling fix.
-
- * backend/pas/pas-backend-ldap.c: Likewise
-
-2002-04-01 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c:
- parent_class should be static. (From Max Horn <max@quendi.de>)
-
-2002-03-29 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add priority
- for the config page. Renamed to "Directory Servers".
-
-2002-03-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_create_card): don't free req->vcard.
- it's freed in pas_book_free_request.
- (pas_backend_file_process_remove_card): don't free req->id for the
- same reason.
- (pas_backend_file_process_modify_card): don't free req->vcard for
- the same reason.
- (pas_backend_file_process_get_changes): don't free req->change_id
- or release_unref the listener for the same reason.
-
-2002-03-27 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (check_schema_support): make sure
- to call ldap_value_free (values);, and ldap_msgfree (resp).
- (get_ldap_library_info): don't ask me why, but it appears we have
- to free each extension char*.
- (query_ldap_root_dse): make sure to free values in the
- subschemaSubentry code before overwriting it, and call
- ldap_msgfree(resp) when we're all done.
- (build_card_from_entry): don't leak the DN, ldap attributes, or
- the berval the ldap_*_attribute calls use to step through the
- attributes. the docs say this berval is freed when
- ldap_next_attribute returns NULL, but if we don't free it it leaks
- a substantial amount of memory.
- (pas_backend_ldap_search): make sure to only allocate *op once,
- and fix the g_warning since op isn't valid in its scope anymore.
-
-2002-03-19 Dan Winship <danw@ximian.com>
-
- * backend/ebook/Makefile.am: Update for libversit change: Use .a
- rather than .la now.
-
- * printing/Makefile.am: Likewise
-
- * gui/component/Makefile.am: Likewise
-
-2002-03-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (addressbook_menu_activated):
- Removed.
- (addressbook_factory_new_control): Don't connect anymore, as this
- signal has been removed from the ESearchBar.
- (addressbook_factory_new_control): No more custom menu items here.
-
-2002-03-15 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_right_click): Update to
- use new EPopupMenu API.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click): Update to use new
- EPopupMenu API.
-
- * gui/component/select-names/e-select-names.c
- (section_right_click_cb): Update to match new EPopupMenu api.
-
-2002-03-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Remove the
- `addressbook_search_menu_items'.
- (addressbook_menu_activated): Removed.
- (addressbook_factory_new_control): Don't connect. No menu items.
-
-2002-03-15 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (control_activate): Call
- `e_search_bar_set_ui_component()' to set the BonoboUIComponent for
- the search bar.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add an icon
- for the LDAP sources configuration control.
-
-2002-03-12 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Remove verb "AddressbookConfig".
- (config_cb): Removed.
-
- * gui/component/addressbook-config.c: Remove `dialog' member from
- `AddresbookDialog'. Instead, add a `config_control' member.
- (config_control_new): New.
- (addressbook_config): Removed.
- (addressbook_config_register_factory): New.
- (config_control_factory_fn): New, factory function for the
- ConfigControl page.
- (addressbook_source_edit_changed): Don't change the sensitivity of
- the dialog. Rather, invoke ::changed on the ConfigPage.
- (auth_checkbutton_changed): No need to manually change the
- sensitiviness of the buttons here either.
- (add_source_clicked): Likewise, just invoke
- evolution_config_control_changed().
- (edit_source_clicked): Likewise.
- (addressbook_dialog_close): Removed.
- (config_control_destroy_callback): New, callback for when the
- config control gets destroyed.
- (addressbook_dialog_apply): Removed.
- (config_control_apply_callback): New callback for
- EvolutionConfigControl::apply.
- (addressbook_dialog_ok): Removed.
- (addressbook_config_control_new): Set up ->config_control and
- connect the signals.
-
- * gui/component/addressbook-config.glade: Call the main hbox in
- the addressbook_sources dialog `addressbook_sources_main_hbox'.
-
- * gui/component/addressbook-component.c (owner_set_cb): Call
- `addresbook_config_register_factory'.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Add items for
- OAFIID:GNOME_Evolution_Addresbook_ConfigControl and
- OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory.
-
-2002-03-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_query):
- change contains x-evolution-any-field to beginswith on email,
- full_name, and nickname. faster, and more applicable to this
- dialog.
-
-2002-03-09 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: add TLSNotAvailable to
- BookLister_CallStatus.
-
- * backend/ebook/e-book-types.h: add TLS_NOT_AVAILABLE to the EBookStatus enum.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): add TLS_NOT_AVAILABLE to the
- switch.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_get_static_capabilities): fix name.
- (pas_backend_ldap_class_init): fix name.
- (pas_backend_ldap_connect): change return type to CallStatus so we
- can return different errors from here. Also, do STARTTLS if the
- user has asked for it and the connection supports it, returning
- TLSNotAvailable (and close the connection) if they chose to
- require it.
- (pas_backend_ldap_load_uri): return pas_backend_ldap_connect.
- (func_beginswith): pull in change from evolution-1-0-branch to
- make full_name beginswith search both cn and sn.
-
-2002-03-09 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (jump_to_letter): since I've
- gone ahead and made the file backend (by way of
- pas-backend-card-sexp.c) use case insensitive searches for
- beginswith, there's no need to list upper and lower case here.
-
- * gui/component/addressbook.c (addressbook_search_option_items):
- reorder things to put "Any field contains" at the end, since it's
- the least efficient search. Also reorder the enum to the same
- ordering. Change "Name contains" to "Name begins with" and change
- "Email contains" to "Email is".
- (addressbook_search_activated): change FULL_NAME to beginswith,
- and change EMAIL to is to match the labels.
-
- * backend/pas/pas-backend-card-sexp.c (compare_name): new
- function, so we can compare both full and family names (so
- beginswith can operate on them both.)
- (endswith_helper): use e_utf8_strstrcase here, since all the
- backends backends use case insensitive searching.
- (func_endswith): same.
-
-2002-03-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_queue_create_card): track
- union/struct change.
- (pas_book_queue_remove_card): same.
- (pas_book_queue_modify_card): same.
- (pas_book_queue_get_cursor): same.
- (pas_book_queue_get_vcard): same.
- (pas_book_queue_authenticate_user): same.
- (pas_book_queue_get_book_view): same.
- (pas_book_queue_get_changes): same.
- (pas_book_free_request): new function - free everything we need to
- for each type of request.
- (pas_book_destroy): call pas_book_free_request here instead of
- just freeing 3 elements of the old struct. yay plugging memleaks.
-
- * backend/pas/pas-book.h: make PASRequest a union and split out
- members into structs, so it's a little clearer which fields are
- used by which requests. Also, add prototype for
- pas_book_free_request so backends can just free everything at once
- (usually in their requests_queued signal func.)
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_create_card): track struct/union change.
- (pas_backend_file_process_remove_card): same.
- (pas_backend_file_process_modify_card): same.
- (pas_backend_file_build_cards_list): same.
- (pas_backend_file_process_get_vcard): same.
- (pas_backend_file_process_get_cursor): same.
- (pas_backend_file_process_get_book_view): same.
- (pas_backend_file_process_get_changes): same.
- (pas_backend_file_process_check_connection): same.
- (pas_backend_file_process_authenticate_user): same.
- (pas_backend_file_process_get_supported_fields): same.
- (pas_backend_file_process_client_requests): case the union to the
- specific struct and pass it to the process_* functions. also,
- call pas_book_free_request here, instead of relying on each of the
- functions to free their stuff.
-
-2002-03-07 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): Update for
- evolution_storage_new() change.
-
-2002-03-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_realize): don't set "editable" here, as
- the way things work the backend isn't able to override a setting
- from the UI, so writable books never show up as writable.
-
-2002-03-04 Chris Toshok <toshok@ximian.com>
-
- [fixes bug #20871]
- * gui/component/select-names/select-names.glade: add the
- status-message label.
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): add status_message field.
-
- * gui/component/select-names/e-select-names.c (status_message):
- new function, set the label's text from the message.
- (e_select_names_init): get the status-message label, and if it's
- valid, connect to the status_message signal of the
- EAddressbookModel.
-
-2002-02-28 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_search): don't
- ref the view here, since it keeps the view alive until the search
- is over, which we don't want. we want the view's death to cancel
- the search. This speeds up starting new searches after one is
- already active (since switching searches actually creates a new
- book view and destroys the old one.)
- (ldap_search_dtor): remove the matching unref here. The unref as
- it was was incorrect anyway, and caused a crash (we needed
- search_op->view, not op->view.)
-
-2002-02-27 Chris Toshok <toshok@ximian.com>
-
- [fixes bug #20690]
- * backend/pas/pas-backend-ldap.c (func_and): the data arg is not
- GList** anymore, it's PASBackendLDAPSExpData*, so use
- ldap_data->list instead of *list.
- (func_or): same.
- (func_not): same.
- (func_contains): same.
- (func_is): same.
- (func_endswith): same.
- (func_beginswith): same, but also special case the beginswith
- "fileAs" query type (the one used by the alphabet buttons on the
- right hand side, so we can deal with entries that don't have
- fileAs attributes, and return meaningful responses.)
- (pas_backend_ldap_build_query): initialize the
- PASBackendLDAPSExpData struct and pass that instead of &list.
- Also, take the PASBackendLDAP arg to add to the struct in case we
- need it at some point in the future.
- (ldap_search_handler): pass in the PASBackendLDAP.
-
-2002-02-26 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): move
- card_count++ inside the if that checks to see if a card matches
- (and adds the card to the list).
-
-2002-02-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_query_changed): only
- handle the ESB_ADVANCED case here now. the actual query work is
- done in addressbook_search_activated.
- (addressbook_search_activated): split out all the searching
- functionality here.
- (addressbook_factory_new_control): hook up "search_activated" to
- addressbook_search_activated.
-
-2002-02-24 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): make the right auth page
- start up open.
-
- * gui/component/addressbook-storage.c (addressbook_source_free):
- free the binddn.
- (addressbook_source_copy): copy the binddn;
-
-2002-02-22 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bugs 20740, 16680, and god knows what else :) ]
- * gui/widgets/e-addressbook-model.c (create_card): double the
- allocated size every time we need more space instead of using a
- fixed size increment. this helps huge queries. Also, remove the
- gtk_object_get of "file_as", as it was dead code.
- (book_view_loaded): handle errors here (by popping up a dialog).
-
- * backend/pas/pas-backend-ldap.c (view_destroy): search_idle ->
- search_timeout.
- (build_card_from_entry): comment out some spew, and unref ecard
- when we're done to plug a memory leak.
- (send_pending_adds): send along to the client all the cards we've
- been saving up.
- (poll_ldap): use a timeout for ldap_result to keep the backend
- from blocking (and it turns out keep the frontend from hanging
- waiting on a ref to complete) on large db's with few matches.
-
- Also, add some fairly smart, self-tuning aggregating of cards.
- Keep track of the number of cards we've sent the last time through
- as well as this time, and estimate the number we want to aggregate
- the next time based on them (we average them at the moment),
- subject to maximum/minimum number of cards. also, we have a
- maximum aggregation time, after which we force a flush if there
- are pending cards and recalculate our target pending number.
- there's a minimum wait time to possibly keep outselves from
- spamming the ui, although it's 0 at the moment.
-
- Lastly, make sure to only notify the GUI of status messages when
- we need to. this results in a *huge* savings.
- (ldap_search_handler): initialize all the pending card stuff, and
- use a timeout instead of an idle function for poll_ldap.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): performance optimization
- for large adds. If we're a CardAddedEvent and there's an existing
- CardAddedEvent at the end of the queue, just concat the lists of
- cards together. This is to keep the gui from falling further and
- further behind the ldap backend, which is merrily spewing updates
- at the gui.
-
-2002-02-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/Makefile.am: Define $(iconsdir).
-
- * gui/component/addressbook-component.c (add_creatable_item): New
- helper function.
- (create_component): Add the icons for the user creatable items as
- well.
-
-2002-02-20 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri):
- track change to signature, and (for now) just change all the
- return FALSE's to _RepositoryOffline (what FALSE used to map to in
- pas_book_factory_process_request), and change TRUE to _Success.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_load_uri):
- track change to signature, and differentiate between
- pas_backend_ldap_connect failing (RepositoryOffline), and
- ldap_url_parse failing (OtherError).
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): since pas_backend_load_uri
- returns status now, use it to nodify the BookListener if there's a
- failure.
-
- * backend/pas/pas-backend.c (pas_backend_load_uri): track change
- to signature.
-
- * backend/pas/pas-backend.h: change return type of
- pas_backend_load_uri to
- GNOME_Evolution_Addressbook_BookListener_CallStatus to allow
- differentiation between failure types.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): handle _AUTHENTICATION_FAILED.
-
- * backend/ebook/e-book-types.h (EBookStatus): add
- _AUTHENTICATION_FAILED.
-
-2002-02-18 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): if the load_uri fails, notify
- the listener that the repository is offline. (partial fix for bug
- 20347)
-
-2002-02-18 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_dn_from_ecard): escape
- commas in the dn, since they're used by ldap to specify the node's
- placement in the tree. (fixes bug 20089)
- (rfc2254_escape): just use sprintf and %02X instead.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (set_book): Keep a
- ref of the model in this case as well.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (set_book): Make
- sure to only set the query once when creating a new book and not
- at all on addressbook model creation. This prevents an accidental
- pair of changes from making the addressbook model load a remote
- addressbook.
-
- * gui/widgets/e-addressbook-model.c (get_view): If this is the
- first_get_view and the addressbook is remote, empty the view
- instead of leaving it in the state it used to be in. This only
- occurs if you set the book after the model has existed for a
- while.
- (e_addressbook_model_set_arg): When setting the book, set
- first_get_view to TRUE.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (display_view): Attach to the
- emvw instead of the emv here.
-
- * gui/widgets/e-minicard-view-widget.c, e-minicard-view-widget.h:
- Made this object have a "column_width" argument and a
- "column_width_changed" signal which are a simple layer down to the
- EMinicardView contained within.
-
- * gui/widgets/gal-view-minicard.c, gui/widgets/gal-view-minicard.h
- (gal_view_minicard_attach): Made this attach to an
- EMinicardViewWidget instead of a EMinicardView.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-util.c, backend/ebook/e-book-util.h
- (e_book_expand_uri, e_book_load_address_book_by_uri,
- e_book_use_address_book_by_uri): New functions that take a file://
- url ending in the directory name and automatically append the
- addressbook.db and do the appropriate thing.
-
- * backend/pas/pas-backend-card-sexp.c,
- backend/pas/pas-backend-card-sexp.h: Added copyright notice here.
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop), gui/component/addressbook.c
- (set_prop): Use e_book_expand_uri instead of
- addressbook_expand_uri.
-
- * gui/component/addressbook-storage.c: Fixed the fcntl include
- here.
-
- * gui/component/addressbook.c (ContactsCopyToFolder,
- ContactsMoveToFolder): Added handlers for these two verbs.
-
- * gui/component/addressbook.h: Removed addressbook_expand_uri in
- favor of e_book_expand_uri.
-
- * gui/widgets/e-addressbook-reflow-adapter.c (transfer_cards):
- Added code to handle Move to and Copy to right click menu items.
-
- * gui/widgets/e-addressbook-util.c,
- gui/widgets/e-addressbook-util.h (e_addressbook_transfer_cards):
- New function to pop up a dialog and transfer a set of cards to the
- given folder.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (display_view): Don't attach to
- the view if it doesn't exist yet. We have to make this then
- attach later.
- (e_addressbook_view_copy_to_folder,
- e_addressbook_view_move_to_folder): New functions utilizing
- e_addressbook_transfer_cards.
- (table_right_click): Add copy_to_folder and move_to_folder to the
- right click menu for tables here.
- (e_addressbook_view_discard_menus): Handle menu unmerging here.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): Removed unused field.
-
-2002-02-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (display_view): Attach the
- GalViewMinicard to the EMinicardView here.
-
- * gui/widgets/gal-view-minicard.c, gui/widgets/gal-view-minicard.h
- (gal_view_minicard_load, gal_view_minicard_save): Made these save
- the column width of the view.
- (gal_view_minicard_attach, gal_view_minicard_detach): Added these
- functions to allow the GalViewMinicard to set the column width of
- a EMinicardView and to monitor its changes.
-
-2002-02-12 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_get_arg): Added an argument to get the model.
-
- * gui/widgets/e-addressbook-view.c (writable_status): Don't bother
- connecting to the writable_status callback on the book, simply
- rely on the writable_status callback on the addressbook model.
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h
- (set_empty_message): Handle the case of a read only view here.
-
-2002-02-07 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): remove
- "New" from user creatable menu items
-
-2002-02-07 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h
- (e_addressbook_view_setup_menus): Changed this function to use the
- new GalViewMenus which takes a GalViewInstance, instead of a
- GalViewCollection.
-
-2002-02-04 JP Rosevear <jpr@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (find_address_mailing): tidy
-
- * conduit/address-conduit.c (addrconduit_load_configuration): load
- default address setting
- (addrconduit_save_configuration): save default address setting
- (e_addr_gui_new): new gui routine for conduit settings
- (e_addr_gui_fill_widgets): ditto
- (e_addr_gui_fill_config): ditto
- (e_addr_gui_destroy): ditto
- (e_addr_context_destroy): destroy the gui and new_cfg
- (local_record_from_ecard): reinstate commented out bits, determine
- which address to sync to pilot
- (ecard_from_remote_record): determine which address to sync from
- pilot
- (fill_widgets): put the gui widgets in
- (create_settings_window): create gui
- (save_settings): fill gui
-
-2002-02-04 JP Rosevear <jpr@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (address_text_changed): if
- the shown address in the mailing address or there is no mailing
- address, set the default flag and make sure the button is checked
- (address_mailing_changed): set the flags properly when the mailing
- address changes
- (e_contact_editor_init): listen for the check button being toggled
- (find_address_mailing): find the address (if any) with the default
- flag
- (set_address_field): set the mailing address button appropriately
- (fill_in_info): find the mailing address
-
- * gui/contact-editor/e-contact-editor.h: add new class data member
-
- * gui/contact-editor/contact-editor.glade: show mailing address
- check button
-
-2002-02-01 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_auto_recipient):
- New function to find out if a destination was one which was
- auto-matically set by Evolution.
- (e_destination_set_auto_recipient): Set whether or not the dest is
- an auto-recipient.
- (e_destination_touch): Don't touch the address if it is an
- auto_recipient.
- (e_destination_list_to_vector_sized): New function to avoid having
- to calculate the length of the list ourselves. Allows for a bit of
- optimization if our caller knows the length of the list.
- (e_destination_xml_encode): Encode the auto_recipient bit.
- (e_destination_xml_decode): Decode the auto_recipient bit.
-
-2002-02-01 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_sync_card): Made
- this preserve addressbook flags other than the first three.
-
- * backend/ebook/e-card-types.h: Added E_CARD_ADDR_MASK and
- E_CARD_ADDR_DEFAULT.
-
- * backend/ebook/e-card.c (get_address_flags): Added "PREF" to
- E_CARD_ADDR_DEFAULT mapping.
-
- * backend/ebook/test-client.c: Added #include "e-book-util.h".
-
-2002-01-30 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_changes):
- compute the change db filename based on our contact db filename.
- (pas_backend_file_load_uri): store the filename in
- bf->priv->filename.
- (pas_backend_file_destroy): free the filename, and (!) free
- bf->priv too.
-
-2002-01-28 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_valid): Revert
- my previous change as trow says this will break auto-completion
- stuff.
-
-2002-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/contact-editor/Makefile.am: Use EVOLUTION_ADDRESSBOOK_CFLAGS.
- * gui/contact-list-editor/Makefile.am: Likewise.
- * gui/merging/Makefile.am: Likewise.
- * gui/search/Makefile.am: Likewise.
- * gui/component/select-names/Makefile.am: Likewise.
-
-2002-01-25 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_valid): Don't
- check for an @ in the email address. This is to fix bug #10960.
-
-2002-01-24 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug 16097 ]
- * gui/component/addressbook-config.glade: gui love for the new
- auth stuff.
-
- * gui/component/addressbook.c (load_uri_cb): track change to auth,
- and offer up different prompt strings depending on which method
- (binddn or email) we're using.
-
- * gui/component/addressbook-storage.c (ldap_unparse_auth): use the
- new auth types for ldap.
- (ldap_parse_auth): same.
- (addressbook_storage_auth_type_to_string): new function.
- (load_source_data): get the binddn too.
- (ldap_source_foreach): store out binddn or emailaddr, depending on
- the auth type chosen.
-
- * gui/component/addressbook-storage.h: add the more detailed auth
- types, add "binddn" to the source structure, and add a prototype
- for addressbook_storage_auth_type_to_string.
-
- * gui/component/addressbook-config.c (auth_checkbutton_changed):
- set the auth stuff (in)sensitive.
- (auth_optionmenu_activated): new function.
- (addressbook_source_dialog_set_source): track UI change.
- (addressbook_source_dialog_get_source): same.
- (add_scope_activate_cb): rename add_activate_cb to this to
- distinguish it from the auth stuff.
- (add_auth_activate_cb): new function.
- (addressbook_source_dialog): track change to auth UI stuff.
- (addressbook_storage_auth_type_to_string): new function.
-
- * backend/ebook/e-book.h: add auth_method arg to
- e_book_authenticate_user.
-
- * backend/ebook/e-book.c (e_book_authenticate_user): track change
- to prototype - add auth_method arg, and pass it along to the CORBA
- call.
-
- * backend/ebook/test-client.c (book_open_cb): track api change -
- keep this building.
-
- * backend/pas/pas-book.h: add auth_method slot in PASRequest.
-
- * backend/pas/pas-book.c (pas_book_queue_authenticate_user): add
- auth_method arg and add it to the PASRequest.
- (impl_GNOME_Evolution_Addressbook_Book_authenticateUser): track
- idl change, add auth_method and pass it along to
- pas_book_queue_authenticate_user.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): support both
- "ldap/simple-email" and "ldap/simple-binddn" auth methods.
-
- * backend/idl/addressbook.idl: add "in string authMethod" to
- authenticateUser.
-
-2002-01-24 Ettore Perazzoli <ettore@ximian.com>
-
- * conduit/Makefile.am: Use EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS
- and EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS and remove unused flags
-
- * gui/component/Makefile.am: Use EVOLUTION_ADDRESSBOOK_CFLAGS and
- EVOLUTION_ADDRESSBOOK_LIBS and remove unused flags.
- * backend/pas/Makefile.am: Likewise.
- * backend/ebook/Makefile.am: Likewise.
- * printing/Makefile.am: Likewise.
- * backend/ebook/Makefile.am: Likewise.
- * gui/widgets/Makefile.am (INCLUDES): Likewise.
-
-2002-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (create_component): Pass a
- NULL @icon to
- `evolution_shell_component_add_user_creatable_item()'.
-
-2002-01-23 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c: #include
- <locale.h>.
-
-2002-01-22 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug # 16864 ]
- * backend/ebook/evolution-ldif-importer.c (getValue): create and
- return a GString here, instead of writing to a fixed size buffer.
- (parseLine): use a GString here instead of a fixed size buffer.
-
-2002-01-21 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_search_handler): Set the
- number of cards to return to the value specified in the ldap uri,
- leaving the default at 100. Fixes Ximian bug #13953.
-
- * gui/component/addressbook-config.c (addressbook_source_dialog),
- gui/component/addressbook-config.glade: Added a limit entry here
- to edit the limit field of the source.
-
- * gui/component/addressbook-storage.c,
- gui/component/addressbook-storage.h
- (addressbook_storage_init_source_uri): Added a limit field to this
- class and pass that value through in the uri that's generated.
-
-2002-01-18 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c: Made username match with no
- domain match be vague instead of partial. Fixes Ximian bug
- #13612.
-
-2002-01-18 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (view_contact_cb): New verb to open
- a bunch of cards.
-
- * gui/widgets/e-addressbook-reflow-adapter.c (open_card): Call
- e_addressbook_show_multiple_cards instead of doing this ourselves.
-
- * gui/widgets/e-addressbook-util.c,
- gui/widgets/e-addressbook-util.h
- (e_addressbook_show_multiple_cards): Added this function to show a
- bunch of cards, including a dialog if lots of windows are going to
- appear.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_view,
- e_addressbook_view_can_view): e_addressbook_view_view calls
- e_addressbook_show_multiple_cards on the appropriate list of
- cards.
-
-2002-01-18 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c
- (fill_in_countries), gui/contact-editor/fulladdr.glade: Sort
- country list. Country list moves from fulladdr.glade to
- e-contact-editor-address.c, but only a few country names have
- actually changed. Fixes Ximian bug #16545.
-
-2001-12-20 Zbigniew Chyla <cyba@gnome.pl>
-
- Fixes #17725
-
- * evolution/addressbook/printing/e-contact-print.c (complete_sequence):
- Do not assume that the first byte of file_as is the first letter, use
- utf8 functions instead.
-
-2002-01-16 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c: move all functions here, get rid of
- header files, use e-pilot-settings to display gui
-
-2002-01-15 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/select-names.glade: remove misleading
- title and fix spacing
-
-2002-01-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (alphabet_state_changed): Handle
- setting the search bar to "Advanced..." when the alphabet buttons
- are pushed and back when they're cleared. Fixes Ximian bug
- #12904.
- (addressbook_menu_activated): When the user calls Search->clear,
- set the search to ESB_ANY and "", don't just set the text. This
- is especially useful when it's set to ESB_ADVANCED.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (alphabet_state_change): Added
- this signal which gets emitted when the alphabet buttons are
- pushed.
- (command_state_change): Removed the ref pair here. It's not
- necessary. gtk_signal_emit refs the object itself.
-
-2002-01-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (name_synonyms): Added a couple
- of names here.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_get_nth_obj): Removed an unused
- variable.
-
-2002-01-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (create_alphabet): Use toggle
- buttons here. Fixes Ximian bug #10734.
-
-2002-01-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (set_fields): Choose the
- first filled in address field here. Fixes Ximian bug #2222.
-
-2002-01-03 Joe Shaw <joe@ximian.com>
-
- * backend/ebook/test-card.c: Add a test for getting arbitrary
- fields.
-
- * backend/pas/pas-backend-card-sexp.c (compare_arbitrary): Added.
- (prop_info_table): Add a LIST_PROP for arbitrary fields.
-
-2002-01-03 Nat Friedman <nat@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): Free the
- query if the oaf response is of zero length.
-
-2001-12-27 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): When we clean, don't clean the model's last
- element. This helps keep things working properly when we have
- signal-character separators.
- (section_right_click_cb): Changed to work properly with our
- EText-emitted popup signal.
- (e_select_names_add_section): Use ETexts for the recipient
- sections, rather than tables. This lets us make them directly
- editable. (Bug #1721)
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_info_new): Pass in a ESelectNamesTextModel, not a
- ESelectNamesModel.
- (e_select_names_popup): Adjust for the new signature for
- e_select_names_model_text_pos.
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_out_cb): Schedule a cleaning when we focus out.
- (focus_in_cb): Cancel pending cleaning when we get focus. This
- helps us avoid bad things happening during the fast focus out/ins
- that happen when the completion dropdown appears.
- (completion_handler): Adjust for new signatures of
- e_select_names_model_text_pos and e_select_names_model_name_pos.
- (e_select_names_manager_entry_new): Pass in our
- ESelectNamesTextModel when constructing the
- ESelectNamesCompletion.
- (e_select_names_manager_entry_free): Cancel any pending clean-ups.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Get the text off of the text model.
- Which is the only way that really makes sense when you think about
- it.
-
- * gui/component/select-names/e-select-names-completion.c: Added a
- copy of the associated ESelectNamesTextModel to
- ESelectNamesCompletionPrivate. This replaces the
- ESelectNamesModel.
- (e_select_names_completion_destroy): Unref ->text_model.
- (e_select_names_completion_handle_request): Pass in our text
- model's separator info when calling e_select_names_model_text_pos.
- (e_select_names_completion_new): Pass in the text model as an arg
- instead of the model, and ref it as needed.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_init): Set separator as either ", " or
- ",", depending on the value of the EVOLUTION_DISABLE_MAGIC_COMMA
- environment variable.
- (e_select_names_text_model_destroy): Free the separator.
- (changed_cb): Flush our cached text on changed.
- (e_select_names_text_model_set_source): Use our own changed_cb
- callback on changed, rather than just connecting up
- e_text_model_changed.
- (e_select_names_text_model_set_separator): Added. Lets the
- separator between recipients be specified.
- (e_select_names_text_model_get_text): Cache the text we get from
- calling e_select_names_model_get_textification.
- (e_select_names_text_model_insert_length): A bunch of small
- changes to properly support generic separators, rather than
- (implicit and explicitly) assuming ", ".
- (e_select_names_text_model_delete): More small tweaks to handle
- generic separators.
- (e_select_names_text_model_get_nth_obj): Use new signature when
- calling e_select_names_model_name_pos, and use our cached text.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_destroy): We don't cache the text or
- addr_text anymore, so no need to free them here.
- (e_select_names_model_changed): ...and no need to reset our text
- and addr_text caches here.
- (e_select_names_model_get_textification): Take a separator as an
- arg, rather than just using ", ". Also, no caching.
- (e_select_names_model_get_address_text): Take a separator as an
- arg, rather than just using ", ". And no caching here either.
- (e_select_names_model_clean): Add arg that give us control over
- whether or not the last entry should get cleaned. We need this
- when using a one-character separator, so that new destinations
- that get tacked onto the end don't get immediately cleaned away
- for being empty.
- (e_select_names_model_name_pos): Take the separator length as an
- argument, remove implicit assumption of length 2.
- (e_select_names_model_text_pos): Take the separator length as an
- argument, remove implicit assumption of length 2.
-
-2001-12-20 Ettore Perazzoli <ettore@ximian.com>
-
- [Fix #17377, Evolution doesn't work on multi-depth displays.]
-
- * gui/component/addressbook-factory.c (main): Push GdkRGB visual
- and colormap.
-
-2001-12-19 Jon Trowbridge <trow@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click): Add cut/copy/paste to
- right-click menu.
-
- * gui/widgets/e-addressbook-view.c (table_right_click): Add
- cut/copy/paste to right-click menu. (Fixes bug #14528.) Also,
- disable some right-click options if our addressbook isn't
- editable.
-
-2001-12-18 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (check_for_slow_setting): go slow and
- clear the map if the last uri and the current uri do not match
- (post_sync): save the last uri
-
- * conduits/address-conduit-config.h: handle a last uri config
- option
-
-2001-12-18 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_default_book_open):
- change this to match its e-book counterpart, and only failover to
- the local addressbook if the protocol wasn't supported. that way
- errors like "failure to connect" are still reported to the user.
-
- * backend/ebook/e-book-util.h: add prototypes for
- e_book_load_default_book and e_book_get_config_database.
-
- * backend/ebook/e-book-util.c (e_book_default_book_open): new
- function, basically cut and paste addressbook_default_book_open
- from addressbook.c here.
- (e_book_load_default_book): cut and past
- addressbook_load_default_book here, pretty much, except leave off
- the auth stuff.
- (e_book_get_config_database): new function, returns the
- Bonobo_ConfigDatabase for e_book_load_default_book to use.
-
- * conduit/address-conduit.c (start_addressbook_server): use
- e_book_load_default_book here.
-
-2001-12-17 Chris Toshok <toshok@ximian.com>
-
- [ fixes bug 17355 ]
- * gui/component/select-names/e-select-names.c (new_folder): if
- we're dealing with an LDAP folder, prepend [LDAP] to it. Now that
- we have 3 different places where folders are coming from, it helps
- to be able to differentiate "Contacts" in ~/evolution and a
- "Contacts" ldap server and a "Contacts" exchange folder.
- (add_additional_select_names_uris): loop through the bonobo conf
- settings for additional folders, adding them to the option menu.
- (e_select_names_hookup_shell_listeners): call
- add_additional_select_names_uris.
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_realize): Use an #ECanvasBackground here
- instead of a #GnomeCanvasRect.
-
-2001-12-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: Added
- 'cache_complete' flag to ESelectNamesCompletionPrivate.
- (e_select_names_completion_seq_complete_cb): Set cache_complete
- to TRUE if our query wasn't interrupted.
- (e_select_names_completion_start_query): Set cache_complete to
- FALSE at the beginning of a potentially-cached query.
- (e_select_names_completion_do_query): Only reuse cached cards
- if cache_complete is TRUE. (Fixes bug #10241)
-
-2001-12-15 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (e_addr_context_destroy): don't free
- the hash table keys, we didn't allocate them and free the change
- objects and unref the associated cards
- (local_record_from_uid): unref the temp card we create
- (replace_record): ref the new card associated with the card change
- and unref the old one
-
-2001-12-13 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): Make sure
- to copy the custom fields so they are not overwritten
-
-2001-12-13 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book-util.c (simple_query_new): Used
- g_strdup_printf to dup a string. Doh! Changed to g_strdup.
- (Bug #17126)
-
-2001-12-07 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_entry_new): Remove a reference to code
- I don't want to commit yet. :-)
-
- * gui/component/select-names/e-select-names-manager.c: Extensively
- refactored -- this code had gotten _really_ ugly. Untangle things
- to the point where our reference counting problems are fixable.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Remove all of the ugly hacks to work around our
- memory management problems, and just unref the manager.
- (Fixes #14412)
-
-2001-12-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (search_for_dn_with_objectclasses): move search_for_dn's contents
- here, and add an "existing_objectclasses" parameter that we pass
- on to build_card_from_entry.
- (search_for_dn): call search_for_dn_with_objectclasses with NULL
- for existing_objectclasses.
- (build_card_from_entry): if existing_objectclasses is non-NULL,
- fill it in with the list of existing objectclass values for this
- entry.
- (add_objectclass_mod): if existing_objectclasses is non-NULL,
- meaning we're modifying an entry, search in the existing
- objectclasses for the ones we want to be there, and only add
- what's missing. If none are missing, don't add objectclass_mod to
- the list of mods.
- (create_card_handler): track change to add_objectclass_mod (pass
- NULL).
- (modify_card_handler): use search_for_dn_with_objectclasses
- instead of search_for_dn, and pass the existing objectclasses to
- add_objectclass_mod. also, free the list when we're done.
- (poll_ldap): track change to build_card_from_entry (pass NULL).
-
-2001-12-05 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- we need to be able to disable non-labels here as well. since
- we're using enable_widget and not gtk_widget_set_sensitive, it's
- okay to handle entries/text's, etc, here.
- (widget_field_mappings): add label-caluri and label-fburl here.
-
- * gui/contact-editor/contact-editor.glade: change the label names
- for the freebusy/calendar urls to have more descriptive names,
- since we use them in e-contact-editor.c now.
-
- * backend/pas/pas-backend-ldap.c: add support for
- caluri/calendarURI, fburl/freeBusyURI.
-
- * backend/pas/evolutionperson.schema: add calendarURI and
- freeBusyURI.
-
-2001-12-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Fixed up the
- accelerators and such here.
-
- * gui/contact-editor/e-contact-editor.c (file_save_as_cb):
- Translate this string.
- (pixmaps): Added a pixmap for the ContactEditorSaveClose command.
- (setup_tab_order): Fixed up the tab order here.
-
- * gui/contact-editor/fulladdr.glade: Made the country combo
- focusable here.
-
-2001-12-03 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_equal): Make address
- comparisons case-insensitive. (Fixes 11776)
-
- * backend/ebook/e-card.c (e_card_email_match_single_string): Make address
- host comparisons case-insensitive. (Fixes 11776)
-
- * gui/component/select-names/e-select-names-manager.c (focus_out_cb): Clean
- ESelectNamesModel on focus-out. (Half of a fix for 15656)
-
- * backend/ebook/e-destination.c (nonempty): Fix this function
- and make it utf8-safe. (The other half of the fix for 15656)
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c: Consistency
- fixes with standard contact editor. Added Save As, Send As, and
- Send To. Replaced Save toolbar with Save and Close and added Save
- and Close menu item. Added a trash icon.
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor-address.c (setup_tab_order):
- Setup the tab order here. Fixes Ximian bug #13751.
-
-2001-11-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (connect_master_list_changed,
- make_suboptions): Changed how this list of categories gets
- computed. Fixes Ximian bugs #7707 and #7708.
-
-2001-11-15 Zbigniew Chyla <cyba@gnome.pl>
-
- * printing/e-contact-print-envelope.c (ecpe_linelist_dimensions),
- printing/e-contact-print.c (e_contact_divide_text, e_contact_output,
- e_contact_rectangle, e_contact_print_letter_tab,
- e_contact_print_letter_heading, e_contact_get_card_size,
- e_contact_print_card, e_contact_print_phone_list):
- s/gnome_font_get_width_string/gnome_font_get_width_utf8/
- s/gnome_font_get_width_string_n/gnome_font_get_width_utf8_sized/
-
-2001-11-14 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (search_for_dn): check against
- LDAP_SUCCESS as the return value, not -1.
- (pas_backend_ldap_build_all_cards_list): same.
- (pas_backend_ldap_process_authenticate_user): same.
-
-2001-11-12 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14843 ]
- * backend/pas/pas-backend-ldap.c (func_and): don't crash if a
- subexpression wasn't filled in.
-
- * backend/pas/pas-backend-ldap.c (func_or): same.
-
-2001-11-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (list_added_cb):
- Release callback's reference to EContactListEditor.
- (list_modified_cb): Release callback's reference to
- EContactListEditor.
- (save_card): Ref the EContactListEditor on behalf of the
- e_book_foo callback. (Fixes bug #14743)
- (save_card): Set changed to false once we've saved.
- (list_deleted_cb): Release callback's reference.
- (delete_cb): Hold reference for the callback.
-
-2001-11-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (categories_clicked): If
- our call to e_categories_new returns NULL, put up an error dialog
- and return. (Fixed #14780)
-
-2001-11-09 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14687 ]
- * backend/pas/pas-backend-file.c
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): do load_uri before add_client,
- so we know if the load actually worked (add_client uses this
- information to respond to the new client.) before this change,
- the client would still think the book was in a useful state even
- if the load_uri failed.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client): if
- the we're not connected, say so.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_add_client):
- same.
- (pas_backend_file_load_uri): don't report_writable here,
- add_client does it. was only needed before because of the
- improper ordering in pas-book-factory.c above.
-
-2001-11-09 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14646 ]
- * gui/component/addressbook.c (addressbook_default_book_open): new
- function. if the default_book failed to load, load the local
- addressbook in its place.
- addressbook_load_default_book): if we're loading the default_book
- uri, use addressbook_default_book_open as the open_response.
-
- * backend/ebook/e-book.c (e_book_load_uri_step): reset the
- load_state to NotLoaded so we can attempt another load_uri on
- the book if it fails.
-
-2001-11-08 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Explicitly destroy entries. Part of the fix for
- the lingering completion window bug.
-
-2001-11-04 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c: Use ordering of the pilot's phone
- label list to find fields we sync in order to avoid strcmp'ing the
- pilot's labels rendering phone syncing usable only for english
- language pilots
-
-2001-11-03 Chris Toshok <toshok@ximian.com>
-
- [ Fixes Ximian bug #14410 ]
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- init in_async_call to FALSE.
- (card_added_cb): turn the UI back on and set in_async_call to
- FALSE.
- (card_modified_cb): same.
- (card_deleted_cb): same.
- (save_card): turn off the UI by setting the dialog insensitive,
- and set in_async_call to TRUE.
- (delete_cb): same.
- (app_delete_event_cb): if we're in an async call don't let the
- window get deleted.
-
- * gui/contact-editor/e-contact-editor.h (struct _EContactEditor):
- add in_async_call flag for when we make a wombat call and need to
- disable the UI.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (e_contact_list_editor_init): init in_async_call to FALSE.
- (list_added_cb): turn the UI back on and set in_async_call to
- FALSE.
- (list_modified_cb): same.
- (list_deleted_cb): same.
- (save_card): turn off the UI by setting the dialog insensitive,
- and set in_async_call to TRUE.
- (delete_cb): same.
- (app_delete_event_cb): if we're in an async call don't let the
- window get deleted.
-
- * gui/contact-list-editor/e-contact-list-editor.h (struct
- _EContactListEditor): add in_async_call flag for when we make a
- wombat call and need to disable the UI.
-
-2001-11-02 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): Check for
- NULL dates before converting them to strings. Fixes Ximian bug
- #14394.
-
-2001-11-02 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Leak select-names related data structures until
- the memory management issues get sorted out. Fixed bug #14086.
-
-2001-10-31 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/e-cardlist-model.c,
- gui/component/select-names/e-select-names-table-model.c,
- gui/widgets/e-addressbook-table-adapter.c: Make the pre_changes
- and changes match here.
-
-2001-10-31 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_destroy): Check that local_listener and
- other_contacts_listener are non-NULL before
- disconnecting/unrefing.
-
- * gui/component/select-names/e-select-names-manager.c
- (entry_destroyed): The entry shouldn't unref the manager.
- (e_select_names_manager_create_entry): The entry shouldn't hold a
- ref to the manager. It becomes circular.
- (e_select_names_manager_create_entry): On the other hand, we
- should hold a ref to the entry we create.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Remove the explicit dialog destroy hack.
-
-2001-10-30 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_destroy): Force the select names dialog to be destroyed.
- This is a hack to fix bug #14002 -- I'll clean up the refcounting
- issues post-freeze. At least now it won't crash.
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): make sure
- to translate the character sets of the names
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (manager_ok_cb): send a null bonobo arg to prevent explosion
-
-2001-10-30 JP Rosevear <jpr@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: correct include typo
-
-2001-10-29 Jon Trowbridge <trow@ximian.com.
-
- * gui/widgets/e-minicard.c (add_field): Five characters, not four!
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_value_at): Convert xml-ified destinations into proper
- addresses.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com.
-
- * gui/component/select-names/e-select-names-bonobo.c (init):
- Connect to manager's "ok" signal.
- (manager_ok_cb): Emit "ok" bonobo-signal.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_class_init): Added "ok" signal.
- (e_select_names_clicked): Emit 'ok' signal.
-
-2001-10-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-util.c
- (e_addressbook_prompt_save_dialog): new function, a "Do you want
- to save changes?" dialog.
-
- * gui/widgets/e-addressbook-util.h: add prototype for
- e_addressbook_prompt_save_dialog.
-
- * gui/contact-editor/e-contact-editor.c (prompt_to_save_changes):
- call e_addressbook_prompt_save_dialog and save the card if they
- select save. return TRUE if the dialog should be closed, FALSE
- otherwise.
- (file_close_cb): check prompt_to_save_changes before closing the
- dialog.
- (app_delete_event_cb): same.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (prompt_to_save_changes): call e_addressbook_prompt_save_dialog
- and save the card if they select save. return TRUE if the dialog
- should be closed, FALSE otherwise.
- (file_close_cb): check prompt_to_save_changes before closing the
- dialog.
- (app_delete_event_cb): same.
-
-2001-10-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (add_objectclass_mod): overload
- this function for modifying objectclasses too, so we can make sure
- evolutionPerson shows up in the objectclasses of an entry if it
- shows up in the schema for the server.
- (create_card_handler): add @replace = FALSE in the call to
- add_objectclass_mod.
- (modify_card_handler): call add_objectclass_mod with @replace =
- TRUE.
- (anniversary_compare): fix typo - return "equal", not "TRUE".
- (birthday_compare): same.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * conduit/address-conduit.c (pre_sync): Comment out spew.
-
- * gui/contact-list-editor/e-contact-list-editor.c (fill_in_info):
- Comment out spew.
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop): Comment out spew.
- (get_dnd_selection): Comment out spew.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_set_value_at): Comment out spew.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (update_command_state): Check that
- our BonoboUIComponent has a container so we don't get a lot of
- annoying debug spew.
-
- * printing/smallbook.ecps: Fixed fonts.
-
- * printing/phonelist.ecps: Fixed fonts.
-
- * printing/medbook.ecps: Fixed fonts.
-
- * printing/e-contact-print.c (e_contact_get_card_size): Commented
- out spew.
-
- * gui/widgets/e-minicard.c (remodel): Check that e_minicard->card
- != NULL.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_destroy): We were using
- book_data->book_view immediately after unrefing it. Reordered the
- code a bit to avoid this.
-
-2001-10-29 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.h: add prototype for
- pas_book_factory_dump_active_backends.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_dump_active_backends): new function.
- (dump_active_server_map_entry): new function.
-
-2001-10-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (make_match): Drop a match if either of the text fields is NULL.
- This could happen if any of the utf-8 involved is invalid, for
- example. (Bug #13757)
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (is_syncable): fix bug that allowed
- for phone's not to be in priority order and the item to still be
- syncable
-
- * conduit/address-conduit-config.h
- (addrconduit_load_configuration): get management by id
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (is_syncable): a card also needs to
- have its phone nums in priority order to be "syncable"
-
-2001-10-29 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (is_syncable): move the syncable
- checking code to a different function
- (ecard_from_remote_record): set the name parts individually
- (local_record_from_ecard): use is_syncable
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (file_as_get_style,
- file_as_set_style): Use the actual ECardName in the ECard instead
- of parsing the full_name here.
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h
- (e_card_simple_set_name): New function to set the ECardName on
- this card and fix the file_as if necessary.
-
-2001-10-29 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h
- (e_card_simple_get): Handle returning dates here.
- (e_card_simple_get_allow_newlines): New function. Returns whether
- it makes much sense to have newlines in this string.
-
- * gui/component/addressbook-config.c,
- gui/component/addressbook-config.h
- (addressbook_create_new_source): The first argument here should
- be const.
-
- * gui/component/addressbook-storage.c: Added #include
- "addressbook-config.h".
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_event): On an
- escape here, cancel editing and remove the focus from the text.
-
- * gui/widgets/e-minicard.c (add_field): Set allow_newlines here.
- (field_activated): Stop editing on the activate signal and remove
- the focus from the text. Fixes Ximian bug #12286.
-
-2001-10-28 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.h: tidy
-
- * conduit/address-conduit-config.h: ditto
-
- * conduit/address-conduit.c (add_record): unref ecard when done
-
-2001-10-28 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card.c (e_card_date_from_string): Expose this
- function.
- (e_card_date_to_string): ...and this one. Fixes build problem in
- pas-backend-ldap.c.
-
-2001-10-28 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listeners): Change "this should never
- happen" dialog to not give my name/e-mail. Sorry translators.
- But this really should never happen, thanks to my fix below.
-
- * gui/component/addressbook-component.c: Initialize
- global_shell_client to NULL. (Bug #6625)
-
-2001-10-27 Chris Toshok <toshok@ximian.com>
-
- [ bug #12979 ]
- * backend/pas/pas-backend-ldap.c (anniversary_populate): new
- function.
- (anniversary_ber): new function.
- (anniversary_compare): new function.
- (birthday_populate): new function.
- (birthday_ber): new function.
- (birthday_compare): new function.
-
-2001-10-27 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_destroy): free up all the book_data
- list stuff.
- (e_select_names_completion_got_book_view_cb): deal with book_data
- being passed as the closure, and increment the
- pending_completion_seq counter.
- (e_select_names_completion_card_added_cb): deal with book_data
- being passwd as the closure.
- (e_select_names_completion_seq_complete_cb): same, and decrement
- the pending_completion_seq if we haven't gotten one for this book
- view before.
- (e_select_names_completion_stop_query): cancel all the
- book_data's.
- (e_select_names_completion_start_query): use the books_not_ready
- counter instead of book_ready. also, do e_book_get_book_view on
- each of the book's in our list.
- (e_select_names_completion_do_query): change to deal with our
- list.
- (e_select_names_completion_book_ready): decrement the
- book_not_ready counter.
- (e_select_names_completion_new): add the book we're created with
- to our list.
- (e_select_names_completion_add_book): implement.
-
- * gui/component/select-names/e-select-names-completion.h: add
- prototype for e_select_names_completion_add_book.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): use addressbook_config_data, and
- don't unref the db.
- (e_select_names_manager_create_entry): always add NULL for a book
- (which corresponds to the local book), and if the completion_book
- is present, add it to the list of books to complete again.
-
-2001-10-27 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (merge_cb): change to
- EBookCallback signature, and unref the book.
- (quick_add_merge_card): use addressbook_load_default_book.
- (ce_have_book): change to EBookCallback signature, and unref the
- book.
- (edit_card): use addressbook_load_default_book.
-
- * gui/component/e-address-popup.c (email_table_save_card_cb):
- change to EBookCallback signature, and unref the book.
- (add_card_idle_cb): use addressbook_load_default_book, and call
- the cb if it fails.
- (e_address_popup_cleanup): fix type -- should be "pop->card =
- NULL", not "pop = NULL".
- (contact_editor_cb): change to EBookCallback signature.
- (edit_contact_info_cb): use addressbook_load_default_book.
- (start_query): change to EBookCallback signature.
- (e_address_popup_query): use addressbook_load_default_book.
-
- * gui/widgets/e-minicard-control.c (book_open_cb): change to
- EBookCallback signature, and unref the book.
- (save_in_addressbook): use addressbook_load_default_book instead
- of e_book_use_local_address_book.
-
- * gui/widgets/Makefile.am (INCLUDES): change includes since we're
- including addressbook.h which has it's own set of funky include
- path requirements.
-
-2001-10-27 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): Don't leak
- stuff. (Bug #13709)
-
-2001-10-27 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-destination.c (name_and_email_simple_query_cb,
- nickname_simple_query_cb): Set book_uri when cardification occurs.
-
-2001-10-27 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Turned off use_ellipsis (it breaks
- emulate_label_resize) and on emulate_label_resize. Fixes Ximian
- bug #13693.
-
-2001-10-27 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (make_match): Doh! We should be sorting our contacts so that the
- most frequently used ones are at the top of the list, not the
- bottom.
-
- * backend/pas/pas-book.c (pas_book_check_queue): That should be a
- bonobo_object_unref, not a gtk_object_unref.
- (pas_book_queue_request): Likewise, we need to bonobo_object_ref
- here.
- (pas_book_destroy): If our pas_book_check_queue timeout is still
- active, disable it. This should never happen, but it never hurts
- to be careful.
- (pas_book_destroy): Set book->priv to NULL after we free it.
-
-2001-10-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): copy phone
- labels and show phone as well, clear correct entry text and
- correctly detect unsyncable cases
-
-2001-10-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): touch the
- record on lookup
- (check_for_slow_setting): write touched only if we are doing a
- slow sync
- (card_removed): don't touch on lookup
- (match): touch on lookup
-
-2001-10-27 Jon Trowbridge <trow@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_check_queue): Added paranoid
- reentrancy guards.
- (pas_book_queue_request): Changed our idle handler into a timeout,
- so as to work w/ reentrancy guards.
- (pas_book_init): Explicit initialization.
-
-2001-10-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.h: add prototypes for
- addressbook_config_database, and addressbook_load_default_book.
-
- * gui/component/addressbook.c (addressbook_config_database): new
- function, so we aren't activating the db everywhere we need to use
- it.
- (addressbook_load_default_book): load the default book, after
- getting the uri from bonobo-config.
-
-2001-10-26 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book-util.c (simple_query_card_added_cb): Return
- on cancellation.
- (simple_query_sequence_complete_cb): Act if not cancelled.
- (simple_query_book_view_cb): Free & return on cancellation.
- (e_book_simple_query_cancel): Set cancellation flag.
-
- * gui/component/e-address-popup.c (e_address_popup_query): Hold a
- reference to ourselves for the duration of our addressbook fetch.
- (start_query): Release when we've fetched our addressbook.
- (e_address_popup_cleanup): Break out most of what we do in
- _destroy into a separate function.
- (e_address_popup_destroy): Class cleanup.
- (contact_editor_cb): Paranoid clean-up.
- (add_contacts_cb): Paranoid clean-up.
- (e_address_popup_ambiguous_email_add): Paranoid clean-up.
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/e-address.conduit.in: remove the merges as valid sync
- types
-
- * conduit/address-conduit.c (pre_sync): write out only the touched
- records if we are doing copies
-
- * conduit/address-conduit-config.h
- (addrconduit_load_configuration): get the sync type
-
-2001-10-26 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-popup.c (e_address_popup_destroy):
- Cancel any pending queries.
-
- * gui/contact-editor/e-contact-editor.c (close_dialog): Don't
- assert, but check if ce->app != NULL, since this function can
- (apparently) get called multiple times.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists): Remove bad
- dialog ref-counting crap.
-
- * gui/contact-editor/e-contact-editor.c (save_card): Ref our
- EContactEditor, since we are holding a pointer to it in
- EditorCloseStruct.
- (card_modified_cb): Unref our EContactEditor when we free our
- EditorCloseStruct.
- (card_added_cb): Unref our EContactEditor when we free our
- EditorCloseStruct.
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (check_for_slow_setting): make debug
- info more accurate
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (e_addr_context_destroy): prevent
- double unref
- (cursor_cb): correct typo
- (card_removed): remove the card from the map if was archived and
- is now deleted
-
-2001-10-26 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.h: new member
-
- * conduit/address-conduit.c (print_remote): free the struct after
- using it
- (e_addr_context_new): make consistent with other conduits
- (e_addr_context_destroy): properly destroy the context
- (cursor_cb): no need to ref the card, its done for us
- (clear_entry_text): util function to free a field
- (free_local): free a local record
- (local_record_to_pilot_record): use a static buffer so we don't
- have to free it later
- (local_record_from_ecard): only fill in the fields we might not
- sync, clear a field before replacing the contents
- (for_each): track locals
- (for_each_modified): ditto
- (free_match): use free_local
-
-2001-10-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h
- (set_has_cursor): Added has_cursor argument. Setting the argument
- to TRUE if the minicard doesn't have focus will grab the focus.
- Fixes Ximian bug #3024.
-
-2001-10-24 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook-factory.c (main): Initialize
- gnome-vfs.
-
- * gui/component/addressbook-component.c (xfer_file): Added.
- (Copied from the calendar.)
- (xfer_folder): Fixed to allow renaming of contact folders.
-
-2001-10-24 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): Removed key_press handler here
- since delete and backspace are now handled by keybindings.
-
-2001-10-23 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c: Fix command paths when we specify
- our pixmaps, so we don't get a lot of totally useless & very ugly
- bonobo-ui spew.
-
- * backend/ebook/e-book-util.c (e_book_nickname_query): The empty
- string as an arg shouldn't generate a warning.
-
- * gui/component/select-names/e-select-names-completion.c: Removed
- our cancelled flag and e_select_names_completion_cancel function,
- since we were just duplicating stuff that had ended up in
- ECompletion.
- (match_name): Form our menu_text properly on an additional-name
- match.
- (e_select_names_completion_got_book_view_cb): Store handles for
- our signals, disconnect them properly when we switch book views.
- (e_select_names_completion_stop_query): Disconnect signals when we
- stop our query.
- (check_capabilities): Spew if we are using LDAP for completion.
- (e_select_names_completion_destroy): Disconnect our signals when
- we destroy.
- This all should fix bug #10241.
-
-2001-10-23 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Set "draw_button" argument to TRUE
- on this EEntry.
-
-2001-10-22 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-save-as.c (save_it): Put up an
- error dialog if there's an error while saving. If the person hits
- cancel on the "file exists" dialog, don't close the file selection
- dialog. Fixes Ximian bug #7055.
-
-2001-10-21 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (model_and_selection_free): right_click_up here when we let go of
- the popup.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_selection_event):
- right_click_up here.
-
-2001-10-21 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section, e_select_names_set_default): Use an
- EEntry here instead of a GtkLabel. Fixes Ximian bug #7067.
-
-2001-10-21 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (control_activate_cb): Call
- e_addressbook_model_force_folder_bar_message when we activate the
- component. (Fixes bug #11749)
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_force_folder_bar_message): Added. Forces
- emission of a folder_bar_message.
-
-2001-10-20 Larry Ewing <lewing@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_set_default): stick with the style font if the
- efont bold font does not exist.
- (e_select_names_set_default): don't forget to unref the oldstyle.
-
-2001-10-20 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): Fix memory leak.
-
- * gui/widgets/e-addressbook-view.c (jump_to_letter): Free our
- string vector letter_v when we are done with it.
-
- * gui/contact-editor/e-contact-quick-add.c (edit_card): Unref our
- QuickAdd structure.
-
- * gui/component/e-address-popup.c (e_address_popup_construct):
- Unref our style after we are done with it.
-
-2001-10-20 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): We
- shouldn't leak the info returned by oaf_query.
-
- * gui/contact-editor/e-contact-quick-add.c (card_added_cb): Remove
- superfluous call to quick_add_unref.
- (editor_closed_cb): Remove superfluous call to quick_add_unref.
-
- * gui/component/select-names/e-select-names.c (esn_get_key_fn): We
- need to unref the card returned by e_addressbook_model_get_card.
-
-2001-10-20 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Make LDAP servers
- non-user-creatable.
-
-2001-10-20 Jon Trowbridge <trow@ximian.com>
-
- * printing/e-contact-print.c (e_contact_print_card): Check that the
- string we are checking for xml-ness is non-NULL.
-
- * backend/ebook/e-destination.c (e_destination_importv): Filter
- out empty destinations. (also Bug #13036)
-
- * printing/e-contact-print.c (e_contact_build_style): Use
- gnome_font_new_closest; if gnome_font_new fails and returns NULL,
- our spacing gets all messed up. (Bug #10785)
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_can_print):
- Allow printing if there are any cards in our view. The selection
- has nothing to do with it.
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Check
- for strings that contain non-whitespace, rather than just looking
- for a non-zero first character. (Bug #13036)
-
-2001-10-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_selection_event):
- Handle focus_change in event by selecting that contact. Fixes
- Ximian bug #3024.
-
- * gui/component/addressbook-component.c (owner_unset_cb):
- Repeatedly call gtk_main_quit here as long as there is a main loop
- around. This is an ugly hack around Ximian bug #11760.
-
-2001-10-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c: Added #include
- <gal/widgets/e-unicode.h>.
-
- * gui/widgets/e-minicard-control.c: Made this display the number
- of extra cards in the attachment as well as made it save them all
- to the local addressbook if the person selects the button. Fixes
- Ximian bug #9507.
-
-2001-10-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): Changed this to not
- grab on a right click. Fixes Ximian bug #12660.
-
-2001-10-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_motion): Get @folder_type here too [to
- match the changes in the EvolutionShellComponentDnd interface].
- Also, remove a debugging message.
- (destination_folder_handle_drop): Likewise.
-
-2001-10-18 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c (add_menu_item):
- Translate labels in select-names option menu. (Bug #9604)
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Made the default window size
- slightly wider. (Bug #7516)
-
-2001-10-18 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h
- (e_card_list_get_vcard): Made this take a const GList.
-
-2001-10-18 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (check_capabilities): Added. Check if our book is local or
- networked.
- (e_select_names_completion_book_ready): Call check_capabilities.
- (e_select_names_completion_new): Call check_capabilities.
- (e_select_names_completion_do_query): If we have a networked book,
- keep trying if we haven't been able to cache any cards --- our
- earlier attempts could have failed due to too many matches. (Bug
- #12932)
-
- * gui/component/select-names/e-select-names-manager.c
- (focus_out_cb): Lag our cardification on focus-out. This seems to
- help with the unintended cardifications that can result from the
- weird focus-out/focus-in events that get generated when the popup
- disappears.
-
- * backend/ebook/e-card-compare.c: Removed some debug spew.
-
-2001-10-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- grab focus in the Account entry when preparing the dialog, fixes
- #10406.
-
-2001-10-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c (new_folder): make
- sure to also add "ldap-contacts" folders to the option menu.
-
-2001-10-17 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): sync all
- the fields we can, with out overwriting
- (local_record_from_ecard): write the fields to the pilot in
- priority order unless there are fields on the pilot we can't
- store, then fill in the fields as they are on the pilot
-
-2001-10-17 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_get_vobject): Did a bit of clean
- up here. Might fix some crashes, specifically Ximian bug #10164.
-
- * gui/widgets/e-addressbook-view.c (SPEC): Updated the model
- column numbers here. Fixes Ximian bug #12308.
-
-2001-10-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_upgrade_db):
- add upgrade from 0.1 to 0.2, where we make sure id dbt's match
- vcard id's, fixes longstanding bug (#7406) where cards were not
- modifiable or removable after having been created during a 1-2
- week long window in early betas.
- (PAS_BACKEND_FILE_VERSION): change to 0.2
- (PAS_ID_PREFIX): #define this here.
- (pas_backend_file_create_unique_id): use PAS_ID_PREFIX instead of
- the string.
-
-2001-10-16 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-ldif-importer.c (support_format_fn): Return
- FALSE if no extension.
-
-2001-10-16 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card.c (e_card_get_id): If card->id is NULL,
- return an empty string.
- (e_card_set_id): Don't allow the card id to be set to NULL; use
- the empty string instead.
- (e_card_get_vobject): When building our vcard, pass in the empty
- string as the id if card->id is NULL. (Bug #10164)
-
-2001-10-16 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): don't set
- the phone info if it is blank
- (ecard_from_remote_record): save up to 3 fax numbers
-
-2001-10-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client):
- unref the book after we pass it off to evolution-addressbook.
-
-2001-10-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_card_dtor): unref
- op->view.
- (pas_backend_ldap_process_create_card): ref op->view.
- (remove_card_dtor): unref op->view.
- (pas_backend_ldap_process_remove_card): ref op->view.
- (modify_card_dtor): unref op->view.
- (pas_backend_ldap_process_modify_card): ref op->view.
- (ldap_search_dtor): unref op->view.
- (pas_backend_ldap_search): ref op->view.
-
-2001-10-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_book_view): make sure to unref the
- book_view here so we don't leak them.
-
-2001-10-12 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-factory.c (main): call
- e_passwords_init and e_passwords_shutdown.
-
-2001-10-15 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (addPropValueQP, addPropValueSets,
- e_card_get_vobject): Properly decide whether a property needs to
- be marked as QP by searching for '\n'. Fixes Ximian bug #3021.
-
-2001-10-15 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-save-as.c (e_contact_save_as,
- e_contact_list_save_as): Set the default file name here. Fixes
- Ximian bug #7053.
-
-2001-10-14 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listeners): Added linebreaks to our
- "this shouldn't happen" dialog message. (Bug #12498)
-
-2001-10-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook-factory.c (main): Add a component name
- to the e_passwords_init() call.
-
-2001-10-12 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/evolution-ldif-importer.c: commit the importer
- originally from Michael M. Morrison, with fixups by toshok.
-
- * backend/ebook/Makefile.am (bin_PROGRAMS): add
- evolution-ldif-importer.
- (oaf_in_files): add
- GNOME_Evolution_Addressbook_LDIF_Importer.oaf.in.
-
- * backend/ebook/e-card-simple.h: add WANTS_HTML and IS_LIST.
-
- * backend/ebook/e-card-simple.c (field_data): add WANTS_HTML and
- IS_LIST.
- (e_card_simple_set): fix typo.
-
- * backend/ebook/.cvsignore: ignore
- GNOME_Evolution_Addressbook_LDIF_Importer.oaf and
- evolution-ldif-importer.
-
- * backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.oaf.in:
- ldif importer oafinfo.
-
-2001-10-12 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added a boolean type here.
-
-2001-10-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): Check to see if the uri we are
- setting is the same as the current uri. If so, do nothing.
- (Bug #11324)
-
-2001-10-11 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c
- (e_destination_reverting_is_a_good_idea): Added. Heuristic for
- whether or not we want to revert to an earlier cardified state.
- (e_destination_cardify): Don't be quite as aggressive about
- reverting to previous cardified states. (Bug #11890)
-
-2001-10-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_destroy,
- fill_in_info, e_card_simple_sync_card, e_card_simple_set_phone,
- e_card_simple_set_address, e_card_simple_set_delivery_address,
- file_as_get_style, file_as_set_style, e_card_simple_set,
- e_card_simple_set_arbitrary),
- gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_destroy,
- e_contact_editor_address_set_arg,
- e_contact_editor_address_get_arg),
- gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_destroy,
- e_contact_editor_fullname_set_arg,
- e_contact_editor_fullname_get_arg),
- gui/contact-editor/e-contact-editor.c (phone_entry_changed,
- address_text_changed, name_entry_changed, full_name_clicked,
- full_addr_clicked, fill_in_info): Changed these to use the new ref
- and unref functions for ECard auxillary types.
-
- * backend/ebook/e-card-simple.h: Added a comment.
-
- * backend/ebook/e-card-types.h: Added ref_count field to all the
- types.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added ref and
- unref functions here for all the ECard auxillary types. Removed
- the corresponding free functions. Switched to using these
- functions where appropriate.
-
- * gui/component/addressbook-factory.c: #include
- <e-util/e-passwords.h>
-
- * gui/component/addressbook.c (load_uri_cb): const correctify.
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names.c: #include
- <addressbook/gui/component/addressbook.h>
-
- * gui/widgets/e-addressbook-model.c (modify_card): Removed an
- unnecessary ref here.
-
-2001-10-11 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_folder):
- Don't need this any more.
-
-2001-10-11 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (new_contact_cb): Check that
- view->view != NULL.
- (save_contact_cb): Check that view->view != NULL.
- (search_cb): Check that view->view != NULL.
- (delete_contact_cb): Check that view->view != NULL.
- (print_cb): Check that view->view != NULL.
- (print_preview_cb): Check that view->view != NULL.
- (stop_loading_cb): Check that view->view != NULL.
- (cut_contacts_cb): Check that view->view != NULL.
- (copy_contacts_cb): Check that view->view != NULL.
- (paste_contacts_cb): Check that view->view != NULL.
- (select_all_contacts_cb): Check that view->view != NULL.
- (send_contact_cb): Check that view->view != NULL.
- (send_contact_to_cb): Check that view->view != NULL.
- (update_command_state): Check that view->view != NULL. Hold a
- reference to the AddressbookView for the duration of the function,
- in case we exit during bonobo-reentrancy.
- (addressbook_view_ref): Added.
- (addressbook_view_unref): Added. Simple ref counting for
- AddressbookView objects.
- (addressbook_view_clear): Zero out an AddressbookView. This is
- now separated from the deallocation of the AddressbookView object,
- so that we don't leave a dangling pointer if we exit during
- bonobo-reentrancy in update_command_state. (Which often seems to
- happen if we exit while addressbook operations are going on.)
- (destroy_callback): Replace previous call to addressbook_view_free
- with addressbook_view_clear/addressbook_view_unref calls.
- (addressbook_factory_new_control): Initialize the reference count
- in the AddressbookView object.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_destroy):
- Carefully zero out our destroyed object.
- (command_state_change): Hold a reference to ourselves during the
- signal emission.
- (get_selected_cards): Ref cards as we add them to the list.
- (e_addressbook_view_stop): Check for view != NULL.
- (e_addressbook_view_can_create): Check for view != NULL.
- (e_addressbook_view_can_print): Check for view != NULL.
- (e_addressbook_view_can_save_as): Check for view != NULL.
- (e_addressbook_view_can_send): Check for view != NULL.
- (e_addressbook_view_can_send_to): Check for view != NULL.
- (e_addressbook_view_can_delete): Check for view != NULL.
- (e_addressbook_view_can_cut): Check for view != NULL.
- (e_addressbook_view_can_copy): Check for view != NULL.
- (e_addressbook_view_can_paste): Check for view != NULL.
- (e_addressbook_view_can_select_all): Check for view != NULL.
- (e_addressbook_view_can_stop): Check for view != NULL.
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy): Be
- careful about zeroing out our destroyed object.
-
- * backend/ebook/e-book-view.c (e_book_view_stop): Added. Stops
- event processing in the underlying listener.
-
-2001-10-10 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_destroy): If our select names dialog is
- still around, destroy it. Otherwise, the dialog will hang around
- after our composer goes away.
-
-2001-10-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.glade: add an Email Address
- field/label/help text.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fill in the email entry
- from the source. also, set the initial state of the email
- label/entry.
- (auth_checkbutton_changed): set the email label/entry
- sensitive/editable if auth is turned on, and
- insensitive/uneditable if it's off.
- (addressbook_source_dialog_get_source): get the email address from
- the email entry.
- (addressbook_source_dialog): hook up the email entry to the
- changed signal foo, as well as the focus handler for displaying
- help text.
-
-2001-10-06 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): db isn't a BonoboObject, so don't
- bonobo_object_unref it!
-
-2001-10-05 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (addressbook_model_set_uri): e_book_load_uri ->
- addressbook_load_uri.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): e_book_load_uri ->
- addressbook_load_uri.
-
- * gui/component/addressbook.c (forget_passwords_cb): new function,
- call e_passwords_forget_passwords.
- (verbs): Add ContactsForgetPasswords.
- (load_uri_auth_cb): new function, call the callback and free up
- our closure stuff.
- (load_uri_cb): once the uri is loaded, check if we're configured
- to authenticate for it, and do so, using the e_passwords stuff.
- (addressbook_load_uri): wrapper around e_book_load_uri. save off
- the parameters and start the load-with-auth machinery.
- (book_open_cb): remove all the auth stuff from here, as it's
- handled elsewhere now.
-
- * gui/component/addressbook-factory.c (main): call
- e_passwords_init.
-
- * gui/component/addressbook-component.c (user_create_new_item_cb):
- e_book_load_uri -> addressbook_load_uri.
- (destination_folder_handle_drop): same.
-
- * gui/component/addressbook.h: add prototype for
- addressbook_load_uri (a wrapper around e_book_load_uri that also
- handles authentication if the user selects it.)
-
-2001-10-05 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Check to make sure our call to
- e_addressbook_model_get_card doesn't return NULL.
-
- * gui/widgets/e-addressbook-model.c
- (e_addressbook_model_get_card): Chek that we aren't requesting a
- negative row.
-
- * gui/contact-list-editor/e-contact-list-editor.c (add_email_cb):
- Move to the bottom of the scrolled window, so we can see the
- address we just added.
- (table_drag_data_received_cb): Move to the bottom of the scrolled
- window, so we can see the contact we just dropped.
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- We don't own the string returned by e_categories_master_list_nth,
- so terrible things will happen if we free it. (Bug 10916)
-
-2001-10-05 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_set_arg):
- don't set the editable field on the model - let the book do that.
- (book_writable_cb): call writable_status to propagate a ui-change
- event up (and sensitize the write-only toolbar buttons after you
- authenticate with ldap.)
-
-2001-10-04 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (activate_factories_for_uri): for some
- reason, matching on protocol is causing problems for me.
- disabling it for now.
-
-2001-10-04 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c: use ldap.png for ldap
- contacts.
-
-2001-10-03 Iain Holmes <iain@ximian.com>
-
- * addressbook/gui/component/addressbook-storage.c
- (addressbook_storage_setup): Only load_storages if you have LDAP.
- (load_source_data): Only do stuff if you have LDAP.
-
-2001-10-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (addressbook_height),
- gui/widgets/e-minicard.c (remodel): Fixed these to determine the
- fields to use properly.
-
-2001-10-02 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): Strip out commas before forming our query.
- (match_name): Use e_card_compare_name_to_string_full, rather
- than our crufty old matching code. Not only is this cleaner,
- but that crufty old code was very broken when it came to
- handling strings with whitespace. (Bug 8988)
- (match_nickname): utf8 and bug fixes.
-
- * backend/ebook/e-card-compare.c
- (e_card_compare_name_to_string_full): Added. This is basically
- e_card_compare_name_to_string with a bunch of extra options, so
- that it can more readily be reused in other contexts.
- (e_card_compare_name_to_string): This is now just a call to
- e_card_compare_name_to_string_full with the extra args filled in
- to defaults that simulate the old behavior.
-
-2001-10-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_construct): remove most of the
- oaf stuff from here. we do it in load_uri, where we'll have more
- information (namely, the protocol we're using.)
- (activate_factories_for_uri): do an oaf query to get a list of all
- objects implementing our BookFactory interface and also supporting
- the protocol used in the uri.
- (e_book_load_uri): try activating book factories to handle this
- uri, and start the iteration over the list.
- (e_book_load_uri_from_factory): try and load the uri.
- (e_book_load_uri_open_cb): callback function for the
- BookFactory_openBook call - if it succeeds, call the user's
- callback. otherwise step to the next factory.
- (e_book_load_uri_step): go to the next factory in our list, and
- error out if there are no more.
-
-2001-10-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_get_textification): Made the max length of
- the textification be 2047 characters. Fixes Ximian bug #3021.
-
-2001-10-01 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): if there
- was no first name or last name, file as the company.
-
-2001-10-01 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key): if there is a db error,
- assume deletion
- (pas_backend_file_changes): write after all is done for efficiency
-
-2001-09-28 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key): g_strdup
- (pas_backend_file_changes): ditto, make sure to free all data and
- do a hash write after each add/remove
-
- * conduit/address-conduit.c (local_record_to_pilot_record): use
- the local record category
- (local_record_from_ecard): ndle the fields and category we don't
- sync by making sure we don't overwrite them
-
-2001-09-27 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_construct): do an oaf query to
- get a list of all objects implementing our BookFactory interface,
- instead of just activating the one IID. this should really be a
- global list, not a per EBook.
- (e_book_load_uri): start the iteration over our list of
- BookFactory's.
- (e_book_load_uri_from_factory): try and load the uri.
- (e_book_load_uri_open_cb): callback function for the
- BookFactory_openBook call - if it succeeds, call the user's
- callback. otherwise step to the next factory.
- (e_book_load_uri_step): go to the next factory in our list, and
- error out if there are no more.
-
-2001-09-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): use the old
- record (if there was one) so as not to overwrite fields we don't
- sync
- (pre_sync): store the dbi in the context and don't make it object
- data
-
-2001-09-26 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book-factory.c (pas_book_factory_destroy): use
- priv->iid instead of the hardcoded string here.
- (pas_book_factory_activate): parameterize the factory's iid, as in
- the calendar server, and provide a default if iid == NULL.
-
- * backend/pas/pas-book-factory.h: add iid parameter for
- pas_book_factory_activate.
-
-2001-09-26 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_textrep): Use
- camel_address_format, not camel_address_encode.
-
-2001-09-26 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Added help text (thanks
- to Aaron) and re-worded the labels, and fixed the shortcuts on the
- brand-spanking-new Collaboration tab.
-
-
-2001-09-26 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.h: add
- completion_book.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_new): get /Addressbook/Completion/uri, and
- if it's present, use the corresponding EBook for completing
- addresses.
- (focus_out_cb): use manager->completion_book here instead of NULL,
- which corresponds to the local addressbook.
- (completion_popup_cb): same.
- (e_select_names_manager_create_entry): same.
-
-2001-09-26 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card-compare.c (e_card_compare_name_to_string):
- Properly handle names when the individual elements (given,
- addition, family) contain whitespace. (Bug #10502)
-
- * backend/ebook/e-destination.c (e_destination_set_name): Reset
- textrep when we change the name.
- (e_destination_set_email): Reset textrep when we change the email.
- (e_destination_get_textrep): Make sure that the textrep version of
- the address is properly quoted if it contains unsafe characters.
- (All related to bug #10796)
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): Fix nickname matching. (bug #9698)
- (make_match): Use e_completion_match_new when building our match,
- rather than ad hoc manipulation of the struct.
-
-2001-09-26 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_changes): set
- the last_use and use_score fields of the card to known values so
- the card doesn't register as changed when only they have changed
-
-2001-09-26 Peter Williams <peterw@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): Fix this function
- to set email addresses properly, and handle multiple occurrences of
- email addresses, home phone numbers, and business phone numbers.
-
-2001-09-25 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c (user_create_new_item_cb):
- Handle creating the new contact in the current folder if it's a
- contacts folder. Fixes Ximian bug #7814.
-
-2001-09-24 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/Makefile.am (LDAP_SCHEMA): add
- evolutionperson.schema
- (EXTRA_DIST): add LDAP_SCHEMA to the dist (but don't install it).
-
-2001-09-23 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): sync the
- note the to pilot and make sure to blank fields when appropriate
- (local_record_from_ecard): sync the note to the desktop
-
-2001-09-22 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c (do_create): g_free (id) in the
- error case to plug a memory leak.
-
-2001-09-22 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (remodel): when creating the cards,
- don't display any of the subname fields (surname, given, middle,
- suffix, etc.)
-
-2001-09-22 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card-simple.c
- (e_card_simple_get): add getters for the additional name fields.
- (field_data): move FAMILY_NAME to the end of the list, and add
- GIVEN_NAME, ADDITIONAL_NAME (middle name), and NAME_SUFFIX.
-
- * backend/ebook/e-card-simple.h: same.
-
-2001-09-21 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (print_preview_cb): Hooked up print
- preview button.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h
- (e_addressbook_view_print_preview): Added this function.
-
- * printing/e-contact-print.c, printing/e-contact-print.h
- (e_contact_print_preview): Added this function.
-
-2001-09-19 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (name_and_email_simple_query_cb):
- Use the default e-mail address if we have nothing else to go on.
- Previously we just failed, which basically meant that name-only
- searches would never work properly.
- (nickname_simple_query_cb): The logic was a bit tangled here; if
- our query status isn't SUCCESS, always give up but don't leak the
- destination. And if our nickname query fails and we try the
- name-and-email query, use the textrep for a name-only search. The
- only reason we are doing a nickname query in the first place is if
- we have an obviously invalid e-mail.
- (launch_cardify_query): Use e_destination_is_valid to determine
- if we should try a nickname query first.
- These changes basically fix bug 7728, and generally make the
- auto-cardification of addresses a lot more clever and robust.
-
- * backend/ebook/e-book-util.c (name_and_email_cb): Use
- e_card_compare_name_to_string instead of e_card_name_match_string.
- (e_book_name_and_email_query): The arguments to g_strsplit were
- in the wrong order. Doh!
-
- * backend/ebook/e-card-compare.c (e_card_compare_name_to_string):
- Added. Replaces e_card_name_match_string, and actually works.
-
- * backend/ebook/e-card.c: Removed e_card_name_match_string
- function, which didn't work particularly well.
-
-2001-09-19 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (cursor_cb): don't add to the complete
- list of cards if the card is a list
- (card_added): don't add to the list of changes if the card is a
- list
- (card_changed): ditto
- (card_removed): ditto
-
-2001-09-19 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listeners): Change the "this should
- never happen" message into a request for people to e-mail me
- directly with info if they encounter that error.
-
- * backend/ebook/e-book-util.c (e_book_name_and_email_query):
- Freeing name[i] instead of namev[i] is a bad idea. (bug #10270)
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Properly handle our GnomeUIInfo labels so that
- they won't be leaked if they are dynamic strings, so that they
- will be i18n-correct, and so that underscores won't be interpreted
- as key accelerators. What a PITA. Also, don't leak our
- iterators. (Bug #10200.)
- (popup_menu_list): The same GnomeUIInfo tweaking as in
- popup_menu_card.
- (popup_menu_nocard): Ditto.
-
-2001-09-18 JP Rosevear <jpr@ximian.com>
-
- * backend/ebook/e-card-simple.c (field_data): add caluri field data
-
- * backend/ebook/e-card.c (e_card_get_vobject): add the caluri
- property when appropriate
- (parse_caluri): handle read caluri
- (e_card_class_init): add caluri arg
- (e_card_destroy): free the caluri
- (e_card_get_arg): return caluri arg
- (e_card_set_arg): set caluri from arg
- (e_card_init): init caluri to null
-
- * backend/ebook/e-card-simple.h: new simple field
-
- * backend/ebook/e-card.h: new member
-
- * gui/contact-editor/e-contact-editor.c (field_changed): util
- callback to change the command state
- (set_entry_changed_signal_field): hook up a change signal to above
- (set_entry_changed_signals): use above function
-
- * gui/contact-editor/e-contact-editor.glade: Add collaboration
- page and fields
-
-2001-09-18 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_build_cards_list): create a sexp and check if
- the cards match before adding them to the list
- (pas_backend_file_process_get_cursor): send extra param
-
-2001-09-18 Larry Ewing <lewing@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (book_query_process_card_list): unref the destination regardless
- of whether we get an email addresss.
-
-2001-09-17 Larry Ewing <lewing@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (name_style_query): use g_strfreev.
- (match_name): s/g_free/g_strfreev.
- (match_file_as): s/g_free/g_strfreev.
-
- * backend/ebook/e-book-util.c (e_book_name_and_email_query): fix
- the memory handling here. All there members of the vector need to
- be freed all the time.
-
- * backend/ebook/load-pine-addressbook.c (parse_line): free the
- string outside of the test that makes sure there are three
- entries.
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): don't malloc a match we will never use.
-
- * gui/widgets/e-addressbook-model.c (get_view): free the dup'd
- capabilities.
-
-2001-09-17 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_is_valid): We want
- to assume that a destination that comes from a card is
- automatically valid, but the right way to check that is by calling
- e_destination_from_card, not by checking if dest->priv->card !=
- NULL. (Fixed bug #10017)
-
- * gui/component/select-names/e-select-names-completion.c
- (match_name): Fixed a stupid bug was causing completion to fail
- for contacts who have only one name. (The classic example we all
- know and love is 'George <jirka@5z.com>') (bug #8353)
-
- * backend/ebook/e-card.c (e_card_list_send): Do the right thing if
- the card we are trying to send to has no valid e-mail addresses.
- (bug #10137)
-
- * gui/widgets/e-minicard.c (e_minicard_event): Code implicitly
- assumed that event->button.button is 1, 2, or 3, causing disaster
- when using a wheel-mouse. Fixed. (bug #9400)
-
-2001-09-16 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (_phone_arrow_pressed):
- use enable_widget instead of gtk_widget_set_sensitive.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
- (disable_widget_foreach): same.
- (enable_writable_fields): same.
- (set_editable): same.
- (enable_widget): new function, using both gtk_widget_set_sensitive
- and *_set_editable to allow the user to select text in GtkEntry's
- and GtkText's.
-
- * gui/contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_set_arg): use set_editable as well as
- set_sensitive, to allow the user to select text in GtkEntry's.
-
- * gui/contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_set_arg): same.
-
-2001-09-16 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: fix syntax errors (which are
- broken, imo...)
-
-2001-09-16 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.h: reorder the LDAP scopes so
- that they match the order of the option menus in the glade file.
-
- * gui/component/addressbook-config.c (auth_checkbutton_changed):
- new function, mostly there to house some #ifdef'ed out code.
- (option_menuitem_activated): new function, to keep track of
- changes to the ldap scope optionmenu.
- (addressbook_source_dialog_set_source): set the menu history as
- well as the dialog's copy of the scope.
- (addressbook_source_dialog_get_source): fill in the source's scope
- from the dialog's copy, and add more #if the_ui_gods_smile_on_me
- code.
- (add_activate_cb): new function, add an activate callback for the
- optionmenu's items.
- (addressbook_source_dialog): more #if the_ui_gods_smile_on_me
- code, always start the dialog on page 0, and hook up the
- scope optionmenu's items.
-
-2001-09-15 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card-compare.c (e_card_compare_name): No
- loose name matches on family names. (#8802)
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): We can't use NULL as the
- first arg for e_addressbook_show_contact_editor anymore. Damn.
- (#8535)
-
- * backend/ebook/e-book-listener.c (e_book_listener_stop): Make
- "stop" do nothing but set the stopped flag, as in
- e-book-view-listener.c.
- (e_book_listener_destroy): Clean up our queue here, rather than in
- e_book_listener_stop.
- (response_free): Added. Move the rather lengthy bit of code
- needed to free a EBookListenerResponse into one place.
- (e_book_listener_check_queue): Properly deal with the stopped
- flag.
- (e_book_listener_queue_response): If the stopped flag is set, just
- drop the incoming response.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_stop): Make "stop" do nothing but set the
- stopped flag.
- (e_book_view_listener_destroy): Move all of the clean-up that used
- to be in e_book_view_listener_stop here. This considerably simplifies
- the logic required to avoid various race conditions.
- (e_book_view_listener_check_queue): Properly deal with the stopped flag.
- (e_book_view_listener_queue_response): Drop all incoming responses if
- we are stopped.
-
-2001-09-14 Jon Trowbridge <trow@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_queue_request): Hold a
- reference to the book on behalf of our idle function.
- (pas_book_check_queue): When we are finished, drop the reference
- we've been holding on behalf of the idle function.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_create_card): Hold a reference to the
- book_view while sending our notifications.
- (pas_backend_file_process_remove_card): Hold a reference to the
- book_view while sending our notifications.
-
- * gui/contact-editor/e-contact-quick-add.c (quick_add_unref): Remove
- debugging spew.
-
- * backend/ebook/e-book-util.c: Remove a lot of unused code that
- worked around bugs that have long since been fixed.
- (simple_query_disconnect): Added. Breaks out the part of
- simple_query_free that disconnect signals.
- (simple_query_free): Replace code w/ a call to
- simple_query_disconnect.
- (simple_query_sequence_complete_cb): Call simple_query_disconnect
- before executing the callback, so that our callbacks don't get
- triggered by any book changes that might occur during that
- callback.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Changed to be consistent with
- e_book_listener_check_queue.
- (e_book_view_listener_queue_response): Also changed to use a
- high-frequency timeout.
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- OK, I've agonized over this stupid little function, and it should
- now be race-free.
- (e_book_listener_queue_response): We process our response queue in
- a high-frequency timeout rather than an idle. Using an idle
- function leads to some tricky race conditions and bad interactions
- with bonobo's semi-broken attempts to take over event processing.
- (e_book_view_listener_stop): Manually disable our timeout and
- clean up.
-
-2001-09-14 Ettore Perazzoli <ettore@ximian.com>
-
- [Automake 1.5 fixes pointed out by Richard Boulton
- <richard@tartarus.org>, as per #9258.]
-
- * gui/component/select-names/Makefile.am: Set CLEANFILES directly
- instead of using `+='.
-
- * backend/pas/Makefile.am: Rename `LDAP_BACKEND_SOURCES' to
- `LDAP_BACKEND_FILES'.
-
- * backend/ebook/Makefile.am: Set CLEANFILES directly instead of
- using `+='.
-
-2001-09-13 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): use
- ldap_init. ldap_open is deprecated in openldap 2.x.
-
-2001-09-12 Iain Holmes <iain@ximian.com>
-
- * backends/ebook/evolution-vcard-importer.c (check_file_is_vcard):
- Fix the check.
-
-2001-09-12 Larry Ewing <lewing@ximian.com>
-
- * backend/ebook/e-destination.c: free the values that are being
- leaked here.
-
-2001-09-12 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c (match_email):
- printf arguments were reversed by mistake. Fixed bug #9693.
-
-2001-09-09 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_list): Added. Treat right-clicks on a contact list as
- a special case.
- (e_select_names_popup): Check if we are dealing with a contact
- list.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): See
- e_book_listener_check_queue below.
- (e_book_view_listener_queue_response): See
- e_book_listener_queue_response below.
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- Explicitly prohibit reentrancy. Use gtk-unref rather than
- bobobo-unref.
- (e_book_listener_queue_response): Hold a gtk-ref to the listener
- while the idle function runs, not a bonobo-ref. As far as I can
- tell, it is impossible to avoid a race condition here when we have
- to worry about bonobo reentrancy.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Alter a copy of the
- original EDestination, rather than just using a new one. We need
- to do this to preserve prior-card information for possible
- reversion later.
- (e_select_names_text_model_delete): Ditto.
-
- * backend/ebook/e-destination.c (e_destination_clear_card): When
- clearing a destination where ->card != NULL, store it for possible
- reversion later.
- (e_destination_revert): If we have an old card stored, go back to
- using it for the destination.
- (e_destination_is_valid): Tries to detect obviously broken
- addresses.
- (e_destination_cardify): If our destination is invalid, first try
- to cardify simply by reverting to an older card.
- (e_destination_destroy): Unref any cached old card.
- (e_destination_copy): Copy the old card information.
-
-2001-09-07 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (sync_table_and_models): Show all rows in the table, and then
- remove the rows that correspond to entries in the
- ESelectNamesModels in the children.
- (real_add_address): Freeze/thaw our ESelectNamesModel, so that we
- don't change our table while we are in the middle of iterating
- over the selection.
- (remove_address): Just delete the address from the
- ESelectNamesModel, the signal handler will do the rest.
- (selected_rows_foreach_cb): Call remove_address to do our dirty
- work.
- (e_select_names_add_section): Connect to the 'changed' signal from
- the ESelectNamesModel, and call sync_table_and_models explicitly to
- get our initial state correct.
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Deal with EDestinations in our table that don't
- come from cards.
-
- * gui/component/select-names/e-select-names-manager.c: Added
- another ESelectNamesModel* to the ESelectNamesManagerSection
- struct. Called 'original_model', this contains a copy of the
- model as it is when we begin using the SelectNames dialog.
- (section_copy): Copy the original model.
- (section_free): Free the original model.
- (e_select_names_manager_add_section_with_limit): Initialize the
- original model.
- (e_select_names_clicked): I've changed the semantics of this
- dialog quite a bit... no UI freeze can stop me! If OK is clicked,
- we do nothing. If Cancel is clicked, we revert to the
- 'original_model' copy of our address entry state before we started
- editting. Finally, we close the dialog before any of thing. Doing
- it last caused problems, because signals were being triggered
- which had dangling pointers as their closures.
- (e_select_names_manager_activate_dialog): Copy our current state
- to the original model, and share the same ESelectNamesModel
- between the dialog and the address entry in the composer..
- (e_select_names_manager_get_cards): Removed. It had been
- #if 0/#endif-ed out for a while.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_freeze): Added.
- (e_select_names_model_thaw): Added.
- (e_select_names_model_uncardify): Added. If possible,
- "uncardifies" a specific model entry.
- (e_select_names_model_changed): Changed to pay attention
- to the freeze count.
-
- * gui/component/select-names/e-select-names-completion.c
- (clean_query_text): Strip leading/trailing whitespace from
- queries.
-
- * backend/ebook/e-destination.c (e_destination_uncardify): Added.
- Converts a card-associated destination into a text-associated
- destination w/ the e-mail address.
- (e_destination_list_to_vector): Added. A convenience routine.
- (e_destination_freev): Added. A convenience routine.
- (e_destination_touchv): Added. I'm lazy.
-
-2001-09-08 Chris Toshok <toshok@ximian.com>
-
- (make_contact_editor_cb): show the right contact editor (the list
- editor for list cards).
-
-2001-09-08 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): do the EDestination xml magic on email
- addresses we put in the popup.
-
-2001-08-27 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- For every category:
- - set .translate to FALSE (e_categories_master_list_nth returns
- translated category name)
- - convert category name in UTF-8 to locale's encoding
-
-2001-08-23 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Fixed two bugs:
- - missing coversion of contact name to GTK+ locale,
- - passing dynamically created string (contact name) inside uiinfo struct
- to gnome-app-helper functions.
- Remember: these functions may change strings, trying to translate them!
- (popup_menu_nocard): Ditto
-
-2001-09-07 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c: Removed unused factory
- variable.
-
-2001-09-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.c (notify_listener): new
- function, notify the bonobo listener.
- (remove_ldap_folder): track change to EvolutionStorage signal.
- (create_ldap_folder): same, and make sure the type is
- "ldap-contacts".
- (load_source_data): folders that we create should have
- "ldap-contacts" as their type.
- (addressbook_storage_add_source): same.
-
- * gui/component/addressbook-component.c: (folder_types): add
- "ldap-contacts", for display of ldap servers (they get their own
- icon, and their own name in the Create New Folder dialog.
- (create_view): use IS_CONTACT_TYPE since we support two folder
- types now.
- (create_folder): same.
- (remove_folder): same.
- (xfer_folder): same.
-
-2001-09-06 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: (pixmaps): change
- /Toolbar/ContactEditorSave to /Toolbar/ContactEditorSaveClose.
-
-2001-09-06 Chris Toshok <toshok@ximian.com>
-
- * gui/component/Makefile.am (INCLUDES): add -DEVOLUTION_IMAGESDIR.
-
- * gui/widgets/e-addressbook-view.c (card_deleted_cb): remove
- status messages from here.
- (e_addressbook_view_delete_selection): same.
-
- * gui/widgets/e-addressbook-model.c (sequence_complete): emit a
- NULL status message along with the stop_state_changed. The null
- status message will clear the status bar for this view.
-
- * gui/component/addressbook.c (set_status_message): use the
- EvolutionActivityClient stuff.
-
- * backend/pas/pas-backend-ldap.c (view_destroy): remove status
- message for abandoning a search.
- (ldap_op_process_current): wrap status messages in _().
- (ldap_op_process): same.
- (create_card_handler): same, and remove the notify_status for ""
- and add a notify_complete call after the card is added.
- (remove_card_handler): same.
- (modify_card_handler): same.
- (poll_ldap): wrap status messages with _(), and remove the "Search
- Complete" message.
- (ldap_search_handler): wrap status message.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): use
- _() on status messages, and make sure the last notify_* called is
- notify_complete.
-
-2001-09-05 Ettore Perazzoli <ettore@ximian.com>
-
- [Fix #958, ShellComponents should not be created by factories, for
- the addressbook.]
-
- * gui/component/addressbook-component.c
- (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_FACTORY_ID): Removed.
- (GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID): New.
- (create_component): Renamed from `factory_fn'. Just register the
- thing on OAF.
- (addressbook_component_factory_init): Just call it.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Remove the
- ShellComponentFactory.
-
-2001-09-04 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-vcard-importer.c (load_file_fn): Return FALSE
- if the file isn't a valid VCard file.
-
-2001-08-05 Zbigniew Chyla <cyba@gnome.pl>
-
- I18n fixes (mainly making buttons on the right side less Anglocentric :-)
-
- * backend/ebook/e-card-simple.c
- (field_data): Marked "name" and "short_name" fields for translation.
- (e_card_simple_get_name, e_card_simple_get_short_name): Return
- localized version of the name (using U_() macro).
-
- * gui/contact-editor/e-contact-editor.c (set_entry_changed_signals):
- Connect "changed" signal from "entry-web" entry to widget_changed.
- (changing this field wasn't making "Save and Close" button sensitive)
-
- * gui/widgets/Makefile.am (glade_DATA): Removed alphabet.glade.
-
- * gui/widgets/e-addressbook-view.c
- (button_labels, button_letters): New strings containing a list of
- labels and "values" of all buttons placed on the right side of the
- addressbook view (intended for localization).
- (struct LetterClosure): Changed the type of letter field to gunichar.
- (e_utf8_split): New function, similar to g_strsplit, but operates on
- UTF-8 strings.
- (jump_to_letter): Don't hardcode letters, build queries dynamically
- using UTF-8 and localized letters stored in button_letters.
- (connect_button): Removed.
- (create_alphabet): Don't use glade file, build buttons manually using
- (localized) labels from button_labels. Use (localized) values from
- button_letters when creating LetterClosure.
-
- * gui/widgets/e-minicard-view-widget.[ch]
- (e_minicard_view_widget_jump_to_letter): Changed the type of the
- second argument from char to gunichar.
-
- * gui/widgets/e-minicard-view.c
- (compare_to_utf_str): Renamed from compare_to_letter, now operates on
- UTF-8 string.
- (e_minicard_view_jump_to_letter): Changed the type of the second
- argument from char to gunichar + conversion to UTF-8 string.
-
- * gui/widgets/e-minicard-view.h
- (e_minicard_view_jump_to_letter): Changed the type of the second
- argument from char to gunichar.
-
-2001-09-02 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book.c (e_book_add_card, e_book_commit_card),
- backend/pas/pas-backend-file.c (do_create),
- backend/pas/pas-backend-ldap.c
- (create_card_handler, remove_card_handler, modify_card_handler,
- pas_backend_ldap_process_get_vcard, poll_ldap): Use
- e_card_get_vcard_assume_utf8 instead of e_card_get_vcard here
- since all internal communications and database storage are assumed
- to be utf8.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h
- (e_card_simple_duplicate): Simplified this function considerably.
- (e_card_simple_get_vcard_assume_utf8): Added this function.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h (e_card_new,
- e_card_load_cards_from_file, e_card_load_cards_from_string): Made
- these functions pay attention to charset attributes.
- (e_card_new_with_default_charset,
- e_card_load_cards_from_file_with_default_charset,
- e_card_load_cards_from_string_with_default_charset): New functions
- that let you change the default charset from UTF-8.
- (e_card_get_vcard): Made this write out charset attributes when
- necessary.
- (e_card_get_vcard_assume_utf8): New function that writes out a
- card without writing out charset attributes.
-
- * backend/ebook/evolution-vcard-importer.c (book_open_cb),
- backend/ebook/load-gnomecard-addressbook.c (book_open_cb),
- backend/ebook/test-card.c (main),
- gui/component/addressbook-component.c
- (destination_folder_handle_drop), gui/contact-editor/test-editor.c
- (main), gui/contact-list-editor/e-contact-list-editor.c
- (table_drag_data_received_cb), gui/widgets/e-addressbook-view.c
- (selection_received), gui/widgets/e-minicard-control.c
- (pstream_load): Changed the default charset to be used here to
- ISO-8859-1.
-
- * backend/ebook/load-gnomecard-addressbook.c (add_card_cb),
- backend/ebook/load-pine-addressbook.c (add_card_cb),
- backend/ebook/test-client-list.c (get_cursor_cb),
- backend/ebook/test-client.c (get_cursor_cb, get_card_cb): Use
- e_card_get_vcard_assume_utf8 to print out testing strings.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h
- (e_select_names_model_contains): Changed this to be const
- EDestination *dest to fix a warning.
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- Translate window title here.
-
-2001-08-31 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): s/_/U_/
-
- * gui/widgets/e-addressbook-reflow-adapter.c (addressbook_compare):
- Use g_utf8_collate.
-
- * gui/widgets/e-minicard.c (e_minicard_compare):
- Ditto.
-
- * printing/e-contact-print.c (card_compare):
- Ditto.
-
-2001-08-29 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_clicked): Use e_select_names_model_merge to
- combine the selected names with any existing ones. This causes
- you to not lose addresses typed directly into the entry while the
- SelectNames dialog is up. (Bug #8058)
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_merge): Merge the contents of one
- ESelectNamesModel into another, avoiding duplicates.
-
- * backend/ebook/e-destination.c (e_destination_equal): Added.
- Determines if two destinations appear to refer to the same
- recipient.
-
- * backend/ebook/e-card.c (e_card_list_send): Added cast to
- g_free args to silence compiler warnings.
-
- * gui/contact-editor/e-contact-quick-add.c (quick_add_set_name):
- Paranoia. Check that name != qa->name.
- (quick_add_set_email): Check that email != qa->email.
- (ce_have_book): Store the QuickAdd data structure in object data,
- so that we can be extra-careful and avoid having a dangling
- pointer floating around out somewhere as the closure for a signal.
- Fixes bug #8155, I think.
- (card_added_cb): Clear object data to ensure single unref.
- (editor_closed_cb): Clear object data to ensure single unref.
-
- * gui/component/select-names/e-select-names-completion.c
- (book_query_score): Make sure that comp->priv->query_text isn't
- NULL. (Fixes bug #8195)
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- This function can be re-entrant during the signal emission; Added
- extra ref/unrefs and checks to avoid problems if this happens.
- This is similar to my recent changes to
- e_book_view_listener_check_queue. (Fixes bug #7400)
-
-2001-08-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Get rid of a warning by
- initializing the closing NULL element in folder_types correctly.
-
- * gui/component/select-names/e-select-names.c: Updated to match
- the studlyCapsification of attributes in shell/Evolution*.idl.
-
-2001-08-27 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (sexp_file_as): Added. Generated queries against file_as.
- (match_file_as): Added. Match results of queries against
- file_as. (Bug #8152)
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Added ref/unref pair to make
- sure that our listener doesn't get finalized during the signal
- emission and leave us with a dangling pointer. (Bug #7661)
-
- * backend/ebook/e-card.c (e_card_list_send): Removed some debugging
- spew that I left in by mistake.
-
- * gui/widgets/e-addressbook-model.c (create_card): Removed debugging
- spew.
-
- * backend/ebook/e-card.c (e_card_list_send): Do the right thing if
- the card we are trying to send to is a contact list. (Bug #6580)
-
-2001-08-27 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- Display localized status string (added missing _()).
-
-2001-08-24 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_set_card): Put a
- freeze/thaw around our the set of operations that changes the
- internal state of our card, so 'changed' signal callbacks won't be
- invoked on a card in an intermediary state. This fixes the bug
- that was causing the e-mail addresses in cards to be blank when
- replying to a message. (An unexpected side-effect of toshok's
- change on 8/22 to make sure that priv->email != NULL).
- (e_destination_get_name): Code slightly rearranged for (IMO)
- clarity.
-
-2001-08-23 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): add
- BUTTON_PRESS_MASK so double clicks still work.
-
-2001-08-23 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_query_changed): switch
- "full_name" to "x-evolution-any-field" in all the queries where we
- want to match all cards, since the backends universally handle
- this special case more efficiently.
-
-2001-08-22 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (extract_info):
- In the GUI, the toggle is labelled "hide addresses", not "show
- addresses" -- so we have to reverse the boolean value we read in.
- (fill_in_info): Same bug as before: since the GUI reads "hide", we
- have to initialize the toggle to '!show_addresses', not
- 'show_addresses'.
-
- * backend/ebook/e-destination.c
- (e_destination_list_show_addresses): Added.
- (e_destination_xml_encode): Encode the value of
- e_destination_list_show_addresses into the XML.
- (e_destination_xml_decode): Read and store the "show_addresses"
- flag.
-
-2001-08-22 jacob berkman <jacob@ximian.com>
-
- * gui/component/e-address-popup.c (emit_event): emit an event from
- our event source
- (contact_editor_cb): emit a destroy event so our control frame can
- be destroyed.
- (edit_contact_info_cb): emit a hide event so our control frame can
- be hidden
- (e_address_popup_cardify):
- (add_contacts_cb): emit the destroy event
- (e_address_popup_factory_new_control): don't unref our object at
- widget destroy time as that was really really broken
- (e_address_popup_factory_new_control): create an event source and
- aggregate ourself with it
-
- * gui/contact-editor/e-contact-editor.c (enable_writable_fields):
- display a nicer warning when we can't find a widget for a given
- field
- (e_contact_editor_raise): only raise if there is a window
-
- * gui/contact-editor/contact-editor.glade: name some widgets that
- got unnamed, and set the first entry as defaultable
-
- * gui/contact-editor/e-contact-editor.c: envelope printing is
- disabled in 1.0
-
-2001-08-22 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_email): make
- sure we don't get into a situation where priv->email == NULL.
-
-2001-08-21 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): if we're dragging,
- drag_button_down won't be true in the BUTTON_RELEASE case, since
- we set it to false in MOTION_NOTIFY once the threshold is reached.
- (e_minicard_drag_end): remove this function, since it was needed
- to work around a bug in gnome-canvas.
-
-2001-08-20 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table): Wrap our addressbook table
- adapter in an ETableWithout, so that we can make addresses appear
- and disappear when we remove/add them to the section lists
- (To/Cc/Bcc) on the right of the dialog.
- (real_add_address_cb): When we add an address, hide it in the main
- list.
- (e_select_names_init): Get pointer to our without table from the
- table's object data, and store it.
- (remove_address): When we remove an address, show it in the main
- list.
- (card_key): Added. Allocate a unique key from an ECard.
- (esn_get_key_fn): Added. Callback for ETableWithout.
- (esn_dup_key_fn): Added. Callback for ETableWithout.
- (esn_free_gotten_key_fn): Added. Callback for ETableWithout.
- (esn_free_duped_key_fn): Added. Callback for ETableWithout.
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): Changed
- E_CARD_SIMPLE_FIELD_NAME_OR_ORG to first try the FILE_AS
- type. This allows the cards in the ESelectName dialog to
- appear in proper sort order (i.e. as 'Doe, John' rather than
- 'John Doe'). Fixes ximian #6002.
-
-2001-08-20 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_class_init): fix arg info - we're
- only passing 1 GTK_TYPE_POINTER arg, not 2.
-
- * gui/widgets/e-minicard.c (e_minicard_event): lots of fixes for
- DnD. For GDK_BUTTON_PRESS, we grab immediately. For
- GDK_BUTTON_MOTION, we start the drag after a certain threshold,
- and connect to the "drag_end" signal on our canvas so we'll know
- when the drag is complete. For GDK_BUTTON_RELEASE, we release the
- grab if we were dragging and get the event.
- (e_minicard_drag_end): new function, just remove the pointer/gtk
- grabs and disconnect.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add "gint
- drag_button"
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key): use DB_NOTFOUND const
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_changes): null out card_sexp so that
- we don't crash when copying
-
-2001-08-20 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c: fix warnings, get compiling again
-
- * conduit/address-conduit-config.h: remove c/p typos
-
- * conduit/address-conduit.h: ditto
-
- * conduit/Makefile.am: link against the static camel
-
-2001-08-20 Damon Chaplin <damon@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c: use bigger Save icon for
- toolbar. Used Delete icon in menu.
-
- * gui/component/addressbook.c: use 'Save As' icon rather than 'Save'
- as it seems more appropriate. Also added delete icon for menu.
-
-2001-08-19 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Update the folder list to
- include a display name and a description.
-
-2001-08-19 Damon Chaplin <damon@ximian.com>
-
- * gui/component/addressbook.c: use new Cut/Copy/Paste/Save/Search
- icons.
-
-2001-08-19 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (set_folder_bar_label),
- gui/widgets/e-addressbook-model.c,
- gui/widgets/e-addressbook-model.h (update_folder_bar_message),
- gui/widgets/e-addressbook-view.c, gui/widgets/e-addressbook-view.h
- (folder_bar_message): Set the folder bar message here. Fixes
- Ximian bug #4670.
-
- * gui/component/select-names/e-select-names-model.c (SEPLEN): Use
- strlen(SEPARATOR) here so that if the separator changes the length
- will work properly.
-
-2001-08-19 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/fulladdr.glade: Added full country list.
- Fixes Ximian bug #5123.
-
-2001-08-18 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c: Hook up `delete-message.png' as the
- icon for "ContactDelete".
- * gui/contact-editor/e-contact-editor.c: Likewise.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.h: add prototype for
- addressbook_get_other_contact_storage.
-
- * gui/component/addressbook-storage.c
- (addressbook_get_other_contact_storage): rename register_storage
- to this, and return the EvolutionStorage.
- (load_source_data): register_storage =>
- addressbook_get_other_contact_storage.
- (addressbook_storage_add_source): register_storage =>
- addressbook_get_other_contact_storage.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c
- (set_entry_changed_signals): connect to the "changed" signal on
- "entry-web" to update command state.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (list_added_cb):
- call e_card_set_id on the list's card so we can continue to use
- this dialog. also, call command_state_changed if we aren't
- closing the dialog so the toolbar is properly sensitized.
- (list_deleted_cb): always close the dialog after we successfully
- delete a list.
-
- * gui/contact-editor/e-contact-editor.c (card_added_cb): call
- e_card_set_id on the card so we can continue to use this dialog
- (to modify or delete the card.)
- (card_deleted_cb): always close the dialog after we successfully
- delete a card.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (addressbook_query_changed): call
- e_sexp_encode_string on the search string the user types in so it
- doesn't break sexp parsing in the wombat.
-
-2001-08-17 Damon Chaplin <damon@ximian.com>
-
- * gui/component/addressbook.c: changed to new print icon.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.c: (struct
- ESelectNamesFolder): rename physical_uri to uri, since it includes
- the addressbook.db for file: uris.
- (e_select_names_folder_free): physical_uri => uri.
- (e_select_names_option_activated): physical_uri => uri, and we
- don't need to strdup_printf "addressbook.db" onto the end anymore.
- (new_folder): if the physical_uri is a file: uri, append
- /addressbook.db onto it.
- (hookup_listener): new function, split out lots of code from
- e_select_names_hookup_shell_listener.
- (e_select_names_hookup_shell_listeners): rename
- e_select_names_hookup_shell_listener to this, and hookup both the
- local and "Other Contacts" listener, using hookup_listener.
- (e_select_names_destroy): disconnect from the
- other_contacts_listener and unref it.
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): add a listener for Other Contacts, and rename
- "listener" to "local_listener."
-
-2001-08-17 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_seq_complete_cb): If we get the
- "sequence_complete" signal when we aren't searching, it means the
- addressbook changed out from under us. Clear the search cache, so
- that future completion requests won't use the out-of-date cached
- data. Also, don't unref book_view... we leave the EBookView open
- so that we can catch these addressbook changes.
- (e_select_names_completion_do_query): Don't use the book_view
- being non-NULL as a sign that another query is still running.
- (e_select_names_completion_got_book_view_cb): Properly unref any
- previous value in book_view.
-
-2001-08-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click),
- gui/widgets/e-addressbook-view.c (table_right_click): Changed the
- messages here in the right click menus.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (view_destroy): unref our
- card_sexp.
- (create_card_handler): make sure to set the id of the vcard so it
- gets properly transmitted back to the BookView, and notify all
- matching BookViews to add the created card.
- (remove_card_handler): notify all matching BookViews to remove the
- card.
- (modify_card_handler): notify all matching BookViews to modify the
- card.
- (pas_backend_ldap_process_get_book_view): init card_sexp based on
- the view's search.
-
-2001-08-17 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_book_view_copy): use card_sexp.
- (pas_backend_file_book_view_free): same.
- (vcard_matches_search): use the new pas_backend_card_sexp_match_vcard call.
- (pas_backend_file_search): use card_sexp.
- (pas_backend_file_process_get_book_view): same.
-
- * backend/pas/Makefile.am (libpas_a_SOURCES): add
- pas-backend-card-sexp.[ch].
-
-2001-08-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Added code
- so the user can create a new contact or contact list from anywhere
- in evolution.
-
-2001-08-16 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/pas/evolutionperson.schema: Added a closing paren.
-
-2001-08-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_handle_request): Renamed from _begin to
- match changes in gal 0.10.99.3.
-
- * gui/contact-editor/e-contact-quick-add.c (e_contact_quick_add):
- Check that name != NULL before we start messing with it.
- (Fixes bug #7329)
-
-2001-08-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): Boost scoring on an exact nickname match.
- Manually addressify match.
- (match_name): Manually addressify matches.
- (book_query_score): Remove automatic addressification.
-
- * gui/component/addressbook.c (addressbook_query_changed): Minor
- tweak to avoid a crash if we have a negative subid with id
- ESB_CATEGORY. This should never happen.
- (addressbook_menu_activated): Reset the entry/option when we
- select "Clear".
- Some changes to reflect renaming in ESearchBar.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): Cardify after importing destinations.
- This might fix a problem that Damon is having.
-
-2001-08-15 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.glade: set title of initial
- dialog to Addressbook Sources (bug #6704).
-
-2001-08-15 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.c (create_ldap_folder): don't
- let people add subdirs in the ldap server storage - everything is
- toplevel there.
-
-2001-08-14 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_vcard): implement using
- search_for_dn.
-
-2001-08-14 Federico Mena Quintero <federico@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Tell the search bar to translate the subitem texts.
-
-2001-08-14 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Add "Any Category" option for category searches.
- (addressbook_query_changed): Do the right thing on an
- "Any Category" search.
-
-2001-08-14 Dan Winship <danw@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: Fix up to match the
- pas_book_new/get_vcard changes.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- Got rid of an extraneous _ here.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- Changed Canceled to Cancelled here. Fixes Ximian bug #2465.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_respond_get_vcard): Oops,
- forgot to write this function.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Added focus targets
- here. Fixes part of Ximian bug #5843.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
- Grab focus here. Fixes Ximian bug #2265.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- (addressbook_query_changed): Fixed two const warnings here.
-
- * printing/e-contact-print-envelope.c,
- printing/e-contact-print-envelope.h: Fixed some missing includes
- here.
-
-2001-08-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-view.c (add_book_iterator): Call
- e_card_set_book here.
-
- * backend/ebook/e-book.c (e_book_do_response_get_vcard): Call
- e_card_set_book here.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Pulled out the
- part where the uri is made part of the uid. Made uri a separate
- field. Fixes Ximian bug #6490.
-
- * backend/ebook/e-destination.c, backend/ebook/e-destination.h:
- Change this to use ECard's split uids and uris.
-
-2001-08-13 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (add_to_supported_fields): don't
- g_strdup the stuff we're passing into e_list_append, since it does
- the copy for us.
- (check_schema_support): don't initialize supported_fields list
- here, since there's a gross case where the programmer/user can
- bring up the contact editor before the connection stuff is
- finished, and we don't want to crash.
- (pas_backend_ldap_init): move it here to we can guarantee it's
- there. (bug #6546).
-
-2001-08-13 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): don't access source->auth
- if source == NULL (bug #7086).
-
-2001-08-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c,
- backend/ebook/e-book-listener.h, backend/ebook/e-book.c,
- backend/ebook/e-book.h, backend/idl/addressbook.idl,
- backend/pas/pas-backend-file.c, backend/pas/pas-book.c,
- backend/pas/pas-book.h: Changed get_card to be asyncronous.
-
- * backend/ebook/e-card.c, backend/ebook/test-client.c: Changed
- these to deal with the new get_card functionality.
-
-2001-08-11 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/component/select-names/e-select-names.c: Mark a string for translation.
- * This fixes bug #7052
- * printing/e-contact-print.h: Add headers to make it stand on itw own.
- * printing/e-contact-print.c: Marked some strings for translation.
- * printing/e-contact-print-envelope.c: Same here.
-
-2001-08-10 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (e_contact_quick_add):
- Remove single- or double-quotes from names before sticking them
- into the addressbook. (Bug #6499)
-
- * gui/component/addressbook.c (addressbook_query_changed):
- Properly handle "Category is" queries by checking the search bar
- suboption.
- (addressbook_factory_new_control): Attach subitems corresponding
- to all wombat categories to the "Category is" ESearchBarItem.
-
- * gui/component/addressbook.c: Set the ESearchBarItem
- subitems explicitly to NULL.
-
-2001-08-10 Anna Marie Dirks <anna@ximian.com>
- * gui/component/select-names/select-names.glade: did a little
- packing-magic to get the two tables at bottom of this dialog
- to seem to line up.
-
- *gui/component/select-names/e-select-names.c: changed the title
- of this dialog to "Select Contacts from Addressbook".
-
-2001-08-09 Anna Marie Dirks <anna@ximian.com>
- * gui/component/select-names/select-names.glade: redesigned
- this dialog to fix bug #6815.
-
- *gui/component/select-names/e-select-names.c: connected the
- widgets (or one of them anyway. clahey did the rest) for my
- new and lovely glade file.
-
-2001-08-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c: remove passwd_cb.
-
-2001-08-09 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- This change is dedicated to Jacob Berkman.
- (e_select_names_text_model_insert_length): If the last character
- we inserted was a "magic comma", remember its position.
- (e_select_names_text_model_delete): If the last character we
- inserted was a "magic comma", and if the next thing we do is to
- hit backspace, delete both the comma and the extra whitespace we
- added.
- (e_select_names_text_model_init): Initialize our last magic comma
- position.
-
-2001-08-09 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): Hook up some magic to
- (basically) cardify an entry on focus-out. (What we do is actually
- more complicated than that.)
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): After we set an entry's text, try to
- cardify it. We need to do this so that (for example) reply
- e-mails get properly cardified.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_duplicate): Use e_select_names_model_append,
- rather than manipulating lists directly.
- (e_select_names_model_insert): Connect "changed" signal proxy for
- added EDestination.
- (e_select_names_model_append): Ditto.
- (e_select_names_model_replace): Ditto, and disconnect signals for
- replaced EDestination.
- (e_select_names_model_delete): Ditto on the disconnection.
- (e_select_names_model_delete_all): Ditto.
- (e_select_names_model_cardify): Added. Try to cardify a specified
- EDestination.
- (e_select_names_model_cancel_cardify): Added. Cancel the pending
- cardification of a single EDestination.
- (e_select_names_model_cardify_all): Added. Cardify all of the
- EDestinations in the model.
- (e_select_names_model_cancel_cardify_all): Added. Cancel's any
- and all pending cardifications.
-
- * backend/ebook/e-destination.c (e_destination_class_init): Added
- "changed" and "cardified" signals.
- (e_destination_freeze): Added (static).
- (e_destination_thaw): Added (static).
- (e_destination_clear_card): Reset allow_cardify and
- cannot_cardify, cancel any pending cardifications, and emit the
- "changed" signal.
- (e_destination_clear_strings): Emit the "changed" signal.
- (e_destination_clear): Do freeze/thaw to prevent multiple signal
- emissions.
- (e_destination_set_card): Check that the card we are setting is
- not equal to the current card, and emit the "changed" signal if we
- are actually changing.
- (e_destination_set_card_uri): Emit "changed" signal, if necessary.
- (e_destination_set_name): Emit "changed" signal, if necessary.
- (e_destination_set_email): Emit "changed" signal, if necessary.
- (e_destination_set_html_mail_pref): Emit "changed" signal, if
- necessary.
- (use_card_cb): If we've just loaded/set the ECard, emit the
- "changed" signal.
- (e_destination_set_raw): Emit "changed" signal, if necessary.
- (e_destination_allow_cardification): Added.
- (e_destination_set_allow_cardification): Added.
- (e_destination_cardify): Added. Tries to automatically convert
- a string-based EDestination to one based on an ECard.
- (e_destination_cardify_delayed): Added. Cardifies in a timeout.
- (e_destination_cancel_cardify): Added. Cancels any pending
- cardifications.
- (e_destination_xml_decode): Added freeze/thaw.
-
- * backend/ebook/e-book-util.c (e_book_nickname_query): Added. A
- canned simple query for nicknames.
-
- * backend/ebook/e-card.c (e_card_email_find_number): Added. Given
- a card and an string containing an email address, return the index
- number of the address inside of the card, or -1 if the address is
- not found.
-
-2001-08-09 Chris Toshok <toshok@ximian.com>
-
- [ Fixes ximian bugs #5080, #6021, #6704, #6705 ]
-
- * gui/component/addressbook.c (book_open_cb): create our own
- dialog that prompts for both the email address and the password.
- the email address is stored in the source and filled in for the
- user after the first time they enter one and press OK.
-
- * gui/component/addressbook-storage.c (create_ldap_folder): has a
- return value, not a int* parameter.
- (create_ldap_folder): new function, we can create ldap servers
- from the File->New->Folder menu item now.
- (register_storage): hook up the "create_folder" signal.
- (addressbook_storage_init_source_uri): remove the file case, we
- only build ldap uris here.
- (load_source_data): remove the file source stuff, and handle
- "emailaddr".
- (save_source_data): call ldap_source_foreach directly.
- (addressbook_source_free): remove file source stuff.
- (addressbook_source_copy): same.
-
- * gui/component/addressbook-storage.h: get rid of all the file
- source stuff from AddressbookSource, since this is only being used
- for ldap servers.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): look up the ldap
- entry based on the provided email address and use the resulting
- DN/passwd to authenticate.
-
- * gui/component/addressbook-config.c: pretty much gutted to make
- it work with the new UI.
-
- * gui/component/addressbook-config.glade: new version from anna.
-
-2001-08-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (SPEC): Upped the minimum width
- on all addressbook columns to 75. Fixes Ximian bug #2773.
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (ce_have_book): mark
- the dialog as changed so the save button is immediately available.
-
- * gui/contact-editor/e-contact-editor.c (card_modified_cb): once
- we save reset the change flag to false if we aren't closing the
- dialog.
- (card_added_cb): same.
- (e_contact_editor_class_init): add a "changed" arg.
- (e_contact_editor_set_arg): add setter for "changed".
- (e_contact_editor_get_arg): add getter for "changed".
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-quick-add.c (ce_have_book): better
- to assume that we can write to the local addressbook than that we
- can't write to it :)
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (create_ui):
- call e_pixmap_update so we can use the same save/save-as pixmaps
- as the contact editor.
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (open_card): new
- function, used by the context menu.
- (e_addressbook_reflow_adapter_right_click): put "Open" at the top
- of the menu. also, disable "Delete" if the addressbook isn't
- writable.
-
-2001-08-08 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (rfc2254_escape): escape *, \, (,
- and ), as per rfc2254.
- (func_contains): escape the string.
- (func_is): same.
- (func_beginswith): same.
- (func_endswith): same.
-
-2001-08-08 Nat Friedman <nat@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (print_envelope): If 0'd out
- since Envelope printing is disabled for 1.0.
- * gui/widgets/e-addressbook-view.c (print_envelope): Likewise.
- * gui/contact-editor/e-contact-editor.c (print_envelope_cb): Likewise.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (e_addressbook_reflow_adapter_right_click): Removed "Print
- Envelope" menu item.
- * gui/widgets/e-addressbook-view.c (table_right_click): Likewise.
- * gui/contact-editor/e-contact-editor.c (verbs): Likewise.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-storage.c (remove_ldap_folder): ifdef
- this HAVE_LDAP.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): set the title of the window to
- "Advanced Search".
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (search_cb): pass view->view instead
- of the EBook.
- (addressbook_search_menu_items): remove E_FILTERBAR_ADVANCED.
- (addressbook_menu_activated): remove E_FILTERBAR_ADVANCED.
- (addressbook_search_option_items): add "Advanced..." here.
- (addressbook_query_changed): add special handling for Advanced...
-
- * gui/search/e-addressbook-search-dialog.h (struct
- _EAddressbookSearchDialog): add EAddressbookView and remove the
- model/adapter fields. Also fix prototype of
- e_addressbook_search_dialog_new.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_class_init): get rid of
- set_arg/get_arg.
- (button_press): set the query on the EAddressbookView, and always
- close the dialog.
- (e_addressbook_search_dialog_init): get rid of the minicard view,
- and pack the other widgets accordingly.
- (e_addressbook_search_dialog_new): pass EAddressbookView instead
- of EBook.
- (e_addressbook_search_dialog_destroy): remove model/adapter stuff.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bug #5066 ]
- * gui/component/addressbook-storage.c (remove_ldap_folder): new
- function, remove the source.
- (register_storage): connect to the "remove_folder" signal so we
- know when to remove the folder.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (build_card_from_entry): use
- g_strcasecmp since ldap attribute names are not case sensitive.
-
-2001-08-07 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (table_drag_data_received_cb): make sure we update the changed
- state if a successful drop happens.
-
-2001-08-07 Jason Leach <jleach@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Make the OK button the keyboard default
- instead of Cancel. Bug #4942.
-
-2001-08-06 Radek Doulik <rodo@ximian.com>
-
- * backend/ebook/e-book.c (e_book_op_free): new EBookOp destructor
- (e_book_unqueue_op): use e_book_op_free
- (e_book_do_response_create_card): ditto
- (e_book_do_response_generic): ditto
- (e_book_do_response_get_cursor): ditto
- (e_book_do_response_get_view): ditto
- (e_book_do_response_get_changes): ditto
- (e_book_do_response_open): ditto
- (e_book_do_response_get_supported_fields): ditto
-
-2001-08-05 Radek Doulik <rodo@ximian.com>
-
- * backend/ebook/e-book.c (e_book_do_response_get_view): set
- op->listener to NULL to catch possible use of freed op
- (e_book_do_response_get_changes): ditto
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): this callback could be (and
- indeed is) called from signal emited above,
- signal handler could call e_book_view_listener_stop, so we need to check
- if idle is still set and if not we don't want to unref again
-
-2001-08-04 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (e_card_compare_name): Made it so
- that if there's one less match than possible compares are
- considered more VAGUE. Fixes Ximian bug #3400.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listener): Check for storage != NULL
- here. This shouldn't come up unless addressbook has crashed
- previously within this session of evolution, but this is just a
- bit of insurance. Fixes Ximian bug #3699.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_name_match_string): Changed the
- criteria of whether the first part of each iteration matched or
- the second one did. Before it got it wrong sometimes and caused
- the pointer to jump off the end of the array. Fixes Ximian bug
- #4674.
-
-2001-08-03 Jason Leach <jleach@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Update
- for EvolutionStorage API changes.
- (addressbook_storage_add_source): Ditto.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (jump_to_letter): Made this
- change the query based on which letter is clicked. Fixes Ximian
- bug #2202.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Fixed warnings here.
-
- * gui/component/select-names/e-select-names-completion.c
- (hash_cleanup_fn): Removed this unused function.
-
-2001-08-03 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c (e_card_simple_sync_card,
- fill_in_info): Made the list of E_CARD_PHONE types in
- phone_correspondences more complete by adding the new 5
- E_CARD_PHONE types. Also, made it a bit less restrictive for some
- types (E_CARD_PHONE_HOME will actually match
- E_CARD_SIMPLE_PHONE_ID_HOME now.) Made e_card_simple_sync_card
- and fill_in_info search for an exact match in the list of
- phone_correspondences and then look for a partial match. Got rid
- of not going forward when doing a remove from an EList since EList
- handles this case automatically.
-
- * backend/ebook/e-card-types.h: Added E_CARD_PHONE types for
- assistant, callback, radio, telex, and ttytdd.
-
- * backend/ebook/e-card.c (get_phone_flags, set_phone_flags):
- Handle the new E_CARD_PHONE types.
-
-2001-08-02 Jon Trowbridge <trow@ximian.com>
-
- * printing/Makefile.am (ecpsdir): Add camel dependency.
-
- * gui/component/Makefile.am: Add camel dependency.
-
- * backend/ebook/Makefile.am: Add camel dependency.
-
- * gui/component/addressbook-factory.c (main): Properly init camel.
-
- * backend/ebook/e-destination.c (e_destination_clear_strings):
- Clear ->raw.
- (e_destination_is_empty): We aren't empty if ->raw is set..
- (e_destination_set_raw): Replaces e_destination_set_string.
- (e_destination_get_name): Use camel's parser to extract the name
- from ->raw.
- (e_destination_get_email): Use camel's parser to extract the email
- address from ->raw.
- (e_destination_get_address): Use camel to produce properly quoted,
- RFC-compliant addresses. Thanks camel! (Bug #5860)
-
- * gui/component/select-names/e-select-names-completion.c
- (emailify_match): Always append an e-mail address, as long as it
- doesn't have one already at it's beginning or end. Don't limit
- self to just emailifying entries tied to cards with multiple
- addresses. (I didn't really want to do this, but people seem to
- like keeping multiple cards for the same person, and other
- solutions (like scanning all matches for duplicate names, and only
- emailifying those) just seemed like way too much work for such a
- limited payoff.)
-
- * gui/component/select-names/e-select-names-text-model.c:
- s/e_destination_set_string/e_destination_set_raw/.
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Quote _'s in our popup menus, so that "foo_bar"
- doesn't get displayed as "foobar" w/ the 'b' underlined. (Bug
- #5558)
- (popup_menu_nocard): Ditto.
-
-2001-08-02 Jason Leach <jleach@ximian.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- Removed some extra padding and pack the addressbook view into a
- frame with inward shadowing, just because it looks prettier.
-
- * gui/contact-editor/e-contact-editor.c: Use the updated Save,
- Save As, and Print icons for the menus and toolbar.
-
-2001-08-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c: Added ContactsSaveAsVCard,
- ContactsSendContactToOther, and ContactsSendMessageToContact verbs
- here.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h (e_addressbook_view_save_as,
- e_addressbook_view_send, e_addressbook_view_send_to): New
- functions to allow outside users to cause the addressbook to save,
- send, or send a message to its selection.
-
-2001-08-01 Christopher James Lahey <clahey@ximian.com>
-
- * contact-editor/.cvsignore: Removed this file from this unused
- directory.
-
-2001-08-01 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/Makefile.am: Added file-exists.glade.
-
- * gui/contact-editor/e-contact-save-as.c (file_exists),
- gui/contact-editor/file-exists.glade: Added a dialog to ask the
- user whether to replace an already existing file. Mostly from a
- patch by Jos Dehaes. Fixes Ximian bug #2231.
-
-2001-08-01 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Removed thrash checking code
- here since thrashing shouldn't happen now that we've cleaned this
- up some.
-
- * backend/ebook/e-book.c (e_book_do_response_get_view): Properly
- handle cases where construction fails.
-
-2001-07-30 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/evolution-vcard-importer.c: Added #include
- <e-util/e-path.h>.
-
-2001-07-23 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- Convert translated string to UTF8 before calling put_html.
-
-2001-07-30 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_do_query): Properly handle the case
- where our "cleaned" completion is the empty string. This happens,
- for example, if the query text is the string "\"". (Bug #5610).
-
- * backend/ebook/e-destination.c (e_destination_get_address_textv):
- Reassure fejj that I'm not doing something stupid here.
- (e_destination_get_address): Fix address quoting. This is a
- stop-gap measure until I can change this code to use Camel's
- superior address-handling routines. (Also Bug #5610)
-
-2001-07-30 Jason Leach <jleach@ximian.com>
-
- * gui/component/addressbook-storage.c (load_source_data): Fix a
- return value bug, to make it so if it fails to load an
- addressbook-sources.xml file (either a parse error or it doesn't
- exist for example), it deregisters the storage.
- (register_storage): Don't make a storage for users who don't have
- LDAP support built in. Bug #1950.
-
-2001-07-30 Frederic Crozat <fcrozat@mandrakesoft.com>
-
- * addressbook/gui/component/addressbook-factory.c: Fix crashes
- when gtkhtml is compiled with gconf support
-
-2001-07-27 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: Tidy ldadds
-
-2001-07-26 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c: Fixing a
- small, stupid mistake; use e_select_names_model_get_textification
- for the getter for "text".
-
- * backend/ebook/e-card.c: Removed some debugging chatter.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): Store the completion
- handler in the entry's object data.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Added support for getting "destinations"
- and "allow_contact_lists" properties.
- (entry_set_property_fn): Added support for setting "destinations"
- and "allow_contact_lists" properties.
- (impl_SelectNames_get_entry_for_section): Added definitions for
- "destinations" and "allow_contact_lists" properties.
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_get_match_contact_lists): Added.
- (e_select_names_completion_set_match_contact_lists): Added.
- Controls whether contact lists are offered as options during
- completion.
- (book_query_process_card_list): Check if match_contact_lists
- is set before (duh!) matching on a contact list.
- (e_select_names_completion_init): Set match_contact_lists
- to TRUE by default.
-
-2001-07-25 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (func_contains): change the way
- x-evolution-any-field is converted to an ldap query. it used to
- be we'd nest queries like: (|(|(|(foo=*x*))(bar=*x*))(baz=*x*)).
- now we build it like: (|(foo=*x*)(bar=*x*)(baz=*x*)). much more
- efficient (both in the building, and on the server side no doubt).
-
-2001-07-25 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_name): Properly dup
- the results of e_destination_get_email.
-
- * gui/component/select-names/e-select-names-popup.c
- (e_select_names_popup): Check that our destination isn't empty
- before building our popup. (Bug #5250)
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Made
- argument const.
-
-2001-07-24 Jon Trowbridge <trow@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-model.c: Added checks
- for all of the args of the exposed functions, so that
- we won't crash on bad inputs. (Related to bug #4856.)
-
-2001-07-24 Jason Leach <jleach@ximian.com>
-
- * gui/merging/e-card-duplicate-detected.glade: "_Add Anyway" to
- "Add Anyway".
-
-2001-07-24 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_name): Added
- fallbacks for the name in the case of an e-card, to avoid the
- "nameless contact" bug.
-
-2001-07-24 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (remodel): need the EDestination magic
- here too for when we modify an already shown card.
-
- * gui/contact-list-editor/e-contact-list-model.c: make
- parent_class static, just to be anal.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (remove_entry_cb): removing entries changes the list, so flag it.
- (table_drag_data_received_cb): restrict cards we add to lists to
- be non-list cards.
- (extract_info): clear out the email list in the card before we
- repopulate it from the contact list model.
- (fill_in_info): set the checkbox to active/inactive based on
- thecard.
-
-2001-07-24 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (wants_html_changed): call
- widget_changed.
- (phone_entry_changed): same.
- (email_entry_changed): same.
- (address_text_changed): same.
- (name_entry_changed): same.
- (company_entry_changed): same.
- (widget_changed): new function that we can either call or set as a
- signal to change the "changed" flag on the dialog.
- (set_entry_changed_signals): connect lots of "changed" signals on
- widgets to widget_changed.
- (add_lists): connect "changed" to widget_changed.
-
-2001-07-24 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_hookup_shell_listener): Check if
- evolution_shell_client_get_local_storage returns CORBA_OBJECT_NIL,
- which it should never do. If it does, print a warning in a dialog
- and try to recover w/o crashing. (Bug #5193)
-
-2001-07-24 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-listener.c (e_book_listener_stop): Don't
- stop the idle_queue and unref from here, since this might be
- called from inside e_book_listener_check_queue, and we don't want
- to return to that function with the listener having been
- destroyed.
- (e_book_listener_check_queue): Don't exit early if the queue is
- stopped. Proceed through the check if the queue is NULL (which is
- must be if the queue is stopped), and then reach the existing code
- to remove the idle handler. Combined with the above, this fixes
- ximian #4485 (again). This is not a plot to boost my
- showstopper-bugfixing count by fixing the same bug over and over
- again.
-
-2001-07-23 Dan Winship <danw@ximian.com>
-
- Re-fix for my 07-18 not-quite-fix.
-
- * backend/ebook/e-book-listener.c: Add a "stopped" flag like
- EBookViewListener.
- (e_book_listener_check_queue): Don't emit signals if the listener
- is stopped.
- (e_book_listener_queue_generic_response, etc): Don't queue
- responses if the listener is stopped.
- (e_book_listener_stop): Flush the queue and stop queue/emitting
- further responses.
-
- * backend/ebook/e-book.c (e_book_unload_uri): Revert the previous
- change and call e_book_listener_stop() instead.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_stop): When removing an idle handler, unref
- the listener as well, since e_book_view_listener_queue_response
- will have ref'ed it.
-
-2001-07-22 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): Add a
- @type arg. If the type is not "contacts", report an
- `UNSUPPORTED_TYPE' error through the listener. Also, remove
- `g_print()' debugging messages.
- (xfer_folder): Likewise.
-
-2001-07-21 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c: Make the "contacts"
- folders user-creatable by setting `user_creatable' to %TRUE in the
- `EvolutionShellComponentFolderType's.
-
-2001-07-18 Chris Toshok <toshok@ximian.com>
-
- [ patch contributed by Jos Dehaes <jos.dehaes@bigfoot.com> ]
-
- * gui/component/addressbook-storage.c (register_storage): new
- function, register our evolution_storage.
- (addressbook_storage_setup): remove storage registration from
- here.
- (load_source_data): register the storage here before we load
- addressbook-sources.xml, and deregister it if there are no sources
- listed.
- (addressbook_storage_remove_source): unregister the storage if the
- list of sources hits 0 length.
-
-2001-07-18 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book.c (e_book_unload_uri): Flush the listener's
- queue before unreffing it to ensure that it doesn't emit any more
- "responses_queued" signals after the EBook is destroyed.
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue,
- e_book_listener_queue_response, e_book_listener_new): Use
- bonobo_object_ref/unref rather than gtk_object_ref/unref.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response, e_book_view_listener_new):
- Likewise.
-
-2001-07-18 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card-compare.c (simple_query_cb): prune the list
- of cards that match our query using the avoid list here, instead
- of using the avoid list in the query itself, since ldap can't
- handle that.
- (use_common_book_cb): remove the block of code including the avoid
- list in the query sent to wombat.
-
-2001-07-17 Chris Toshok <toshok@ximian.com>
-
- [ Fixes bugs #4611 - crash searching in the name field at Bigfoot for "\"
- and #4554 - general ldap search crash ]
-
- * backend/pas/pas-backend-ldap.c (func_contains): the length of
- the big query string needs to take into account the length of the
- footer as well as the header - fix random memory corruption here.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_build_query):
- list can be NULL, specifically if there's a parsing error in the
- sexp, so deal with it.
-
-2001-07-17 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_queue_response): Hold a reference to our
- listener while the idle function is active.
- (e_book_view_listener_check_queue): Only unref the listener when
- the idle function is finished.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_clicked): Instead of replacing section->model with
- source, copy source onto section->model with
- e_select_names_model_overwrite_copy. #if 0/#endif out all of the
- stuff related to ETextModels, because it doesn't make any sense to
- me, and everything appears to work without it.
- (Die bug #2059. Die! Die! Die!)
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_overwrite_copy): Added. Copies the contents
- of one ESelectNamesModel onto another.
-
- * backend/ebook/e-destination.c (e_destination_copy): Made the argument
- const.
-
- * backend/ebook/e-destination.c (e_destination_set_string): Removed
- old, broken code and annoying g_messages.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_response): Hold a reference to the listener
- while the idle function is active.
- (e_book_listener_check_queue): Only release our reference to the
- listener when the queue is empty. These two changes fix a race
- condition, since the listener could be unrefed while the listener
- was still active. (Seems to fix bug #4485)
-
-2001-07-17 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade,
- gui/merging/e-card-duplicate-detected.glade,
- gui/merging/e-card-merging-book-commit-duplicate-detected.glade,
- printing/e-contact-print.glade: Patch from Taylor Hayward
- <thayward@gjpc.com>. Added accelerators to a few dialogs.
-
-2001-07-16 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- Added addSectionWithLimit to the SelectNames interface.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_add_section_with_limit): Added. Implements
- addSectionWithLimit.
- (e_select_names_bonobo_construct): Set up as a BonoboEventSource.
- (init): Listen for "changed" signals from our manager.
- (manager_changed_cb): Notify our listeners if we get a changed
- signal from our manager.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_class_init): Added a "changed" signal".
- (section_copy): Propogate the signal connection.
- (section_free): Disconnect the changed handler.
- (e_select_names_manager_add_section_with_limit): Connect to the
- new section's model, listening for changes.
- (e_select_names_manager_activate_dialog): Connect to the "working
- copy" model, listening for changes.
- (e_select_names_manager_add_section_with_limit): Added.
- (e_select_names_manager_add_section): Changed to just be a special
- case of e_select_names_manager_add_section_with_limit.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_set_limit): Added. Allows a max number of
- names allowed in the model.
- (e_select_names_model_get_limit): Added. Returns the limit.
- (e_select_names_model_at_limit): Added. Returns TRUE if the
- model is "full".
- (e_select_names_model_insert): Check that we aren't at the
- limit before inserting. Silently return if we are.
- (e_select_names_model_append): Check that we aren't at the
- limit before appending. Silently return if we are.
-
-2001-07-16 Chris Toshok <toshok@ximian.com>
-
- [ Fix bug #4705 - LDAP storage gets saved with corrupted binddn]
-
- * gui/component/addressbook-config.c (addressbook_dialog_apply):
- call addressbook_storage_write_sources here after we're done
- rebuilding them.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_clear_sources): don't write the source file
- here.
- (addressbook_storage_add_source): same.
- (addressbook_storage_remove_source): same.
- (addressbook_storage_write_sources): new function, write the
- source file out.
- (addressbook_source_copy): g_strdup the binddn so we don't end up
- free'ing it multiple times thanks to copies freeing theirs.
-
- * gui/component/addressbook-storage.h: add prototype for
- address_storage_write_sources.
-
-2001-07-16 Iain Holmes <iain@ximian.com>
-
- * backend/pas/evolution-vcard-importer.c (ebook_create): Don't just
- use the default directory. Use the directory that is passed into the
- load file function.
-
-2001-07-15 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_set_string):
- Commented out some unused variables and labels.
- (e_destination_importv): Check for the xml not parsing correctly
- and just return NULL here.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_import_destinationv): Handle a NULL destv
- here.
-
-2001-07-15 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_drag_data_get): Added a
- call to e_table_view_to_model_row here.
- (e_addressbook_view_can_print, e_addressbook_view_can_delete,
- e_addressbook_view_can_copy): If the selection model is NULL here,
- return NULL (this was done before in a g_return_val_if_fail which
- is only conditionally included.)
-
-2001-07-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/contact-editor.glade: Changed Company to
- Organization here.
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/Makefile.am: add ldap cflags
-
-2001-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_xml_decode):
- Oops. I introduced my own bug, accidently set `email' to a
- g_free'd pointer - eek!
-
-2001-07-12 Jeffrey Stedfast <fejj@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_importv): Optimized
- the same way I optimized g_strsplit. If you use a GPtrArray
- instead of a linked list, you save yourself from having to iterate
- through the list an extra 3 times.
- (e_destination_xml_decode): Do NOT, I repeat: do NOT!
- e_utf8_xml1_decode something which is already in UTF-8 or you'll
- corrupt it!! I smack thee who hath done this evil deed!
-
-2001-07-12 Iain Holmes <iain@ximian.com>
-
- * backend/e-book/evolution-vcard-importer.c (support_format_fn):
- Check for no extension. Actually same as Jason's fix below :) but
- also check the file contents.
-
-2001-07-12 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook-config.glade: add accelerators,
- taylor's patch
-
-2001-07-12 Jason Leach <jleach@ximian.com>
-
- * backend/ebook/evolution-vcard-importer.c (support_format_fn):
- Crash fix because strcmp() hates NULL arguments. Bug #3777.
-
-2001-07-11 Jason Leach <jleach@ximian.com>
-
- * gui/component/select-names/e-select-names.c (remove_cb): Added
- some comments for clarity and fixed a pretty noticable bug with
- how right click "Remove" was deleting more than it should with
- consecutive runs.
-
-2001-07-10 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: assign OID's to the schema
- entries, and add schema support for contact lists.
-
-2001-07-10 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): Set
- bf->priv->file_db before calling do_create.
-
-2001-07-06 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Fixed order
- of arguments to evolution_shell_component_new.
-
-2001-07-08 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Check that str isn't
- the empty string before doing an insert.
-
- * backend/ebook/e-destination.c (e_destination_set_string): We were
- being too smart for our own good here, and causing problems for
- the completion code... (bug #4253, bug #4255, bug #4280)
- (e_destination_set_name): Clear any cached address.
- (e_destination_set_email): Clear any cached address.
- (e_destination_get_address): Handle the cases where the name
- contains some e-mail information.
-
-2001-07-09 Kjartan Maraas <kmaraas@gnome.org>
-
- * gui/contact-list-editor/e-contact-list-editor.c: Marked a
- string for translation. Also add the neccesary includes to make
- _() macros work.
-
-2001-07-07 Jon Trowbridge <trow@ximian.com>
-
- * gui/widgets/e-minicard.c (add_field): Detect the embedded
- EDestination XML, and convert it to a nice-looking e-mail address.
-
- * gui/contact-list-editor/e-contact-list-editor.c: Adjusted to
- reflect changes to EContactListModel. (Yeah, this is vague,
- but the changes are _really_ obvious and boring.)
-
- * gui/contact-list-editor/e-contact-list-model.c: Revamped
- to make everything an EDestination, rather than storing either
- cards or strings.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Use
- e_destination_get_textrep.
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Use e_destination_get_name and
- e_destination_get_email.
-
- * gui/component/select-names/e-select-names-popup.c
- (popup_menu_card): Use e_destination_get_name instead of
- e_card_name_to_string.
- (quick_add_cb): Use e_destination_get_address.
- (popup_menu_nocard): Use e_destination_get_name.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_changed): Removed obsolete debugging code.
- (e_select_names_model_get_textification): Use e_destination_get_textrep.
- (e_select_names_model_get_address_text): Use e_destination_get_address.
- (e_select_names_model_get_string): Use e_destination_get_textrep.
- (e_select_names_model_replace): Use e_destination_get_textrep.
- (e_select_names_model_name_pos): Use e_destination_get_textrep.
-
- * gui/component/select-names/e-select-names-completion.c
- (emailify_match): Match only if this isn't a contact list.
- (match_email): Match only if this isn't a contact list.
- (match_name): Do the right thing in the case of a contact list.
- (book_query_process_card_list): Don't construct a match for
- each possible e-mail address if this is a contact list.
-
- * backend/ebook/e-destination.c: Major-league de-crufting and
- rationalization, combined with lots of hacks to make things work
- properly with contact lists.
- (e_destination_copy): Copy contact list info.
- (e_destination_clear_card): Clear contact list info.
- (e_destination_is_empty): If we contain a contact list, we aren't
- empty.
- (e_destination_set_card_uri): Added. Allows us to set a
- destination by card URI.
- (e_destination_set_name): Allows the contact's name only ("Jane
- Smith") to be set.
- (e_destination_set_email): Allows the contact's e-mail only
- ("jane@assbarn.com") to be set.
- (e_destination_set_string): Takes a free-form string containing a
- contact's name and/or e-mail, and tries to do the right thing with
- it.
- (e_destination_contains_card): Renamed. Used to be
- e_destination_has_card.
- (e_destination_from_card): Added. Returns TRUE if the
- EDestination comes from either a ECard (which we presently hold)
- or is specified by an ECard URI.
- (e_destination_use_card): Allows an EDestination's ECard to be
- accessed, via a callback. If we only are holding the URI, the
- card will be loaded and stored in the EDestination.
- (e_destination_get_name): Returns the name only ("Jane Smith"), or
- NULL.
- (e_destination_get_email): Returns the email only
- ("jane@assbarn.com"), or NULL.
- (e_destination_get_address): Added. Returns a "full address" if
- both the name & e-mail are available ("Jane Smith
- <jane@assbarn.com>"), or just the e-mail if the name is unknown
- ("jane@assbarn.com>"). If the destination is a contact list,
- returns a comma-separated list of addresses.
- (e_destination_get_textrep): Added. Returns a "text
- representation" of the EDestination. This is what is now
- displayed for completed, "cardified" destinations in addressbook
- entries.
- (e_destination_is_evolution_list): Check to see if this
- destination is for a contact list.
- (e_destination_xml_encode): Added. Build an XML data structure
- representing an EDestination.
- (e_destination_xml_decode): Added. Parse an XML data structure,
- constructing an EDestination.
- (e_destination_export): Added. Returns a null-terminated string
- containing an XML representation of the EDestination, with
- newlines and excess whitespace removed.
- (e_destination_import): Added. Parses a string containing an XML
- representation of an EDestination.
- (e_destination_exportv): Added. Returns a null-terminated string
- containing an XML representation of a collection of EDestinations,
- with newlines and excess whitespace removed.
- (e_destination_importv): Added. Takes an XML representation of a
- collection of destinations, parses it, and returns a vector of
- EDestinations.
-
- * backend/ebook/e-card.c (e_card_duplicate): Copy the ->book
- pointer.
- (e_card_get_id): Check that the argument is valid.
- (e_card_set_id): Check that the argument is valid.
- (e_card_get_book): Added. Return the EBook the ECard came from.
- (e_card_get_uri): Added. Tries to returns a URI for the ECard,
- which is of the form (EBook URI)/(ECard unique ID). Returns NULL
- if the EBook URI or the ID are unknown/not set.
- (e_card_get_vobject): If we have the URI, use it as the
- VCUniqueStringProp, rather than just the ID. This is a hack to
- make DnD work properly.
- (parse_id): Detect if the unique ID we've been passed is a URI or
- just a plain card ID, and do the right thing in either case.
- (e_card_uri_extract_book_uri): Added. Convenience function for
- parsing card URIs.
- (e_card_uri_extract_card_id): Added. Convenience function for
- parsing card URIs.
- (e_card_load_uri): Added. Allows an ECard to be loaded by its
- URI.
-
- * backend/ebook/e-book-view.c: Added a EBook * to the
- _EBookViewPrivate struct. This is meant to contain the EBook the
- EBookView is associated with.
- (add_book_iterator): Added. A convenience function for attaching
- the EBook to a GList of cards (if no EBook is already stored).
- (e_book_view_do_added_event): Record the EBook in the added
- ECards.
- (e_book_view_do_modified_event): Record the EBook in the modified
- ECards.
- (e_book_view_set_book): Added. Stores a pointer to the
- EBookView's "parent" EBook.
- (e_book_view_init): Init book_view->priv->book to NULL.
- (e_book_view_destroy): Unref book_view->priv->book.
-
- * backend/ebook/e-book.c: Added a uri field to _EBookPrivate.
- (e_book_unqueue_op): Removed debugging spew.
- (e_book_do_response_get_view): Attach the current EBook to the
- created EBookView.
- (e_book_do_response_get_changes): Attach the current EBook to the
- created EBookView.
- (e_book_load_uri): Save a copy of the uri in the EBook.
- (e_book_get_uri): Added. Just returns book->priv->uri.
- (e_book_get_card): Attach a pointer to the Ebook to the
- newly-loaded ECard.
- (e_book_add_card): Attach a pointer to the EBook to the
- newly-added ECard.
- (e_book_commit_card): Attach a pointer to the EBook to the
- committed ECard.
- (e_book_init): Initialize the uri to NULL.
- (e_book_destroy): Free the uri string on destruction.
-
-2001-07-06 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (populate_context_menu):
- Removed. [It was just bogus testing code for the right-click menu
- populating interface in the shell].
- (factory_fn): Pass NULL as the PopulateContextMenuFn.
-
-2001-07-05 Anna Marie Dirks <anna@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade:
- Added some accelerators, padding, and a "memebers" frame;
- also fixed spacing and growth behaviour of this dialog.
-
-2001-07-05 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (compare_category): Fix a memory
- leak here.
-
-2001-07-05 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (match_search_info_free): Set
- info->avoid = NULL. This shouldn't make a difference, but it
- can't hurt.
-
-2001-07-05 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_is_cell_editable): Check if the row is within our
- table and return from this function as if the card is a standard
- card, not a list.
-
-2001-07-03 Damon Chaplin <damon@ximian.com>
-
- * backend/ebook/Makefile.am (evolution_vcard_importer_LDADD):
- added $(BONOBO_CONF_LIBS) to get it to compile.
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Added
- $(BONOBO_CONF_LIBS).
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_create_categories),
- gui/contact-editor/e-contact-editor.c (categories_clicked):
- Switched to an ECategoriesMasterListWombat instead of an
- ECategoriesMasterListArray here.
-
-2001-07-02 Peter Williams <peterw@ximian.com>
-
- * gui/contact-editor/Makefile.am (INCLUDES): srcdir !=
- builddir compile fix.
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): Same.
-
- * gui/widgets/Makefile.am (INCLUDES): Same.
-
- * gui/search/Makefile.am (INCLUDES): Same.
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * gui/contact-editor/e-contact-editor.c (categories_clicked):
- Turned off wombatification of the categories master list here.
-
-2001-07-01 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-editor.c (fill_in_info):
- use ECARD_UID_LINK_PREFIX.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (e_contact_list_model_get_email): use ECARD_UID_LINK_PREFIX.
-
- * backend/ebook/e-destination.h: add prototype for
- e_destination_importv_list.
-
- * backend/ebook/e-destination.c (e_destination_importv_list): new
- function, take an ECard corresponding to an address list and
- resolve any linked cards, returning an EDestination vector.
-
- * backend/ebook/e-card.h (ECARD_UID_LINK_PREFIX): #define this here,
- since we need to use it in a few places.
-
-2001-07-02 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- related_contacts field.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h
- (e_select_names_model_import_destinationv): Added this function.
-
- * gui/contact-editor/contact-editor.glade: Replaced the entry here
- for related contacts with a table which is filled in in the C code.
-
- * gui/contact-editor/e-contact-editor.c,
- gui/contact-editor/e-contact-editor.h (add_lists): Added a select
- names entry here for the related contacts field.
-
- * gui/widgets/Makefile.am: Removed all the test programs here
- since there are circular dependencies now.
-
-2001-07-01 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_string): Fall
- back to use the name field if all else fails (which can happen
- with imported EDestinations).
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Fix for the
- "recipient not specified" bug --- we were not correctly checking
- for whether or not an EDestination was actually empty.
-
-2001-06-30 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card.c (e_card_evolution_list): Check args.
- Somewhere in the code (somewhere in the minicard stuff) this can
- be called with a NULL arg, which was causing crashes.
- (e_card_evolution_list_show_addresses): Check args.
-
- * backend/ebook/e-destination.c (build_field): I was accidentally
- comparing characters and strings here, and didn't see the compiler
- warning. Fixed.
- (e_destination_exportv): Don't export any empty destinations.
- (bug#3825).
-
-2001-06-30 Zbigniew Chyla <cyba@gnome.pl>
-
- * gui/component/e-address-popup.c (e_address_popup_construct): Marked
- strings for translation.
-
-2001-06-30 Jon Trowbridge <trow@ximian.com>
-
- * gui/merging/e-card-merging.c (match_query_callback): Make the
- standard for considering two cards to be match stricter.
-
- * gui/component/select-names/e-select-names-completion.c
- (make_match): Use the card's use-score to set the match's
- sort_major value.
- (match_name): Removed obsolete code.
- (e_select_names_completion_begin): Added (double) cast to make
- match->score calculation come out properly.
-
- * backend/ebook/e-card.c: Added X-EVOLUTION-LAST-USE and
- X-EVOLUTION-USE-SCORE to attribute_jump_array.
- (e_card_get_today): Added. A convenience routine for getting
- today's date and putting it in a GDate.
- (e_card_get_use_score): Added. Compute the current, time-decayed,
- use-score for the card.
- (e_card_touch): Increment the use-score by one; update the last
- used date.
- (e_card_date_to_string): Added as a convenience routine, getting
- rid of some code duplication.
- (e_card_get_vobject): Add handlers for X-EVOLUTION-USE-SCORE and
- X-EVOLUTION-LAST-USE.
- (parse_last_use): Added.
- (parse_use_score): Added.
- (e_card_class_init): Added args for last-use and use-score.
- (e_card_get_arg): Added handlers for last-use and use-score.
- o
- (e_card_set_arg): Added handlers for last-use and use-score.
-
- * backend/ebook/e-destination.c: Added pending_card_id to
- EDestinationPrivate struct.
- (e_destination_copy): Copy the pending_card_id.
- (e_destination_is_empty): Check for a pending_card_id. We are
- non-empty if we have one.
- (e_destination_clear_card): Clear pending_card_id.
- (e_destination_set_card): Clear pending_card_id.
- (e_destination_has_pending_card): Added.
- (e_destination_use_card): Added. An asynchronous way to load a
- pending card and then apply a callback to it.
- (build_field): Be paranoid, map our special characters to '_'.
- (e_destination_export): Use EXPORT_MAX_FIELDS symbol rather than a
- hard-wired array size. Added the "card" entry.
- (e_destination_import): Fix bug in handling of the "name" field.
- Process the "card" field.
- (e_destination_touch): "Touch" and commit the ECard corresponding
- to the e-mail address in the destination. (A query against the
- local addressbook is actually performed, in case the destination
- isn't cardified.
-
- * backend/ebook/e-card-compare.c (e_card_compare_name): Revamp the
- way E_CARD_MATCH_FOO results are mapped to comparison results.
- Report better matches when the family name is matched.
-
-2001-06-29 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_query):
- Added a search field to the query here.
- (e_select_names_init): Update the query on a number of signals here.
-
- * gui/component/select-names/e-select-names.h: Added search_entry
- here.
-
- * gui/component/select-names/select-names.glade: Added the search
- entry here. Added some labels. Removed the update button.
-
-2001-06-29 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_option_activated): Change the uri here to have
- addressbook.db at the end.
-
- * gui/component/select-names/select-names.glade: Changed the name
- of the folder option menu here to match the name used in the code.
-
-2001-06-29 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c (update_query):
- Change the query when the "Update List" button is pushed.
-
- * gui/component/select-names/e-select-names.h: Removed
- currently_selected field. Added categories_entry field.
-
- * gui/component/select-names/select-names.glade: Added "Update
- List" button.
-
-2001-06-29 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/Makefile.am (INCLUDES): add EVOLUTION_IMAGESDIR
- define.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add our pixbuf and
- pixbuf size.
-
- * gui/widgets/e-minicard.c (e_minicard_init): init the icon pixbuf
- and its size.
- (e_minicard_destroy): unref the list_icon_pixbuf.
- (e_minicard_realize): create the list_icon GnomeCanvasPixbuf.
- (e_minicard_resize_children): clip the header_text by the
- list_icon, and place the list_icon in the right spot.
- (remodel): show the list_icon if we're a list, and hide it
- otherwise.
-
-2001-06-28 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_double_click): pop up
- list editor for lists, contact editor otherwise.
-
- * gui/widgets/e-minicard.c (e_minicard_event): same.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): change "editor" to
- GtkOjbect, since it can be either a contact editor or contact list
- editor.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_is_cell_editable): don't allow editting of any fields
- except the name and file_as for lists.
-
-2001-06-28 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/Makefile.am (INCLUDES): remove ancient
- e-table include, and add include for contact-editor so we can
- reuse the confirm_delete dialog.
-
- * gui/contact-list-editor/e-contact-list-editor.h (struct
- _EContactListEditor): remove prototype for
- e_contact_list_editor_close, since the function no longer exists.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (list_deleted_cb): new function, emit our "list_deleted" signal.
- (delete_cb): new function, called from the Delete toolbar item.
- (e_contact_list_editor_raise): flesh out function.
- (extract_info): "evolution_list" => "list".
- (fill_in_info): same.
-
-2001-06-28 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card.c (e_card_get_vobject): add support for
- X-EVOLUTION-LIST and X-EVOLUTION-LIST-SHOW-ADDRESSES.
- (parse_list): new function, parse the boolean X-EVOLUTION-LIST.
- (parse_list_show_addresses): new function, parse the boolean
- X-EVOLUTION-LIST-SHOW-ADDRESSES.
- (e_card_class_init): add args for "list" and
- "list_show_addresses".
- (e_card_set_arg): add support for list and list_show_addresses.
- (e_card_get_arg): same.
- (e_card_init): init list and list_show_addresses.
-
-2001-06-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Pass NULL as
- the @external_uri_schemas argument to
- `evolution_shell_component_new()'.
-
-2001-06-27 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_row_count): track storage change - we're only using
- 1 array now.
- (contact_list_value_at): same.
- (contact_list_model_destroy): same.
- (e_contact_list_model_init): same.
- (e_contact_list_model_add_email): same.
- (e_contact_list_model_add_card): same.
- (e_contact_list_model_remove_row): same.
- (e_contact_list_model_remove_all): new function - just free/unref
- all existing rows.
- (e_contact_list_model_get_email): new function, returns the
- alloc'ed string containing either an email address or an encoded
- ECardId.
-
- * gui/contact-list-editor/e-contact-list-model.h: remove the 2
- separate arrays for email and cards, and store them in the same
- array.
-
- * gui/contact-list-editor/e-contact-list-editor.h (struct
- _EContactListEditor): add the visible_addr_checkbutton widget.
-
- * gui/contact-list-editor/e-contact-list-editor.c
- (visible_addrs_toggled_cb): new function.
- (e_contact_list_editor_init): connect to "toggled" on
- visible_addrs_checkbutton.
- (file_save_cb): new function.
- (tb_save_and_close_cb): new function.
- (verbs): add Save and Save & Close.
- (list_added_cb): new function.
- (list_modified_cb): new function.
- (save_card): new function - we do *not* use e_card_merging_* calls
- here.
- (e_contact_list_editor_get_arg): un-#if 0 code in the "card"
- getter.
- (e_contact_list_editor_set_arg): same for the "card" setter.
- (extract_info): new function.
- (fill_in_info): new function.
-
- * gui/contact-list-editor/contact-list-editor.glade: add a
- checkbutton at the bottom to determine whether to visibly include
- mail addresses in mail sent to this list.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_create_categories): Oops. Can't use the wombat
- version of the master categories list yet.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-table-adapter.c (create_card): memmove
- counts were off in this function.
- (remove_card, modify_card): Moved the table notifications around a
- bit here.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/component/select-names/select-names.glade
- (e_select_names_create_categories): Added a categories combo here.
- It's not used yet.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * gui/search/addresstypes.xml: Added category searching to the
- advanced search dialog here.
-
-2001-06-26 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (compare_category): Added
- category searching to the file backend.
-
- * gui/component/addressbook.c (addressbook_query_changed): Added
- category searching to the search bar.
-
-2001-06-25 Peter Williams <peterw@ximian.com>
-
- * conduit/Makefile.am (INCLUDES): Fix for srcdir != builddir.
-
-2001-06-25 Chris Toshok <toshok@ximian.com>
-
- * gui/contact-list-editor/contact-list-editor.glade: change layout
- slightly, the icon no longer pushes everything to the left, and
- make the buttons on the right smaller and more in line with the
- other widgets.
-
- * gui/contact-list-editor/e-contact-list-model.c
- (contact_list_value_at): return the SimpleAndString->string
- instead of querying the ecardsimple.
- (e_contact_list_model_init): initially allocate 10 of each type
- (email and simple).
- (e_contact_list_model_add_email): realloc if need be.
- (e_contact_list_model_add_card): same, and initialize the string
- displayed to be "[Name] [<email>]".
- (e_contact_list_model_remove_row): change for SimpleAndString.
- (contact_list_model_destroy): free our 2 arrays.
-
- * gui/contact-list-editor/e-contact-list-model.h: add alloc counts
- and the SimpleAndString struct.
-
- * gui/contact-list-editor/e-contact-list-editor.c: Helix Code =>
- Ximian.
- (e_contact_list_editor_init): hook up d&d destination signals, and
- un-#if 0 the delete_event signal.
- (table_drag_motion_cb): new function.
- (table_drag_drop_cb): new function.
- (table_drag_data_received_cb): new function.
- (file_close_cb): new function.
- (verbs) uncomment the close verb.
- (close_dialog): new function.
- (app_delete_event_cb): new function.
-
- * gui/contact-list-editor/e-contact-list-editor.h: Helix Code =>
- Ximian.
-
-2001-06-25 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-popup.c: Add a huge steaming pile of
- code to handle the case of single-address merging. In other
- words, if you go to "harvest" an address by right-clicking on it
- in the mail viewer, and you already have a closely-matching
- contact (w/ a different e-mail address), this gives you the
- option of editting that contact's e-mail addresses to add the
- one you just clicked on.
-
- * backend/ebook/e-card-compare.c (match_search_info_free): It is
- amazing how much better things work when you don't try to
- dereference the pointer you just freed.
-
-2001-06-24 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/Makefile.am (minicard_test_LDADD): correct path to
- libecontacteditor.a.
- (minicard_widget_test_LDADD): same.
- (INCLUDES): same, for the includes.
-
- * gui/widgets/e-minicard.h: correct e-contact-editor.h path.
-
- * gui/widgets/e-addressbook-util.h: correct path to
- e-contact-editor.h, and add e-contact-list-editor.h. Add
- prototype for e_addressbook_show_contact_list_editor.
-
- * gui/widgets/e-addressbook-util.c: remove #include
- "e-contact-editor.h" (our header includes it.)
- (added_cb): rename card_added_cb to this, and make it so it can be
- reused in both the list and card cases. remove the g_print too.
- (modified_cb): same for modified case.
- (deleted_cb): same for deleted case.
- (editor_closed_cb): change first arg to GtkObject* so we can reuse
- this for both list and card.
- (e_addressbook_show_contact_editor): use added_cb, modified_cb,
- deleted_cb, and pass FALSE as user_data.
- (e_addressbook_show_contact_list_editor): new function, same as
- above but creating a contact-list-editor, and pass TRUE as
- user_data.
-
- * gui/component/e-address-popup.c: correct path to contact-editor.
-
- * gui/component/e-address-widget.c: same.
-
- * gui/component/select-names/e-select-names-popup.c: same.
-
- * gui/component/select-names/e-select-names-text-model.c: same.
-
- * gui/component/addressbook.c (new_contact_list_cb): new function.
- (update_command_state): update ContactNewList command.
- (verbs): remove ViewAll from the toolbar from the verb list. Add
- ContactNewList.
- (pixmaps): same for pixmaps.
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): new
- path for contact-editor.
- (INCLUDES): same.
-
- * gui/contact-list-editor/e-contact-list-model.h:
- * gui/contact-list-editor/e-contact-list-model.c:
- * gui/contact-list-editor/e-contact-list-editor.h:
- * gui/contact-list-editor/e-contact-list-editor.c:
- * gui/contact-list-editor/Makefile.am: Initial contact-list editor
- commit.
-
- * gui/Makefile.am (SUBDIRS): add contact-editor.
-
- * Makefile.am: (SUBDIRS): remove contact-editor.
-
-2001-06-21 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (make_contact_editor_cb): Renamed. (The old name,
- edit_contact_info_have_book_cb was a hold-over from before, when
- we weren't using e_book_use_local_address_book.)
-
- * gui/component/e-address-popup.c
- (e_address_popup_schedule_refresh): A Added. We now do the name
- refreshes in an idle function, rather than in the setters.
- (e_address_popup_set_free_form): Added. Properly handle inputs of
- the form "Foo <bar@zar.com>", extracting the name and e-mail
- address.
- (e_address_popup_set_name): Check to make sure that the free-form
- handler shouldn't be used to handle the input. Schedule a refresh
- after making any changes.
- (e_address_popup_set_email): Check to make sure that the free-form
- handler shouldn't be used to handle the input. Schedule a refresh
- after making any changes.
- (e_address_popup_name_only_matches): Temporary place-holder for
- handling name-only matches.
- (query_cb): If our initial query fails (and included e-mail
- information), do a name-only query. This is to handle the case of
- adding new e-mail addresses to existing contacts.
- (e_address_popup_query): Eliminated the "common_book" crap; using
- e_book_use_local_address_book instead.
-
- * backend/ebook/e-card-compare.c (match_search_info_free): Make
- sure that the ->avoid list gets properly freed.
-
-2001-06-20 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_supported_fields): fix a refcounting
- memleak.
-
-2001-06-20 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): fix memory
- leak.
-
-2001-06-20 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c: add prototype for
- close_dialog to remove warnings.
-
-2001-06-20 Dave Camp <dave@ximian.com>
-
- * backend/ebook/e-card.c (e_card_list_send): Changed attach_data
- to be a GNOME_Evolution_Composer_AttachmentData rather than a
- CORBA_char*.
-
-2001-06-19 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_double_click): track
- change to e_addressbook_show_contact_editor signature.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_event): same.
-
- * gui/widgets/e-minicard.c (e_minicard_event): same.
-
- * gui/widgets/e-addressbook-util.c (e_addressbook_error_dialog):
- add an entry for "Card ID already exists".
- (e_addressbook_show_contact_editor): track the change to signal
- names and e_contact_editor_new signature here.
-
- * gui/widgets/e-addressbook-util.h: change
- e_addressbook_show_contact_editor's signature to match
- e_contact_editor_new more closely.
-
- * gui/widgets/e-addressbook-table-adapter.c (unlink_model): free
- up the simple mapping to plug a potentially sizeable memory leak.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): call
- e_addressbook_show_contact_editor here.
-
- * gui/component/select-names/e-select-names-popup.c
- (edit_contact_info_have_book_cb): remove the get_supported_fields
- stuff, since the contact editor handles it for us now, and call
- e_addressbook_show_contact_editor.
-
- * gui/component/e-address-popup.c (edit_contact_info_cb): same.
-
- * gui/component/addressbook.c (new_contact_cb): track change to
- e_addressbook_show_contact_editor.
-
-2001-06-19 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-quick-add.c (ce_have_book): rename
- ce_book_found_fields to this, remove the fetching of fields (the
- contact editor code handles that now.), and change the add_card
- signal to card_added.
- (card_added_cb): copied somewhat from merge_cb above. we don't
- need to do the merge here, just call the callback.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_class_init):
- track signal change. add book arg, and is_read_only -> editable.
- (wants_html_changed): if the card isn't already changed, flag it
- as such (and update the commands.)
- (phone_entry_changed): same.
- (email_entry_changed): same.
- (address_text_changed): same.
- (name_entry_changed): same.
- (company_entry_changed): same.
- (full_name_clicked): is_read_only -> editable.
- (full_addr_clicked): same.
- (card_added_cb): new function, emit our card_added signal, and
- close the dialog if we're supposed to. properly deal with error
- status here.
- (card_modified_cb): same, modulo card_added -> card_modified.
- (save_card): actually call e_card_merging_book_{add/commit}_card
- instead of using a signal. Also, add a gboolean arg to tell
- whether or not to close the dialog after saving the card.
- (card_deleted_cb): new function, just emit our "card_deleted"
- signal.
- (delete_cb): actually call e_book_remove_card here, instead of
- using a signal.
- (tb_save_and_close_cb): call save_card with TRUE for should_close.
- (e_contact_editor_init): init changed = FALSE;
- (e_contact_editor_destroy): unref our book if we have one.
- (e_contact_editor_new): new signature, set the "book" arg, and
- call e_book_get_supported_fields here.
- (supported_fields_cb): new function, show the contact editor.
- (e_contact_editor_set_arg): initialize changed to FALSE when
- setting the card (but *after*, since the changed callbacks will
- set it to TRUE.) also, call command_state_changed if editable
- changes. also handle setting "book". oh, and is_read_only ->
- editable.
- (command_state_changed): new function - set the state of the
- commands we care about.
- (e_contact_editor_get_arg): add "book" handling, and is_read_only
- -> editable.
- (_phone_arrow_pressed): is_read_only -> editable.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
- (enable_writable_fields): same.
- (set_editable): rename set_read_only to this, and is_read_only ->
- editable.
-
- * contact-editor/e-contact-editor.h (struct _EContactEditor):
- is_read_only -> editable, add a "changed" flag so we can sensitize
- commands correctly, and add an EBook* arg to e_contact_editor_new
- and to the EContactEditor struct. Also, change all the signals to
- past tense, and send the EBookStatus in them.
-
- * contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_class_init): is_read_only -> editable.
- (e_contact_editor_address_set_arg): same.
- (e_contact_editor_address_get_arg): same.
-
- * contact-editor/e-contact-editor-address.h (struct
- _EContactEditorAddress): same.
-
- * contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_class_init): same.
- (e_contact_editor_fullname_set_arg): same.
- (e_contact_editor_fullname_get_arg): same.
-
- * contact-editor/e-contact-editor-fullname.h (struct
- _EContactEditorFullname): same.
-
- * contact-editor/Makefile.am: don't build contact-editor-test now,
- until contact-editor gets moved to gui/ and we can more easily
- depend on the e_card_merging_* calls.
-
- * backend/pas/pas-backend-ldap.c (ldap_error_to_response): return
- CardIdAlreadyExists for LDAP_ALREADY_EXISTS.
-
- * backend/idl/addressbook.idl: Add CardIdAlreadyExists to the
- BookListener status enum.
-
- * backend/ebook/e-book-types.h: add
- E_BOOK_STATUS_CARD_ID_ALREADY_EXISTS.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_convert_status): add support for
- CardIdAlreadyExists.
-
-2001-06-19 Jon Trowbridge <trow@ximian.com>
-
- * contact-editor/e-contact-quick-add.c: Serious de-crufting,
- removal of gtk_object_set_data() hacks, simplified by using
- some of the newer ebook convenience routines, etc.
- (ce_book_found_fields):
- s/e_contact_editor_raise/e_contact_editor_show/, to accomodate the
- small changes in the contact editor API.
-
-2001-06-18 Eskil Heyn Olsen <eskil@eskil.dk>
-
- * conduit/address-conduit.c: (check_for_slow_setting),
- (conduit_get_gpilot_conduit):
- Tweaked for some gnome-pilot api changes
-
-2001-06-15 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (search_for_dn): implement this
- properly, using base and (objectclass=*).
-
-2001-06-14 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c (delete_cb): save ourselves a
- function call - call close_dialog instead of file_close_cb.
-
-2001-06-14 Jeffrey Stedfast <fejj@ximian.com>
-
- * gui/component/addressbook-component.c: Set the
- "expoted_dnd_types" to NULL in the folder_types.
-
-2001-06-11 Dan Winship <danw@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (search_override_check): Add a workaround for an EText bug.
- (e_select_names_completion_begin): Fix up the match scoring in the
- search_override case so the lines are offered in the correct
- order.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * gui/merging/Makefile.am (glade_DATA): Added
- e-card-merging-book-commit-duplicate-detected.glade here.
-
- * gui/merging/e-card-merging-book-commit-duplicate-detected.glade:
- Added this file. The GUI for asking whether to commit a modified
- card.
-
- * gui/merging/e-card-merging.c, gui/merging/e-card-merging.h
- (e_card_merging_book_commit_card): Added this function.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (addressbook_set_value_at), gui/widgets/e-addressbook-util.c
- (commit_card_cb), gui/widgets/e-minicard.c (e_minicard_event): Use
- e_card_merging_book_commit_card instead of e_book_commit_card here.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Made e_card_simple_get_id return const char *.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Made
- e_card_get_id return const char *.
-
- * gui/component/e-cardlist-model.c (e_cardlist_model_add): Made id
- variable const here. Added a break to make it slightly more
- efficient.
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made
- e_minicard_get_card_id return const char *.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (entry_compare): Made this handle
- the "id" property in searches.
- (pas_backend_file_process_modify_card): Made id variable const
- here.
-
- * backend/pas/pas-backend-ldap.c (modify_card_handler): Made id
- variable const here.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c,
- backend/ebook/e-book-listener.h, backend/ebook/e-book.c: Rolled
- back the change 2 ago, dated 06/11/2001 01:51 in CVS, involving
- e-book-listener.[ch] and e-book.c.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book.c (e_book_load_uri,
- e_book_get_supported_fields, e_book_authenticate_user,
- e_book_remove_card_by_id, e_book_add_vcard, e_book_commit_vcard,
- e_book_get_cursor, e_book_get_book_view, e_book_get_changes): Made
- it so that all of these functions queue their ops before calling
- their CORBA functions. This way, if the response is sent back
- before the CORBA function returns there's no problem. Added
- e_book_unqueue_op so that the op could be unqueued if the CORBA
- call fails.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c, backend/ebook/e-book-listener.h
- (e_book_listener_unpop_response): Added this function to put a
- response back into the queue.
-
- * backend/ebook/e-book.c (e_book_check_listener_queue,
- e_book_queue_op): Handle the case where the op hasn't been queued
- yet when we get the response. In this case we unpop the response.
- Also, when queueing an op, we check to see if there are any
- responses waiting.
-
- * This change has been reverted.
-
-2001-06-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c, backend/ebook/e-card-compare.h
- (e_card_locate_match_full): Added this function to let you do
- slightly more complicated searches.
-
- * gui/merging/e-card-merging.c (e_card_merging_book_add_card): Use
- e_card_locate_match_full to check if the card exists in the book
- it's being added to instead of in the default book.
-
-2001-06-09 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_name): Removed unused email variable.
-
-2001-06-09 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-compare.c (use_common_book_cb): Null
- terminate the strv here.
- (e_card_locate_match): ref here instead of unref.
-
- * backend/ebook/e-card-simple.c (e_card_simple_get): Handle a NULL
- card here.
-
- * contact-editor/Makefile.am (INCLUDES), gui/widgets/Makefile.am
- (INCLUDES): Added addressbook/gui/merging here.
-
- * contact-editor/e-contact-quick-add.c (book_ready_cb),
- gui/component/addressbook-component.c (dnd_drop_book_open_cb),
- gui/widgets/e-addressbook-table-adapter.c
- (addressbook_append_row), gui/widgets/e-addressbook-util.c
- (add_card_cb), gui/widgets/e-addressbook-view.c
- (selection_received), gui/widgets/e-minicard-control.c
- (book_open_cb): Use e_card_merging_book_add_card instead of
- e_book_add_card here.
-
- * gui/Makefile.am (SUBDIRS): Added merging.
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD),
- gui/widgets/Makefile.am (minicard_test_LDADD,
- minicard_widget_test_LDADD): Added libecardmerging.a here.
-
- * gui/merging/, gui/merging/.cvsignore, gui/merging/Makefile.am:
- New addressbook library.
-
- * gui/merging/e-card-duplicate-detected.glade: Glade file for
- duplicate detected dialog.
-
- * gui/merging/e-card-merging.c, gui/merging/e-card-merging.h: New
- files for detecting duplicates before adding and putting up a
- dialog if duplicates are found.
-
- * gui/widgets/e-minicard-view.c: Include e-addressbook-util.h
- here.
-
-2001-06-08 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c (e_contact_editor_new): remove
- the gtk_widget_show call...
- (e_contact_editor_show): and put it here.
-
- * contact-editor/e-contact-editor.h: add prototype for
- e_contact_editor_show.
-
- * gui/widgets/e-minicard.c (e_minicard_event): call
- e_addressbook_show_contact_editor.
- (card_modified_cb): call e_addressbook_error_dialog if status !=
- SUCCESS.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_event): call
- e_addressbook_show_contact_editor. also, use card_modified_cb as
- the commit_card callback.
-
- * gui/widgets/e-addressbook-view.c (table_double_click): clean
- this area up alot, call e_addressbook_show_contact_editor.
- (card_deleted_cb): call e_addressbook_error_dialog.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (card_modified_cb): new function, call e_addressbook_error_dialog
- if the status != SUCCESS.
- (addressbook_set_value_at): use card_modified_cb as the callback
- for e_book_commit_card.
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): add
- e-addressbook-util.[ch].
-
- * gui/component/addressbook.c (new_contact_cb): use
- e_addressbook_show_contact_editor here.
-
-2001-06-05 Christopher James Lahey <clahey@ximian.com>
-
- * contact-editor/e-contact-editor.c (categories_clicked): Remove
- references to ECategoryMasterListWombat.
-
-2001-06-05 Jason Leach <jleach@ximian.com>
-
- * gui/component/select-names/e-select-names.c (remove_cb): Make
- this work when multiple names are selected then right
- click->Remove.
-
-2001-06-05 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): Copy dates as they come
- in.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_changes_foreach_key, pas_backend_file_changes,
- pas_backend_file_process_remove_card,
- pas_backend_file_process_modify_card,
- pas_backend_file_build_all_cards_list, pas_backend_file_get_vcard,
- pas_backend_file_maybe_upgrade_db): memset DBTs to 0 before using
- them.
- (pas_backend_file_build_all_cards_list): Reindented.
-
- * contact-editor/contact-editor.glade: Replaced GnomeDateEdits
- with a custom widget that creates an EDateEdit.
-
- * contact-editor/e-contact-editor.c: Use an EDateEdit here instead
- of a GnomeDateEdit.
-
-2001-06-05 Jason Leach <jleach@ximian.com>
-
- (Fix bug #655: SelectNames doesn't let you remove addresses after
- you add them)
-
- * gui/component/select-names/e-select-names.c
- (section_right_click_cb): New function, provides a popup menu with
- just "Remove" in it.
- (remove_cb): New callback to do the remove.
- (e_select_names_add_section): Attach the "right_click" signal to
- the section_right_click_cb above.
-
-2001-06-05 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (completion_handler): Change the completion handler to use the
- ECompletionMatch.
-
- * gui/component/select-names/e-select-names-completion.c
- General changes to convert for ECompletionMatch use.
- (emailify_match): Use extra sort keys in ECompletionMatch to let
- us ensure that the primary email address is always the first
- option, the secondary comes second, etc. There was no nice way to
- do this previously.
- (match_name): Removed code that adjusted score based on
- similarities between the "real name" and the e-mail address. It
- seemed like a good idea at the time, but produced unexpected and
- confusing results.
-
-2001-06-04 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-card-compare.c: Added. Code for testing
- if two ECards appear to pertain to the same contact (using loose
- matching rules, as opposed to requiring exact equality) and to
- query the addressbook for the "best match" to ECard.
-
-2001-06-03 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (set_status_message): remove spew,
- and don't call the ShellView CORBA method if the interface doesn't
- exist (for whatever reason.)
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_destroy):
- unref the EAddressbookModel.
- (create_minicard_view): unref the adapter.
- (card_added_cb): call e_book_error_dialog if status != SUCCESS.
- (card_modified_cb): same.
- (card_removed_cb): new function, and same.
- (delete_card_cb): pass card_removed_cb as the callback.
- (emit_status_message): new function, just emit status_message.
- (status_message): change to call emit_status_message.
- (card_deleted_cb): emit_status_message ("Done."), and call
- e_book_error_dialog if status != SUCCESS.
- (do_remove): pass view in the closure arg.
- (e_addressbook_view_delete_selection): emit status "Removing
- cards..." before starting the removal.
- (e_book_error_dialog): new function - pop up a (possibly) helpful
- message about why an operation failed.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_new): ref the EAddressbookReflowAdapter.
- (e_minicard_view_widget_destroy): unref the adapter.
- (e_minicard_view_widget_get_selection_model): if there isn't a
- minicard view return NULL.
-
- * gui/widgets/e-addressbook-table-adapter.c
- (e_addressbook_table_adapter_construct): ref the
- EAddressbookModel.
-
- * gui/widgets/e-addressbook-reflow-adapter.c
- (addressbook_finalize): rename this from addressbook_destroy, to
- reflect the method change.
- (e_addressbook_reflow_adapter_class_init): same.
- (e_addressbook_reflow_adapter_construct): ref the
- EAddressbookModel.
-
- * gui/widgets/e-addressbook-model.h: add editable_set flag.
-
- * gui/widgets/e-addressbook-model.c (writable_status): only record
- the writable state of the addressbook if the user hasn't set it.
- (e_addressbook_model_init): init editable_set to FALSE.
- (e_addressbook_model_set_arg): set editable_set to TRUE.
-
-2001-06-03 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am (evolution_vcard_importer_LDADD): Move
- `$(DB3_LDADD)' before libeutil.
-
-2001-06-01 Ettore Perazzoli <ettore@ximian.com>
-
- * backend/ebook/Makefile.am (evolution_vcard_importer_LDADD): Add
- $(DB3_LDADD)'.
-
-2001-05-31 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/Makefile.am (INCLUDES): Added db3 cflags.
-
- * backend/pas/pas-backend-file.c: Updated this to use db3.
-
-2001-05-31 Federico Mena Quintero <federico@ximian.com>
-
- * gui/widgets/e-addressbook-view.h (EAddressbookView): Added
- fields for the GalViewMenus and GalViewCollection; we need to keep
- them around while the component is active.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Plug leak; unref the spec.
- Unref the factories. Do not unref the collection, since we need
- it for the signal emission (okay, so the views object adds a
- reference to it, but if we are interested in it we should keep a
- reference anyways).
- (e_addressbook_view_setup_menus): Create the collection and views
- on the EAddressbookView's fields so that we can keep them around.
- (e_addressbook_view_discard_menus): New function; gets rid of the
- collection and views objects.
-
- * gui/component/addressbook.c (control_activate_cb): Call
- e_addressbook_view_discard_menus().
-
-2001-05-31 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names.h (struct
- _ESelectNames): add the EAddressbookModel* and change the
- ETableModel's name to "adapter".
-
- * gui/component/select-names/e-select-names.c (set_book),
- (addressbook_model_set_uri): these two things take an
- EAddressbookModel* instead of an ETableModel now.
- (e_addressbook_create_ebook_table): don't case the
- EAddressbookModel* to ETableModel*, create an EAddressbookTableAdapter
- on the EAddressbookModel instead.
- (e_select_names_init): set e_select_names->adapter.
-
-2001-05-31 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (remove_card): decrement
- data_count before emitting the card_removed signal, and break
- after we've removed the matching card.
- (e_addressbook_model_class_init): change signature of
- "card_removed" signal to match what we emit (and what is
- expected.)
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init): the
- signal name is "destroy", not "destroyed".
- (do_remove): new function, actually remove the card.
- (e_addressbook_view_delete_selection): get this working for both
- view types.
-
-2001-05-31 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c: Print Preview =>
- ContactsPrintPreview. Changed peter's change so that the node
- name is more in line with "Print.."'s
-
-2001-05-30 Peter Williams <peterw@ximian.com>
-
- * gui/component/addressbook.c: Use the correct path to the print
- preview menu item.
-
-2001-05-30 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (cut_contacts_cb): new function, for
- the Cut verb.
- (copy_contacts_cb): new function, for the Copy verb.
- (paste_contacts_cb): new function, for the Paste verb.
- (select_all_contacts_cb): new function, for the Select All verb.
- (update_command_state): add handling for sensitivity of
- Cut/Copy/Paste/Select All.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init): init
- the invisible and set up selection/destroy signals.
- (get_selection_model): new function, so we can get the
- ETableSelectionModel from either view type. makes lots of the
- other functions easier, since we can get the list of selected
- cards using the same code regardless of view type.
- (invisible_destroyed): new function.
- (selection_get): new function. convert the clipboard list to
- string.
- (selection_clear_event): new function - free up the list of
- ECards.
- (selection_received): if the selection data is valid and
- well-formed, add the corresponding cards to the ebook.
- (add_to_list): new function.
- (get_selected_cards): new function.
- (e_addressbook_view_cut): new function, implement in terms of
- _copy and _delete_selection.
- (e_addressbook_view_copy): claim ownership of the CLIPBOARD
- selection after saving the list of selected ECards.
- (e_addressbook_view_paste): call gtk_selection_convert.
- (e_addressbook_view_select_all): new function, using
- e_selection_model_select_all.
- (e_addressbook_view_can_print): re-implement in terms of
- get_selection_model.
- (e_addressbook_view_can_delete): same.
- (e_addressbook_view_can_cut): new function.
- (e_addressbook_view_can_copy): new function.
- (e_addressbook_view_can_paste): new function. hmm, always return
- TRUE here.
- (e_addressbook_view_can_select_all): new function.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView): add
- selection stuff - the list of selected cards, and the GtkInvisible
- selection owner, and add prototypes for
- e_addressbook_view_[can]_{cut,copy,paste,select_all}.
-
- * gui/widgets/e-minicard-view-widget.h: add a prototype for
- e_minicard_view_widget_get_selection_model.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_get_selection_model): new function.
-
-2001-05-27 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook.c: #include
- "evolution-shell-component-utils.h" rather than "e-gui-utils.h"
- for e_pixmaps_update.
-
-2001-05-25 Peter Williams <peterw@ximian.com>
-
- * gui/component/Makefile.am: Reference libeshell.la instead of
- libeshell.a.
-
-2001-05-25 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-reflow-adapter.c (addressbook_height):
- Correct the height calculation here to not include the
- E_CARD_SIMPLE_FIELD_FAMILY_NAME since it won't be displayed.
-
- * gui/widgets/e-minicard.c (remodel): Changed this to continue to
- be more consistent and simpler.
-
-2001-05-23 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (view_destroy): fix strings such
- that ones that happening at the beginning or during an operation
- are followed by "..." and those that stop the operation are
- followed by "."
- (create_card_handler): same.
- (ldap_op_process_current): same, and also call _notify_complete if
- we can't connect to ldap server.
- (poll_ldap): same, and change "Polling for LDAP search result" to
- "Receiving LDAP search results"
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): call
- notify_status_message at the beginning of this function, and
- whenever we call _notify_complete.
-
-2001-05-23 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-addressbook-model.h: add sequence_complete_id to
- EAddressbookModel and stop_state_changed to
- EAddressbookModelClass. also, add prototype for
- e_addressbook_model_can_stop.
-
- * gui/widgets/e-addressbook-model.c (remove_book_view): disconnect
- from "sequence_complete", and set search_in_progress to FALSE.
- (sequence_complete): set search_in_progress to FALSE and emit
- "stop_state_changed."
- (e_addressbook_model_class_init): create the "stop_state_changed"
- signal.
- (e_addressbook_model_init): init stuff.
- (book_view_loaded): connect to "sequence_complete" signal.
- (book_view_loaded): set search_in_progress to TRUE and emit
- "stop_state_changed"
- (e_addressbook_model_stop): set search_in_progress to false, emit
- "stop_state_changed", and set our status to "Search Interrupted."
- (e_addressbook_model_can_stop): return search_in_progress.
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init):
- connect to the stop_state_changed signal on EAddressbookModel.
- (stop_state_changed): new function.
- (e_addressbook_view_can_stop): call e_addressbook_model_can_stop.
-
- * gui/component/addressbook.c (update_command_state): use
- e_addressbook_view_can_stop to set the sensitivity of the stop
- button.
-
-2001-05-22 Dan Winship <danw@ximian.com>
-
- * backend/ebook/e-book-listener.c (e_book_listener_check_queue):
- ref the listener for the duration of this function, since emitting
- "responses_queued" may cause it to be unreffed by its EBook in
- some cases, which could cause the second response_queue check to
- look at garbage data if it got destroyed.
- (e_book_listener_destroy): Call g_source_remove if idle_id is set.
-
-2001-05-22 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c: track the change in
- evolution-addressbook.xml's bonobo ui path's.
-
-2001-05-21 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (change_view_type): update_view_type
- is gone, since the menu item is gone.
-
- * gui/widgets/e-addressbook-table-adapter.c (create_card): use
- e_table_model_rows_inserted here.
-
-2001-05-20 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_source_item_new): Removed an unused variable.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Made text here non-const.
-
- * gui/component/select-names/e-select-names-popup.c
- (edit_contact_info_cb): Cast to a gpointer here.
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table): Cast to E_TABLE_MODEL here.
-
-2001-05-18 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_name): Do a better job constructing match strings, so we
- never try to use a segment of the name that isn't there (resulting
- in ugly (null)'s in the string). Boost our score if some part of
- the name also matches the front part of the e-mail address, so the
- name match will always trump the e-mail match.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Return the serialized EDestinations
- (rather than just a string w/ e-mail addresses) through the bonobo
- component's property bag.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_export_destinationv): Added. A convenience routine
- for serializing the model's EDestinations into a string.
-
- * gui/component/select-names/e-select-names-popup.c
- (add_html_mail): Added. Puts in a check menu item for whether or
- not the recipient wants HTML mail.
- (popup_menu_card): Add menu item for HTML mail. Enable edit
- contact info item.
- (popup_menu_nocard): Add menu item for HTML mail. Enable edit
- contact info item.
-
- * backend/ebook/e-book-util.c (e_book_use_local_address_book):
- Added. Fetches the local addressbook and caches it on the first
- call. This is meant to be an easy and efficient way to get at the
- local addressbook with the minimum of code.
- (e_book_query_address_locally): Added. Convenience code that
- does an e-mail only e_book_name_and_email_query against the
- local address book.
-
- * backend/ebook/e-destination.c
- (e_destination_set_html_mail_pref): Added. Allows the intended
- recipient's HTML mail preference to be manipulated.
- (e_destination_get_email_verbose): Added. Cleaned up to use
- e_destination_get_name.
- (e_destination_get_html_mail_pref): Added. Read the recipient's HTML mail
- preference. If the destination is linked to a card, the
- preference is taken from the card (unless it has been explicitly
- overridden by a called to e_destination_set_html_mail_pref).
- (e_destination_get_address_textv): Added. Form a unified address string
- from a NULL-terminated vector of EDestinations.
- (e_destination_export): Added. Serialize an EDestination to a string.
- (e_destination_import): Added. Unserialize a string to build an
- EDestination.
- (e_destination_exportv): Added. Serialize a NULL-terminated vector of
- EDestinations to a string.
- (e_destination_importv): Added. Unserialize a string to build a
- NULL-terminated vector of EDestinations.
-
- * gui/component/select-names/e-select-names-completion.c:
- Implemented local versions of g_strcasecmp and g_strncasecmp
- (which should really be in glib, I think...) for utf8, and used
- them to make this code utf8-safe.
-
-2001-05-17 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (update_command_state): no more
- ContactFind command.
-
-2001-05-17 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): add our selection_change
- signal.
- (e_minicard_view_widget_realize): connect to the ESelectionModel's
- selection_changed signal.
- (e_minicard_view_widget_selected_count): new function.
- (selection_change): new function - emit our "selection_change"
- signal.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidgetClass): add selection_change signal. also,
- add prototype for e_minicard_view_widget_selected_count.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): add our command_state_change
- signal.
- (e_addressbook_view_init): connect to the writable_status signal
- on the EAddressbookModel.
- (minicard_selection_change): new function - calls
- command_state_change.
- (create_minicard_view): connect to selection_change on the
- minicard_view so we know when to update command state.
- (table_selection_change): new function - calls
- command_state_change.
- (writable_status): new function - calls command_state_change.
- (command_state_change): new function - emits our
- "command_state_change" signal.
- (create_table_view): connect to the selection_change signal so we
- know to update the command state.
- (change_view_type): update the command state every time we change
- view types.
- (e_addressbook_view_can_create): new function.
- (e_addressbook_view_can_print): new function.
- (e_addressbook_view_can_delete): new function.
- (e_addressbook_view_can_stop): new function.
-
- * gui/widgets/e-addressbook-view.h (struct
- _EAddressbookViewClass): add command_state_change signal, and
- prototypes of functions the component can use to test the state of
- commands.
-
- * gui/widgets/e-addressbook-model.c (addressbook_destroy): unlink
- the writable_status signal on the EBook.
- (writable_status): new function.
- (e_addressbook_model_class_init): add our writable_status signal.
- (e_addressbook_model_init): init writable_status_id.
- (e_addressbook_model_set_arg): unlink the writable_status signal
- on the old EBook, and connect it on the new one.
-
- * gui/widgets/e-addressbook-model.h: add writable_status signal.
-
- * gui/component/addressbook.c (update_command_state): new
- function, set the sensitivity of the bonobo commands.
- (control_activate): update our command state immediately upon
- activating the control.
- (addressbook_factory_new_control): register command_state_change
- to update the commands.
-
-2001-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): initialize the model and
- adapter.
- (button_press): set on the model.
- (e_addressbook_search_dialog_new): same.
- (e_addressbook_search_dialog_set_arg): same.
- (e_addressbook_search_dialog_destroy): unref the model and
- adapter.
-
- * gui/search/e-addressbook-search-dialog.h (struct
- _EAddressbookSearchDialog): add our model and reflow adapter.
-
-2001-05-16 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c: (e_minicard_view_destroy): Fixed
- up the lifetime of the drag_data_get signal a bit.
-
-2001-05-15 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view.c (add_to_list): MinicardViewModel
- -> ReflowAdapter name change.
- (get_card_list): same.
- (e_minicard_view_drag_begin): same.
- (supported_fields_cb): model -> adapter.
- (adapter_changed): hook up signals and set the empty message on
- our adapter.
- (e_minicard_view_set_arg): add support for "adapter", and set
- model -> adapter.
- (e_minicard_view_get_arg): same.
- (disconnect_signals): no more status_message.
- (do_remove): track to use adapter.
- (e_minicard_view_class_init): add adapter arg, and remove
- status_message.
- (e_minicard_view_init): all the code here is in adapter_changed
- now.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView):
- EMinicardViewModel -> EAddressbookReflowAdapter.
- (struct _EMinicardViewClass): get rid of status_message.
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): remove the status_message
- signal.
- (e_minicard_view_widget_new): take the adapter as our argument,
- and store it away for when we create the view.
- (e_minicard_view_widget_realize): when we create the view just set
- the adapter field on it. also, don't connect to status_message.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): add our adapter here, so we can pass it
- into the view when we create it.
- (struct _EMinicardViewWidgetClass): remove status_message.
-
- * gui/widgets/e-addressbook-view.c (status_message): new function,
- no more propagating status messages!
- (e_addressbook_view_init): create our model and conenct to its
- status_message signal.
- (book_writable_cb): set "editable" on the model, not our object.
- (e_addressbook_view_set_arg): same, but with "book" and "query" as
- well.
- (create_minicard_view): create our reflow adapter and pass it to
- the minicard view widget. also, call e_reflow_model_changed so
- it'll pick up any already present cards.
- (table_double_click): ADDRESSBOOK_MODEL -> TABLE_ADAPTER.
- (get_card_list_1): remove the cast, since we don't need it any
- longer.
- (table_right_click): ADDRESSBOOK_MODEL -> TABLE_ADAPTER.
- (table_drag_data_get): same.
- (create_table_view): create the table adapter, and use it as our
- ETableModel.
- (change_view_type): remove the status_message hook up and setting
- of query/book/editable.
- (e_addressbook_view_stop): just call e_addressbook_model_stop here
- instead of switching on the view type.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView): add
- our EAddressbookModel.
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): add the
- adapter files, and remove e-minicard-view-model.[ch].
-
- * gui/widgets/e-minicard-view-model.[ch]: removed.
-
- * gui/widgets/e-addressbook-table-adapter.c: new file.
-
- * gui/widgets/e-addressbook-table-adapter.h: new file.
-
- * gui/widgets/e-addressbook-reflow-adapter.c: new file.
-
- * gui/widgets/e-addressbook-reflow-adapter.h: new file.
-
- * gui/widgets/e-addressbook-model.c: rework this class to now
- subclass from ETableModel anymore. It not subclasses from
- GtkObject, and we use table and reflow adapters to get at the
- data.
-
- * gui/widgets/e-addressbook-model.h: same.
-
-2001-05-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view-model.c (remove_card): Fix a small
- error not decreasing the data_count here.
-
-2001-05-13 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.h: add prototype for
- addressbook_expand_uri.
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop): create an EBook for
- @physical_uri.
- (dnd_drop_book_open_cb): actually add the dropped cards.
-
- * gui/component/addressbook.c (addressbook_expand_uri): abstract
- this code out from the set_prop method so we can use it in the
- component.
- (set_prop): call addressbook_expand_uri.
-
- * backend/ebook/e-card.c (e_card_load_cards_from_string): new
- function.
-
- * backend/ebook/e-card.h: add prototype for
- e_card_load_cards_from_string.
-
-2001-05-12 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c
- (destination_folder_handle_drop): spew the data passed to us.
- (destination_folder_handle_motion): the suggested_action is not an
- ActionSet, but an Action, so don't or together multiple actions.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- correct bug causing the Ok button to never be enabled.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (populate_context_menu):
- example.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_drag_data_get):
- use e_card_list_get_vcard to build up the data to send.
- (e_minicard_view_init): connect to the model's drag_begin signal.
- (e_minicard_view_drag_begin): gather the list of cards being
- dragged and call gtk_drag_begin.
- (add_to_list): new function.
- (get_card_list): same.
- (disconnect_signals): disconnect the drag_data_get signal.
- (e_minicard_view_init): connect to the drag_begin signal on our
- model.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView): change
- drag_card to drag_list.
-
- * gui/widgets/e-minicard-view-model.c (minicard_drag_begin): new
- function, emit our drag_begin signal.
- (addressbook_incarnate): connect to the item's drag_begin signal.
- (e_minicard_view_model_class_init): init our drag_begin signal.
-
- * gui/widgets/e-minicard-view-model.h: add drag_begin signal.
-
- * gui/component/addressbook-config.c (addressbook_source_dialog):
- always loop through all source types here, making LDAP first so
- it's forces as the first notebook item.
- (addressbook_config_auth_label): remove SASL case.
- (addressbook_source_edit_changed): same.
- (addressbook_source_item_new): flag the area of code that needs to
- go into the advanced dialog (if we add one before someone
- graciously redesigns the entire addressbook gui :)
-
-
- * gui/component/addressbook-storage.c (ldap_unparse_auth): remove
- SASL case.
- (ldap_parse_auth): same.
-
- * gui/component/addressbook-storage.h: make LDAP come first in our
- source type enumeration, and remove the SASL auth type.
-
-2001-05-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): If the name is set and
- the full_name or file_as haven't been yet, set them.
-
-2001-05-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c: Reordered the includes here.
- (string_to_dbt): The sleepycat libdb documentation suggests
- memseting the DBT to 0 so we do that here.
-
- * gui/widgets/e-minicard-view-model.c (addressbook_height): Skip
- the E_CARD_SIMPLE_FIELD_FAMILY_NAME field.
-
- * gui/widgets/e-minicard.c (remodel): Skip the
- E_CARD_SIMPLE_FIELD_FAMILY_NAME field.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): only
- check schema support if we've connected.
-
-2001-05-11 Chris Toshok <toshok@ximian.com>
-
- * contact-editor/e-contact-editor.c (enable_writable_fields):
- don't leak the ECard or ECardSimple.
-
-2001-05-08 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.oaf.in:
- Renamed the GnomeCard_Importer.oaf.in to this, and change the IID.
-
- * Makefile.am: Rename all the GnomeCard to VCard.
-
- * evolution-vcard-importer.c: Make the GnomeCard a generic
- vcard importer.
-
-2001-05-08 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/Makefile.am (libebookinclude_HEADERS): Removed
- e-card-pairs.h since we're not using it.
-
- * backend/ebook/e-book-view.c (e_book_view_check_listener_queue):
- Added break; to default: case here.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added changed variable so as to avoid sync_card when possible.
- (e_card_simple_destroy): Free all the data here properly.
- (e_card_simple_get_arg): Slight simplification here.
- (fill_in_info, e_card_simple_arbitrary_foreach,
- e_card_simple_get_arbitrary): Call e_card_free_empty_lists here to
- save a bit of memory.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Fixed up
- includes a bit.
- (e_card_list_get_vcard, e_card_list_send): Added these functions
- for acting on a group of cards.
- (parse_org): Cleaned up this function a bit.
- (e_card_free_empty_lists): Added this function to delete
- unnecessary ELists and save a bit of memory.
- (e_v_object_get_child_value): Made this return NULL if not found
- instead of g_strdup("").
-
- * contact-editor/e-contact-save-as.c,
- contact-editor/e-contact-save-as.h (e_contact_list_save_as): Added
- this function to save multiple contacts.
-
- * gui/widgets/Makefile.am: Commented out reflow test.
- (libeminicard_a_SOURCES): Added e-minicard-view-model.c and
- e-minicard-view-model.h.
-
- * gui/widgets/e-minicard-view-model.c,
- gui/widgets/e-minicard-view-model.h: Model for use in
- EMinicardView.
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h:
- Reworked this to use the new EReflow stuff.
-
- * gui/widgets/e-minicard.c (e_minicard_event): Doesn't handle
- right click menus now. Emits a signal on the parent canvas item
- instead.
-
- * printing/e-contact-print-envelope.c,
- printing/e-contact-print-envelope.h
- (e_contact_print_envelope_list_dialog_new): Added this function to
- print multiple envelopes (only prints first for now.)
-
- * printing/e-contact-print.c, printing/e-contact-print.h
- (e_contact_print_card_list_dialog_new): Added this function to
- print multiple cards. Only prints the first for now.
-
-2001-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): flesh out
- the function more. It should work now, but there's no way to
- invoke this method from the ui at the moment, heh.
-
-2001-05-07 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook.c (book_open_cb): Use a different
- error message in the ldap support/no ldap support/file cases.
-
-2001-05-07 Gediminas Paulauskas <menesis@delfi.lt>
-
- * gui/component/addressbook.c: use define from
- widgets/misc/e-filter-bar.h instead of own enumeration and search menu
- names.
-
- * gui/component/Makefile.am, gui/component/select-names/Makefile.am:
- removed EVOLUTION_VERSION.
-
-2001-05-04 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): un-#if 0
- this.
- (xfer_folder): add skeleton code to validate xfer request. always
- notifies with PERMISSION_DENIED at present.
- (populate_context_menu): un-#if 0 this.
- (get_dnd_selection): same.
- (destination_folder_handle_motion): new function.
- (destination_folder_handle_drop): new function.
- (factory_fn): create a EvolutionShellComponentDndDestinationFolder
- interface, and add it to our shell component.
-
-2001-05-04 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): init change_id to NULL
-
-2001-05-02 JP Rosevear <jpr@ximian.com>
-
- * gui/component/addressbook.c (addressbook_view_free): unref the
- book if the view is being destroyed
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): unref the book_view when
- we are finished, it is only interesting if someone else has reffed
- it now (weak reference)
- (pas_backend_file_add_client): unref the book for the same reason
- as above
-
- * Fixes bug #2255
-
-2001-04-30 JP Rosevear <jpr@ximian.com>
-
- * backend/pas/pas-backend-file.c (vcard_matches_search): if the
- view does not contain a search context, the result is by default
- false fixes #2470
-
-2001-04-25 Dan Winship <danw@ximian.com>
-
- * gui/component/addressbook-factory.c (main): Remove call to
- unicode_init.
-
-2001-04-23 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-popup.c: Lots of code has been
- simplified here.
- (e_address_popup_factory_new_control): Rather than directly pop
- our control up in a window (via the e_address_popup_popup
- function, which is now gone), just return the widget and let the
- caller do the popping. This works better, since it means we don't
- have to work around the vagaries of bonobo focus & event handling.
- (e_address_popup_set_name): Refresh when both name & email have
- been set, rather than checking a stupid counter.
- (e_address_popup_set_email): Ditto.
-
-2001-04-22 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_clear_sources): Added save_source_data here.
-
-2001-04-21 Jon Trowbridge <trow@ximian.com>
-
- * contact-editor/e-contact-quick-add.c (clicked_cb): Properly
- convert to utf8. (Bug #2256)
- (build_quick_add_dialog): Properly convert from utf8. (Bug #2256)
-
-2001-04-16 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-destination.c (e_destination_get_name): Added.
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Use e_select_names_model_append. It's
- nicer.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_append): Added.
-
- * gui/component/select-names/e-select-names-completion.c
- (book_query_process_card_list): Filter out completion matches that
- don't have an associated e-mail address.
- (book_query_score): Give a bonus to the primary address, so that
- it always comes up first in the completion results.
-
- * gui/component/e-address-popup.c (e_address_popup_refresh_names):
- Convert utf8 strings into gtk strings before displaying.
-
-2001-04-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-view-listener.c,
- backend/ebook/e-book-view-listener.h: Added the function
- e_book_view_listener_stop to tell the book view listener to stop
- sending signals.
-
- * backend/ebook/e-book-view.c (e_book_view_destroy): Tell the
- EBookViewListener to stop when we're destroyed.
-
- * backend/pas/pas-backend-file.c (view_destroy,
- pas_backend_file_process_get_book_view,
- pas_backend_file_process_get_changes): Cleaned these up a bit
- using bonobo_object_ref and bonobo_object_unref.
- (pas_backend_file_process_get_book_view,
- pas_backend_file_process_get_changes): bonobo_object_release_unref
- the EBookListener here.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_book_view): Cleaned this up a bit
- using bonobo_object_ref. Make sure to unref the listener when
- we're done with it. Put the new book_view in the list before
- telling the book_listener that it's ready.
-
- * backend/pas/pas-book-view.c (pas_book_view_construct): Cleaned
- this up a bit using bonobo_object_dup_ref.
- (pas_book_view_destroy): Cleaned this up a bit using
- bonobo_object_release_unref.
-
- * backend/pas/pas-book.c (pas_book_queue_get_book_view,
- pas_book_queue_get_changes): bonobo_object_dup_ref here instead of
- just duplicating.
-
-2001-04-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-book-listener.c
- (impl_BookListener_respond_get_cursor): Ref the cursor here when
- we receive it.
- (impl_BookListener_respond_get_view,
- impl_BookListener_respond_get_changes): Ref the book_view here
- when we receive it.
- (impl_BookListener_respond_open_book): Ref the book here when we
- receive it.
- (e_book_listener_destroy): Unref the objects in our queue here.
-
- * backend/ebook/e-book-view.c (e_book_view_construct): Cleaned
- this up using bonobo_object_dup_ref.
- (e_book_view_destroy): Cleaned this up using
- bonobo_object_release_unref.
-
- * backend/ebook/e-book.c (e_book_do_response_get_cursor,
- e_book_do_response_get_view, e_book_do_response_get_changes,
- e_book_unload_uri): Cleaned this up using
- bonobo_object_release_unref.
-
-2001-04-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Get the ESelectNamesModel from the
- widget's text model instead of storing it as a gtk_object_set_data
- since it may change.
-
-2001-04-12 Jason Leach <jasonleach@usa.net>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): Update the Voice
- and Fax phone numbers too, finishing off bug #1667.
-
-2001-04-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): Update the built
- in VCard.
-
-2001-04-12 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): put the
- business address into the pilot record as that is what we put into
- the desktop record
- (ecard_from_remote_record): set both the address label and
- delivery address to avoid bad parser guessing, fixes #2143
-
- * backend/ebook/e-card-types.h: remove deprecated pilot code
-
- * backend/ebook/e-card.c: ditto
-
- * backend/ebook/e-card.h: ditto
-
-2001-04-11 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): Don't add
- more than five phone numbers and set the remaining blank entries
- to some reasonable defaults
-
-2001-04-11 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.h: Added
- E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING.
-
- * gui/component/addressbook-component.c (accepted_dnd_types):
- Fixed a warning here.
-
- * gui/widgets/e-addressbook-model.c: Modified this to have more
- columns, but not let them be edited if they're not a simple
- string.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_init): Fixed a
- warning and a memory leak here.
-
-2001-04-10 Gediminas Paulauskas <menesis@delfi.lt>
-
- * backend/ebook/evolution-gnomecard-importer.c: added missing #include.
- * contact-editor/e-contact-editor.c (_arrow_pressed): popup menu items were
- not translated after selecting one of them.
- * gui/widgets/e-addressbook-view.c: mark popup menu items with N_().
- Updated list[] for translators.
- * gui/widgets/e-minicard.c: same.
- * gui/widgets/e-minicard-view-widget.c (e_minicard_view_widget_set_arg): fix warning
- for "editable" arg.
- * gui/widgets/e-minicard-view.c: convert "empty_message" to utf8.
-
-2001-04-09 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-component.c (remove_folder): stubbed,
- #if 0'ed
- (xfer_folder): same.
- (populate_context_menu): same.
- (get_dnd_selection): same.
- (factory_fn): add the accepted drag types ("text/x-vard") to
- folder_types.
-
-2001-04-09 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (e_minicard_event): on BUTTON_PRESS: if
- it's button 1, store the button x, y, and set drag_button_down to
- TRUE. on BUTTON_RELEASE: always set drag_button_down to FALSE.
- for MOTION_NOTIFY: initiate drag if the pointer has moved 3
- pixels.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add fields for
- button x, y, and a bit for if the button has been pressed so we
- can tell whether a motion should be a drag.
- (struct _EMinicardClass): add drag_begin signal.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_drag_begin): new
- function, starts the drag.
- (book_view_loaded): connect the "drag_data_get" signal.
- (e_minicard_view_drag_data_get): new function.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView): add
- drag_card and id for canvas_drag_data_get_id.
-
- * gui/widgets/e-addressbook-view.c (table_drag_data_get): new
- function.
- (create_table_view): add d&d stuff.
-
-2001-04-08 Chris Toshok <toshok@ximian.com>
-
- * printing/e-contact-print.c: add #include <sys/types.h> since
- gnome-print.h uses time_t without including it. this really
- should be fixed in gnome-print.
-
-2001-04-08 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client):
- make sure to notify new clients to the writable status of an
- already open (and authenticated) book.
-
-2001-04-04 Kjartan Maraas <kmaraas@gnome.org>
-
- * contact-editor/e-contact-editor.[ch]: Fix headers.
- * component/addressbook-storage.c: Same here.
- * gui/search/e-addressbook-search-dialog.c: Same here.
- * gui/widgets/e-addressbook-view.c: Same here.
- * gui/widgets/e-minicard-label.c: Same here.
- * gui/widgets/e-minicard-view-widget.c: Same here.
- * gui/widgets/e-minicard-view.c: Same here.
- * gui/widgets/e-minicard-widget-test.c: Same here.
- * gui/widgets/e-minicard-widget.c: Same here.
- * gui/widgets/e-minicard.c: Same here.
- * gui/widgets/test-minicard-label.c: Same here.
-
-2001-04-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_double_click): Fixed a
- crash here.
-
-2001-04-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-model.c (COLS): Made this table model
- more consistent in the number of columns it has.
- (addressbook_append_row): Fixed this function. We removed the col
- offset.
-
-2001-04-02 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-gnomecard-importer.c (importer_init): Shut
- down and unregister the factory on exit.
-
-2001-04-01 Gediminas Paulauskas <menesis@delfi.lt>
-
- * contact-editor/contact-editor.glade: changed icon to
- evolution-contacts-plain.png.
- * gui/component/addressbook.c: use new pixmap cache. Added icon for new
- contact, print, print preview, changed filenames of renamed icons.
-
-2001-03-31 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Call e_select_names_model_clean after
- adding address. This should deal with the bug reports related
- to stray commas.
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_clean): Added. Remove all empty destinations.
-
- * backend/ebook/e-destination.c (e_destination_is_empty): Added. Check
- if an EDestination is in essentially a null state.
-
-2001-03-30 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_add_client):
- Tell new clients that are added whether they're writable.
-
-2001-03-29 Jon Trowbridge <trow@ximian.com>
-
- * printing/e-contact-print.c: Added #include <libgnome/gnome-paper.h>
-
- * printing/e-contact-print-envelope.c: Added #include <time.h>
- and #include <libgnome/gnome-paper.h>
-
-2001-04-03 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (match_email): Better handle matching of "nameless" contacts.
-
- * backend/ebook/e-destination.c (e_destination_get_string): Better
- handle the case of a "nameless" contact.
-
-2001-03-29 Kjartan Maraas <kmaraas@gnome.org>
-
- * *.*: Clean up #includes. Replace <gnome.h>, <bonobo.h> and
- <gtk/gtk.h> with more finegrained headers where needed.
-
-2001-03-28 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): Fixed some crashes.
-
-2001-03-28 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Use E_CARD_SIMPLE_FIELD_NAME_OR_ORG instead of
- getting the NAME and then the ORG. That way if we expand
- NAME_OR_ORG, this will use it.
-
- * gui/component/select-names/e-select-names.c
- (e_addressbook_create_ebook_table, SPEC): Use the correct column
- in the SPEC.
-
-2001-03-25 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_seq_complete_cb): Rather than starting
- the pending query by directly calling
- e_select_names_completion_do_query, call
- e_completion_begin_search. Circumventing the ECompletion API was
- causing it to get confused in some cases.
-
-2001-03-23 Jon Trowbridge <trow@ximian.com>
-
- * gui/widgets/e-minicard-widget.c (e_minicard_widget_set_card):
- Added. Call me old-fashioned, but I just prefer to have a real
- API rather than doing everything via gtk_object_get/set-type
- calls.
- (e_minicard_widget_set_arg): Changed to call
- e_minicard_widget_set_card.
-
- * backend/ebook/e-book-util.c: Small changes to get rid of
- compiler warnings. (Casting out const, removed unused variables,
- etc.) Removed some debugging messages.
-
- * gui/component/addressbook-factory.c (main): Added call
- to e_address_popup_factory_init.
-
- * gui/component/e-address-popup.c: Added. A popup gadget that is
- invoked (as a bonobo control) when an address is left-clicked in
- the mailer. The addressbook is queries, and the address is either
- displayed as a minicard (if it already exists) or in a "generic
- format". A button is provided for editting/adding the contact.
- Some of the semantics of this widget are a bit... non-standard,
- because of bonobo issues. I can't really seem to replicate
- popup-menu behavior because of how bonobo propogates events, etc.
- so I've tried to produce something that I think is non-annoying.
- YMMV.
-
-2001-03-22 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/evolution-gnomecard-importer.c: Update to the new
- IDL.
-
-2001-03-20 Miguel de Icaza <miguel@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Added artwork from
- Jakub.
-
-2001-03-19 Christopher James Lahey <clahey@ximian.com>
-
- * Merged branch:
-
-2001-03-14 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c: Call
- e_selection_model_simple_insert_rows and
- e_selection_model_simple_delete_rows instead of
- e_selection_model_simple_insert_row and
- e_selection_model_simple_delete_row.
-
-End of branch
-
-2001-03-17 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: Brutally
- refactored to boost performance in large-addressbook situations.
- These fixes give accepable performance (even with the suboptimal
- pas-backend-file searching) using tigert's addressbook-of-death.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search):
- Start feeding query matches back to the caller before the
- entire search is complete; this gives us some "instant feedback"
- rather than causing evolution to totally lock up...
-
- * backend/ebook/e-book.c (e_book_queue_op): Tag all queued ops.
- (e_book_cancel_op): Added. Search for a pending op with a given
- tag, and mark it as inactive.
- (e_book_do_response_get_cursor): Don't execute callback if this
- operations has been cancelled.
- (e_book_do_response_get_view): Ditto.
- (e_book_do_response_get_changes): Ditto.
- (e_book_do_response_get_supported_fields): Ditto.
- (e_book_get_supported_fields): Return an operation tag (that can
- be used to cancel the operation) rather than just TRUE/FALSE.
- Zero is always an invalid tag and is returned in the case of an
- error, so this shouldn't break any code that looked at the return
- value (unless it did so in a particularly stupid way, of course).
- (e_book_get_cursor): Ditto.
- (e_book_get_book_view): Ditto.
- (e_book_get_changes): Ditto.
- (e_book_cancel): Added. Cancel a pending operation. (Basically
- a call to e_book_cancel_op with error checking, etc.)
-
- * backend/ebook/e-book-types.h: Added E_BOOK_STATUS_CANCELLED.
-
-2001-03-17 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_writable_status): new function.
- (impl_BookListener_report_writable): new function.
- (e_book_listener_get_epv): fill in epv->notifyWritable.
-
- * backend/ebook/e-book-listener.h: add writable status entries.
-
- * backend/ebook/e-book.c (e_book_do_writable_event): new function.
- (e_book_check_listener_queue): add WritableStatusEvent to the
- switch.
- (e_book_class_init): register writable_status signal.
-
- * backend/ebook/e-book.h: add writable_status signal.
-
- * backend/idl/addressbook.idl: add notifyWritable method to
- BookListener.
-
- * gui/widgets/e-minicard.c (e_minicard_class_init): add "editable"
- arg.
- (e_minicard_init): init editable.
- (e_minicard_set_arg): loop over the minicard fields setting their
- "editable".
- (e_minicard_get_arg): add editable.
- (supported_fields_cb): use editable when creating the
- contact_editor.
- (add_field): set "editable" when creatin the e_minicard.
-
- * gui/widgets/e-minicard.h (struct _EMinicard): add "editable".
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_class_init): add
- editable arg.
- (e_minicard_view_init): init editable.
- (create_card): pass editable to e_minicard canvas item.
- (e_minicard_view_set_arg): bit of a hack - loop over all the
- canvas items setting their "editable."
- (e_minicard_view_get_arg): add editable.
- (supported_fields_cb): use editable when creating the contact
- editor.
-
- * gui/widgets/e-minicard-view.h (struct _EMinicardView): add
- "editable."
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): add "editable" field.
- (e_minicard_view_widget_init): init editable to FALSE.
- (e_minicard_view_widget_set_arg): save editable, and pass it along
- the e-minicard-view.
- (e_minicard_view_widget_realize): same.
- (e_minicard_view_widget_get_arg): add editable.
-
- * gui/widgets/e-minicard-view-widget.h (struct
- _EMinicardViewWidget): add "editable" field.
-
- * gui/widgets/e-minicard-label.h (struct _EMinicardLabel): add
- "editable" field.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_class_init):
- add "editable" arg.
- (e_minicard_label_set_arg): editable, set it on the e_text too.
- (e_minicard_label_get_arg): editable.
- (e_minicard_label_construct): set the "editable" field when we
- create the e_text cavas item
-
- * gui/widgets/e-addressbook-view.c (e_addressbook_view_init):
- default editable to FALSE.
- (book_writable_cb): new function, set our editable field and
- gtk_object_set it on the active view.
- (e_addressbook_view_set_arg): set the active view's editable when
- we set the view's book, and connect the "writable_status" signal
- to book_writable_cb.
- (change_view_type): same.
- (supported_fields_cb): use our "editable" when creating the
- contact editor.
-
- * gui/widgets/e-addressbook-view.h (struct _EAddressbookView): add
- editable field.
-
- * gui/widgets/e-addressbook-model.c (e_addressbook_model_init):
- change the default of editable to FALSE.
-
- * backend/pas/pas-book.c (pas_book_report_writable): new function.
-
- * backend/pas/pas-book.h: prototype for pas_book_report_writable.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): if
- we open the file O_RDWR (or create it) report it as writable. if
- we can't open it as O_RDWR, try opening it read-only before we
- attempt to create it.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_authenticate_user): if we authenticate
- successfully, grant write permissions (this is lacking but there's
- really nothing we can do to determine the extent of the access
- afforded a user.)
-
-
-2001-03-15 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/e-address-widget.c: Added addressbook querying and
- "cardification" functions, which are turned off by default for now
- because of addressbook bugs. Added a popup menu option to turn
- queries on, so that others can enjoy the thrill of massive flaming
- death.
-
- * gui/component/addressbook-factory.c (main): Made warnings always
- be fatal.
-
- * backend/pas/pas-book-view.c: Added some debugging spew.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): Added
- a little experimental code to try to make file searches scale
- better. #if 0/#endif-ed out for now.
-
- * contact-editor/e-contact-quick-add.c: #included e-book-util.h.
-
- * backend/ebook/e-card.c (e_card_name_match_string): Added.
- Looser name-matching function.
- (e_card_email_match_string): Added. Loose e-mail matching.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): Added code to cause us to
- abort rather than get trapped in a 100%-CPU-consuming loop in
- certain situations. Now we just need to figure out how to avoid
- these situations altogether.
-
- * backend/ebook/e-book-util.c: Added. Now contains the simple
- query stuff and the open local addressbook functions.
-
- * backend/ebook/e-book.c: Moved simple query stuff and open local
- addressbook functions into e-book-util.c.
-
-2001-03-15 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_set_arg):
- * gui/widgets/e-minicard.c (e_minicard_set_arg, e_minicard_event):
- Update arguments to e_canvas_item_grab_focus.
-
-2001-03-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Fix a warning
- here.
-
-2001-03-13 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/Makefile.am (minicard_label_test_LDADD): Change to
- ld order from Greg Williams.
-
-2001-03-13 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_book_view): Moved where we call
- pas_book_respond_get_book_view.
-
-2001-03-12 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: add E_STRING_PROP for
- categories.
-
- * backend/pas/evolutionperson.schema: add categories attribute.
-
- * backend/ebook/e-card-simple.c (field_data): add
- E_CARD_SIMPLE_FIELD_CATEGORIES.
-
- * backend/ebook/e-card-simple.h: add
- E_CARD_SIMPLE_FIELD_CATEGORIES.
-
-2001-03-12 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard.c (supported_fields_cb): add is_read_only
- param.
-
- * gui/widgets/e-minicard-view.c (supported_fields_cb): add
- is_read_only param.
-
- * gui/widgets/e-addressbook-view.c (supported_fields_cb): add
- is_read_only param.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): add is_read_only param.
- also, include a little policy here and make it TRUE, as the user
- shouldn't be editting in this context anyway (imo).
-
- * gui/component/addressbook.c (supported_fields_cb): add
- is_read_only param.
-
- * contact-editor/test-editor.c (main): add is_read_only param.
-
- * contact-editor/e-contact-editor.c (set_read_only): new function,
- that either enables or disables all the text fields, combo boxes,
- and some buttons, depending on the state of is_read_only.
- (e_contact_editor_class_init): add read/write arg "is_read_only".
- (full_name_clicked): set the is_read_only of the fullname dialog
- to the editor's.
- (full_addr_clicked): same.
- (e_contact_editor_new): add is_read_only param, that gets set
- along with the other params.
- (e_contact_editor_set_arg): add setter for is_read_only.
- (e_contact_editor_get_arg): add getter for is_read_only.
- (_phone_arrow_pressed): change TRUE to !editor->is_read_only for
- entry.
- (_email_arrow_pressed): same.
- (_address_arrow_pressed): same.
- (enable_writable_fields): same.
-
- * contact-editor/e-contact-editor-fullname.c
- (e_contact_editor_fullname_class_init): add read/write arg
- "is_read_only".
- (e_contact_editor_fullname_set_arg): add setter for is_read_only
- that enables/disables all the entries/combos.
- (e_contact_editor_fullname_get_arg): add getter for is_read_only.
-
- * contact-editor/e-contact-editor-fullname.h (struct
- _EContactEditorFullname): add is_read_only flag.
-
- * contact-editor/e-contact-editor-address.c
- (e_contact_editor_address_class_init): add read/write arg
- "is_read_only".
- (e_contact_editor_address_set_arg): add setter for is_read_only
- that disables/enables all the entries/combos.
- (e_contact_editor_address_get_arg): add getter for is_read_only.
-
- * contact-editor/e-contact-editor-address.h (struct
- _EContactEditorAddress): add is_read_only flag.
-
-2001-03-13 Iain Holmes <iain@ximian.com>
-
- * backend/ebook/Makefile.am: Change the importer includes around a bit.
-
- * backend/ebook/evolution-gnomecard-importer.c: Correctly add the includes.
-
-2001-03-09 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: PISOCK_INCLUDEDIR has become
- PISOCK_CFLAGS in gnome-pilot.m4 and remove capplet foo
-
-2001-03-11 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (e_book_simple_query): Added. A
- simplified, cancellable query mechanism that lets you avoid
- dealing with EBookView.
- (e_book_simple_query_cancel): Added. Cancels a running query.
-
- * backend/ebook/e-book-types.h: Add enum EBookSimpleQueryStatus.
-
-2001-03-08 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-popup.c
- (quick_add_cb): Switched to use e_contact_quick_add_free_form.
- Removed debugging code, hopefully without introducing any bugs
- in the process.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Fix bug with commas
- inside of name/address combos. As long as the comma is inside of
- quotes, it will be treated as part of the name rather than as a
- break between addresses.
-
- * gui/component/select-names/e-select-names-completion.c
- (match_nickname): Use e_card_name_to_string for nickname match
- strings.
- (match_email): Use e_card_name_to_string for email match strings.
- (e_select_names_completion_begin): Strip quotes out of query text,
- so we don't produce malformed sexps.
- Added William Blake quote easter egg.
-
- * contact-editor/e-contact-quick-add.c: Further attempts to fix...
- mostly unsuccessful.
- (e_contact_quick_add_free_form): Added. Takes a single string
- and tries to parse out (using some simple, loose rules) the
- name and e-mail -- then calls e_contact_quick_add. An attempt to
- get the computer to automatically Do The Right Thing.
-
- * backend/ebook/e-book.c: Fixed some broken indentation. Yes, I'm
- anal.
-
- * gui/component/GNOME_Evolution_Addressbook.oafinfo: Added oaf_server
- info for EAddressWidget.
-
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Added oaf_server
- info for EAddressWidget.
-
- * gui/component/addressbook-factory.c (main): Add call to
- e_address_widget_factory_init.
-
- * gui/component/e-address-widget.h:
- * gui/component/e-address-widget.c: Added. A little widget (and a
- Bonobo control, BTW) for displaying addresses, with a left-click
- menu. Used to display addresses in the mail viewer (as embedded
- GtkHTML objects, replacing the text previously used). Still quite
- incomplete.
-
-2001-03-08 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook-component.c (factory_fn): Specify a
- NULL `EvolutionShellComponentGetDndSelectionFn'.
-
-2001-03-06 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Fix glitch with
- inserting comma-delimited stuff when length > 1.
-
-2001-03-06 Jon Trowbridge <trow@ximian.com>
-
- * backend/ebook/e-book.c (e_book_load_local_address_book): Added.
- Just encapsulates opening
- file://~username/evolution/local/Contactes/addressbook.db, so that
- path doesn't need to be hardwired in throughout the code.
-
-2001-03-06 Benjamin Kahn <xkahn@cybersites.com>
-
- * contact-editor/e-contact-quick-add.c (clicked_cb):
- Added the third argument to e_contact_editor_new. (Cheated
- and send NULL for the field argument, which is probably
- troublesome. It will be fixed soon by either clahey or
- toshok.)
-
-2001-03-06 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-model.c
- (e_select_names_model_replace): Fix a reference counting bug.
-
- * gui/component/select-names/e-select-names-manager.c (popup_cb):
- A callback for creating the appropriate popup by calling
- e_select_names_popup.
- (e_select_names_manager_create_entry): Connect popup_cb to the
- entry's popup signal
-
- * gui/component/select-names/e-select-names-popup.c: Added. Code
- for popup right-click menus for recipient entries. Still a bit
- incomplete.
-
- * backend/ebook/e-destination.c (e_destination_get_email_num):
- Added.
-
- * contact-editor/e-contact-quick-add.c: Added. Some code and a
- dialog for very quickly adding entries to the address book.
- Still not fully working.
-
-2001-03-04 Christopher James Lahey <clahey@ximian.com>
-
- * backend/ebook/e-card-simple.c: Cleaned up the formatting in this
- file a bit.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_set_arg):
- Made it so that passing in NULL to the writable_fields arg sets
- the set of writable fields to the empty set.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): Pass NULL as the
- writable_fields argument here.
-
- * gui/widgets/e-addressbook-model.c: Don't offset by one here.
- This way we will get the file_as field as one of our
- ETableColumns.
-
- * gui/widgets/e-addressbook-view.c (SPEC): Updated this for the
- changes in ECardSimple.
-
- * gui/widgets/e-minicard.c (remodel): Don't remodel if the item
- isn't realized.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: doh, track renaming of
- objectclass from evolvePerson to evolutionPerson.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolutionperson.schema: rename evolveperson.schema
- to this, and add remaining attributes.
-
- * backend/pas/pas-backend-ldap.c: add remaining fields, and fix up
- ones that were incorrent (either the ldap_attr or the query prop).
-
-2001-03-02 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: update sed script
-
- * conduit/e-address.conduit.in: update for new pilot foo
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): track change to
- e_contact_editor_new.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (add_objectclass_mod): add
- objectclasses for "person", "organizationalPerson", and "top" as
- well, just to be complete.
- (check_schema_support): rename check_for_evolve_person to this, to
- reflect that we're doing more than just checking for that
- objectClass.
- (add_oc_attributes_to_supported_fields): new function.
- (add_to_supported_fields): new function.
- (pas_backend_ldap_destroy): unref supported_fields.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * gui/widgets/e-minicard-view.c (supported_fields_cb): new
- function.
- (e_minicard_view_event): split out the creation of the contact
- editor to the supported_fields callback.
-
- * gui/widgets/e-minicard.c (supported_fields_cb): new function.
- (e_minicard_event): split out the creation of the contact editor
- to the supported_fields callback.
-
- * gui/widgets/e-addressbook-view.c (table_double_click): split
- function into two functions, since e_book_get_supported_fields
- requires a callback now.
- (supported_fields_cb): new function.
-
- * gui/component/addressbook.c (new_contact_cb): split this into
- two functions, since e_book_get_supported_fields requires a
- callback now.
- (supported_fields_cb): new function.
-
- * contact-editor/test-editor.c (main): track change to
- e_contact_editor_new (pass NULL for the writable_fields arg.)
-
- * contact-editor/contact-editor.glade: fix several labels so they
- make better sense (since we look them up in e-contact-editor.c.)
-
- * contact-editor/e-contact-editor.h (struct _EContactEditor): add
- writable_fields. also, add it to e_contact_editor_new.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_class_init):
- add writable_fields arg.
- (e_contact_editor_destroy): unref the writable_fields list.
- (e_contact_editor_new): pass @fields as the writable_fields arg.
- (e_contact_editor_set_arg): add writable_fields support.
- (enable_writable_fields): new (very hairy) function, to disable
- everything and reenable just the fields listed in the
- writable_fields list.
- (_email_arrow_pressed): set label-email1, entry-email1, and
- checkbutton-htmlmail to be sensitive since the only way to get
- here is to activate a writable field in the menu.
- (_address_arrow_pressed): set label-address, button-fulladdr, and
- text-address to be sensitive for the same reason.
- (_phone_arrow_pressed): sensitize the label and entry for the same
- reason.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-card-simple.c (field_data): add new entries for
- phone enums, and fill in the ecard_field with (bogus in all but a
- few cases) strings. these are the strings sent from wombat to
- evolution-addressbook for supported_fields.
- (e_card_simple_get_ecard_field): new function.
- (e_card_simple_map_phone_to_field): new function.
- (e_card_simple_map_email_to_field): new function.
- (e_card_simple_map_address_to_field): new function.
-
- * backend/ebook/e-card-simple.h: add a few phone entries to the
- ECardSimpleField enum, and add prototypes for mapping the list
- types (phone, email, address) to ECardSimpleField. Also, add
- prototype for e_card_simple_get_ecard_field.
-
- * backend/ebook/e-book.c
- (e_book_do_response_get_supported_fields): don't build the EList
- here, it's already built.
-
- * backend/ebook/e-book-listener.h: change fields from the CORBA
- sequence to the EList in our reponse struct.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): we make the
- EList here, since after we return the CORBA list is freed up.
-
-2001-03-02 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_supported_fields): implement
- properly, we support everything.
-
-2001-03-01 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): Oops, we do need to be able to write to
- "text" after all (for things like Reply-to: to work properly).
- Fixed.
- (impl_SelectNames_get_entry_for_section): Made "text" a writeable
- property again.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_insert_length): Increment pos so that
- we don't reverse strings when length > 1 (a particularly amusing
- bug).
-
- * gui/component/select-names/e-select-names-completion.c
- (e_select_names_completion_destroy): Check for NULL before calling
- gtk_object_unref (GTK_OBJECT (---)), to get rid of annoying error
- messages.
-
-2001-03-01 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-completion.c: I am an
- idiot.
-
-2001-03-01 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-table-model.c
- (fill_in_info): Change for new EDestination/ESelectNamesModel API.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_get_source): Added. A function for
- looking up the ESelectNamesModel by id. (I didn't end up using
- this function, but it might come in handy later.)
- (e_select_names_manager_get_cards): #if 0/#endif out this
- function.
- (e_select_names_manager_create_entry): Modified to attach an
- ESelectNamesCompletion to the entry we create.
- (completion_handler): A post-completion handler for our EEntry, to
- take the completion's extra data (an EDestination) and properly
- stick it into our ESelectNamesModel.
-
- * gui/component/select-names/e-select-names.c
- (real_add_address_cb): Changed to operate on EDestinations rather
- than ECards and to use the new ESelectNamesModel API. This leads
- to a rather nice code simplication.
- (remove_address): Changed for new ESelectNamesModel API.
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): Rather than just passing the entry's text
- through the property bag, get the "address text" from the model.
- This returns a nice, verbose string of addresses with names
- expanded when the address is tied to an ECard (i.e. "Jon
- Trowbridge <trow@ximian.com>").
- (impl_SelectNames_get_entry_for_section): Make the text property
- read-only.
- (entry_set_property_fn): ...and since it is read-only now, chop
- out the setter code.
-
- * gui/component/select-names/e-select-names-text-model.h:
- * gui/component/select-names/e-select-names-text-model.c: Again,
- this code has been (pretty much) totally rewritten to convert all
- text operations into changes on the ESelectNamesModel. This lets
- us give the associated EEntry some (IMHO) nice semantics regarding
- whitespace, etc. Includes object activation, so destinations tied
- to ECards are underlined and can be double-clicked to bring up a
- contact editor.
-
- * gui/component/select-names/e-select-names-model.h:
- * gui/component/select-names/e-select-names-model.c: I've heavily
- modified this object to both hide all implementation details
- (which the old version exposed a bit too much for my peculiar
- tastes) and to act as an EDestination container. The old code put
- the text model operations here. I've moved them all to
- ESelectNamesTextModel --- so the text model actions (insert,
- delete, etc.) are all done through the API rather than operating on
- ESelectNamesModel internals.
-
- * gui/component/select-names/e-select-names-completion.c: Added. A
- fairly complicated object derived from ECompletion that searches
- our local addressbook in various and sundry ways.
-
- * gui/component/select-names/e-select-names-completion.h:
-
- * backend/ebook/e-destination.h:
- * backend/ebook/e-destination.c: Added. This object encapsulates
- a place to sent an email to, which can either be just a address as
- a string ("trow@ximian.com"), a fancier string ("Jon Trowbridge
- <trow@ximian.com>"), or an ECard and a specific address within
- that ECard.
-
-2001-03-01 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h,
- gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Used
- ESelectionModelSimple and the changes to EReflow and EReflowSorted
- to get multiple selection in the minicard view.
-
- * gui/widgets/test-reflow.c: Changed this to get it to compile
- with the changes to EReflow.
-
-2001-02-21 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search): Made
- this pay attention to the return value of e_sexp_parse.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_activate_obj): Fixed a const
- inconsistency here.
-
-2001-02-21 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-book.c (pas_book_queue_get_supported_fields):
- new function.
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields): track
- change to idl.
- (pas_book_respond_get_supported_fields): new function.
-
- * backend/pas/pas-book.h: add GetSupportedFields to the
- PASOperation enum. Also, add a stringlist field to the PASRequest
- struct. lastly, add a prototype for
- pas_book_respond_get_supported_fields.
-
- * backend/pas/pas-backend.h: remove prototype for
- pas_backend_get_supported_fields, and remove it from the vtable.
-
- * backend/pas/pas-backend.c (pas_backend_get_supported_fields):
- remove.
- (pas_backend_class_init): no vtable entry for get_supported_fields
- anymore.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_get_supported_fields): new function.
- (pas_backend_ldap_process_client_requests): add case for
- GetSupportedFields.
- (pas_backend_ldap_class_init): get_supported_fields isn't in
- vtable anymore.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_get_supported_fields): new function.
- (pas_backend_file_process_client_requests): add case for
- GetSupportedFields.
- (pas_backend_file_class_init): get_supported_fields isn't in
- vtable anymore.
-
- * backend/idl/addressbook.idl: Book::getSupportedFields now
- returns void and add BookListener::notifySupportedFields.
-
- * backend/ebook/test-client.c (get_fields_cb): new function.
- (auth_user_cb): track change to e_book_get_supported_fields.
-
- * backend/ebook/e-book.c
- (e_book_do_response_get_supported_fields): new function.
- (e_book_check_listener_queue): add case
- GetSupportedFieldsResponse.
- (e_book_get_supported_fields): switch to async model.
-
- * backend/ebook/e-book.h: switch e_book_get_supported_fields to an
- async model.
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_get_supported_fields_response): new
- function.
- (impl_BookListener_response_get_supported_fields): new function.
- (e_book_listener_get_epv): fill in epv's "notifySupportedFields"
-
- * backend/ebook/e-book-listener.h: add an async response for
- GetSupportedFields and add a stringlist member to the
- EBookListenerResponse struct.
-
-2001-02-20 Federico Mena Quintero <federico@ximian.com>
-
- * backend/pas/pas-book-factory.c (pas_book_factory_activate):
- Moved the register_factory() code to here, since it was the only
- thing being called anyways.
- (PasBookFactoryPrivate): Added a "registered" flag.
- (pas_book_factory_activate): Set the registered flag.
- (pas_book_factory_destroy): Deactivate the factory when we go away.
-
-2001-02-20 Chris Toshok <toshok@ximian.com>
-
- * backend/ebook/e-book.c (e_book_get_supported_fields): new function.
-
- * backend/ebook/e-book.h: add e-book interface to getting
- supported fields.
-
- * backend/ebook/test-client.c (auth_user_cb): shoe-horn in some
- spew about supported fields.
-
-2001-02-19 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: Remove PISOCK_LIBDIR
-
-2001-02-19 Jon Trowbridge <trow@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): When creating the entry,
- open up an ebook (corresponding to the local addressbook) and make
- the entry use an EAddressCompletion.
- (completion_handler): Added; this is the actual completion
- handler, which manipulates the entry when the user selects
- something from the drop-down.
-
- * gui/component/select-names/e-select-names-model.c: Various hacks
- by clahey to unbreak e_select_names_model_add_item,
- e_select_names_model_replace_item (which I added) and
- e_select_names_model_remove_item.
-
- * gui/component/select-names/e-select-names-text-model.c
- (e_select_names_text_model_obj_count,
- e_select_names_text_model_get_nth_obj): Make chunks of text that
- correspond to ECards in the ESelectNamesModel be embedded objects.
- (e_select_names_text_model_activate_obj): On activation, pop up a
- contact editor for the embedded object's card.
- (e_select_names_text_model_model_changed): Fixed to work with
- ETextModel API changes.
- (e_select_names_text_model_set_text): Make const correct.
- (e_select_names_text_model_insert): Make const correct.
- (e_select_names_text_model_insert_length): Make const correct.
-
- * backend/ebook/e-address-completion.h,
- backend/ebook/e-address-completion.c: Added. EAddressCompletion
- is a derived class of ECompletion that does asynchronous address
- lookups for completions.
-
-2001-02-17 Chris Toshok <toshok@ximian.com>
-
- * backend/idl/addressbook.idl: add sequence<string> typedef, and
- add getSupportedFields method.
-
- * backend/pas/pas-book.c
- (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields): new
- function.
-
- * backend/pas/pas-backend.c (pas_backend_class_init): init
- get_supported_fields = NULL.
- (pas_backend_get_supported_fields): new function.
-
- * backend/pas/pas-backend.h: add prototype for
- pas_backend_get_supported_fields.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_get_supported_fields): new function.
- (pas_backend_file_class_init): fill in get_supported_fields.
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_get_supported_fields): new function.
- (pas_backend_ldap_class_init): fill in get_supported_fields.
-
-2001-02-14 Christopher James Lahey <clahey@ximian.com>
-
- * backend/pas/pas-backend-ldap.c: Undefine E_STRING_PROP and
- E_LIST_PROP here.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h (e_contact_editor_raise): Added
- this function.
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h
- (e_minicard_event): Added an editor field to the EMinicard object.
- Made it so that if you double click on the same card twice, it
- doesn't open a new window, but instead raises the old.
-
-2001-02-08 Iain Holmes <iain@ximian.com>
-
- * gui/component/addressbook-storage.c (addressbook_source_free):
- Free the ldap.binddn.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Free the dir strings.
-
-2001-02-08 Christopher James Lahey <clahey@ximian.com>
-
- * contact-editor/e-contact-editor.c (categories_clicked): Set the
- header on the category dialog we pop up.
-
-2001-02-12 Kjartan Maraas <kmaraas@gnome.org>
-
- * backend/ebook/GNOME_Evolution_Addressbook_GnomeCard_Importer.oaf.in: Translations.
- * gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.oaf.in:
- Marked strings for translation in this newly created file.
- * gui/component/select-names/Makefile.am: Hook up the .oaf.in files in the
- xml-i18n-tools framework.
- * gui/component/Makefile.am: Same as above.
- * gui/component/GNOME_Evolution_Addressbook.oaf.in: Marked stuff for translation here
- too.
-
-2001-02-11 Jason Leach <jasonleach@usa.net>
-
- * gui/component/addressbook.c: Removed an ancient #include
- <libgnorba/gnorba.h>
-
-2001-02-11 Gediminas Paulauskas <menesis@delfi.lt>
-
- Really use xml-i18n-tools.
-
- * conduit/e-address-conduit-control-applet.desktop: removed.
- * conduit/e-address-conduit-control-applet.desktop.in: added empty.
- * conduit/Makefile.am: reflect above changes, merge translations.
-
- * contact-editor/e-contact-editor-strings.h,
- contact-editor/fulladdr.glade.h, contact-editor/fullname-strings.h,
- contact-editor/e-contact-editor-confirm-delete.glade.h,
- gui/component/select-names/select-names.glade.h:
- removed these files, xml-i18n-extract takes care of strings itself.
-
- * contact-editor/*.glade,
- gui/component/select-names/select-names.glade,
- gui/widgets/alphabet.glade, printing/e-contact-print.glade:
- changed project options to not output_translatable_strings.
-
- * contact-editor/Makefile.am, gui/widgets/Makefile.am,
- gui/component/select-names/Makefile.am, printing/Makefile.am:
- do not include removed files in EXTRA_DIST.
-
-2001-02-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (check_for_evolve_person): flesh
- out this check. #ifdef the entire thing OPENLDAP2, as it only
- works with the new schema stuff in openldap 2.x (both on server
- and client, so upgrade your server.)
-
-2001-02-07 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: Added N_("* Click here to add
- a contact *").
-
-2001-02-07 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_connect): only
- set the DEBUG_LEVEL if we're OPENLDAP2.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (email_compare): return TRUE if
- equal, FALSE otherwise.
- (business_compare): same.
- (homephone_compare): same.
- (email_ber): return NULL if there are no elements in our list.
- (homephone_ber): same.
- (business_ber): same.
- (build_mods_from_ecards): add smarts to handle list elements
- properly (like email, business_phone, home_phone.) now we'll
- properly send updates if any element in the list changes.
-
-2001-02-06 Christopher James Lahey <clahey@ximian.com>
-
- * gui/widgets/Makefile.am (INCLUDES): Added
- -DEVOLUTION_DATADIR=\""$(datadir)"\".
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Changed the local and system
- directories.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_card_handler): doh,
- didn't mean to commit this.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/evolveperson.schema: new file. this will eventually
- form the suggested additions to an existing openldap server that,
- along with support for inetorgperson, will allow people to store
- all evolution attributes in ldap.
-
-2001-02-06 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_init): don't
- need the = NULL's since we g_new0.
- (check_for_evolve_person): new function.
- (pas_backend_ldap_connect): check to see if the evolvePerson
- objectclass is there.
- (build_mods_from_ecards): right now, just silently skip the extra
- attributes if we don't support evolvePerson.
- (add_objectclass_mod): new function, add both inetOrgPerson and
- (if it's available) evolvePerson as objectclasses.
- (pas_backend_ldap_process_authenticate_user): also check to see if
- evolvePerson is there, if we couldn't do it (due to auth reasons)
- in the connect method.
- (prop_info): change the telephoneNumber LDAP attribute to be used
- for evolution's business phone numbers. the primary phone number
- will be a single valued attribute on evolvePerson.
- (business_populate): new function.
- (business_ber): new function.
- (business_compare): new function.
-
-2001-02-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (create_card_handler): err,
- allocate 2 char*s when i assign 2 char*s.
-
-2001-02-05 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (modify_card_handler): switch to
- ldap_modify_ext_s if OPENLDAP2, as ldap_modify_s is deprecated.
- (build_mods_from_ecards): don't include the mod if the value is ""
- - this isn't valid on schema checking ldap servers.
- (homephone_populate): new function.
- (homephone_ber): new function.
- (homephone_compare): new function.
- (create_card_handler): add spew when adding cards so I can see
- what's going on.
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-config.c (table_add_elem): Save the
- help_text in the closure.
-
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): Added
- gal-view-factory-minicard.c, gal-view-factory-minicard.h,
- gal-view-minicard.c, and gal-view-minicard.h.
-
- * gui/widgets/gal-view-factory-minicard.c,
- gui/widgets/gal-view-factory-minicard.h,
- gui/widgets/gal-view-minicard.c, and
- gui/widgets/gal-view-minicard.h: New classes for minicard view
- type.
-
- * gui/widgets/e-addressbook-view.c: Deploy gal-view stuff
- properly.
-
-2001-02-05 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (e_card_get_vcard): Make the Note field
- be quoted printable.
-
-2001-01-27 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): This should be a close button,
- not a cancel button.
-
-2001-02-04 Christopher James Lahey <clahey@ximian.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): Call
- e_select_names_set_default when appropriate.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Added support for
- double clicking sending the selected contacts to the default
- section. Added a set_default function. Made multiple selection
- work.
-
-2001-01-29 Chris Toshok <toshok@ximian.com>
-
- * gui/component/addressbook-config.c
- (addressbook_config_source_label): #ifdef INCLUDE_FILE_SOURCE.
- (table_add_elem): add help_text parameter and set up focus_in
- events to display the help in the dialog's html area.
- (focus_help): new function, calls put_html on the help text.
- (addressbook_ldap_auth_item_new): add help texts.
- (addressbook_source_item_new): add help texts.
- (addressbook_source_dialog): add help texts.
-
-2001-01-27 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Remove the butt-ugly arrow icon and
- replace it with a less invasive "->" icon.
-
-2001-01-25 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (build_mods_from_ecards): add
- comment about the else block here.
- (prop_info): add home_address, business_address, business_fax,
- assistant, and isdn.
-
-2001-01-25 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): Made
- this only add the initial VCard if it finds a file
- "create-initial" in the directory it's creating the database in.
-
- * gui/component/addressbook-component.c (factory_fn): Added a
- create_folder function.
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Fixed an unused variable
- warning.
-
-2001-01-25 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_setup_menus): Setup the view collection
- properly and handle the "display_view" signal.
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Consider the
- placeholder in the path for the "Print" item.
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (update_pixmaps): Set the icon for
- "/Toolbar/Find" to "24_find_contact.xpm".
-
-2001-01-25 Ettore Perazzoli <ettore@ximian.com>
-
- * gui/component/addressbook.c (set_pixmap): New.
- (update_pixmaps): New function, setting the pixmaps for the items
- of type "pixbuf", using `set_pixmap'.
- (control_activate): Call it.
-
-2001-01-25 Not Zed <NotZed@Ximian.com>
-
- * backend/pas/pas-backend-ldap.c: esexp api change fixes.
-
- * backend/pas/pas-backend-file.c (entry_compare): Fix for e_sexp api changes.
- (vcard_matches_search): esexp api fixes.
- (pas_backend_file_search): Ouch, unref the e-sexp properly (not gtk object).
-
-2001-01-24 Chris Toshok <toshok@ximian.com>
-
- * backend/pas/pas-backend-ldap.c (email_ber_func): make sure to
- add the lengths here (include the \0? anyone?).
- (build_mods_from_ecards): if we're filling in mod->mod_bvalues,
- set mod_op |= LDAP_MOD_BVALUES.
-
-2001-01-23 Jason Leach <jasonleach@usa.net>
-
- (Fix #1225: advanced search cancel/close)
-
- * gui/search/e-addressbook-search-dialog.c
- (e_addressbook_search_dialog_init): Set it up with Search and a
- Cancel button, Search is still the default.
-
-2001-01-23 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): properly ref
- the ecard. still need to kill some memory leaks.
-
-2001-01-22 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: remove vfs dependency
-
-2001-01-21 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (delete_record): Remove
- deleted records from the pilot map so we don't have dupes in the future
-
-2001-01-19 Dan Winship <danw@ximian.com>
-
- * gui/widgets/e-addressbook-view.c (table_right_click):
- * gui/widgets/e-minicard.c (e_minicard_event): Update for
- e_popup_menu_run prototype change.
-
-2001-01-19 Jason Leach <jasonleach@usa.net>
-
- (Adding a boolean "entry_changed" BonoboPropertyBag arg)
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_set_property_fn): Use a gtk_object_set_data to set the
- property to TRUE here.
-
- (entry_changed): New function, calls bonobo_control_set_property
- if entry_changed hasn't been set to TRUE yet.
-
- (impl_SelectNames_get_entry_for_section): Connect "changed" on
- each entry_widget to the new entry_changed() func.
-
-2001-01-19 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): always free
- the delivery elements and correct embarrassingly stupid memory error
- that was causing the addressbook conduit problems.
-
- * backend/ebook/e-book-view-listener.c
- (e_book_view_listener_check_queue): ref/unref ourself when processing
- in case someone we signal unrefs us.
-
- * conduit/address-conduit.c (sequence_complete): disconnect signals
- when complete
-
-2001-01-17 Federico Mena Quintero <federico@ximian.com>
-
- * backend/pas/pas-book-factory.c (pas_book_factory_activate): Made
- it return a gboolean; it was completely ignoring the return value
- from register_factory().
-
-2001-01-17 Larry Ewing <lewing@helixcode.com>
-
- * backend/ebook/.cvsignore: add evolution-gnomecard-importer.
-
- * backend/ebook/Makefile.am (oaf_DATA): don't require the pine
- oainfo file until it is actually added to the repository. We need
- to keep the build working for nightlies to work.
-
-2001-01-16 Jason Leach <jasonleach@usa.net>
-
- * backend/pas/pas-backend-file.c (INITIAL_VCARD): s/Helix
- Code/Ximian/ for the initial contact card.
-
-2001-01-15 JP Rosevear <jpr@ximian.com>
-
- * conduit/address-conduit.c (print_local): prevent segfaults and
- buffer overflows
- (print_remote): ditto
-
-2001-01-14 JP Rosevear <jpr@ximian.com>
-
- * conduit/Makefile.am: pass -module and -avoid-version to conduit
- linker
-
-2001-01-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (factory_fn): Pass NULL as
- the @copy_folder_fn arg to `evolution_shell_component_new'.
-
-2001-01-12 Miguel de Icaza <miguel@ximian.com>
-
- * gui/widgets/e-addressbook-view.c: added i18n for etable.
-
-2001-01-11 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_process_create_card): get a book view from
- somewhere so we can give status messages - choose the first one in
- the list.
- (pas_backend_ldap_process_modify_card): same.
- (pas_backend_ldap_process_remove_card): same.
- (prop_info): add more properties, like home_phone, mobile, pager,
- uri, org_unit, office, title, and manager.
-
-2001-01-09 Miguel de Icaza <miguel@gnu.org>
-
- * gui/widgets/Makefile.am (minicard_widget_test_LDADD): Put GNOME
- libraries at the end to make the thing compile.
-
- * printing/Makefile.am: Order LDADD flags correctly so it compiles.
-
-2001-01-09 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- connect with the EAddressbookView's status_message signal.
- (set_status_message): set the status message on the ShellView
- Interface associated with our control.
- (retrieve_shell_view_interface_from_control): new function. get
- the shell view inteface associated with a control.
-
- * gui/widgets/e-addressbook-view.c
- (e_addressbook_view_class_init): register status_message signal.
- (status_message): new function, emit our status_message signal.
- (change_view_type): connect with the view->object's
- "status_message" signal.
-
- * gui/widgets/e-addressbook-view.h (struct
- _EAddressbookViewClass): add status_message signal.
-
-2001-01-09 Chris Toshok <toshok@helixcode.com>
-
- * gui/widgets/e-minicard-view-widget.c
- (e_minicard_view_widget_class_init): register our status_message
- signal.
- (status_message): new function, emit our status_message signal.
- (e_minicard_view_widget_realize): connect to the EMinicardView's
- status_message signal.
-
- * gui/widgets/e-minicard-view-widget.h: add status_message signal.
-
- * gui/widgets/e-minicard-view.c (e_minicard_view_class_init):
- register our status_message signal.
- (e_minicard_view_init): init status_message_id.
- (status_message): new function, emit our status_message signal.
- (book_view_loaded): connect to the EBookView's status_message
- signal.
- (disconnect_signals): disconnect status_message_id.
-
- * gui/widgets/e-minicard-view.h: add status_mesage_id, and
- status_message signal.
-
- * gui/widgets/e-addressbook-model.c (status_message): new
- function, emit our status_message.
- (e_addressbook_model_class_init): register our "status_message"
- signal.
- (book_view_loaded): connect to the EBookView's status_message
- signal, so we can chain it to our parent.
- (e_addressbook_model_init): init status_message_id.
- (remove_book_view): disconnect status_message_id.
-
- * gui/widgets/e-addressbook-model.h: add status_message_id, and
- status_message signal.
-
- * backend/pas/pas-backend-ldap.c change the objectclass we create
- objects with to "inetOrgPerson" as it encompasses the fields we
- use.
- (create_dn_from_ecard): remove the mail/org handling from
- here. we just prepend cn=$cn onto the base dn.
- (create_card_handler): remove the NULL that build_mods_from_ecards
- adds at the end, and insert our objectClass.
- (modify_card_handler): call search_for_dn to get the ECardSimple
- of the old card, since it might (and does in the current code)
- doing a brute force search.
- (search_for_dn): new function, to search for an entry by its dn.
- right now we brute force (objectclass=*) under the base dn and
- compare dn's. going to add a first pass that explodes the dn and
- searches that way, using (objectclass=*) as a last resort. also,
- here's where we'd put the extensibleMatch code if we want to go
- that route.
-
- * backend/ebook/e-card.c (e_card_set_arg): if we're setting the
- full name regenerate ecard->name.
-
-2001-01-04 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-book-listener.c
- (e_book_listener_queue_authentication_response): new function.
- (impl_BookListener_respond_authentication_result): new function.
- (e_book_listener_get_epv): fill in
- epv->notifyAuthenticationResult.
-
- * backend/ebook/e-book-listener.h: add AuthenticationResponse to
- EBookListenerOperation.
-
- * backend/ebook/e-book.c (e_book_authenticate_user): new function.
-
- * backend/ebook/e-book.h: add prototype for
- e_book_authenticate_user.
-
- * backend/idl/addressbook.idl (GNOME:Evolution:Addressbook:Book):
- add authenticateUser method.
- (GNOME:Evolution:Addressbook:BookListener): add
- AuthenticationFailed and AuthenticationRequired to CallStatus.
- also add notifyAuthenticationResult method.
-
- * backend/pas/pas-backend-file.c
- (pas_backend_file_process_authenticate_user): dummy
- authenticate_user function that always succeeds.
- (pas_backend_file_process_client_requests): respond to the
- AuthenticateUser request.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_build_query):
- gtk_object_unref(sexp) => s_exp_unref(sexp).
- (pas_backend_ldap_process_authenticate_user): fill in to use
- ldap_simple_bind_s.
- (pas_backend_ldap_process_client_requests): respond to the
- AuthenticateUser request.
-
- * backend/pas/pas-book.c (pas_book_queue_authenticate_user): new
- function.
- (impl_GNOME_Evolution_Addressbook_Book_authenticateUser): new
- function.
- (pas_book_respond_authenticate_user): new function.
- (pas_book_get_epv): fill in epv->authenticateUser.
-
- * backend/pas/pas-book.h: add AuthenticateUser operation type, and
- add user/passwd to the PASRequest struct.
-
- * gui/component/addressbook-storage.c
- (addressbook_storage_get_source_by_uri): new function. should use
- a hashtable, perhaps, but the lists will generally be small
- anyway.
-
- * gui/component/addressbook-storage.h: add prototype for
- addressbook_storage_get_source_by_uri.
-
- * gui/component/addressbook-config.c
- (addressbook_source_dialog_set_source): fill in the binddn if the
- auth page is shown.
-
- * gui/component/addressbook.c (book_open_cb): shoe-horn
- authentication in here. if the source was configured to use
- authentication, authenticate the user after opening the ebook.
- also, be paranoid and clear out the password after authenticating.
- (book_auth_cb): callback for auth. set the "book" arg on the
- view->view here.
- (passwd_cb): set the view's passwd that'll be used in
- book_open_cb.
- (addressbook_view_free): g_free view->passwd.
-
-2001-01-04 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-component.c,
- gui/component/addressbook-component.h
- (addressbook_component_get_shell_client): Added this function.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Added code for the
- ability to switch between different folders. This doesn't work
- yet.
-
- * gui/component/select-names/select-names.glade,
- gui/component/select-names/select-names.glade.h: Added an option
- menu to this dialog.
-
-2001-01-04 JP Rosevear <jpr@helixcode.com>
-
- * conduit/Makefile.am: Fix hard coded library names that were
- accidentally committed (i'm looking at you miggie)
-
- * contact-editor/e-contact-editor.c (categories_clicked): Reflect
- renaming.
-
- * contact-editor/e-contact-editor-categories.[hc]: These are
- living in gal now
-
-2001-01-04 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_free):
- Need to e_sexp_unref the the sexp, not gtk_object_unref it.
-
-2001-01-03 Michael Meeks <michael@helixcode.com>
-
- * gui/widgets/e-addressbook-model.c (get_view): check
- capabilities is valid before doing a strstr.
-
-2001-01-03 Michael Meeks <michael@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_search):
- g_strdup things we g_free.
-
-2001-01-02 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c (delete_cb): Make sure this
- won't crash if the given contact is removed from the database
- while this function is being called.
-
- * gui/widgets/e-minicard.c: Made sure this won't crash if the
- given contact is removed from the database while the right click
- menu is being displayed.
-
-2000-12-30 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook-config.c (edit_source_clicked): copy
- the dialog's source, destroy the dialog after we're done, and make
- sure to update both columns in the clist.
- (add_source_clicked): copy the dialog's source, and destroy the
- dialog when we're done.
- (addressbook_source_dialog_destroy): free up all the dialog's
- memory.
-
- * gui/component/addressbook.c (set_prop): allow file: uri's that
- point to files, not just dirs that contain addressbook.db. The
- rule is the addressbook file has to end in .db.
-
- * gui/component/addressbook-storage.c (file_source_foreach):
- contactserver => contactfile. cut and paste error.
- (addressbook_storage_init_source_uri): use file://%s to build the
- uri.
-
- * gui/component/e-ldap-server-dialog.[ch]: forgot to remove these
- in my last commit.
-
-2000-12-29 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (config_cb): new function, calling
- our new config ui code.
- (control_activate): no longer load evolution-addressbook-ldap.xml,
- as it's not there.
-
- * gui/component/addressbook-component.c (owner_set_cb):
- setup_ldap_storage => addressbook_storage_setup.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES):
- remove e-ldap-storage.[ch] and add addressbook-storage.[ch].
- (glade_DATA): remove ldap-server-dialog.glade and add
- addressbook-config.glade.
- (EXTRA_DIST): same.
-
- * gui/component/addressbook-config.[ch]: add another dialog to
- give a list of our sources and offer the Add/Delete/Edit
- interface. This plugs into the previous dialog work (the source
- editor.)
-
- * gui/component/addressbook-storage.[ch]: new files, containing
- the remains of e-ldap-storage.[ch] and adding the new
- AddressbookSource type and it's subordinates. Also, the xml
- format has changed slightly and the file name is no longer
- ~/evolution/ldap-servers.xml - it's
- ~/evolution/addressbook-sources.xml.
-
- * gui/component/addressbook-config.glade: new file, new config
- interface.
-
- * gui/component/ldap-server-dialog.glade: removed.
-
- * gui/component/e-ldap-storage.[ch]: removed.
-
-2000-12-28 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES): add
- addressbook-config.[ch].
-
- * gui/component/addressbook-config.c,
- gui/component/addressbook-config.h: new files, containing at the
- moment a beautiful "new/edit source dialog" inspired by the
- mail-config-gui code. It'll be ready for prime time after rev'ing
- the .xml file the addressbook uses to store it's "other sources"
- to include files, and the addition of the ldap auth stuff.
-
-2000-12-25 Miguel de Icaza <miguel@helixcode.com>
-
- * gui/widgets/e-minicard.c (e_minicard_realize): Set draw
- background to FALSE.
-
- * gui/widgets/e-minicard-label.c (e_minicard_label_construct): ditto.
- (e_minicard_label_construct): ditto
-
-2000-12-23 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fullname-strings.h,
- contact-editor/fullname.glade: Added Ms. and Miss to the prefix
- drop down box. Patch submitted by Martin Hicks <mort@bork.org>.
-
-2000-12-21 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (cursor_cb): Ref the cards that get put
- in the change list
- (next_changed_item): util function to get the real next changed item
- (compute_status): really compute the status of the record
- (local_record_from_uid): Set the id of the temporary card
- (check_for_slow_setting): Make this check a little saner
- (card_added): Only record the CardObjectChange if the card is not
- archived
- (card_changed): ditto
- (card_removed): ditto
- (set_status_cleared): actually clear the status
- (for_each_modified): Clean out cruft and use next_changed_item
- (add_record): Set the new id properly in our local card copy
- (replace_record): handle the case where the record has been deleted
- and we need to call add. need to update the changed_hash entry
- (delete_record): Don't panic if the card is not found, its already
- been deleted.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy):
- The change_context no longer has a del_cards member
- (pas_backend_file_book_view_free): ditto
- (pas_backend_file_process_get_changes): ditto
- (pas_backend_file_changes_foreach_key): just record the id
- (pas_backend_file_changes): notify_remove needs an id not a vcard
-
-2000-12-20 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (match): Use my own wrapper
- functions instead of trying to *directly* access the the data
- structures my self
- (post_sync): Put in hack to prevent syncing the same records twice
- (local_record_from_uid): set the card id when creating a blank one
- (add_record): Set the id of the card we have and don't go to the
- server to get the latest version
-
-2000-12-19 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): Convert
- pilot strings to utf for the e-cards.
-
-2000-12-19 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (local_record_from_ecard): Convert ecard
- strings to pilot encodings
-
-2000-12-19 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c (delete): Made it so that if
- you select multiple contacts, the right click menu to delete
- deletes them all.
-
-2000-12-18 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_error_to_response): always
- use LDAP_NAME_ERROR (in the openldap1 case it's #defined to
- NAME_ERROR).
- (build_card_from_entry): ldap_get_values can return NULL. also,
- openldap2 keeps us from getting at ldap->ld_errno, so we can't
- tell if there was a decoding error like we used to. the double
- free problem where ldap would free the ber if there was a decoding
- problem might be fixed now.. further investigation is needed.
- for now we leak in openldap2.
- (ldap_search_handler): the ldap structure is opaque, so use
- ldap_search_ext to give the extra information (the max responses,
- timeout, etc.) in the openldap2 case.
-
-2000-12-13 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_error_to_response): Test
- for the existance of LDAP_NAME_ERROR and if it exists as a macro,
- use it instead of NAME_ERROR.
-
-2000-12-14 Michael Meeks <michael@helixcode.com>
-
- * gui/component/GNOME_Evolution_Addressbook.oafinfo: update cut
- and paste description error.
-
-2000-12-13 Dan Winship <danw@helixcode.com>
-
- * gui/widgets/e-minicard-control.c (stream_read): NULL-terminate
- the returned vcard so we don't sometimes end up with trailing
- junk that makes libversit unhappy.
-
-2000-12-13 Iain Holmes <iain@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_add_section): Make the -> into a GNOME stock image.
-
-2000-12-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_init): Connect to the "cursor_change" signal on
- the ETable here instead of the ETableScrolled.
- (remove_address): Added the col and event parameters to this
- callback to match the added parameters to the double click signal.
- (e_select_names_add_section): Connect to the "double_click" signal
- on the ETable here instead of the ETableScrolled.
-
-2000-12-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (e_card_set_arg): When setting the "name"
- argument, copy the incoming name. This fixes a crash.
-
-2000-12-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Made editing the name using
- the full name button set the file as entry properly. Made it
- so that the address parse that the user chooses after
- clicking on the Full Address... button gets saved.
-
-2000-12-08 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c (full_name_clicked): Made it
- so that the editor->name is set after the entry is changed. This
- means that the reparse that the person chose is saved.
-
-2000-12-07 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Pass NULL
- as the @toplevel_node_handler_id argument to
- `evolution_storage_new'.
-
-2000-12-08 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Fixed some formatting.
-
- * contact-editor/e-contact-editor-categories.h: Removed an
- unneeded #include.
-
- * gui/widgets/e-addressbook-view.c: Connect to the signals on the
- ETable instead of the ETableScrolled.
-
-2000-12-07 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (local_record_from_uid): Pass "" rather
- than NULL to e_card_new.
- (local_record_from_ecard): Make sure ecard->name is valid
- (check_for_slow_setting): Remove hard coded test value
- (card_added): g_strdup the resul of e_card_get_id
- (card_changed): ditto
-
-2000-12-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c: Got rid of code referencing
- the ETableScrolled proxy functions.
-
-2000-12-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Moved the gal view menu stuff from
- here to EAddressbookView.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h: New function to set up the menus
- for the EAddressbookView.
-
-2000-12-06 JP Rosevear <jpr@helixcode.com>
-
- * conduit/Makefile.am: Another conduit build fix
-
-2000-12-05 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_changes_foreach_key):
- Create an empty vcard with the appropriate id for deleted cards
-
- * conduit/address-conduit.c (ecard_from_remote_record): Ensure the
- address fields are added sensibly
-
-2000-12-05 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Updated the
- call to `evolution_storage_new()': pass NULL for
- @toplevel_node_uri.
-
-2000-11-28 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (local_record_to_pilot_record): Return
- a struct rather than a pointer to a struct
- (view_cb): kill warning
- (compare): local_record_to_pilot_record now returns a struct
- (prepare): ditto
- (free_prepare): remove as per gnome-pilot changes
- (conduit_get_gpilot_conduit): don't listen for free_prepare signal
-
-2000-11-27 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: Remove "complete" field
-
- * conduit/address-conduit.c (print_local): Make it print useful debug
- info
- (print_remote): ditto
- (local_record_from_ecard): Make sure phone numbers get out to the pilot
- (ecard_from_remote_record): Set phone strings to "" if they are null
- (sequence_complete): unref the book view
- (view_cb): ref the book view
- (free_prepare): do nothing
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_free):
- Destroy the card lists with the rest of the view.
- (pas_backend_file_changes): Don't destroy the card lists here
- (pas_backend_file_book_view_free): Free the card/id lists in the
- change context here, the correct place.
- (pas_backend_file_changes): instead of here...
-
-2000-11-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Set view.change_context to NULL
- in pas_backend_file_process_get_book_view. Changed
- pas_backend_file_book_view_copy a bit.
-
- * backend/pas/pas-backend-ldap.c: Got rid of a warning.
-
-2000-11-18 Matt Bissiri <matt@bissiri.org>
-
- * gui/component/Makefile.am:
- Add widgets/menus/libmenus.la to evolution_addressbook_LDADD
- so that it will link properly now that gal-view-menus.[ch]
- was moved from gal into evolution.
-
-2000-11-15 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy):
- Initialize destination struct with '0's.
-
-2000-11-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Changed the mime type from "text/vcard"
- to "text/x-vcard".
-
-2000-11-11 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * backend/ebook/.cvsignore: Add idl-generated files.
- * backend/ebook/e-book.c: (e_book_do_response_get_changes):
- * backend/ebook/e-card.c: (e_card_send):
- s/Evolution_/GNOME_Evolution_/g;
-
-2000-11-11 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Link in composer bonobo code.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added code to
- send mail to an ECard or send an ECard as a VCard attachment.
-
- * contact-editor/e-contact-editor.c: Add verbs to send the contact
- as a VCard or send mail to the contact.
-
- * gui/search/e-addressbook-search-dialog.c: Removed some unused
- variables.
-
- * gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard.c:
- Added menu items to send the contact as a VCard or send mail to
- the contact.
-
-2000-11-11 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * gui/component/addressbook.oafinfo:
- * gui/component/select-names/evolution-addressbook-select-names.oafinfo:
- Update the remaining "IDL:Evolution*" to "IDL:GNOME/Evolution*"
- to sync up with yesterday's IDL re-scoping.
-
-2000-11-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: Fixed a warning.
-
- * gui/component/addressbook.c: Put in gal view menus for testing
- purposes.
-
- * printing/e-contact-print-envelope.c: Fixed up envelope printing
- a bit. Added code for printing return addresses.
-
-2000-11-09 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: Add changed_hash, change list and complete bool
-
- * conduit/address-conduit.c (local_record_from_ecard): Add empty field checks
- (card_added): callback for book view
- (card_changed): ditto
- (card_removed): ditto
- (sequence_complete): ditto
- (view_cb): callback for the get changes call
- (pre_sync): force synchronous loading of book view
- (for_each): we already have the card so create the local record directly
- (for_each_modified): Uncomment and fix
- (delete_record): ditto
-
- * conduit/Makefile.am: link against gal for ebook - needs fixing
-
- * backend/ebook/e-book.c (e_book_do_response_get_changes): Properly respond
- to a get_changes call
- (e_book_check_listener_queue): define the get changes response operation
-
- * backend/ebook/e-book-listener.c (e_book_listener_queue_get_changes_response):
- Queue up a get changes response
- (impl_BookListener_respond_get_changes): Implement the get_changes method
- (e_book_listener_get_epv): add get_changes implementation to epv
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy): Only
- copy the search_context and change_context elements if they actually exist
- (pas_backend_file_changes): Hard code a path for now, only notify if
- there is something to notify about
-
-2000-11-07 JP Rosevear <jpr@helixcode.com>
-
- * backend/pas/pas-book.h: Update PASRequest structure
-
- * backend/pas/pas-book.c (impl_Evolution_Book_get_changes): update param name
- (pas_book_queue_get_changes): Use PASRequest change_id slot
-
- * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy):
- Properly copy change_id and change_context
- (pas_backend_file_book_view_free): Free change_id/change_context
- (pas_backend_file_changes_foreach_key): Callback to figure out the
- deleted cards
- (pas_backend_file_changes): Use new e-dbhash stuff to implement.
- Write out updated hash
-
- * backend/idl/addressbook.idl: Rename get_changes param
-
-2000-11-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Switched from EAddressbookSearch to
- ESearchBar.
-
- * gui/widgets/Makefile.am, gui/widgets/e-addressbook-search.c,
- gui/widgets/e-addressbook-search.h: Removed EAddressbookSearch.
- This has been moved to filter/ and renamed ESearchBar.
-
- * printing/e-contact-print-envelope.c: Forgot to set the font.
- This works for me now.
-
-2000-11-06 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (impl_SelectNames_get_entry_for_section): Duplicate the object
- reference before returning.
-
-2000-11-05 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c,
- gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard.c: Add
- menus items to the envelope printing stuff.
-
- * gui/component/addressbook.c: Hook up the search menu.
-
- * gui/widgets/e-addressbook-search.c,
- gui/widgets/e-addressbook-search.h: Add the search menu.
-
- * printing/Makefile.am: Add e-contact-print-envelope.c and
- e-contact-print-envelope.h.
-
- * printing/e-contact-print-envelope.c,
- printing/e-contact-print-envelope.h: Added envelope printing.
-
-2000-11-03 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/component/select-names/Makefile.am: Clean the idl-generated
- files properly.
-
-2000-11-02 Christopher James Lahey <clahey@helixcode.com>
-
- * ename/.cvsignore, gui/minicard/.cvsignore: Removed these
- unnecessary .cvsignores.
-
- * gui/component/addressbook.c: Switch to using EAddressbookSearch
- instead of custom quick search widget.
-
- * gui/component/select-names/e-select-names.c: Made this do a
- slightly better job of rendering names.
-
- * gui/widgets/Makefile.am: Added e-addressbook-search.c and
- e-addressbook-search.h.
-
- * gui/widgets/e-addressbook-search.c,
- gui/widgets/e-addressbook-search.h: New class that puts up an
- entry and a combo box.
-
-2000-11-01 Dan Winship <danw@helixcode.com>
-
- * gui/component/e-ldap-storage.c (load_ldap_data):
- (e_ldap_storage_add_server): Add "highlighted" flag to
- evolution_storage_new_folder
-
-2000-10-31 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (cursor_cb): Let the warning make sense
- (compute_pid): remove
- (local_record_from_ecard): Create local record from ecard - not finished
- (local_record_from_uid): Obtain local_record from uid with the proper
- e-book way
- (set_status_cleared): Add empty callback
- (add_archive_record): kill
- (delete_archive_record): kill
- (archive_record): Add empty callback
- (conduit_get_gpilot_conduit): Update signal connects
-
- * backend/pas/pas-backend-file.c (vcard_change_type): Function to determine
- the type of change - not finished
- (pas_backend_file_search_changes): Create a view and callback based on
- how the cards have changed
- (pas_backend_file_process_get_changes): Implement the get changes operation
- for files
- (pas_backend_file_process_client_requests): Add GetChanges method for
- processing
-
- * backend/pas/pas-book.c (pas_book_queue_get_changes): Add changes to
- the list
- (impl_Evolution_Book_get_changes): implement object method
- (pas_book_get_epv): Add get changes to epv
- (pas_book_respond_get_changes): Respond to the get changes operation
-
- * backend/pas/pas-book.h: Add GetChanges PASOperation
-
- * backend/idl/addressbook.idl: add get_changes and respond_get_changes
- methods
-
- * backend/ebook/e-book.c (e_book_get_changes): Client function
- to a view of the changed objects
-
- * backend/ebook/e-book.h: New prototype
-
-2000-10-30 Kjartan Maraas <kmaraas@gnome.org>
-
- * backend/e-book/e-card.c: Fixed marking of strings
- for translation. Use "_(" instead of "_ (".
- * gui/component/addressbook-factory.c: Add missing
- calls to bindtextdomain() and textdomain noticed by
- Dan Winship.
- * gui/component/addressbook.c: Marked string for translation.
-
-2000-10-27 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/Makefile.am, gui/search/Makefile.am,
- printing/Makefile.am: Fixed these to include EXTRA_GNOME_CFLAGS.
-
- * gui/component/select-names/e-select-names-manager.c: Turned off
- newlines in header fields.
-
-2000-10-26 Michael Meeks <michael@helixcode.com>
-
- * printing/e-contact-print.c (e_contact_print_letter_tab),
- (complete_sequence, e_contact_do_print_phone_list, lowify):
- unsigned charness.
-
-2000-10-25 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (ldap_op_process_current): only
- call the handler if the if we're connected, and if we fail to
- connect finish the op and post a message.
- (pas_backend_ldap_connect): add debug spew if DEBUG is defined.
- (modify_card_handler): LDAP_RES_SEARCH_ENTRY => LDAP_SUCCESS.
- (modify_card_handler): only perform the ldap_modify_s if we have a
- list of modifications.
- (get_cursor_handler): use ldap_error_to_response here.
- (pas_backend_ldap_load_uri): use LDAP_PORT instead of the constant
- 389.
-
-2000-10-23 Dan Winship <danw@helixcode.com>
-
- * gui/component/select-names/Makefile.am (INCLUDES):
- * gui/component/Makefile.am (INCLUDES): Update EVOLUTION_LOCALEDIR
-
- * backend/pas/Makefile.am (INCLUDES):
- * backend/ebook/Makefile.am (INCLUDES): Update GNOMELOCALEDIR.
-
-2000-10-23 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: Use new libeconduit calls and
- abstraction
-
- * conduit/address-conduit.c: ditto
-
-2000-10-23 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.c (pre_sync): Use e_pilot_map_read
- (post_sync): Use e_pilot_map_write
-
- * conduit/Makefile.am: Link libeconduit and not libical
-
-2000-10-20 Michael Meeks <michael@helixcode.com>
-
- * contact-editor/e-contact-editor.c (tb_save_and_close_cb):
-
- * gui/component/addressbook.c (toggle_view_as_cb):
-
-2000-10-20 JP Rosevear <jpr@helixcode.com>
-
- * conduit/address-conduit.h: New structure of file - similar
- to calendar/todo conduits
-
- * conduit/address-conduit.c: ditto
-
- * conduit/address-conduit-config.h: Config stuff for conduit
-
- * conduit/.cvsignore: Update
-
- * conduit/Makefile.am: Build fixes
-
- * conduit/address-conduit-control-applet.desktop: Renamed
- to e-address-conduit-control-applet.desktop
-
- * conduit/address.conduit.in: Renamed to e-address.conduit.in
-
-2000-10-19 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c (SPEC): Remove Family name
- column since it's a bit weird. This also fixes the initial state
- since all of the column choices were off by one.
-
-2000-10-19 Ettore Perazzoli <ettore@helixcode.com>
-
- * printing/Makefile.am (glade_DATA): Remove
- `e-contact-print.glade.h'.
- (EXTRA_DIST): Move here.
-
- * gui/component/Makefile.am (glade_DATA): Remove
- `ldap-server-dialog.glade.h'.
- (EXTRA_DIST): Move here.
-
-2000-10-19 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Change how the extension field acts when
- converting delivery addresses to labels.
-
-2000-10-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added the
- function e_card_delivery_address_to_label.
-
- * contact-editor/e-contact-editor-address.c: Fixed a potential
- crash.
-
- * contact-editor/e-contact-editor.c: Made this save the changed
- data to the string version of the address.
-
-2000-10-19 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (change_view_type): update to new
- UI handler.
- (update_view_type): split from (change_view_type).
- (control_activate): add an update_view_type.
-
-2000-10-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Change NAME_OR_ORG to return the
- email address if both name and organization are taken.
-
- * gui/component/select-names/e-select-names.c: Fixed up the spec
- strings in this class. Removed the "cursor_mode" argument to
- ETable since it's part of the spec now.
-
-2000-10-17 Iain Holmes <iain@helixcode.com>
-
- * contact-editor/contact-editor.glade: Change the initial dialog
- visibility to FALSE
- so the contact editor doesn't flash when it appears.
-
-2000-10-16 Iain Holmes <iain@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_activate_dialog): Only allow one dialog
- per manager.
-
-2000-10-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fulladdr.glade: Fixed a typo. Made this look a
- bit better.
-
-2000-10-15 Dan Winship <danw@helixcode.com>
-
- * gui/component/select-names/Makefile.am:
- * gui/component/Makefile.am: Remove CPPFLAGS since they just
- duplicate flags that were already in INCLUDES.
-
- * printing/Makefile.am (ecpsdir):
- * gui/widgets/Makefile.am:
- * contact-editor/Makefile.am: Move -D flags from CPPFLAGS to
- INCLUDES so they don't override any CPPFLAGS set at configure
- time.
-
-2000-10-14 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): if we are in
- LDAP mode then merge in the extra few items, otherwise just merge
- the standard thing; saves duplication.
-
-2000-10-14 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.oafinfo: Added
- "evolution:shell-component-icon" property.
-
-2000-10-14 Iain Holmes <iain@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_manager_activate_dialog): Only allow one dialog
- per id.
- (e_select_names_manager_destroy): Destroy the hashtable.
- (e_select_names_manager_init): Init the hashtable.
-
-2000-10-13 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fulladdr.glade, contact-editor/fulladdr.glade.h:
- Rearranged these fields a bit more.
-
-2000-10-13 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/select-names/e-select-names.c,
- gui/widgets/e-addressbook-view.c: Changed these for boolean
- ascending attribute instead of int ascending attribute. Fixed
- e-select-names to not use a column past the end of its array.
-
- * contact-editor/e-contact-editor-address.c,
- contact-editor/fulladdr.glade, contact-editor/fulladdr.glade.h:
- Rearranged the address editor dialog.
-
-2000-10-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed the column
- elements, the no-headers attribute and added a cursor-mode=line
- attribute.
-
- * gui/component/select-names/e-select-names.c,
- gui/widgets/e-addressbook-view.c: Fixed the column elements here.
-
-2000-10-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/select-names/e-select-names.c,
- gui/widgets/e-addressbook-view.c: Updated these to the new style
- ETables.
-
-2000-10-06 Not Zed <NotZed@HelixCode.com>
-
- * gui/search/e-addressbook-search-dialog.c (get_widget): Removed
- ondemand callback nonsense from rule_context_load().
-
-2000-10-05 Michael Meeks <michael@helixcode.com>
-
- * contact-editor/e-contact-editor.c (create_ui): upd.
- (e_contact_editor_init): upd.
-
- * gui/component/addressbook.c (control_activate_cb): upd.
- (control_deactivate): kill.
- (control_activate): upd.
-
-2000-09-22 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): update.
-
- * contact-editor/e-contact-editor.c (create_ui): upd.
-
-Fri Sep 29 07:33:54 2000 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made it so
- that minicard doesn't write out changes to the backend unless
- something's actually changed.
-
-Tue Sep 26 16:28:47 2000 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Make sure that card->name and
- card->full_name are always valid.
-
- * contact-editor/e-contact-editor.c: Removed some unused
- variables.
-
-2000-09-22 Matt Bissiri <bissiri@eecs.umich.edu>
-
- * contact-editor/e-contact-editor-fullname.c (extract_info): If
- (editor->name == NULL), store ptr to newly allocated ECardName in
- editor->name, not just in a stack variable. This fixes a crash
- which happened when you click "New", then click "Full Name...",
- then enter name, then click "OK".
-
- * backend/ebook/e-card.c (e_card_name_to_string): Add
- g_return_val_if_fail.
-
-2000-09-25 Jeffrey Stedfast <fejj@helixcode.com>
-
- * gui/widgets/Makefile.am:
- * gui/component/Makefile.am:
- * contact-editor/Makefile.am:
- * printing/Makefile.am: Look for ename in /e-util/ename instead of
- /addressbook/ename
-
- * backend/ebook/e-card.c: Updated to include e-util/ename/*.h
-
- * ename: Moved to /e-util so it could be shared
-
- * Makefile.am (SUBDIRS): took out ename
-
-2000-09-25 Nat Friedman <nat@helixcode.com>
-
- * ename/e-name-western-tables.h: Added a ton of new prefixes and
- suffixes.
-
-2000-09-22 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): update.
-
- * contact-editor/e-contact-editor.c (create_ui): upd.
-
-2000-09-22 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: lots of changes. flesh out the
- remove/modify/create functions. add another flag for the property
- table, PROP_DN, which makes it easy for us to determine when we
- need to create a new DN for a record when we're modifying. also
- add a ber_func to the table for PROP_TYPE_LIST fields, which fills
- in the list of bvalues that we send to the ldap server. The
- add/modify/delete stuff hasn't been tested yet, and it hopelessly
- complex (yay ldap).
- (ldap_search_handler): act synchronous when ldap_search responds
- with -1.
- (view_destroy): use pas_book_view_notify_status_message.
- (ldap_op_process_current): same
- (ldap_op_process): same
- (poll_ldap): same
- (ldap_search_handler): same
-
-2000-09-22 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-card-simple.h: add
- E_CARD_SIMPLE_FIELD_FAMILY_NAME to the enum.
-
- * backend/ebook/e-card-simple.c (field_data): add
- E_CARD_SIMPLE_FIELD_FAMILY_NAME.
- (e_card_simple_get): add getter for FAMILY_NAME.
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Made addresses be quoted printable again
- so that they will encode properly if they have carriage returns in
- them. This is possible now because of a fix in libversit.
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book-view-listener.c,
- backend/ebook/e-book-view-listener.h, backend/ebook/e-book-view.c,
- backend/ebook/e-book-view.h, backend/idl/addressbook.idl,
- backend/pas/pas-book-view.c, backend/pas/pas-book-view.h: Added a
- function to set the status message associated with a given view.
- This is not yet implemented in the gui.
-
-2000-09-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book.c, backend/ebook/e-book.h,
- backend/idl/addressbook.idl, backend/pas/pas-backend-file.c,
- backend/pas/pas-backend-ldap.c, backend/pas-backend.c,
- backend/pas/pas-backend.h, backend/pas/pas-book.c,
- backend/pas/pas-book.h: Added a function to query static
- capabilities (capabilities that can be reported immediately) and
- implemented them in the 2 servers.
-
- * gui/component/addressbook.c: Added a View All button and a Stop
- button. Sorted out the new directory server stuff a bit.
-
- * gui/widgets/e-addressbook-model.c,
- gui/widgets/e-addressbook-model.h: Cleaned up a bit. Added a stop
- function. Check for capabilities before deciding whether to load
- all cards when initially viewed.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h: Added stop and view all
- functions.
-
- * gui/widgets/e-minicard-view-widget.c,
- gui/widgets/e-minicard-view-widget.h,
- gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h:
- Added a stop function. Check for capabilities before deciding
- whether to load all cards when initially viewed.
-
-2000-09-21 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): remove _UIHandler
-
-2000-09-21 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c: Added a missing include
- of ctype.h.
-
- * backend/pas/pas-backend-file.c: Fixed a problem where using a
- GList was causing us to not be reentrant. We now use an EList
- here and so now this is reentrant. This should fix the "wombat
- crashes every time you run evolution" bug.
-
- * contact-editor/e-contact-editor.c: Fixed a type mismatch.
-
-2000-09-21 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c: Make this work when a
- field is spread across multiple lines.
-
-2000-09-20 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added a
- wants_html field to cards. Uses "x-mozilla-html".
-
- * contact-editor/Makefile.am: Added definition of
- EVOLUTION_DATADIR.
-
- * contact-editor/contact-editor.glade: Make Wants HTML check
- button visible.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Make Wants HTML check button
- active. Fix UI stuff to use XML. Set parent window of
- confirm_delete dialog.
-
- * gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard.c: Set
- the parent window of the confirm_delete dialog.
-
-2000-09-20 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/e-addressbook-view.c: Fixed display of the minicards
- when the addressbook was first loading. (It was overwriting a
- string with NULL during init.)
-
-2000-09-19 Dan Winship <danw@helixcode.com>
-
- * gui/search/Makefile.am (ruledir): Use $(datadir), not
- $(prefix)/share
-
-2000-09-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am, contact-editor/Makefile.am,
- ename/Makefile.am, gui/component/Makefile.am,
- gui/widgets/Makefile.am: Added $(EXTRA_GNOME_CFLAGS) and
- $(EXTRA_GNOME_LIBS). Removed unneeded libraries.
-
- * backend/ebook/e-card.c, backend/pas/pas-backend-file.c,
- contact-editor/e-contact-editor-address.c,
- contact-editor/e-contact-editor-categories.c,
- contact-editor/e-contact-editor-categories.h,
- contact-editor/e-contact-editor-fullname.c,
- contact-editor/e-contact-editor.c,
- contact-editor/e-contact-save-as.c, ename/e-address-western.c,
- ename/test-ename-western-gtk.c,
- gui/component/addressbook-factory.c, gui/component/addressbook.c,
- gui/component/e-cardlist-model.h, gui/component/e-ldap-storage.c,
- gui/component/select-names/e-select-names-bonobo.c,
- gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-table-model.h,
- gui/component/select-names/e-select-names-text-model.h,
- gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/search/e-addressbook-search-dialog.c,
- gui/widgets/e-addressbook-model.h,
- gui/widgets/e-addressbook-view.c, gui/widgets/e-minicard-label.c,
- gui/widgets/e-minicard-view-widget.c,
- gui/widgets/e-minicard-view-widget.h,
- gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h,
- gui/widgets/e-minicard-widget.h, gui/widgets/e-minicard.c,
- gui/widgets/test-minicard-label.c, gui/widgets/test-reflow.c,
- printing/e-contact-print.c: Fixed the #include lines to deal
- properly with gal.
-
-2000-09-15 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.h,
- contact-editor/e-contact-save-as.h,
- gui/widgets/e-addressbook-model.h,
- gui/widgets/e-minicard-view-widget.h,
- gui/widgets/e-minicard-view.h, gui/widgets/e-minicard.c,
- gui/widgets/e-minicard.h: Fixed the paths of some .h #includes.
-
- * gui/component/addressbook.c: Removed all of the code to actually
- create and display the correct view of the addressbook and moved
- it to the new class gui/widgets/e-addressbook-view.c.
-
- * gui/widgets/Makefile.am: Added everything necessary for
- e-addressbook-view.c and e-addressbook-view.h.
-
- * gui/widgets/e-addressbook-view.c,
- gui/widgets/e-addressbook-view.h: New class to deal with actual
- display of addresses and switching between card view and table
- view.
-
- * gui/widgets/e-minicard-view-widget.c: Made this deal more
- gracefully with having the book set to NULL.
-
-2000-09-16 Michael Meeks <michael@helixcode.com>
-
- * gui/component/select-names/e-select-names.c: fix broken include.
-
- * gui/component/Makefile.am (INCLUDES): define datadir.
- (evolution_addressbook_SOURCES): remove e-addressbook-model.[ch]
-
- * gui/component/addressbook.c (control_activate): use datadir.
-
-2000-09-16 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/widgets/Makefile.am (gladedir): Define.
- (glade_DATA): Install `alphabet.glade'.
- (EXTRA_DIST): Define.
-
- * gui/component/Makefile.am (glade_DATA): Remove `alphabet.glade'.
- (EXTRA_DIST): Remove `alphabet.glade.h'.
-
- * gui/widgets/Makefile.am (libeminicard_a_SOURCES): Add
- `e-addressbook-model.c' and `e-addressbook-model.h'. I hope this
- is what Chris meant to do.
-
- * gui/component/Makefile.am (INCLUDES): Add
- `-I$(top_srcdir)/addressbook/gui/widgets'.
- (evolution_addressbook_SOURCES): Remove `e-addressbook-model.c'
- and `e-addressbook-model.h'.
-
- * gui/component/select-names/e-select-names.c: #include
- "e-addressbook-model.h" from "addressbook/gui/widgets" instead of
- "addressbook/gui/component", as it has been moved there.
-
-2000-09-15 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: split all the ldap operations
- into 2 halves, a handler, and destructor, and create a structure
- containing two function pointers and any data they need. this
- allows us queue up pending operations (since the LDAP*'s are no
- longer view specific. there's one per backend.) also, add
- support for restarting async operations if the SERVER DOWN error
- isn't communicated until sometime after the handler is called (as
- is the case with the async search stuff.)
-
-2000-09-14 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook-factory.c (main): Call unicode_init
- for e-font stuff.
-
-2000-09-14 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/Makefile.am, gui/widgets/Makefile.am: Added
- $(GNOME_PRINT_LIBS) to all of the test files in these directories.
-
-2000-09-14 Michael Meeks <michael@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): fix path.
-
- * gui/component/addressbook.c: update include.
-
- * gui/component/addressbook-factory.c: update include.
-
- * gui/widgets/e-minicard-view.h: update include.
-
- * gui/search/e-addressbook-search-dialog.c: update include path.
-
-2000-09-13 Michael Meeks <michael@helixcode.com>
-
- * contact-editor/e-contact-editor.c (e_contact_editor_init): hack.
- (create_toolbar): ditto.
-
-2000-09-07 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c: Radicaly update UI handler code.
-
-2000-09-13 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/widgets/*, gui/minicard/*: Moved gui/minicard to
- gui/widgets, except for e-reflow.c, e-reflow.h, e-reflow-sorted.c,
- and e-reflow-sorted.h.
-
- * gui/widgets/Makefile.am: Added e-reflow to the INCLUDES list and
- libereflow.a to a bunch of LDADD lines.
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Added
- libereflow.a here.
-
- * gui/Makefile.am (SUBDIRS): Replaced minicard with widgets.
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/select-names/Makefile.am: Add space after `-I'
- when invoking `orbit-idl'.
-
-2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/Makefile.am (EXTRA_DIST): Remove `ui.xml'.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Fixed a crash error.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * ename/e-address-western.c: Fixed some warnings.
-
-2000-09-11 Jesse Pavel <jpavel@helixcode.com>
-
- * ename/e-address-western.c: fixed certain address parsing
- problems.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/fulladdr.glade: Made this a bit better balanced.
-
- * gui/component/addressbook.c: Make the toolbar button for find do
- the same thing that the menu item for search does.
-
- * gui/search/e-addressbook-search-dialog.c: Made the top half of
- this not expand.
-
-2000-09-11 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Removed a bunch of redundant code. Made it so that when you set
- an address label, it sets the delivery address as well. Added
- functions to set and get the delivery address.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added code to
- convert and address label to a delivery address.
-
- * contact-editor/Makefile.am: Added e-contact-editor-address.[ch],
- fulladdr.glade, fulladdr.glade.h.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Switched from a label
- to a button to show the parsed address.
-
- * contact-editor/e-contact-editor-address.c,
- contact-editor/e-contact-editor-address.h: New class to implement
- the parsed address dialog.
-
- * contact-editor/e-contact-editor-fullname.c,
- contact-editor/e-contact-editor-fullname.h: Added const to the
- _new function.
-
- * contact-editor/e-contact-editor.c: Implemented clicking on the
- address button.
-
- * contact-editor/fulladdr.glade, contact-editor/fulladdr.glade.h:
- New glade files for the parsed address dialog.
-
- * contact-editor/fullname-strings.h, fullname.glade: Changed these
- accellabels to labels.
-
- * ename/Makefile.am: Added e-address-western.c.
-
- * ename/e-address-western.c: Fixed some warnings.
-
-2000-09-10 Christopher James Lahey <clahey@helixcode.com>
-
- * ename/e-address-western.c: Added by Jesse.
-
-2000-09-08 Lauris Kaplinski <lauris@helixcode.com>
-
- * gui/minicard/e-minicard-label.c (e_minicard_label_construct):
- Use canvas default font
-
- * gui/minicard/e-minicard.c (e_minicard_realize): Ditto
- (get_left_width): Ditto
-
-2000-09-08 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed a few warnings.
-
-2000-09-02 Lauris kaplinski <lauris@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: e_utf8 wrappers
-
- * contact-editor/e-contact-editor.c: e_utf8 wrappers
-
-2000-09-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/e-ldap-storage.c (load_ldap_data): Updated for the
- extra arg now needed by `evolution_storage_new_folder()'.
- (e_ldap_storage_add_server): Likewise.
-
-2000-08-31 Ettore Perazzoli <ettore@helixcode.com>
-
- * conduit/Makefile.am (INCLUDES): Add `BONOBO_GNOME_CFLAGS' and
- `-I$(top_srcdir)'.
-
-2000-08-31 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Install load-gnomecard-addressbook
- and load-pine-addressbook.
-
-2000-08-30 Lauris Kaplinski <lauris@helixcode.com>
-
- * printing/e-contact-print.c: Countless small changes for gnome-print 0.21+
-
-2000-08-30 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook.oafinfo: Add a name to the minicard
- viewer.
-
-2000-08-29 Dan Winship <danw@helixcode.com>
-
- * backend/ebook/e-book.c:
- * backend/ebook/test-client.c:
- * backend/ebook/test-client-list.c:
- * backend/ebook/load-gnomecard-addressbook.c:
- * backend/ebook/load-pine-addressbook.c:
- * backend/pas/pas-book-factory.c:
- * conduit/address-conduit.h: Remove USING_OAF checks
-
-2000-08-28 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Use the right argument name to turn
- on grid lines.
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/minicard/Makefile.am: Comment out minicard-view-test
- since its gnorba dependent
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/component/addressbook-component.c: Remove gnorba stuff
-
- * gui/minicard/e-minicard-control.c (e_minicard_control_factory_init):
- ditto
-
- * gui/component/addressbook.c: ditto
-
- * gui/component/addressbook-factory.c: ditto
-
-2000-08-25 Christopher James Lahey <clahey@helixcode.com>
-
- * demo/* Removed the demo directory since it's no longer used.
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/minicard/Makefile.am: Remove gnorba stuff
-
- * gui/minicard/e-minicard-control.gnorba: Kill
-
-2000-08-26 JP Rosevear <jpr@helixcode.com>
-
- * gui/component/addressbook.gnorba: Kill
-
- * gui/component/Makefile.am: Remove gnorba stuff
-
-2000-08-25 Dan Winship <danw@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_LDFLAGS): Add
- -export-dynamic so libglade will be able to resolve custom widget
- callbacks.
-
-2000-08-23 Lauris Kaplinski <lauris@helixcode.com>
-
- * backend/pas/pas-backend-file.c (func_contains): Use e_utf8_strstrcase
-
- * contact-editor/e-contact-editor-fullname.c (fill_in_field): Use e_utf8 wrapper
- (extract_field): Same
-
- * contact-editor/e-contact-editor.c (full_name_clicked): Don't crash
-
- * ename/Makefile.am: Link demo with libeutil.la
-
- * ename/test-ename-western-gtk.c (full_changed_cb): Use e_utf8 wrapper
-
- * gui/component/addressbook.c (find_contact_cb): Use e_utf8 wrapper
- (search_entry_activated): Same
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/e-addressbook-search-dialog.c: Fix an error in the
- arguments to rule_context_load.
-
- * backend/ebook/e-card.c: Fix this to not mess up if the person
- passes a VCard with a carriage return in the mailing address.
-
-2000-08-14 Not Zed <NotZed@HelixCode.com>
-
- * gui/search/addresstypes.xml: Fixed fullname->full_name for
- search field.
-
- * gui/search/e-addressbook-search-dialog.c (get_widget): Check we
- actually got any parts to build the dialogue with.
-
-2000-08-13 Not Zed <NotZed@HelixCode.com>
-
- * gui/component/addressbook-component.c (owner_set_cb): Set the
- global_shell_client nastyhack when we know it.
- This is only required to link with the filter code ...
-
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Added
- libfilter.a to the link line.
-
- * gui/search/Makefile.am (noinst_LIBRARIES): Change library name
- from libaddressbooksearchdialog to libaddressbooksearch, as used
- elsewhere.
-
- * gui/search/e-addressbook-search-dialog.c (get_widget):
- Implement.
- (get_query): Likewise.
- (e_addressbook_search_dialog_destroy): Unref filter stuff when
- done.
-
- * gui/component/addressbook.c (control_deactivate): Added chris's
- patch to put the meny in
-
-2000-08-22 Lauris Kaplinski <lauris@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Use e_utf8 wrappers everywhere
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/e-card.h: Started adding a time zone field to ECard.
-
- * gui/component/e-addressbook-model.c: Added
- e_table_model_pre_change where appropriate.
-
- * gui/minicard/e-minicard-control.c: Added a ref and unref pair.
-
-2000-08-22 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Linked in the search dialog again.
- It looks like some changes in the shell made this not work.
-
-2000-08-19 Christopher James Lahey <clahey@helixcode.com>
-
- * conduit/address-conduit.c, conduit/address-conduit.h: Changed
- this to use ECardSimple.
-
- * contact-editor/e-contact-editor.c: Fixed a memory leak.
-
- * gui/component/addressbook.c: Added stuff to the right click
- menu. Activated the new search dialog that doesn't quite work
- yet.
-
- * gui/minicard/e-minicard-view.c: Fixed some run time warnings.
-
-2000-08-15 Larry Ewing <lewing@helixcode.com>
-
- * gui/minicard/e-minicard.c (e_minicard_event): use style colors
- for the selected state. This doesn't properly redraw the minicard
- when there is a style_change event, that is next.
- (e_minicard_realize): use style colors.
-
-2000-08-14 Peter Williams <peterw@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Include the proper db1/db.h
- as in RedHat 7.0 -- patch from Kenny Graunke <kwg@teleport.com>
-
-2000-08-13 Chris Toshok <toshok@helixcode.com>
-
- * conduit/Makefile.am (libaddress_conduit_la_SOURCES): add
- address-conduit.h
-
- * Makefile.am (CONDUIT_SUBDIR): only set subdir if
- ENABLE_PILOT_CONDUITS is set.
-
-2000-08-13 Chris Toshok <toshok@helixcode.com>
-
- * Makefile.am (SUBDIRS): add conduit subdir.
-
-2000-08-13 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (conduit_get_gpilot_conduit): add
- special oaf initialization hack so conduit can find wombat, and
- accept all cookies so that we can actually talk to oaf.
-
-2000-08-13 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Fixed a typo that cause the
- wrong field to be searched.
-
- * gui/component/select-names/e-select-names.c: Made the select
- names dialog only display entries with email addresses.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade: Fixed a typo in the name of
- the first phone entry.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/Makefile.am,
- gui/search/e-addressbook-search-dialog.c,
- gui/search/e-addressbook-search-dialog.h: A few small interface
- fixes.
-
- * gui/component/Makefile.am: Link in the addressbook search
- dialog.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/Makefile.am: Added the search directory.
-
- * backend/ebook/e-book.c: Fixed a potential crash.
-
- * gui/minicard/e-reflow-sorted.h: Fixed an include line.
-
- * gui/search/.cvsignore, gui/search/Makefile.am: New files.
-
- * gui/search/e-addressbook-search-dialog.c: Fixed compilation.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * printing/Makefile.am: Ettore fixed compilation.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/.cvsignore: Added load-gnomecard-addressbook.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/e-addressbook-search-dialog.c,
- gui/search/e-addressbook-search-dialog.h: Made this into a Gtk
- object.
-
-2000-08-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-book-view.c: Ref our book view listener.
-
- * gui/component/addressbook.c: Updated to use new minicard view
- widget.
-
- * gui/minicard/Makefile.am: Added e-minicard-view-widget.c and
- e-minicard-view-widget.h.
-
- * gui/minicard/e-minicard-view-widget.c,
- gui/minicard/e-minicard-view-widget.h: New class that's just a
- minicard view in an ECanvas.
-
- * gui/search/e-addressbook-search-dialog.c: New file for
- implementing a search dialog.
-
-2000-08-11 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (transmit): implement code to encode
- the first email address and send to the pilot.
- (get_phone_label_by_flag): rename find_phone_label_for_flags to
- this, and implement by calling get_phone_label_by_name.
-
-2000-08-11 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (ecard_from_remote_record): add code
- for handling email addresses from pilot (which stores it as a
- phone number entry. go figure.)
- (check_for_slow_setting): #if 0 out, since we don't use it (yet).
- (update_record): un #if 0 the code to handle the case where the
- pilot info has changed for a local record.
- (merge_ecard_with_remote_record): implement function, but for now
- just return the existing (desktop) record - we still don't allow
- merge from the pilot.
-
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/addresstypes.xml: Changed a couple of input field
- names.
-
-2000-08-10 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c: Remove prototype for
- `setup_ldap_storage()', which shouldn't be here anyway.
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/search/, gui/search/addresstypes.xml: New search dialog for
- addressbook.
-
-2000-08-10 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook-component.c (owner_set_cb): Update for
- changed prototype, pass evolution_homedir arg to
- setup_ldap_storage.
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Now takes
- an evolution_homedir arg, uses that to generate the path to the
- ldapservers.xml file, and stores the result in a static variable.
- (e_ldap_storage_add_server, e_ldap_storage_remove_server): Use that
- static variable rather than hardcoding the path to the file.
-
-2000-08-10 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Fixed any search to not crash on
- missing phone numbers or email addresses.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-control.c: Added a button to save to
- your addressbook.
-
-2000-08-09 Cody Russell <bratsche@gnome.org>
-
- * gui/component/addressbook.c: Make the toolbar honor the user's
- gnomecc settings for detachable toolbars.
-
-2000-08-09 Nat Friedman <nat@helixcode.com>
-
- * ename/e-name-western-tables.h: Added some military prefixes.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Fixed a warning.
-
-2000-08-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Add the stock
- print icon to the print item.
-
-2000-08-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Put the print
- item in the right placeholder so that it gets the right position
- in the "File" menu.
- (control_deactivate): Updated accordingly.
-
-2000-08-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c, gui/minicard/e-minicard.c: Changed
- e_popup_menu_run call to match the new arguments.
-
- * gui/component/addressbook.oafinfo: Fixed this file to work
- properly.
-
- * gui/minicard/e-minicard-control.c: Use the correct oafinfo ID
- here. Also cleaned up the code a bit with the help of Michael
- Meeks.
-
-2000-08-08 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-addressbook-model.c (e_addressbook_model_init):
- use x-evolution-any-field.
-
- * gui/component/addressbook.c (search_entry_activated): use
- x-evolution-any-field.
- (change_view_type): same.
-
- * gui/minicard/e-minicard-view.c (e_minicard_view_init): set query
- to x-evolution-any-field.
-
- * backend/pas/pas-backend-ldap.c (func_contains): support
- x-evolution-any-field for matching any evolution supported field.
-
- * backend/pas/pas-backend-file.c (compare_email): switch to using
- ECardSimple calls.
- (compare_phone): same.
- (compare_address): same.
- (entry_compare): switch to using ECardSimple calls, and support a
- 'x-evolution-any-field' wildcard field.
- (vcard_matches_search): use an ECardSimple.
-
-2000-08-07 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Removed the next and prev
- toolbar buttons since they don't do anything.
-
-2000-08-07 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor.c: Fixed the tab order to not
- repeat the web page address field.
-
-2000-08-07 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Fixed the tab order for this
- dialog.
-
-2000-08-05 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed a warning.
-
- * backend/ebook/e-card.c: Cast to (char *) in
- e_card_load_cards_from_file since libversit isn't const correct.
-
- * backend/pas/pas-backend-file.c: Fixed a warning.
-
-2000-08-04 Michael Meeks <michael@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): unref.
-
- * demo/addressbook.c (control_activate): unref.
-
-2000-08-02 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/e-addressbook-model.c: Emit "model_pre_change"
- signal as appropriate.
-
-2000-08-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c: Adapted this to supply the
- new append_row API of ETableModel.
-
-2000-07-31 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Changed the default set of columns.
-
-2000-07-29 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added load-gnomecard-addressbook
- compilation.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- e_card_load_cards_from_file helper function to load multiple cards
- from a single file.
-
- * backend/ebook/load-gnomecard-addressbook.c: New file to load
- vcard files. I think this is the format that gnomecard uses so if
- you copy your gnomecard file to gnomecard.vcf and then run this
- program in the same directory, it'll copy all your gnome contacts
- into evolution. It needs to be changed to take a filename as a
- parameter. Some fields (phone and address information, for
- example) aren't displayed properly, but are saved. This is new
- code, so some other than phone and address may be lost.
-
-2000-07-28 Ettore Perazzoli <ettore@helixcode.com>
-
- * backend/pas/Makefile.am: Add `pas-backend-ldap.c' and
- `pas-backend-ldap.h' to `EXTRA_DIST' so they get distributed even
- if the OpenLDAP support is not enabled.
-
-2000-07-27 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c: Changed the URI to load
- to.
-
-2000-07-26 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-widget-test.c: Fixed a warning.
-
-2000-07-26 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (view_destroy): wait to free the
- view until we've taken care of freeing its internals. also, close
- the ldap connection here.
- (pas_backend_ldap_connect): rename p_b_l_ensure_connected to this,
- since it's always called when we create a view.
- (pas_backend_ldap_build_all_cards_list): open an ldap connection
- in this function and close it at the end.
- (poll_ldap): make sure to call ldap_unbind to close the view's
- connection here.
- (pas_backend_ldap_search): call pas_backend_ldap_connect here -
- ldap_unbind will either be called from poll_ldap or from
- view_destroy.
- (pas_backend_ldap_get_vcard): the PASBackendLDAP no longer has an
- LDAP*.
-
-2000-07-26 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_build_all_cards_list): add support for user settable scope.
- (pas_backend_ldap_search): same.
- (pas_backend_ldap_load_uri): same.
-
-2000-07-26 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook.oafinfo: lowercasify the
- supported_mime_types
-
-2000-07-25 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-card-types.h: add enum for e-card pilot status.
-
- * conduit/address-conduit.c: #ifdef out all the archiving code with SUPPORT_ARCHIVING.
- (purge): implement correctly - deleting ecards whose pilot status is DELETED.
- (set_status): implement.
- (set_pilot_id): add gtk_main call here to change commit_card into a synchronous
- (delete_all): implement correctly - don't delete the records, just set their status to DELETED.
- (local_record_from_ecard): get the current status from the ecard.
-
- * backend/ebook/e-card.c (e_card_get_vcard): add vcard support for pilot status.
- (parse_pilot_status): new function.
- (e_card_class_init): add pilot status object arg.
- (e_card_set_arg): add pilot status support.
- (e_card_get_arg): same.
- (e_card_init): initialize pilot_status to 0.
-
-2000-07-25 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c: add comment headers to signals that
- didn't have any.
-
-2000-07-25 Chris Toshok <toshok@helixcode.com>
-
- * conduit/address-conduit.c (start_address_server): use the user's
- Contact db. not toshok's.
-
-2000-07-25 Michael Meeks <michael@helixcode.com>
-
- * backend/ebook/load-pine-addressbook.c (book_open_cb): check we
- opened ok.
-
-2000-07-25 Seth Alves <alves@hungry.com>
-
- * ename/Makefile.am (libename_static_la_LDFLAGS): build static
- version of the library for address conduit to use
-
- * backend/ebook/Makefile.am: build a static version of the library
- to link into the conduit
-
-2000-07-25 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Added a #define for
- "X-EVOLUTION-PILOTID". Added a parse_pilot_id to read pilot id's
- in properly from VCards. Rearranged some field orders. Added a
- get_arg case for ARG_PILOTID. Initialize pilot_id field to 0.
-
-2000-07-24 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-card.h: add pilot_id.
-
- * backend/ebook/e-card.c (e_card_get_vcard): add support for
- X-EVOLUTION-PILOTD vcard field.
- (e_card_class_init): add pilot_id arg.
- (e_card_set_arg): handle pilot_id arg.
-
-2000-07-23 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book-view-listener.c: Remove the idle handler
- when we're destroyed.
-
- * printing/e-contact-print.c: Fixed the spacing on the card
- header.
-
-2000-07-20 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.oafinfo: Fixed the oaf info.
-
- * gui/minicard/.cvsignore, gui/minicard/Makefile.am,
- gui/minicard/e-minicard-widget-test.c: Added a test for the
- minicard widget.
-
- * gui/minicard/e-minicard-control.c: Fixed the mime type.
-
- * gui/minicard/e-minicard.c: Fixed some crashes if your parent
- isn't a minicard view.
-
- * gui/minicard/e-minicard-control.oafinfo: Removed.
-
-2000-07-20 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (factory_fn): Update for
- the new `evolution_shell_component_new()'.
-
-2000-07-19 Fatih Demir <kabalak@gmx.net>
-
- * conduit/address-conduit-control-applet.desktop:
- Added the Turkish desktop entry.
-
-2000-07-18 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-control.c: Added "text/vCard" to the
- list of mime types we support.
-
-2000-07-18 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/Makefile.am: Added
- gui/minicard/e-minicard-control.c,
- gui/minicard/e-minicard-control.h,
- gui/minicard/e-minicard-widget.c, and
- gui/minicard/e-minicard-widget.h.
-
- * gui/minicard/e-minicard-control.c,
- gui/minicard/e-minicard-control.h,
- gui/minicard/e-minicard-widget.c,
- gui/minicard/e-minicard-widget.h: Got these to compile.
-
- * gui/minicard/e-minicard-control.gnorba,
- gui/minicard/e-minicard-control.oafinfo: Copied directly from
- bonobo-clock-control. These aren't done yet.
-
-2000-07-18 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-control.c,
- gui/minicard/e-minicard-control.h,
- gui/minicard/e-minicard-widget.c,
- gui/minicard/e-minicard-widget.h: New files for using a minicard
- as a widget or a bonobo control.
-
-2000-07-14 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-ldap-storage.c (ldap_server_foreach): duh.
- don't save the port in the host slot either.
-
-2000-07-13 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-confirm-delete.glade,
- contact-editor/e-contact-editor-confirm-delete.glade.h: Added
- these.
-
-2000-07-13 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Switched the order of compilation of printing and
- contact-editor.
-
- * contact-editor/Makefile.am: Added printing libraries and a
- confirm delete dialog glade file.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Enabled the delete and print
- functions as well as providing a confirm delete dialog to the
- outside world.
-
- * gui/component/addressbook.c: Made the delete button on new cards
- active.
-
- * gui/minicard/Makefile.am: Added printing libraries to a number
- of test programs.
-
- * gui/minicard/e-minicard.c: Added print and delete to the right
- click menu. Made the delete button on the card editor active.
-
- * printing/e-contact-print.c, printing/e-contact-print.h: Added a
- function to print a single card.
-
-2000-07-12 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-ldap-storage.c (ldap_server_foreach): oops. fix
- typo that was saving the port in the rootdn spot.
- (save_ldap_data): make this a bit safer - writing to a new file
- and renaming it.
- (load_ldap_data): make this a bit smarter - if parsing the
- ldapservers.xml file fails and there's a .new file there,
- rename it.
-
-2000-07-12 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Do case insensitive compares.
-
- * addressbook/gui/component/addressbook.c: Make quick search
- search both name and company name.
-
-2000-07-12 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Add icons to the toolbars.
-
-2000-07-12 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/Makefile.am: Added installation of arrow.png.
-
- * contact-editor/e-contact-editor.c: Use EVOLUTIONDIR #define.
-
-2000-07-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Removed an unused function
-
-2000-07-10 Dan Winship <danw@helixcode.com>
-
- * gui/component/select-names/Makefile.am (EXTRA_DIST): add idl
- file to EXTRA_DIST
-
-2000-07-10 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Remove the
- SelectNames test.
-
-2000-07-10 Peter Williams <peterw@curious-george.helixcode.com>
-
- * gui/component/select-names/e-select-names-model.c: (Clahey's fix)
- Make multiple addresses be concatenated correctly.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c,
- gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Switched from ETable
- to ETableScrolled.
-
- * addressbook/gui/minicard/e-minicard.c: Don't display mailer or
- "name or org" fields.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added a field that gives the name if it exists and the company
- name otherwise.
-
- * gui/component/e-addressbook-model.c: Formatting changes.
-
- * gui/component/select-names/e-select-names-table-model.c: Added
- stripping of names and display of company name if name doesn't
- exist.
-
- * gui/component/select-names/e-select-names.c: Fixed up the
- display so that we display both name and email address.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-model.c: Fixed a small
- off by one error that was causing an extra character to get
- deleted sometimes.
-
-2000-07-09 Anders Carlsson <andersca@gnu.org>
-
- * gui/minicard/test-reflow.c (allocate_callback): Fix off by one bug with
- scroll region setting.
- (resize): Likewise.
- (main): Put the contacts list in an EScrolledFrame instead of using a
- separate GtkScrollbar.
-
- * gui/minicard/e-reflow.c (e_reflow_event): Don't change mouse cursor and
- don't allow drags on dividers that aren't visible.
-
- * gui/component/addressbook.c (allocate_callback): Fix off by one bug with
- scroll region setting.
- (resize): Likewise.
- (create_minicard_view): Put the contacts list in an EScrolledFrame instead of
- using a separate GtkScrollbar.
-
-2000-07-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Removed unused do_nothing_cb
- function.
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-manager.h: Made the OK
- and Cancel buttons in the ESelectNames dialog we create work
- properly.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h: Added
- e_select_names_model_duplicate.
-
- * gui/component/select-names/e-select-names-text-model.c: Made the
- text be set correctly if there's already data in the source when
- the text model is created.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Removed handling of
- the buttons (the user of this dialog will have to handle them.)
- Added e_select_names_get_source. Fixed some typos.
-
-2000-07-09 Not Zed <NotZed@HelixCode.com>
-
- * gui/component/addressbook.c: Link the toolbar print button to
- the print callback.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names.c
- (e_select_names_clicked): Hitting OK or Cancel at least closes the
- dialog now.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_create_entry): Set the returned entry to
- use the ellipsis.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-factory.c: Include
- e-select-names-factory.h.
-
- * gui/component/select-names/e-select-names-model.c: Handle a NULL
- iterator properly in the replace function.
-
- * gui/component/select-names/e-select-names-table-model.c: Fill in
- info properly in the value_at function.
-
- * gui/component/select-names/e-select-names-text-model.c: Don't
- strlen a NULL text object.
-
- * gui/component/select-names/e-select-names.c: Close if the person
- hits ok or cancel (doesn't yet actually undo changes if Cancel is
- hit.) Handle removing addresses when they're double clicked on.
-
- * gui/component/select-names/select-names.glade,
- gui/component/select-names/select-names.glade.h: Hid some unused
- fields and changed the text at the top of the dialog.
-
-2000-07-08 Jeffrey Stedfast <fejj@helixcode.com>
-
- * gui/component/select-names/.cvsignore: Ignore dynamically
- created source files
-
-2000-07-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/select-names/e-select-names-bonobo.c
- (entry_get_property_fn): New function to set the properties.
-
-2000-07-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-factory.c (main): Start up the factory
- for `Evolution::Addressbook::SelectNames'.
-
- * gui/component/select-names/evolution-addressbook-select-names.oafinfo:
- New.
-
- * gui/component/select-names/e-select-names-factory.c: New.
- * gui/component/select-names/e-select-names-factory.h: New.
-
- * gui/component/select-names/e-select-names-bonobo.c: New.
- * gui/component/select-names/e-select-names-bonobo.h: New.
-
- * gui/component/addressbook-factory.c (main): Call
- `e_select_names_factory_init()'.
-
- * gui/component/select-names/e-select-names-manager.c
- (e_select_names_manager_add_section): Made const-aware.
- (e_select_names_manager_create_entry): Made const-aware.
- (e_select_names_manager_activate_dialog): Made const-aware.
-
- * gui/component/select-names/Evolution-Addressbook-SelectNames.idl:
- New.
-
-2000-07-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c,
- gui/component/e-addressbook-model.h: Added an "editable" argument.
-
- * gui/component/select-names/e-select-names.c: Set our
- EAddressModel to not be editable.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names.c: Changed to line
- mode.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-model.c: Implemented the
- get_cards function.
-
- * gui/component/select-names/e-select-names.c: Implemented adding
- cards through the interface.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c: Make the
- entry widgets we create editable.
-
- * gui/component/select-names/e-select-names-model.c: Use
- e_strsplit instead of g_strsplit. Fixed an off by 1 error.
-
- * gui/component/select-names/e-select-names-table-model.c: When
- the model changes, send a model changed signal.
-
- * gui/component/select-names/e-select-names-text-model.c: Made
- changing this work correctly if it's empty. Made change signals
- propagate properly. Is a bit better about freeing iterators when
- done.
-
- * gui/component/select-names/e-select-names.c: Made the finished
- lists be in order instead of being sorted.
-
-2000-07-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c (new_server_cb): Since
- ELDAPServer->port is a char *, allocate a string with the number
- 389 contained.
-
- * gui/component/addressbook.c: Make the select names test test the
- new code instead of the old way of getting to an ESelectNames
- dialog.
-
- * gui/component/select-names/e-select-names-manager.c: Coded
- storing the model for each section, creating an entry and
- returning it, and for activating the dialog. Wrote a bit of the
- get_cards code, but not all of it.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h: Coded all of
- the code needed to make ESelectNamesTextModel work (it doesn't
- yet, but all the code should be there.) Removed
- E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL.
-
- * gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-text-model.c: Changed
- these to compensate for removal of
- E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL.
-
- * gui/component/select-names/e-select-names-table-model.h,
- gui/component/select-names/e-select-names-text-model.h: Fixed some
- silly typos.
-
- * gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h: Added a parameter to
- add_section that lets you specify the source ESelectNamesModel.
-
-2000-07-06 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/e-ldap-storage.h: add scope to ELDAPServer, and
- make port a string.
-
- * gui/component/e-ldap-storage.c (load_ldap_data): don't load a
- uri, load all the bits and pieces and build up the uri when
- creating the folder, according to the openldap url format.
- (ldap_server_foreach): store out each of the individual uri
- pieces.
- (e_ldap_storage_remove_server): free the new fields.
- (get_string_value): if the text is empty, return the empty string
- instead of NULL.
-
- * gui/component/e-ldap-server-dialog.c (extract_server_info): port is a string now.
- (fill_in_server_info): port is a string now.
-
-2000-07-06 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Changed "FIXME: Save and
- Close" to "Save and Close". Removed some toolbar items that will
- never be used.
-
- * gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h: Added functions
- to allow you to modify the model (not implemented yet.)
-
- * gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-table-model.h: Finished
- this. Doesn't support changing the model at all.
-
- * gui/component/select-names/e-select-names-text-model.c: Finished
- this. Changing the model by typing is done, but doesn't work
- since none of the functions in the base model are implemented.
-
-2000-07-05 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (new_server_cb): call
- e_ldap_storage_add_server call.
-
- * gui/component/ldap-server-dialog.glade: add name row.
-
- * gui/component/e-ldap-server-dialog.h: remove the ELDAPServer type.
-
- * gui/component/e-ldap-server-dialog.c (extract_server_info): add
- support for the name-entry.
-
- * gui/component/e-ldap-server-dialog.c (fill_in_server_info): same.
-
- * gui/component/e-ldap-storage.h: add ELDAPServer type, and add
- prototypes for e_ldap_storage_add_server and
- e_ldap_storage_remove_server.
-
- * gui/component/e-ldap-storage.c (e_ldap_storage_add_server): new
- function, add it to our hash table, add a shell folder, and save
- out the metadata.
- (ldap_server_foreach): add the ldap server info under a
- "contactserver" node.
- (setup_ldap_storage): create our hashtable.
-
-2000-07-05 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (set_prop): remove hack to read
- "uri" file from local directory.
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES): add
- e-ldap-storage.{c,h}
-
- * gui/component/addressbook-component.c (owner_set_cb): call
- setup_ldap_storage.
-
- * gui/component/e-ldap-storage.c (setup_ldap_storage): Register
- the LDAP storage and load the .xml file.
- (load_ldap_data): function to load our xml file.
- (save_ldap_data): function to save our xml file.
-
- * gui/component/e-ldap-storage.h: new file.
-
-2000-07-03 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-text-model.c,
- gui/component/select-names/e-select-names.c: Fixed more compile
- errors.
-
-2000-07-03 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/Makefile.am: Fixed compile error.
-
-2000-07-03 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Removed e-card-iterator.c,
- e-card-iterator.h, e-card-list-iterator.c, e-card-list-iterator.h,
- e-card-list.c, e-card-list.h.
-
- * backend/ebook/e-card-iterator.c,
- backend/ebook/e-card-iterator.h,
- backend/ebook/e-card-list-iterator.c,
- backend/ebook/e-card-list-iterator.h, backend/ebook/e-card-list.c,
- backend/ebook/e-card-list.h: Removed in favor or versions without
- the -card in the e-util directory since these classes are not
- specific to cards at all.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h,
- backend/ebook/e-card.c, backend/ebook/e-card.h,
- backend/ebook/load-pine-addressbook.c, backend/ebook/test-card.c,
- backend/pas/pas-backend-file.c: Changed the references to
- e-card-list.c and friends to e-list.c and friends.
-
- * contact-editor/e-contact-editor.c: Added #include
- <e-contact-save-as.h> to fix a warning.
-
- * gui/component/Makefile.am: Moved a number of classes associated
- with the select-names object to the new select-names directory.
-
- * gui/component/addressbook.c: Changed the reference to
- e-select-names.h.
-
- * gui/component/e-select-names.c, gui/component/e-select-names.h,
- gui/component/select-names.glade,
- gui/component/select-names.glade.h: Moved these files into
- select-names/.
-
- * gui/component/select-names/.cvsignore,
- gui/component/select-names/Makefile.am,
- gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-manager.h,
- gui/component/select-names/e-select-names-model.c,
- gui/component/select-names/e-select-names-model.h,
- gui/component/select-names/e-select-names-table-model.c,
- gui/component/select-names/e-select-names-table-model.h,
- gui/component/select-names/e-select-names-text-model.c,
- gui/component/select-names/e-select-names-text-model.h,
- gui/component/select-names/e-select-names.c,
- gui/component/select-names/e-select-names.h,
- gui/component/select-names/recipient.glade,
- gui/component/select-names/select-names.glade,
- gui/component/select-names/select-names.glade.h: New files for
- select names dialog (e-select-names.c, e-select-names.h,
- select-names.glade, select-names.glade.h and recipient.glade moved
- from gui/component/.)
-
-2000-06-29 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (owner_set_cb): Get an
- EvolutionShellClient instead of an Evolution_Shell to match the
- changes in libeshell.
-
-2000-06-28 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names/,
- gui/component/select-names/e-select-names-manager.c,
- gui/component/select-names/e-select-names-manager.h: New select
- names manager interface (Not complete.)
-
-2000-06-26 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- addressbook/gui/component/e-cardlist-model.c: Added
- value_to_string handlers.
-
- * demo/addressbook-widget.c, demo/demo.c: Removed usage of "x" and
- "y" arguments.
-
- * addressbook/gui/component/addressbook.c: Activated Click To Add
- and set the click to add message.
-
- * addressbook/gui/component/e-addressbook-model.c: Added
- value_to_string and append_row handlers.
-
- * addressbook/gui/component/e-select-names.c: Added a column.
-
-2000-06-26 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (poll_ldap): remove spew.
- (pas_backend_ldap_ensure_connected): duh, don't access a pointer
- we know to be NULL.
- (query_prop_to_ldap): rename map_e_card_prop_to_ldap to this.
- easier to type.
-
-2000-06-21 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/test-minicard-label.c,
- gui/minicard/test-minicard.c, gui/minicard/test-reflow.c: Remove
- usage of "x" and "y" arguments.
-
-2000-06-18 <ettore@helixcode.com>
-
- * contact-editor/Makefile.am (INCLUDES): Use
- `$(BONOBO_GNOME_CFLAGS)' so that we compile when Bonobo is not in
- the default GNOME prefix.
-
-2000-06-17 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-label.c,
- gui/minicard/e-minicard-label.h, gui/minicard/e-minicard.c: Made
- the left column of minicards not get any wider than the widest
- possible name.
-
-2000-06-13 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/Makefile.am (SHELL_OBJS): Removed.
- (evolution_addressbook_LDADD): Link with
- `$(top_builddir)/shell/libeshell.a'.
-
-2000-06-12 Federico Mena Quintero <federico@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Removed the
- ETableModel thaw handler.
- * gui/component/e-cardlist-model.c: Likewise.
-
-2000-06-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-select-names.c: Fixed the widget reparenting.
-
-2000-06-11 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/Makefile.am: Added glade files.
-
- * gui/component/addressbook.c: Added a test of the Select Names
- functionality.
-
- * gui/component/e-addressbook-model.c: Made this class_init
- function a bit cleaner.
-
- * gui/component/e-select-names.c: Tested this and fixed some
- obvious errors.
-
- * gui/component/select-names.glade: The main window shouldn't be
- visible by default.
-
-2000-06-11 Ettore Perazzoli <ettore@helixcode.com>
-
- * contact-editor/Makefile.am (contact_editor_test_LDADD): Link
- with libemiscwidgets.a.
- * gui/component/Makefile.am (evolution_addressbook_LDADD): Likewise.
- * gui/minicard/Makefile.am (minicard_test_LDADD): Likewise.
- (reflow_test_LDADD): Likewise.
- (minicard_view_test_LDADD): Likewise.
-
-2000-06-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-cardlist-model.c: Renamed a bunch of functions
- for better readability.
-
- * gui/component/e-select-names.c, gui/component/e-select-names.h:
- This should be a working dialog now.
-
- * gui/component/select-names.glade: Changed the name & creation
- function of the ETable here.
-
-2000-06-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/select-names.glade,
- gui/component/select-names.glade.h: Glade files for Select Names
- dialog.
-
-2000-06-10 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Do e_card_simple_sync and
- extract_info more often.
-
- * gui/component/addressbook.c: Added table printing code.
-
-2000-06-09 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (factory_fn): Pass NULL
- for the new args @create_folder_fn and @remove_folder_fn.
-
-2000-06-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook-component.c (create_view): Updated for
- the new `EvolutionShellComponentCreateViewFn'. Return
- `EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE' if @type is not
- "contacts".
-
-2000-06-08 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Bind Save As to save the
- current view of the contact as a vcard.
-
-2000-06-08 Federico Mena Quintero <federico@helixcode.com>
-
- * contact-editor/e-contact-editor.c (save_card): Doh, sync the
- card simple and extract the card info.
-
-2000-06-08 Federico Mena Quintero <federico@helixcode.com>
-
- * contact-editor/e-contact-editor.h (EContactEditor): Now this
- derives from GtkObject. It follows the same strategy as the
- EventEditor in the calendar.
- (EContactEditor): Added an is_new_card field so that we can know
- whether to add() or commit() the card.
-
- * contact-editor/e-contact-editor.c (e_contact_editor_get_type):
- Derive from GtkObject.
- (e_contact_editor_class_init): Likewise.
- (e_contact_editor_class_init): Added an "is_new_card" argument.
- (e_contact_editor_set_arg): Handle ARG_IS_NEW_CARD.
- (e_contact_editor_get_arg): Likewise.
- (e_contact_editor_new): Take in an is_new_arg argument and set it
- on the object.
- (e_contact_editor_init): Load the app widget into the app field of
- the EContactEditor structure. Create its UIHandler as well.
- (e_contact_editor_class_init): New "add_card", "commit_card", and
- "editor_closed" signals.
-
- * contact-editor/test-editor.c (main): Modified for the new API.
- (editor_closed_cb): Tweaked for the new API.
- Since this test program does not use Bonobo, it doesn't work,
- though.
-
- * gui/component/addressbook.c (new_contact_cb): Use the new
- contact editor API.
- (table_double_click): Ditto.
-
- * gui/minicard/e-minicard-view.c (e_minicard_view_event): Use the
- new contact editor API.
-
- * gui/minicard/e-minicard.c (e_minicard_event): Use the new
- contact editor API.
-
-2000-06-08 Ettore Perazzoli <ettore@helixcode.com>
-
- * contact-editor/Makefile.am (contact_editor_test_LDADD): Remove
- the `$(srcdir)/' prefix from `libecontacteditor.a' because [of
- course] the library is built in the build directory, not in the
- source directory.
- * gui/minicard/Makefile.am (minicard_test_LDADD): Likewise with
- `libeminicard.a'.
- (minicard_label_test_LDADD): Likewise.
- (reflow_test_LDADD): Likewise.
- (minicard_view_test_LDADD): Likewise.
-
-2000-06-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Bind right click on the ETable to
- "Save to VCard."
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Made phone/email/address
- labels change correctly again.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook-component.c: Made
- evolution-addressbook shut down when the shell is done with it.
-
-2000-06-02 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard.c: Made
- double click only work on the first button.
-
-2000-06-01 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard.c: return TRUE if opening a contact
- editor so that we don't get a "new dialog" contact editor.
-
-2000-06-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (new_contact_cb): Use the stock
- cancel button for the dialog.
- (table_double_click): Likewise.
- (find_contact_cb): Likewise.
-
-2000-05-31 Miguel de Icaza <miguel@helixcode.com>
-
- * contact-editor/contact-editor.glade: Added accelerators for
- the remaining items.
-
- Add spacing, beautify the dialogs.
-
-2000-06-01 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Put the toolbar
- into a frame to make it look like standard GNOME toolbars. Also,
- set `GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL' so that it does not do
- evil things when its moved to the left or the right of the window.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-cardlist-model.c,
- gui/component/e-cardlist-model.h: New files for card list.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Fixed a memory leak.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/alphabet.glade: Made the alphabet buttons not
- focusable.
-
- * gui/minicard/e-minicard-view.c: Made the "123" button work.
-
- * gui/minicard/e-reflow-sorted.c: Made all buttons past the last
- letter available work.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/alphabet.glade: Added a bit of space around the
- alphabet bar.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/Makefile.am: Added alphabet.glade and
- alphabet.glade.h.
-
- * gui/component/addressbook.c, gui/component/alphabet.glade,
- gui/component/alphabet.glade.h: Added an alphabet bar.
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard-view.h,
- gui/minicard/e-reflow-sorted.c, gui/minicard/e-reflow-sorted.h:
- Added the ability to just to a particular spot in the reflow.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * printing/Makefile.am: Added BONOBO_GNOME_CFLAGS to CPPFLAGS.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-view.c: Made double clicking create a
- new card. Set the empty message.
-
- * gui/minicard/e-minicard.c: Made sorting be case insensitive.
-
- * gui/minicard/e-reflow-sorted.c, e-reflow.c, e-reflow.h: Added a
- message for when the reflow is empty.
-
- * printing/e-contact-print.c, printing/medbook.ecps: Made the
- default printout be full page. Made sorting case insensitive.
-
-2000-05-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book-view-listener.c,
- backend/ebook/e-book-view-listener.h, backend/ebook/e-book-view.c,
- backend/ebook/e-book-view.h, backend/idl/addressbook.idl,
- backend/pas/pas-backend-file.c, backend/pas/pas-backend-ldap.c,
- backend/pas/pas-book-factory.c, backend/pas/pas-book-view.c,
- backend/pas/pas-book-view.h: Added "sequence_complete" signal.
-
- * printing/e-contact-print.c: Made printing wait for
- "sequence_complete" signal and made it sort.
-
-2000-05-25 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c,
- gui/component/e-addressbook-model.c,
- gui/component/e-addressbook-model.h: Added double click to open
- contact editor.
-
-2000-05-25 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Removed some columns.
-
-2000-05-25 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/component/addressbook.c (addressbook_factory_new_control):
- New function.
- (addressbook_factory): Use it.
-
- * Makefile.am (evolution_addressbook_LDADD): Link with
- `evolution-shell-component.o' from the shell directory.
-
- * gui/component/addressbook-component.c: New.
- * gui/component/addressbook-component.h: New.
-
-2000-05-23 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Switched printing and gui.
-
- * backend/ebook/e-book-view-listener.h,
- backend/ebook/e-book-view.h, backend/ebook/e-book.h,
- backend/ebook/e-card-cursor.h, backend/ebook/e-card-list.h,
- backend/ebook/e-card-simple.h, backend/ebook/e-card.h: Fixed the
- #defines to work elsewhere in evolution.
-
- * gui/component/Makefile.am: Added linking to libecontactprint.
-
- * gui/component/addressbook.c: Added a menu item to print the
- current query.
-
- * printing/Makefile.am: Add linking to libebook and requirements.
- Add installation of ecps files.
-
- * printing/e-contact-print.c, printing/e-contact-print.h: Changed
- this to use real data from an EBook.
-
- * printing/test-print.c: Made this pass NULL, NULL to
- e_contact_print_dialog_new so that it will compile.
-
-2000-05-23 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-save-as.c: Fixed some memory leaks.
-
-2000-05-23 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/Makefile.am: Added e-contact-editor-save-as.c and
- e-contact-editor-save-as.h.
-
- * contact-editor/e-contact-save-as.c,
- contact-editor/e-contact-save-as.h: New files that display a save
- as dialog and then save the given card to that file.
-
- * gui/minicard/e-minicard.c: Call e_contact_save_as in a right
- click menu.
-
-2000-05-19 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c,
- gui/component/e-addressbook-model.c: Added initialize_value and
- value_is_empty callbacks.
-
-2000-05-19 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Fixed a bug that broke
- address field support.
-
-2000-05-19 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Added support for arbitrary
- fields in the contact editor.
-
-2000-05-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Fixed e_card_name_copy and
- e_card_arbitrary_copy to deal correctly with a passed NULL.
-
- * contact-editor/Makefile.am: Removed imagesdir stuff.
-
- * contact-editor/arrow.png: Made this transparent.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Renamed some widgets
- and added custom widgets for all of the images.
-
- * contact-editor/e-contact-editor.c: Worked on making this work
- decently well with messed up glade files. Cleaned up a lot of code.
-
-2000-05-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Fixed the code to write out and read in
- arbitrary fields.
-
-2000-05-18 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h,
- backend/ebook/e-card-types.h, backend/ebook/e-card.c,
- backend/ebook/e-card.h: Implemented "MAILER" field. Added
- arbitrary field support.
-
- * contact-editor/e-contact-editor-categories.c: Fixed a warning.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Added E_CARD_SIMPLE_FIELD_MAILER. Not implemented yet.
-
-2000-05-16 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (construct_email_list): convert to use ECardSimple.
- (poll_ldap): same.
-
-2000-05-16 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-book.h: add typedefs for the can_write
- functions, and add parameters to pas_book_new.
-
- * backend/pas/pas-book.c (pas_book_construct): add can_write/can_write_card params.
- (pas_book_new): same.
- (impl_Evolution_Book_can_write): new function.
- (impl_Evolution_Book_can_write_card): same.
- (pas_book_get_epv): assign the can_write/can_write_card slots in the epv.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_can_write): new function.
- (pas_backend_ldap_can_write_card): same.
- (pas_backend_ldap_add_client): add can_write/can_write_card to pas_book_new call.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_can_write_card): new function, calls can_write.
- (pas_backend_file_can_write): same.
- (can_write): return TRUE if we can write to the addressbook file.
- (pas_backend_file_add_client): add can_write/can_write_card to pas_book_new call.
-
- * backend/idl/addressbook.idl (Evolution): add can_write and
- can_write_card permission requests.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (e_card_get_vcard): Fixed a large memory leak.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c (add_list_unique): Fixed another memory
- leak.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/pas/pas-backend-file.c,
- contact-editor/e-contact-editor.c, ename/e-name-western.c,
- gui/component/addressbook.c, gui/minicard/e-minicard-view.c: Fixed
- some memory leaks.
-
- * backend/ebook/e-card.c: Rearranged some code.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed a reference
- leak.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Fixed a compile
- error.
-
-2000-05-16 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Got rid of a
- memory leak. Rearranged a couple functions.
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard-view.h:
- Added some code to stop watching the EBook when the canvas is
- destroyed (apparently the canvas is destroyed before our widget is
- destroyed.)
-
-2000-05-14 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-categories.c: Use the correct
- policy for resize.
-
-2000-05-14 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added libeutil for e-card's support
- for categories.
-
- * backend/ebook/e-card-list.c, backend/ebook/e-card-list.h: Added
- a function to get the length.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added categories
- support (accessible either as "categories" or "category_list".)
-
- * contact-editor/Makefile.am: Added e-table and all of the
- categories files.
-
- * contact-editor/categories.glade,
- contact-editor/categories-strings.h,
- contact-editor/e-contact-editor-categories.c,
- contact-editor/e-contact-editor-categories.h:
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Rearranged this dialog.
-
- * contact-editor/e-contact-editor.c: Rearranged dialog a bit.
- Added opening of categories dialog.
-
- * gui/component/Makefile.am: Rearranged libraries so that
- libetable would be available for the contact editor categories
- dialog.
-
- * gui/component/addressbook.c: Fix for new ETable resizing. Make
- contact editor dialog resizable.
-
- * gui/minicard/Makefile.am: Added libetable contact editor
- categories dialog.
-
- * gui/minicard/e-minicard.c: Make contact editor dialog resizable.
-
-2000-05-12 Miguel de Icaza <miguel@gnu.org>
-
- * contact-editor/fulname.glade: Use accelerators here.
-
-2000-05-13 Valek Filippov <frob@df.ru>
-
- * gui/component/ldap-server-dialog.glade: save translatable strings
- * gui/component/ldap-server-dialog.glade.h: file with strings
- * printing/e-contact-print.glade: save translatable strings
- * printing/e-contact-print.glade.h: file with strings
-
-2000-05-11 Dan Winship <danw@helixcode.com>
-
- * gui/component/addressbook.c (control_activate): Now that we
- depend on recent gnome-libs we can make the toolbar detachable
- again.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Make the table view be sorted by
- name initially.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-book-factory.c: Send a proper response when you
- can't find the ldap URI.
-
- * gui/component/addressbook.c: Cleaned up the open error dialog a
- bit.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Added a dialog for when you can't
- open an addressbook.
-
-2000-05-10 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added e-book-types.h, e-card-pairs.h,
- e-card-types.h.
-
- * backend/pas/Makefile.am: Added pas-backend-ldap.h.
-
- * contact-editor/Makefile.am: Added a proper EXTRA_DIST section.
- Removed some old defines.
-
- * ename/Makefile.am: Added e-name-western-tables.h.
-
- * gui/component/Makefile.am: Added e-ldap-server-dialog.h. Added
- a proper EXTRA_DIST section.
-
- * gui/minicard/e-reflow.c: Added a missed cast.
-
- * printing/Makefile.am: Added a proper EXTRA_DIST section.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Make sure that the canvas
- doesn't intercept keyboard focus.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Use new art.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Replaced the Address
- button with a label and rearranged the address area a bit.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard.c: Reenable editting.
-
- * gui/minicard/e-reflow-sorted.c: Make reflow flow on deletion.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Destroy the view object when
- leaving the minicard view.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-reflow-sorted.c: Fixed reflow sorting to call
- reflow_request when sorting on an item changes.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Make File As change if name or
- company are changed pretty much anywhere.
-
- * gui/minicard/e-minicard.c: Turned off having minicard editing
- effect anything since it's so crashy.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c: Enabled a couple more fields
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Added a default card to all new
- file backends.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c: Rearranged order of things
- getting destroyed.
-
- * gui/minicard/e-minicard-view.c: Rearranged order of things
- getting destroyed. Don't set attributes of non-null or destroyed
- items. Destroy parent object when destroyed. Maintain ref_count
- of items in list.
-
- * gui/minicard/e-minicard.c: Don't set attributes of non-null
- items.
-
- * gui/minicard/e-reflow-sorted.c: Maintain ref_count of items in
- list.
-
- * gui/minicard/e-reflow.c: Maintain ref_count of items in list.
- Destroy parent object when destroyed.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed some indentation.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Changed Email to
- Primary Email.
-
- * contact-editor/e-contact-editor.c: Added checkmarks to indicate
- if data exists in the pull down menus for the phone, address, and
- email fields.
-
-2000-05-09 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed the string duplication
- problem. Fixed the business/home address string mix up.
-
- * gui/component/addressbook.c: Made the minicard view the default
- view.
-
-2000-05-08 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c: Fixed this up a bit. Syncing
- should work better now.
-
-2000-05-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard-view.c, gui/minicard/e-minicard.c,
- gui/minicard/e-minicard.h, gui/minicard/e-reflow-sorted.c,
- gui/minicard/e-reflow-sorted.h: Made a minimal number of things be
- destroyed and recreated when updating a field.
-
-2000-05-07 <toshok@the-dot-in.helixcode.com>
-
- * gui/minicard/e-minicard.c (remodel): make sure to free the
- return value of e_card_simple_get.
-
- * gui/component/addressbook.c (teardown_table_view): destroy the
- ECardSimple here, plug memory leak.
- (create_table_view): use view->simple so we can destroy the
- ECardSimple later on.
-
-2000-05-07 Chris Toshok <toshok@helixcode.com>
-
- * ename/e-name-western.c (e_name_western_extract_middle): comment
- function, and fix an ABR.
-
-2000-05-07 Chris Toshok <toshok@helixcode.com>
-
- * ename/e-name-western.c (e_name_western_cleanup_string): comment
- function, and fix an ABR.
-
-2000-05-08 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/minicard/e-minicard.c: Added saving in minicard view.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c: Fixed an off by 2 error.
-
-2000-05-07 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (set_prop): don't create a new
- ebook. instead, unload the current uri (if there is one) and load
- the new one.
- (addressbook_factory): create the ebook once.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/e-addressbook-model.c: Replaced some model_changed
- calls with row_inserted calls.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c, backend/pas/pas-backend-ldap.c:
- Removed some code that was notifying too many clients at the wrong
- times.
-
- * gui/component/addressbook.c: Set view->book. Unreffed
- view->book. Unreffed the model instead of destroying it. Removed
- the /tmp/test.db stuff.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Make the addressbook create the
- correct file uri. Added a default query. Initialize view->model
- and view->view to NULL.
-
- * gui/component/e-addressbook-model.c,
- gui/minicard/e-minicard-view.c: Only call get_book_view if both
- book and query and non-null.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (control_deactivate): remove the
- separator and toggle view items as well.
- (toggle_view_as_cb): callback for the "/View/Toggle View" menu
- item.
- (get_query): getter for the query string that takes into account
- the two view types.
- (set_query): setter for the query string that takes into account
- the two view types.
- (set_book): setter for the EBook type - not really a setter, since
- the book is kept in the AddressbookView, but this method actually
- sets the "book" property on the current view.
- (find_contact_cb): make use of get/set_query
- (search_entry_activated): make use of set_query.
- (control_activate): add a menu separator and an item to toggle
- between view types.
- (book_open_cb): make use of set_book.
- (ebook_create): no longer needs to return the EBook, since we set
- the book field in our view.
- (teardown_minicard_view): destructor function for the minicard
- specific ui.
- (create_minicard_view): constructor function for the minicard
- specific ui.
- (teardown_table_view): destructor function for the e-table
- specific ui.
- (create_table_view): constructor function for the e-table specific
- ui.
- (change_view_type): destroy the old and create the new view ui,
- change the label of the Toggle View menu item, and reset the book
- and query on the new view type.
- (addressbook_factory): create an all-encompassing vbox that the
- view uses to create the bonobo control, which contains 1 widget
- per ui specific view (the e-table in the table case, and another
- vbox in the minicard case.) use change_view_type to create the
- initial view.
-
-2000-05-07 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-book.c: Made a NULL callback just mean to not
- call back.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Reordered fields. Added a get_const function to get a constant
- string that persists until the simple is destroyed.
-
- * gui/component/Makefile.am: Added e-addressbook-model.c and
- e-addressbook-model.h and all of the libraries and includes that
- they are dependent on.
-
- * gui/component/addressbook-factory.c: Initialize e cursors.
-
- * gui/component/addressbook.c: Added inactive code to display an
- ETable view of the addressbook.
-
- * gui/component/e-addressbook-model.c,
- gui/component/e-addressbook-model.h: New files to implement an
- ETable model with a EBook back end.
-
-2000-05-06 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- Mostly finished ECardSimple.
-
- * contact-editor/e-contact-editor.c: Changed this to match with
- some of the changes to ECardSimple.
-
- * gui/component/addressbook.c: Changed this to look for
- "addressbook.db" in the given directory if it doesn't find the
- file "uri".
-
- * gui/minicard/e-minicard.c, gui/minicard/e-minicard.h: Changed
- this to use ECardSimple.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/.cvsignore: ignore evolution-addressbook.pure
-
- * gui/component/Makefile.am: add support for generating
- evolution-addressbook.pure.
-
-2000-05-06 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_load_uri): if a
- port isn't specified in the uri default to 389.
-
-2000-05-06 Christopher James Lahey <clahey@helixcode.com>
-
- * gui/component/addressbook.c: Made this take a uri through its
- property bag.
-
-2000-05-05 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added e-card-simple.c and
- e-card-simple.h.
-
- * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h:
- New card wrapper class to simplify things.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Changed e-contact-editor to use
- ECardSimple a bit.
-
-2000-05-03 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/addressbook.c (control_deactivate): #ifdef
- HAVE_LDAP the ldap specific stuff.
- (null_cb): same.
- (control_activate): same.
-
-2000-05-02 Ettore Perazzoli <ettore@helixcode.com>
-
- * backend/ebook/Makefile.am (INCLUDES): Add
- `-I$(top_srcdir)/addressbook/ename'.
-
-2000-05-02 Matt Loper <matt@helixcode.com>
-
- * demo/Makefile.am: set G_LOG_DOMAIN.
- * printing/Makefile.am: same.
-
-2000-05-01 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-book-factory.c: Add back in the
- CORBA_Object_release.
-
- * backend/pas/pas-book.c: Properly duplicate and release the
- listener passed to us.
-
-2000-05-01 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/pas/pas-backend-file.c, backend/pas/pas-backend-ldap.c:
- Made uri slightly better managed.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_process_request): Remove this
- CORBA_Object_release that causes things not to work. This is just
- a temporary fix until we figure out what's actually wrong.
-
- * backend/pas/pas-book.c: Fixed a copy and paste error in a warning.
-
-2000-05-01 Christopher James Lahey <clahey@helixcode.com>
-
- * Makefile.am: Switched the subdirs order since backend depends on
- ename.
-
-2000-05-01 Larry Ewing <lewing@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_remove_client):
- fix a typo in the for loop.
-
-2000-05-01 Michael Meeks <michael@helixcode.com>
-
- * backend/pas/pas-book-factory.c: include gtk.
-
-2000-04-30 Federico Mena Quintero <federico@helixcode.com>
-
- * backend/ebook/e-book-types.h (EBookStatus): Added new status
- values for the IDL stuff.
-
- * backend/pas/pas-book-factory.h (PASBookFactoryClass): New
- "last_book_gone" signal.
-
- * backend/pas/pas-book-factory.c
- (pas_book_factory_launch_backend): Better error handling.
- (pas_book_factory_process_queue): Let
- pas_book_factory_process_request() free the request.
- (pas_book_factory_process_request): Free the request here.
- Perform better error handling.
- (free_active_server_map_entry): Free an active server map entry;
- free the URI key and unref the backend value. This function was
- renamed; the old one was trying to CORBA_Object_unref() a GTK+
- object!
- (remove_backends_entry): Free a backend table entry; free the URI
- key.
- (backend_last_client_gone_cb): Remove the backend from the active
- server map and emit the "last_book_gone" signal if appropriate.
- (pas_book_factory_get_n_backends): New function to query the
- number of running backends in an addressbook factory.
-
- * backend/idl/addressbook.idl (BookListener::CallStatus): Added a
- ProtocolNotSupported code. This is for when the addressbook
- factory cannot find a provider for the requested URI.
-
- * backend/pas/pas-backend.h (PASBackendClass): New
- "last_client_gone" signal.
- (PASBackendClass): New get_uri virtual method.
-
- * backend/pas/pas-backend.c (pas_backend_load_uri): Return a
- gboolean success code.
- (pas_backend_add_client): Return a gboolean success code.
- (pas_backend_last_client_gone): New function used by backend
- implementations to notify upwards when the backend's last client
- is destroyed.
- (pas_backend_get_uri): New function to get the URI of a backend.
-
- * backend/pas/pas-backend-file.c (pas_backend_file_add_client):
- Pass the backend as the closure data to the "destroy" handler of
- the book. We cannot call pas_book_get_backend() in the callback
- since the book's private data has already been destroyed when the
- callback is invoked. Alternatively, we could move the private
- data destruction step to the book's ::finalize() method.
- (pas_backend_file_book_destroy_cb): Get the backend from the
- callback's data, not from the book.
- (pas_backend_file_remove_client): Remove the book from the list of
- clients. When all clients go away, call
- pas_backend_last_client_gone().
- (PASBackendFilePrivate): Added an uri field.
- (pas_backend_file_get_uri): Implement the get_uri method.
- (pas_backend_file_load_uri): Return a gboolean success code.
- Also, store the URI in the private structure.
- (pas_backend_file_add_client): Return a gboolean success code.
- Also, call pas_backend_last_client_gone() if appropriate.
- (pas_backend_file_destroy): Free the bf->priv->uri.
-
- * backend/pas/pas-backend-ldap.c (pas_backend_ldap_add_client):
- Pass the backend as the closure data to the "destroy" handler of
- the book. See above for rationale.
- (pas_backend_ldap_book_destroy_cb): Get the backend from the
- callback's data.
- (pas_backend_ldap_remove_client): Remove the book from the list of
- clients. When all clients go away, call
- pas_backend_last_client_gone().
- (pas_backend_ldap_load_uri): Return a gboolean success code.
- (pas_backend_ldap_add_client): Return a gboolean success code.
- Also, call pas_backend_last_client_gone() if appropriate.
- (PASBackendLDAPPrivate): New uri field.
- (pas_backend_ldap_get_uri): Implement the get_uri method.
- (pas_backend_ldap_load_uri): Store the uri in the private
- structure.
- (pas_backend_ldap_destroy): Free the bl->priv->uri.
-
-2000-04-30 Chris Toshok <toshok@helixcode.com>
-
- * gui/component/Makefile.am (evolution_addressbook_SOURCES): added
- e-ldap-server-dialog.c
- (glade_DATA): added ldap-server-dialog.glade
-
- * gui/component/ldap-server-dialog.glade: new file.
-
- * gui/component/e-ldap-server-dialog.h: new file.
-
- * gui/component/e-ldap-server-dialog.c: new file, contains logic
- associated with ldap server dialog.
-
- * gui/component/addressbook.c (control_deactivate): remove the
- directory server menu item.
- (null_cb): do nothing callback for e_book_load_uri call. should
- change to (at the very least) pop up a dialog if there was an
- error.
- (new_server_cb): new function - really just switches to a
- particular ldap server, since the information isn't saved
- anywhere.
- (control_activate): add directory server menu item.
-
-2000-04-30 Chris Toshok <toshok@helixcode.com>
-
- * backend/ebook/e-book.c (e_book_load_uri): create the book
- listener here, since it's destroyed in unload_uri.
- (e_book_construct): remove the book listener construction here.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/.cvsignore: Added load-pine-addressbook.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor.c, gui/minicard/e-minicard.c: Made
- some fields invisible that were visible before.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c: Make file as not have the : after it if
- it's empty. If there's no name, or file_as, fill in these fields
- with defaults based on full_name or name respectively.
-
- * backend/ebook/load-pine-addressbook.c: New file to do import of
- pine .addressbook files.
-
- * backend/pas/pas-backend-file.c: Made empty fields act as the
- empty string for searches.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Made the File As field update
- properly as you edit the name and company fields. Added the pull
- down list of File As choices. Made sure that all fields will
- be set to NULL if they are deleted to the empty string.
-
- * gui/minicard/e-minicard.c: Use the File As field instead of the
- Full Name field for the header. Make identical compares on the
- File As field do a compare on the uid.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor-fullname.c,
- contact-editor/fullname.glade: Fixed a string mismatch.
-
-2000-04-30 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/Makefile.am: Added ename includes and libs.
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- e_card_name_from_string. Added header for
- e_card_delivery_address_from_string, even though it's not
- implemented yet.
-
- * contact-editor/Makefile.am: Removed the ename includes since we
- no longer use ename directly here.
-
- * contact-editor/e-contact-editor.c: Fixed this to properly save
- the address labels displayed. Updated this to use the function
- e_card_name_from_string instead of doing it by hand.
-
- * contact-editor/fullname-strings.h,
- contact-editor/fullname.glade: Deleted an unused field. Changed
- the set of prefixes and suffixes.
-
-2000-04-30 Chris Toshok <toshok@helixcode.com>
-
- * backend/pas/pas-backend-ldap.c
- (pas_backend_ldap_ensure_connected): add support for a rootdn in
- the uri.
- (pas_backend_ldap_build_all_cards_list): make use of the rootdn in
- the call to ldap_search_s.
- (pas_backend_ldap_search): same.
- (pas_backend_ldap_load_uri): get the rootdn out of the passed in uri.
-
-2000-04-29 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added
- e_card_phone_new e_card_delivery_address_new,
- e_card_delivery_address_to_string, e_card_name_copy,
- e_card_name_new, e_card_name_to_string, and made e_card_name_free
- public. Removed some unused code.
-
- * backend/pas/pas-backend-file.c: Fixed a warning.
-
- * contact-editor/Makefile.am: Added e-contact-editor-fullname.[ch]
- and fullname.glade. Added e-name libs and includes.
-
- * contact-editor/e-contact-editor-fullname.c,
- contact-editor/e-contact-editor-fullname.h,
- contact-editor/fullname-strings.h, contact-editor/fullname.glade:
- New dialog for editing the fields of a name separately.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Create an
- EContactEditorFullname when you click on the Full Name button.
- Maintain a parsed name at all times.
-
- * gui/component/Makefile.am, gui/minicard/Makefile.am: Added
- e-name libs.
-
-2000-04-28 Larry Ewing <lewing@helixcode.com>
-
- * backend/pas/pas-book-factory.c (register_factory): fix the
- `USING_OAF' changes so that they work for when we are not using
- oaf.
-
-2000-04-27 Ettore Perazzoli <ettore@helixcode.com>
-
- * ename/Makefile.am
- (gnome_libs): Use `BONOBO_GNOME_LIBS'.
- (INCLUDES): Add `-I$(srcdir)/..'.
-
- * backend/pas/pas-book-factory.c
- (register_factory): New function to register the factory.
- Implementation different according to `USING_OAF'.
- (pas_book_factory_activate): Use `register_factory()'.
-
- * gui/component/addressbook.c: New #define `CONTROL_FACTORY_ID',
- varying depending on whether we are `USING_OAF'.
- (addressbook_factory_init): Use `CONTROL_FACTORY_ID'.
-
- * backend/ebook/test-client.c (init_corba): New function,
- implemented differently according to the `USING_OAF' #define.
-
- * backend/ebook/e-book.c: New #define `CARDSERVER_OAF_ID'.
- (e_book_construct): Work with OAF #if `USING_OAF'.
-
- * backend/ebook/Makefile.am (gnome_libs): Removed.
- (corbadir): Removed.
- (ebook_libs): Removed.
- (test_client_LDADD): Just add `libebook.la'.
- (test_card_LDADD): Likewise.
- (test_client_list_LDADD): Likewise.
-
- * gui/component/addressbook-factory.c
- (init_corba): New helper function, implemented differently
- according to `USING_OAF'.
- (main): Call `init_corba()'.
-
-2000-04-27 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card.c, backend/ebook/e-card.h: Added file as,
- office, manager, assistant, spouse, and anniversary fields. These
- all use "X-EVOLUTION-" fields in the VCards.
-
- * backend/pas/pas-backend-file.c: Added all the new fields (except
- anniversary) to the list of fields.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Fixed some misnamed
- fields and fixed the placement of the comments field.
-
- * contact-editor/e-contact-editor.c: Made the newly added fields
- display properly.
-
- * Makefile.am: Added ename.
-
- * ename/e-name-western.h, ename/test-ename-western-gtk.c,
- ename/test-ename-western.c: Fixed up some #includes.
-
- * ename/.cvsignore: Added .cvsignore.
-
-2000-04-26 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-types.h, backend/ebook/e-card.c,
- backend/ebook/e-card.h: Added an address label field.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Got rid of some unused
- fields.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Added the address label field.
- Load only. Editing these fields seems to mess things up.
-
-2000-04-26 Christopher James Lahey <clahey@helixcode.com>
-
- * contact-editor/e-contact-editor.c: Added proper handling of the
- email field.
-
-2000-04-26 Christopher James Lahey <clahey@helixcode.com>
-
- * backend/ebook/e-card-types.h, backend/ebook/e-card.c,
- gui/minicard/e-minicard.c: Prefixed the ADDR_ flags.
-
- * contact-editor/contact-editor.glade,
- contact-editor/e-contact-editor-strings.h: Edited the glade file.
- Removed all the fields that we don't use.
-
- * contact-editor/e-contact-editor.c,
- contact-editor/e-contact-editor.h: Made the phone fields work
- properly. The address and email fields are temporarily turned off
- until they can be made to work as the phone fields do.
-
-2000-04-25 Ettore Perazzoli <ettore@helixcode.com>
-
- * gui/minicard/Makefile.am (INCLUDES): Use
- `$(BONOBO_GNOME_CFLAGS)'.
-
- * backend/pas/Makefile.am (idl_flags): Add `-I $(datadir)/idl' to
- pick up IDL files in the installation prefix as well.
- (INCLUDES): Use `$(BONOBO_GNOME_CFLAGS)'.
-
- * backend/ebook/Makefile.am (ORBIT_IDL): Use `-I $(datadir)/idl'
- to get the IDLs from the installation prefix as well.
- (INCLUDES): Add `$(BONOBO_GNOME_CFLAGS)'.
- (test_client_LDADD): Use `$(BONOBO_GNOME_LIBS)' instead of
- hardcoding `-lbonobo'! Also get rid of some other useless flags,
- as `$(BONOBO_GNOME_LIBS)' really has all what we need.
- (test_client_list_LDADD): Likewise.
- (test_card_LDADD): Likewise.
-
-2000-04-18 Federico Mena Quintero <federico@helixcode.com>
-
- * gui/minicard/Makefile.am (INCLUDES): Use "e-minicard" as the log
- domain.
-
- * gui/component/Makefile.am (INCLUDES): Use
- "evolution-addressbook" as the log domain.
-
- * backend/pas/Makefile.am: Build libpas.a, not a shared library.
- Do not install any header files.
- (INCLUDES): Remove spurious include paths.
-
- * backend/pas/*.[ch]: Fix includes.
-
- * backend/ebook/Makefile.am: Do not install the test programs.
- Fixed some include weirdness.
-
- * backend/ebook/*.[ch]: Fix includes.
-
- * contact-editor/Makefile.am (INCLUDES): Set the log domain to
- "contact-editor".
- (INCLUDES): Fix.
-
- * contact-editor/*.[ch]: Fix includes.
-
- * gui/minicard/*.[ch]: Fix includes.
-
- * ChangeLog: Started a ChangeLog here.
diff --git a/addressbook/E-CARD-NEEDED-FIELDS b/addressbook/E-CARD-NEEDED-FIELDS
deleted file mode 100644
index e227d1b130..0000000000
--- a/addressbook/E-CARD-NEEDED-FIELDS
+++ /dev/null
@@ -1,9 +0,0 @@
-I will add these fields as I get a chance to.
-
-Thanks,
- Chris Lahey
-
-X-EVOLUTION-LIST boolean if this is a mailing list.
-X-EVOLUTION-LIST-SHOW-ADDRESSES boolean whether to list all email addresses in the To: line or to treat the list kind of like a BCC.
-X-EVOLUTION-RELATED-CONTACTS EDestionationList of related contacts.
-REV last changed date. \ No newline at end of file
diff --git a/addressbook/Makefile.am b/addressbook/Makefile.am
deleted file mode 100644
index d0d48e5076..0000000000
--- a/addressbook/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-if ENABLE_PILOT_CONDUITS
-CONDUIT_SUBDIR=conduit
-endif
-
-SUBDIRS = \
- backend printing gui tools $(CONDUIT_SUBDIR)
-
-EXTRA_DIST = \
- ChangeLog.pre-1-4
diff --git a/addressbook/backend/.cvsignore b/addressbook/backend/.cvsignore
deleted file mode 100644
index 09980ae6ba..0000000000
--- a/addressbook/backend/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/backend/Makefile.am b/addressbook/backend/Makefile.am
deleted file mode 100644
index b2807b2480..0000000000
--- a/addressbook/backend/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = idl ebook pas
diff --git a/addressbook/backend/ebook/.cvsignore b/addressbook/backend/ebook/.cvsignore
deleted file mode 100644
index e3e9c805bb..0000000000
--- a/addressbook/backend/ebook/.cvsignore
+++ /dev/null
@@ -1,25 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-addressbook-stubs.c
-addressbook-skels.c
-addressbook-common.c
-addressbook.h
-test-card
-test-client
-test-client-list
-load-pine-addressbook
-load-gnomecard-addressbook
-evolution-vcard-importer
-evolution-gnomecard-importer
-evolution-ldif-importer
-GNOME_Evolution_Addressbook_VCard_Importer.server
-GNOME_Evolution_Addressbook_LDIF_Importer.server
-GNOME_Evolution_Addressbook_VCard_Importer.server.in
-GNOME_Evolution_Addressbook_LDIF_Importer.server.in
-e-book-marshal.c
-e-book-marshal.h
diff --git a/addressbook/backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in b/addressbook/backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in
deleted file mode 100644
index 392220d119..0000000000
--- a/addressbook/backend/ebook/GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in
+++ /dev/null
@@ -1,29 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_LDIF_ImporterFactory"
- type="exe"
- location="@LIBEXECDIR@/evolution-ldif-importer">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution LDIF importer"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_LDIF_Importer"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_LDIF_ImporterFactory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Importer:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution:menu_name" type="string"
- _value="LDAP Data Interchange Format (.ldif)"/>
- <oaf_attribute name="name" type="string"
- _value="Evolution LDIF importer"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in b/addressbook/backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in
deleted file mode 100644
index b630d31bec..0000000000
--- a/addressbook/backend/ebook/GNOME_Evolution_Addressbook_VCard_Importer.server.in.in
+++ /dev/null
@@ -1,29 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_VCard_ImporterFactory"
- type="exe"
- location="@LIBEXECDIR@/evolution-vcard-importer">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution VCard importer"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_VCard_Importer"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_VCard_ImporterFactory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Importer:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution:menu_name" type="string"
- _value="VCard (.vcf, .gcrd)"/>
- <oaf_attribute name="name" type="string"
- _value="Evolution VCard Importer"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am
deleted file mode 100644
index d79cd7abdc..0000000000
--- a/addressbook/backend/ebook/Makefile.am
+++ /dev/null
@@ -1,186 +0,0 @@
-noinst_PROGRAMS = test-card test-client test-client-list
-
-privlibexec_PROGRAMS = \
- evolution-vcard-importer \
- evolution-ldif-importer
-
-toolsdir = $(privlibexecdir)/
-tools_PROGRAMS = \
- load-pine-addressbook \
- load-gnomecard-addressbook
-
-# CORBA stuff
-
-CORBA_ADDRESSBOOK_SOURCE_H = \
- addressbook.h
-CORBA_ADDRESSBOOK_SOURCE_C = \
- addressbook-common.c \
- addressbook-stubs.c \
- addressbook-skels.c
-CORBA_ADDRESSBOOK_IDL = $(srcdir)/../idl/addressbook.idl
-
-$(CORBA_ADDRESSBOOK_SOURCE_H): $(CORBA_ADDRESSBOOK_IDL)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(CORBA_ADDRESSBOOK_IDL)
-
-$(CORBA_ADDRESSBOOK_SOURCE_C): $(CORBA_ADDRESSBOOK_SOURCE_H)
-
-CORBA_SOURCE_H = $(CORBA_ADDRESSBOOK_SOURCE_H)
-CORBA_SOURCE_C = $(CORBA_ADDRESSBOOK_SOURCE_C)
-CORBA_SOURCE = $(CORBA_SOURCE_H) $(CORBA_SOURCE_C)
-
-
-# The component
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DDATADIR=\"$(datadir)\" \
- -DLIBDIR=\"$(libdir)\" \
- -DG_LOG_DOMAIN=\"EBook\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/camel \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/ename \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_builddir)/addressbook/ename \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- -DG_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-privlib_LTLIBRARIES = libebook.la libebook-static.la
-
-# Make sure the libraries are not built in parallel when using a parallel make;
-# libtool can't handle that.
-libebook_static_la_DEPENDENCIES = libebook.la
-
-libebook_la_SOURCES = \
- $(CORBA_SOURCE) \
- e-book-listener.c \
- e-book-marshal.c \
- e-book-view-listener.c \
- e-book-view.c \
- e-book.c \
- e-book-util.c \
- e-card-cursor.c \
- e-card-simple.c \
- e-card.c \
- e-card-compare.c \
- e-destination.c
-
-libebook_la_LIBADD = \
- $(top_builddir)/libversit/libversit.la \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/e-util/libeutil.la
-
-libebookincludedir = $(privincludedir)/ebook
-
-libebookinclude_HEADERS = \
- e-book-listener.h \
- e-book-types.h \
- e-book-view-listener.h \
- e-book-view.h \
- e-book.h \
- e-book-util.h \
- e-card-cursor.h \
- e-card-simple.h \
- e-card-types.h \
- e-card.h \
- e-card-compare.h \
- e-destination.h \
- addressbook.h
-
-
-#
-# make a static library for use by addressbook's conduit's shared library
-#
-libebook_static_la_SOURCES = $(libebook_la_SOURCES)
-libebook_static_la_LDFLAGS = -all-static
-
-# GLib marshalling cruft
-
-e-book-marshal.h: e-book-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=e_book_marshal e-book-marshal.list --header > e-book-marshal.h.tmp \
- && mv e-book-marshal.h.tmp e-book-marshal.h ) \
- || ( rm -f e-book-marshal.h.tmp && exit 1 )
-
-e-book-marshal.c: e-book-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=e_book_marshal e-book-marshal.list --body > e-book-marshal.c.tmp \
- && mv e-book-marshal.c.tmp e-book-marshal.c ) \
- || ( rm -f e-book-marshal.c.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-book-marshal.c e-book-marshal.h
-
-test_client_SOURCES = \
- test-client.c
-
-test_client_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-test_client_list_SOURCES = \
- test-client-list.c
-
-test_client_list_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-test_card_SOURCES = \
- test-card.c
-
-test_card_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-evolution_vcard_importer_SOURCES = \
- evolution-vcard-importer.c
-
-evolution_vcard_importer_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/shell/importer/libevolution-importer.la \
- $(DB3_LDADD)
-
-evolution_ldif_importer_SOURCES = \
- evolution-ldif-importer.c
-
-evolution_ldif_importer_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) \
- $(top_builddir)/shell/importer/libevolution-importer.la \
- $(DB3_LDADD)
-
-load_pine_addressbook_SOURCES = \
- load-pine-addressbook.c
-
-load_pine_addressbook_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-load_gnomecard_addressbook_SOURCES = \
- load-gnomecard-addressbook.c
-
-load_gnomecard_addressbook_LDADD = \
- libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-
-BUILT_SOURCES = $(CORBA_SOURCE) $(MARSHAL_GENERATED) $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
-server_in_files = GNOME_Evolution_Addressbook_VCard_Importer.server.in.in \
- GNOME_Evolution_Addressbook_LDIF_Importer.server.in.in
-
-server_DATA = $(server_in_files:.server.in.in=.server)
-%.server.in: %.server.in.in
- sed -e "s|\@LIBEXECDIR\@|$(privlibexecdir)|" $< > $@
-
-
-@INTLTOOL_SERVER_RULE@
-
-EXTRA_DIST = $(server_in_files) $(server_DATA) e-book-marshal.list
diff --git a/addressbook/backend/ebook/TODO b/addressbook/backend/ebook/TODO
deleted file mode 100644
index a69703cd92..0000000000
--- a/addressbook/backend/ebook/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-* Make sure open_book_progress does not use the EBook op queue; make
- sure it works.
diff --git a/addressbook/backend/ebook/docs/rfc2047.txt b/addressbook/backend/ebook/docs/rfc2047.txt
deleted file mode 100644
index ff9a744bf3..0000000000
--- a/addressbook/backend/ebook/docs/rfc2047.txt
+++ /dev/null
@@ -1,843 +0,0 @@
-
-
-
-
-
-
-Network Working Group K. Moore
-Request for Comments: 2047 University of Tennessee
-Obsoletes: 1521, 1522, 1590 November 1996
-Category: Standards Track
-
-
- MIME (Multipurpose Internet Mail Extensions) Part Three:
- Message Header Extensions for Non-ASCII Text
-
-Status of this Memo
-
- This document specifies an Internet standards track protocol for the
- Internet community, and requests discussion and suggestions for
- improvements. Please refer to the current edition of the "Internet
- Official Protocol Standards" (STD 1) for the standardization state
- and status of this protocol. Distribution of this memo is unlimited.
-
-Abstract
-
- STD 11, RFC 822, defines a message representation protocol specifying
- considerable detail about US-ASCII message headers, and leaves the
- message content, or message body, as flat US-ASCII text. This set of
- documents, collectively called the Multipurpose Internet Mail
- Extensions, or MIME, redefines the format of messages to allow for
-
- (1) textual message bodies in character sets other than US-ASCII,
-
- (2) an extensible set of different formats for non-textual message
- bodies,
-
- (3) multi-part message bodies, and
-
- (4) textual header information in character sets other than US-ASCII.
-
- These documents are based on earlier work documented in RFC 934, STD
- 11, and RFC 1049, but extends and revises them. Because RFC 822 said
- so little about message bodies, these documents are largely
- orthogonal to (rather than a revision of) RFC 822.
-
- This particular document is the third document in the series. It
- describes extensions to RFC 822 to allow non-US-ASCII text data in
- Internet mail header fields.
-
-
-
-
-
-
-
-
-
-Moore Standards Track [Page 1]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- Other documents in this series include:
-
- + RFC 2045, which specifies the various headers used to describe
- the structure of MIME messages.
-
- + RFC 2046, which defines the general structure of the MIME media
- typing system and defines an initial set of media types,
-
- + RFC 2048, which specifies various IANA registration procedures
- for MIME-related facilities, and
-
- + RFC 2049, which describes MIME conformance criteria and
- provides some illustrative examples of MIME message formats,
- acknowledgements, and the bibliography.
-
- These documents are revisions of RFCs 1521, 1522, and 1590, which
- themselves were revisions of RFCs 1341 and 1342. An appendix in RFC
- 2049 describes differences and changes from previous versions.
-
-1. Introduction
-
- RFC 2045 describes a mechanism for denoting textual body parts which
- are coded in various character sets, as well as methods for encoding
- such body parts as sequences of printable US-ASCII characters. This
- memo describes similar techniques to allow the encoding of non-ASCII
- text in various portions of a RFC 822 [2] message header, in a manner
- which is unlikely to confuse existing message handling software.
-
- Like the encoding techniques described in RFC 2045, the techniques
- outlined here were designed to allow the use of non-ASCII characters
- in message headers in a way which is unlikely to be disturbed by the
- quirks of existing Internet mail handling programs. In particular,
- some mail relaying programs are known to (a) delete some message
- header fields while retaining others, (b) rearrange the order of
- addresses in To or Cc fields, (c) rearrange the (vertical) order of
- header fields, and/or (d) "wrap" message headers at different places
- than those in the original message. In addition, some mail reading
- programs are known to have difficulty correctly parsing message
- headers which, while legal according to RFC 822, make use of
- backslash-quoting to "hide" special characters such as "<", ",", or
- ":", or which exploit other infrequently-used features of that
- specification.
-
- While it is unfortunate that these programs do not correctly
- interpret RFC 822 headers, to "break" these programs would cause
- severe operational problems for the Internet mail system. The
- extensions described in this memo therefore do not rely on little-
- used features of RFC 822.
-
-
-
-Moore Standards Track [Page 2]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- Instead, certain sequences of "ordinary" printable ASCII characters
- (known as "encoded-words") are reserved for use as encoded data. The
- syntax of encoded-words is such that they are unlikely to
- "accidentally" appear as normal text in message headers.
- Furthermore, the characters used in encoded-words are restricted to
- those which do not have special meanings in the context in which the
- encoded-word appears.
-
- Generally, an "encoded-word" is a sequence of printable ASCII
- characters that begins with "=?", ends with "?=", and has two "?"s in
- between. It specifies a character set and an encoding method, and
- also includes the original text encoded as graphic ASCII characters,
- according to the rules for that encoding method.
-
- A mail composer that implements this specification will provide a
- means of inputting non-ASCII text in header fields, but will
- translate these fields (or appropriate portions of these fields) into
- encoded-words before inserting them into the message header.
-
- A mail reader that implements this specification will recognize
- encoded-words when they appear in certain portions of the message
- header. Instead of displaying the encoded-word "as is", it will
- reverse the encoding and display the original text in the designated
- character set.
-
-NOTES
-
- This memo relies heavily on notation and terms defined RFC 822 and
- RFC 2045. In particular, the syntax for the ABNF used in this memo
- is defined in RFC 822, as well as many of the terminal or nonterminal
- symbols from RFC 822 are used in the grammar for the header
- extensions defined here. Among the symbols defined in RFC 822 and
- referenced in this memo are: 'addr-spec', 'atom', 'CHAR', 'comment',
- 'CTLs', 'ctext', 'linear-white-space', 'phrase', 'quoted-pair'.
- 'quoted-string', 'SPACE', and 'word'. Successful implementation of
- this protocol extension requires careful attention to the RFC 822
- definitions of these terms.
-
- When the term "ASCII" appears in this memo, it refers to the "7-Bit
- American Standard Code for Information Interchange", ANSI X3.4-1986.
- The MIME charset name for this character set is "US-ASCII". When not
- specifically referring to the MIME charset name, this document uses
- the term "ASCII", both for brevity and for consistency with RFC 822.
- However, implementors are warned that the character set name must be
- spelled "US-ASCII" in MIME message and body part headers.
-
-
-
-
-
-
-Moore Standards Track [Page 3]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- This memo specifies a protocol for the representation of non-ASCII
- text in message headers. It specifically DOES NOT define any
- translation between "8-bit headers" and pure ASCII headers, nor is
- any such translation assumed to be possible.
-
-2. Syntax of encoded-words
-
- An 'encoded-word' is defined by the following ABNF grammar. The
- notation of RFC 822 is used, with the exception that white space
- characters MUST NOT appear between components of an 'encoded-word'.
-
- encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
-
- charset = token ; see section 3
-
- encoding = token ; see section 4
-
- token = 1*<Any CHAR except SPACE, CTLs, and especials>
-
- especials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "
- <"> / "/" / "[" / "]" / "?" / "." / "="
-
- encoded-text = 1*<Any printable ASCII character other than "?"
- or SPACE>
- ; (but see "Use of encoded-words in message
- ; headers", section 5)
-
- Both 'encoding' and 'charset' names are case-independent. Thus the
- charset name "ISO-8859-1" is equivalent to "iso-8859-1", and the
- encoding named "Q" may be spelled either "Q" or "q".
-
- An 'encoded-word' may not be more than 75 characters long, including
- 'charset', 'encoding', 'encoded-text', and delimiters. If it is
- desirable to encode more text than will fit in an 'encoded-word' of
- 75 characters, multiple 'encoded-word's (separated by CRLF SPACE) may
- be used.
-
- While there is no limit to the length of a multiple-line header
- field, each line of a header field that contains one or more
- 'encoded-word's is limited to 76 characters.
-
- The length restrictions are included both to ease interoperability
- through internetwork mail gateways, and to impose a limit on the
- amount of lookahead a header parser must employ (while looking for a
- final ?= delimiter) before it can decide whether a token is an
- "encoded-word" or something else.
-
-
-
-
-
-Moore Standards Track [Page 4]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- IMPORTANT: 'encoded-word's are designed to be recognized as 'atom's
- by an RFC 822 parser. As a consequence, unencoded white space
- characters (such as SPACE and HTAB) are FORBIDDEN within an
- 'encoded-word'. For example, the character sequence
-
- =?iso-8859-1?q?this is some text?=
-
- would be parsed as four 'atom's, rather than as a single 'atom' (by
- an RFC 822 parser) or 'encoded-word' (by a parser which understands
- 'encoded-words'). The correct way to encode the string "this is some
- text" is to encode the SPACE characters as well, e.g.
-
- =?iso-8859-1?q?this=20is=20some=20text?=
-
- The characters which may appear in 'encoded-text' are further
- restricted by the rules in section 5.
-
-3. Character sets
-
- The 'charset' portion of an 'encoded-word' specifies the character
- set associated with the unencoded text. A 'charset' can be any of
- the character set names allowed in an MIME "charset" parameter of a
- "text/plain" body part, or any character set name registered with
- IANA for use with the MIME text/plain content-type.
-
- Some character sets use code-switching techniques to switch between
- "ASCII mode" and other modes. If unencoded text in an 'encoded-word'
- contains a sequence which causes the charset interpreter to switch
- out of ASCII mode, it MUST contain additional control codes such that
- ASCII mode is again selected at the end of the 'encoded-word'. (This
- rule applies separately to each 'encoded-word', including adjacent
- 'encoded-word's within a single header field.)
-
- When there is a possibility of using more than one character set to
- represent the text in an 'encoded-word', and in the absence of
- private agreements between sender and recipients of a message, it is
- recommended that members of the ISO-8859-* series be used in
- preference to other character sets.
-
-4. Encodings
-
- Initially, the legal values for "encoding" are "Q" and "B". These
- encodings are described below. The "Q" encoding is recommended for
- use when most of the characters to be encoded are in the ASCII
- character set; otherwise, the "B" encoding should be used.
- Nevertheless, a mail reader which claims to recognize 'encoded-word's
- MUST be able to accept either encoding for any character set which it
- supports.
-
-
-
-Moore Standards Track [Page 5]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- Only a subset of the printable ASCII characters may be used in
- 'encoded-text'. Space and tab characters are not allowed, so that
- the beginning and end of an 'encoded-word' are obvious. The "?"
- character is used within an 'encoded-word' to separate the various
- portions of the 'encoded-word' from one another, and thus cannot
- appear in the 'encoded-text' portion. Other characters are also
- illegal in certain contexts. For example, an 'encoded-word' in a
- 'phrase' preceding an address in a From header field may not contain
- any of the "specials" defined in RFC 822. Finally, certain other
- characters are disallowed in some contexts, to ensure reliability for
- messages that pass through internetwork mail gateways.
-
- The "B" encoding automatically meets these requirements. The "Q"
- encoding allows a wide range of printable characters to be used in
- non-critical locations in the message header (e.g., Subject), with
- fewer characters available for use in other locations.
-
-4.1. The "B" encoding
-
- The "B" encoding is identical to the "BASE64" encoding defined by RFC
- 2045.
-
-4.2. The "Q" encoding
-
- The "Q" encoding is similar to the "Quoted-Printable" content-
- transfer-encoding defined in RFC 2045. It is designed to allow text
- containing mostly ASCII characters to be decipherable on an ASCII
- terminal without decoding.
-
- (1) Any 8-bit value may be represented by a "=" followed by two
- hexadecimal digits. For example, if the character set in use
- were ISO-8859-1, the "=" character would thus be encoded as
- "=3D", and a SPACE by "=20". (Upper case should be used for
- hexadecimal digits "A" through "F".)
-
- (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be
- represented as "_" (underscore, ASCII 95.). (This character may
- not pass through some internetwork mail gateways, but its use
- will greatly enhance readability of "Q" encoded data with mail
- readers that do not support this encoding.) Note that the "_"
- always represents hexadecimal 20, even if the SPACE character
- occupies a different code position in the character set in use.
-
- (3) 8-bit values which correspond to printable ASCII characters other
- than "=", "?", and "_" (underscore), MAY be represented as those
- characters. (But see section 5 for restrictions.) In
- particular, SPACE and TAB MUST NOT be represented as themselves
- within encoded words.
-
-
-
-Moore Standards Track [Page 6]
-
-RFC 2047 Message Header Extensions November 1996
-
-
-5. Use of encoded-words in message headers
-
- An 'encoded-word' may appear in a message header or body part header
- according to the following rules:
-
-(1) An 'encoded-word' may replace a 'text' token (as defined by RFC 822)
- in any Subject or Comments header field, any extension message
- header field, or any MIME body part field for which the field body
- is defined as '*text'. An 'encoded-word' may also appear in any
- user-defined ("X-") message or body part header field.
-
- Ordinary ASCII text and 'encoded-word's may appear together in the
- same header field. However, an 'encoded-word' that appears in a
- header field defined as '*text' MUST be separated from any adjacent
- 'encoded-word' or 'text' by 'linear-white-space'.
-
-(2) An 'encoded-word' may appear within a 'comment' delimited by "(" and
- ")", i.e., wherever a 'ctext' is allowed. More precisely, the RFC
- 822 ABNF definition for 'comment' is amended as follows:
-
- comment = "(" *(ctext / quoted-pair / comment / encoded-word) ")"
-
- A "Q"-encoded 'encoded-word' which appears in a 'comment' MUST NOT
- contain the characters "(", ")" or "
- 'encoded-word' that appears in a 'comment' MUST be separated from
- any adjacent 'encoded-word' or 'ctext' by 'linear-white-space'.
-
- It is important to note that 'comment's are only recognized inside
- "structured" field bodies. In fields whose bodies are defined as
- '*text', "(" and ")" are treated as ordinary characters rather than
- comment delimiters, and rule (1) of this section applies. (See RFC
- 822, sections 3.1.2 and 3.1.3)
-
-(3) As a replacement for a 'word' entity within a 'phrase', for example,
- one that precedes an address in a From, To, or Cc header. The ABNF
- definition for 'phrase' from RFC 822 thus becomes:
-
- phrase = 1*( encoded-word / word )
-
- In this case the set of characters that may be used in a "Q"-encoded
- 'encoded-word' is restricted to: <upper and lower case ASCII
- letters, decimal digits, "!", "*", "+", "-", "/", "=", and "_"
- (underscore, ASCII 95.)>. An 'encoded-word' that appears within a
- 'phrase' MUST be separated from any adjacent 'word', 'text' or
- 'special' by 'linear-white-space'.
-
-
-
-
-
-
-Moore Standards Track [Page 7]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- These are the ONLY locations where an 'encoded-word' may appear. In
- particular:
-
- + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'.
-
- + An 'encoded-word' MUST NOT appear within a 'quoted-string'.
-
- + An 'encoded-word' MUST NOT be used in a Received header field.
-
- + An 'encoded-word' MUST NOT be used in parameter of a MIME
- Content-Type or Content-Disposition field, or in any structured
- field body except within a 'comment' or 'phrase'.
-
- The 'encoded-text' in an 'encoded-word' must be self-contained;
- 'encoded-text' MUST NOT be continued from one 'encoded-word' to
- another. This implies that the 'encoded-text' portion of a "B"
- 'encoded-word' will be a multiple of 4 characters long; for a "Q"
- 'encoded-word', any "=" character that appears in the 'encoded-text'
- portion will be followed by two hexadecimal characters.
-
- Each 'encoded-word' MUST encode an integral number of octets. The
- 'encoded-text' in each 'encoded-word' must be well-formed according
- to the encoding specified; the 'encoded-text' may not be continued in
- the next 'encoded-word'. (For example, "=?charset?Q?=?=
- =?charset?Q?AB?=" would be illegal, because the two hex digits "AB"
- must follow the "=" in the same 'encoded-word'.)
-
- Each 'encoded-word' MUST represent an integral number of characters.
- A multi-octet character may not be split across adjacent 'encoded-
- word's.
-
- Only printable and white space character data should be encoded using
- this scheme. However, since these encoding schemes allow the
- encoding of arbitrary octet values, mail readers that implement this
- decoding should also ensure that display of the decoded data on the
- recipient's terminal will not cause unwanted side-effects.
-
- Use of these methods to encode non-textual data (e.g., pictures or
- sounds) is not defined by this memo. Use of 'encoded-word's to
- represent strings of purely ASCII characters is allowed, but
- discouraged. In rare cases it may be necessary to encode ordinary
- text that looks like an 'encoded-word'.
-
-
-
-
-
-
-
-
-
-Moore Standards Track [Page 8]
-
-RFC 2047 Message Header Extensions November 1996
-
-
-6. Support of 'encoded-word's by mail readers
-
-6.1. Recognition of 'encoded-word's in message headers
-
- A mail reader must parse the message and body part headers according
- to the rules in RFC 822 to correctly recognize 'encoded-word's.
-
- 'encoded-word's are to be recognized as follows:
-
- (1) Any message or body part header field defined as '*text', or any
- user-defined header field, should be parsed as follows: Beginning
- at the start of the field-body and immediately following each
- occurrence of 'linear-white-space', each sequence of up to 75
- printable characters (not containing any 'linear-white-space')
- should be examined to see if it is an 'encoded-word' according to
- the syntax rules in section 2. Any other sequence of printable
- characters should be treated as ordinary ASCII text.
-
- (2) Any header field not defined as '*text' should be parsed
- according to the syntax rules for that header field. However,
- any 'word' that appears within a 'phrase' should be treated as an
- 'encoded-word' if it meets the syntax rules in section 2.
- Otherwise it should be treated as an ordinary 'word'.
-
- (3) Within a 'comment', any sequence of up to 75 printable characters
- (not containing 'linear-white-space'), that meets the syntax
- rules in section 2, should be treated as an 'encoded-word'.
- Otherwise it should be treated as normal comment text.
-
- (4) A MIME-Version header field is NOT required to be present for
- 'encoded-word's to be interpreted according to this
- specification. One reason for this is that the mail reader is
- not expected to parse the entire message header before displaying
- lines that may contain 'encoded-word's.
-
-6.2. Display of 'encoded-word's
-
- Any 'encoded-word's so recognized are decoded, and if possible, the
- resulting unencoded text is displayed in the original character set.
-
- NOTE: Decoding and display of encoded-words occurs *after* a
- structured field body is parsed into tokens. It is therefore
- possible to hide 'special' characters in encoded-words which, when
- displayed, will be indistinguishable from 'special' characters in the
- surrounding text. For this and other reasons, it is NOT generally
- possible to translate a message header containing 'encoded-word's to
- an unencoded form which can be parsed by an RFC 822 mail reader.
-
-
-
-
-Moore Standards Track [Page 9]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- When displaying a particular header field that contains multiple
- 'encoded-word's, any 'linear-white-space' that separates a pair of
- adjacent 'encoded-word's is ignored. (This is to allow the use of
- multiple 'encoded-word's to represent long strings of unencoded text,
- without having to separate 'encoded-word's where spaces occur in the
- unencoded text.)
-
- In the event other encodings are defined in the future, and the mail
- reader does not support the encoding used, it may either (a) display
- the 'encoded-word' as ordinary text, or (b) substitute an appropriate
- message indicating that the text could not be decoded.
-
- If the mail reader does not support the character set used, it may
- (a) display the 'encoded-word' as ordinary text (i.e., as it appears
- in the header), (b) make a "best effort" to display using such
- characters as are available, or (c) substitute an appropriate message
- indicating that the decoded text could not be displayed.
-
- If the character set being used employs code-switching techniques,
- display of the encoded text implicitly begins in "ASCII mode". In
- addition, the mail reader must ensure that the output device is once
- again in "ASCII mode" after the 'encoded-word' is displayed.
-
-6.3. Mail reader handling of incorrectly formed 'encoded-word's
-
- It is possible that an 'encoded-word' that is legal according to the
- syntax defined in section 2, is incorrectly formed according to the
- rules for the encoding being used. For example:
-
- (1) An 'encoded-word' which contains characters which are not legal
- for a particular encoding (for example, a "-" in the "B"
- encoding, or a SPACE or HTAB in either the "B" or "Q" encoding),
- is incorrectly formed.
-
- (2) Any 'encoded-word' which encodes a non-integral number of
- characters or octets is incorrectly formed.
-
- A mail reader need not attempt to display the text associated with an
- 'encoded-word' that is incorrectly formed. However, a mail reader
- MUST NOT prevent the display or handling of a message because an
- 'encoded-word' is incorrectly formed.
-
-7. Conformance
-
- A mail composing program claiming compliance with this specification
- MUST ensure that any string of non-white-space printable ASCII
- characters within a '*text' or '*ctext' that begins with "=?" and
- ends with "?=" be a valid 'encoded-word'. ("begins" means: at the
-
-
-
-Moore Standards Track [Page 10]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- start of the field-body, immediately following 'linear-white-space',
- or immediately following a "(" for an 'encoded-word' within '*ctext';
- "ends" means: at the end of the field-body, immediately preceding
- 'linear-white-space', or immediately preceding a ")" for an
- 'encoded-word' within '*ctext'.) In addition, any 'word' within a
- 'phrase' that begins with "=?" and ends with "?=" must be a valid
- 'encoded-word'.
-
- A mail reading program claiming compliance with this specification
- must be able to distinguish 'encoded-word's from 'text', 'ctext', or
- 'word's, according to the rules in section 6, anytime they appear in
- appropriate places in message headers. It must support both the "B"
- and "Q" encodings for any character set which it supports. The
- program must be able to display the unencoded text if the character
- set is "US-ASCII". For the ISO-8859-* character sets, the mail
- reading program must at least be able to display the characters which
- are also in the ASCII set.
-
-8. Examples
-
- The following are examples of message headers containing 'encoded-
- word's:
-
- From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>
- To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
- CC: =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
- Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
- =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
-
- Note: In the first 'encoded-word' of the Subject field above, the
- last "=" at the end of the 'encoded-text' is necessary because each
- 'encoded-word' must be self-contained (the "=" character completes a
- group of 4 base64 characters representing 2 octets). An additional
- octet could have been encoded in the first 'encoded-word' (so that
- the encoded-word would contain an exact multiple of 3 encoded
- octets), except that the second 'encoded-word' uses a different
- 'charset' than the first one.
-
- From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>
- To: ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se
- Subject: Time for ISO 10646?
-
- To: Dave Crocker <dcrocker@mordor.stanford.edu>
- Cc: ietf-822@dimacs.rutgers.edu, paf@comsol.se
- From: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@nada.kth.se>
- Subject: Re: RFC-HDR care and feeding
-
-
-
-
-
-Moore Standards Track [Page 11]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- From: Nathaniel Borenstein <nsb@thumper.bellcore.com>
- (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)
- To: Greg Vaudreuil <gvaudre@NRI.Reston.VA.US>, Ned Freed
- <ned@innosoft.com>, Keith Moore <moore@cs.utk.edu>
- Subject: Test of new header generator
- MIME-Version: 1.0
- Content-type: text/plain; charset=ISO-8859-1
-
- The following examples illustrate how text containing 'encoded-word's
- which appear in a structured field body. The rules are slightly
- different for fields defined as '*text' because "(" and ")" are not
- recognized as 'comment' delimiters. [Section 5, paragraph (1)].
-
- In each of the following examples, if the same sequence were to occur
- in a '*text' field, the "displayed as" form would NOT be treated as
- encoded words, but be identical to the "encoded form". This is
- because each of the encoded-words in the following examples is
- adjacent to a "(" or ")" character.
-
- encoded form displayed as
- ---------------------------------------------------------------------
- (=?ISO-8859-1?Q?a?=) (a)
-
- (=?ISO-8859-1?Q?a?= b) (a b)
-
- Within a 'comment', white space MUST appear between an
- 'encoded-word' and surrounding text. [Section 5,
- paragraph (2)]. However, white space is not needed between
- the initial "(" that begins the 'comment', and the
- 'encoded-word'.
-
-
- (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=) (ab)
-
- White space between adjacent 'encoded-word's is not
- displayed.
-
- (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=) (ab)
-
- Even multiple SPACEs between 'encoded-word's are ignored
- for the purpose of display.
-
- (=?ISO-8859-1?Q?a?= (ab)
- =?ISO-8859-1?Q?b?=)
-
- Any amount of linear-space-white between 'encoded-word's,
- even if it includes a CRLF followed by one or more SPACEs,
- is ignored for the purposes of display.
-
-
-
-Moore Standards Track [Page 12]
-
-RFC 2047 Message Header Extensions November 1996
-
-
- (=?ISO-8859-1?Q?a_b?=) (a b)
-
- In order to cause a SPACE to be displayed within a portion
- of encoded text, the SPACE MUST be encoded as part of the
- 'encoded-word'.
-
- (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=) (a b)
-
- In order to cause a SPACE to be displayed between two strings
- of encoded text, the SPACE MAY be encoded as part of one of
- the 'encoded-word's.
-
-9. References
-
- [RFC 822] Crocker, D., "Standard for the Format of ARPA Internet Text
- Messages", STD 11, RFC 822, UDEL, August 1982.
-
- [RFC 2049] Borenstein, N., and N. Freed, "Multipurpose Internet Mail
- Extensions (MIME) Part Five: Conformance Criteria and Examples",
- RFC 2049, November 1996.
-
- [RFC 2045] Borenstein, N., and N. Freed, "Multipurpose Internet Mail
- Extensions (MIME) Part One: Format of Internet Message Bodies",
- RFC 2045, November 1996.
-
- [RFC 2046] Borenstein N., and N. Freed, "Multipurpose Internet Mail
- Extensions (MIME) Part Two: Media Types", RFC 2046,
- November 1996.
-
- [RFC 2048] Freed, N., Klensin, J., and J. Postel, "Multipurpose
- Internet Mail Extensions (MIME) Part Four: Registration
- Procedures", RFC 2048, November 1996.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Moore Standards Track [Page 13]
-
-RFC 2047 Message Header Extensions November 1996
-
-
-10. Security Considerations
-
- Security issues are not discussed in this memo.
-
-11. Acknowledgements
-
- The author wishes to thank Nathaniel Borenstein, Issac Chan, Lutz
- Donnerhacke, Paul Eggert, Ned Freed, Andreas M. Kirchwitz, Olle
- Jarnefors, Mike Rosin, Yutaka Sato, Bart Schaefer, and Kazuhiko
- Yamamoto, for their helpful advice, insightful comments, and
- illuminating questions in response to earlier versions of this
- specification.
-
-12. Author's Address
-
- Keith Moore
- University of Tennessee
- 107 Ayres Hall
- Knoxville TN 37996-1301
-
- EMail: moore@cs.utk.edu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Moore Standards Track [Page 14]
-
-RFC 2047 Message Header Extensions November 1996
-
-
-Appendix - changes since RFC 1522 (in no particular order)
-
- + explicitly state that the MIME-Version is not requried to use
- 'encoded-word's.
-
- + add explicit note that SPACEs and TABs are not allowed within
- 'encoded-word's, explaining that an 'encoded-word' must look like an
- 'atom' to an RFC822 parser.values, to be precise).
-
- + add examples from Olle Jarnefors (thanks!) which illustrate how
- encoded-words with adjacent linear-white-space are displayed.
-
- + explicitly list terms defined in RFC822 and referenced in this memo
-
- + fix transcription typos that caused one or two lines and a couple of
- characters to disappear in the resulting text, due to nroff quirks.
-
- + clarify that encoded-words are allowed in '*text' fields in both
- RFC822 headers and MIME body part headers, but NOT as parameter
- values.
-
- + clarify the requirement to switch back to ASCII within the encoded
- portion of an 'encoded-word', for any charset that uses code switching
- sequences.
-
- + add a note about 'encoded-word's being delimited by "(" and ")"
- within a comment, but not in a *text (how bizarre!).
-
- + fix the Andre Pirard example to get rid of the trailing "_" after
- the =E9. (no longer needed post-1342).
-
- + clarification: an 'encoded-word' may appear immediately following
- the initial "(" or immediately before the final ")" that delimits a
- comment, not just adjacent to "(" and ")" *within* *ctext.
-
- + add a note to explain that a "B" 'encoded-word' will always have a
- multiple of 4 characters in the 'encoded-text' portion.
-
- + add note about the "=" in the examples
-
- + note that processing of 'encoded-word's occurs *after* parsing, and
- some of the implications thereof.
-
- + explicitly state that you can't expect to translate between
- 1522 and either vanilla 822 or so-called "8-bit headers".
-
- + explicitly state that 'encoded-word's are not valid within a
- 'quoted-string'.
-
-
-
-Moore Standards Track [Page 15]
-
diff --git a/addressbook/backend/ebook/docs/rfc2425.txt b/addressbook/backend/ebook/docs/rfc2425.txt
deleted file mode 100644
index 30fed9bc07..0000000000
--- a/addressbook/backend/ebook/docs/rfc2425.txt
+++ /dev/null
@@ -1,1851 +0,0 @@
-
-
-
-
-
-
-Network Working Group T. Howes
-Request for Comments: 2425 M. Smith
-Category: Standards Track Netscape Communications Corp.
- F. Dawson
- Lotus Development Corporation
- September 1998
-
-
- A MIME Content-Type for Directory Information
-
-Status of this Memo
-
- This document specifies an Internet standards track protocol for the
- Internet community, and requests discussion and suggestions for
- improvements. Please refer to the current edition of the "Internet
- Official Protocol Standards" (STD 1) for the standardization state
- and status of this protocol. Distribution of this memo is unlimited.
-
-Copyright Notice
-
- Copyright (C) The Internet Society (1998). All Rights Reserved.
-
-1. Abstract
-
- This document defines a MIME Content-Type for holding directory
- information. The definition is independent of any particular
- directory service or protocol. The text/directory Content-Type is
- defined for holding a variety of directory information, for example,
- name, or email address, or logo. The text/directory Content-Type can
- also be used as the root body part in a multipart/related Content-
- Type for handling more complicated situations, especially those in
- which non-textual information that already has a natural MIME
- representation, for example, a photograph or sound, is to be
- represented.
-
- The text/directory Content-Type defines a general framework and
- format for holding directory information in a simple "type:value"
- form. We refer to "type" in this context meaning a property or
- attribute with which the value is associated. Mechanisms are defined
- to specify alternate languages, encodings and other meta-information.
- This document also defines the procedure by which particular formats,
- called profiles, for carrying application-specific information within
- a text/directory Content-Type can be defined and registered, and the
- conventions such formats must follow. It is expected that other
- documents will be produced that define such formats for various
- applications (e.g., white pages).
-
-
-
-
-
-Howes, et. al. Standards Track [Page 1]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL" in this
- document are to be interpreted as described in [RFC-2119].
-
-2. Table of Contents
-
- Status of the Memo................................................ 1
- Copyright Notice.................................................. 1
- 1. Abstract...................................................... 1
- 2. Table of Contents............................................. 2
- 3. Need for a MIME Directory Type................................ 3
- 4. Overview...................................................... 4
- 5. The text/directory Content-Type............................... 4
- 5.1. MIME media type name........................................ 4
- 5.2. MIME subtype name........................................... 5
- 5.3. Required parameters......................................... 5
- 5.4. Optional parameters......................................... 5
- 5.5. Encoding considerations..................................... 5
- 5.6. Security considerations..................................... 6
- 5.7. Interoperability considerations............................. 6
- 5.8. Published specification..................................... 6
- 5.8.1. Line delimiting and folding............................... 6
- 5.8.2. ABNF content-type definition.............................. 7
- 5.8.3. Pre-defined Parameters.................................... 9
- 5.8.4. Pre-defined Value Types...................................11
- 5.9. Applications which use this media type......................14
- 5.10. Additional information.....................................14
- 5.11. Person & email address to contact for further information..14
- 5.12. Intended usage.............................................14
- 5.13. Author/Change controller...................................15
- 6. Predefined Types..............................................15
- 6.1. SOURCE Type Definition......................................15
- 6.2. NAME Type Definition........................................16
- 6.3. PROFILE Type Definition.....................................16
- 6.4. BEGIN Type Definition.......................................17
- 6.5. END Type Definition.........................................17
- 7. Use of the multipart/related Content-Type.....................18
- 8. Examples.......................................................18
- 8.1. Example 1...................................................19
- 8.2. Example 2...................................................19
- 8.3. Example 3...................................................20
- 8.4. Example 4...................................................21
- 9. Registration of new profiles..................................22
- 9.1. Define the profile..........................................22
- 9.2. Post the profile definition.................................23
- 9.3. Allow a comment period......................................23
- 9.4. Submit the profile for approval.............................23
- 10. Profile Change Control.......................................23
-
-
-
-Howes, et. al. Standards Track [Page 2]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- 11. Registration of new types....................................24
- 11.1. Define the type............................................24
- 11.2. Post the type definition...................................25
- 11.3. Allow a comment period.....................................25
- 11.4. Submit the type for approval...............................25
- 12. Type Change Control..........................................25
- 13. Registration of new parameters...............................26
- 13.1. Define the parameter.......................................26
- 13.2. Post the parameter definition..............................27
- 13.3. Allow a comment period.....................................27
- 13.4. Submit the parameter for approval..........................27
- 14. Parameter Change Control.....................................28
- 15. Registration of new value types..............................28
- 15.1. Define the value type......................................28
- 15.2. Post the value type definition.............................29
- 15.3. Allow a comment period.....................................29
- 15.4. Submit the value type for approval.........................29
- 16. Security Considerations......................................30
- 17. Acknowledgements..............................................30
- 18. References....................................................30
- 19. Authors' Addresses...........................................32
- 20. Full Copyright Statement......................................33
-
-3. Need for a MIME Directory Type
-
- For purposes of this document, a directory is a special-purpose
- database that contains typed information. A directory usually
- supports both read and search of the information it contains, and can
- support creation and modification of the information as well.
- Directory information is usually accessed far more often than it is
- updated. Directories can be local or global in scope. They can be
- distributed or centralized. The information they contain can be
- replicated, with weak or strong consistency requirements.
-
- There are several situations in which users of Internet mail might
- wish to exchange directory information: the email analogy of a
- "business card" exchange; the conveyance of directory information to
- a user having only email access to the Internet; the provision of
- machine-parseable address information when purchasing goods or
- services over the Internet; etc. As MIME [RFC-2045, RFC-2046] is
- used increasingly by other protocols, most notably HTTP, it can also
- be useful for these protocols to carry directory information in MIME
- format. Such a format, for example, could be used to represent URC
- (uniform resource characteristics) information about resources on the
- World Wide Web, or to provide a rudimentary directory service over
- HTTP.
-
-
-
-
-
-Howes, et. al. Standards Track [Page 3]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-4. Overview
-
- The scheme defined here for representing directory information in a
- MIME Content-Type has two parts. First, the text/directory Content-
- Type is defined for use in holding directory information within a
- single body part, for example name, title, or email address. In its
- simplest form, the format uses a "type:value" approach, which should
- be easily parseable by existing MIME implementations and
- understandable by users. More complicated situations can be
- represented also. This document defines the general form the
- information in the Content-Type should have, and the procedure by
- which specific types and values (properties) for particular
- applications can be defined. The framework is general enough to
- handle information from any number of end directory services,
- including LDAP [RFC-1777, RFC-1778], WHOIS++ [RFC-1835], and X.500
- [X500].
-
- Directory entries can include far more than just textual information.
- Some such information (e.g., an image or sound) overlaps with
- predefined MIME Content-Types. In these cases it can be desirable to
- include the information in its well-known MIME format. This situation
- is handled by using a multipart/related Content-Type as defined in
- [RFC-2112]. The root component of this type is a text/directory body
- part specifying any in-line information, and for information
- contained in other Content-Types, the Content-IDs (in URI form) of
- those parts.
-
- In some applications, it can be useful to include a pointer (e.g, a
- URI) to some directory information rather than the information
- itself. This document defines a general mechanism for accomplishing
- this.
-
-5. The text/directory Content-Type
-
- The text/directory Content-Type is used to hold basic directory
- information and URIs referencing other information, including other
- MIME body parts holding supplementary or non-textual directory
- information, such as an image or sound. It is defined as follows,
- using the MIME media type registration template from [RFC-2048].
-
- To: ietf-types@uninett.no
- Subject: Registration of MIME media type text/directory
-
-5.1. MIME media type name
-
- MIME media type name: text
-
-
-
-
-
-Howes, et. al. Standards Track [Page 4]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-5.2. MIME subtype name
-
- MIME subtype name: directory
-
-5.3. Required parameters
-
- Required parameters: charset
-
- The "charset" parameter is as defined in [RFC-2046] for other body
- parts. It is used to identify the default character set used within
- the body part.
-
-5.4. Optional parameters
-
- Optional parameters: profile
-
- The "profile" parameter is used to convey the type(s) of entity(ies)
- to which the directory information pertains and the likely set of
- information associated with the entity(ies). It is intended only as a
- guide to applications interpreting the information contained within
- the body part. It SHOULD NOT be used to exclude or require particular
- pieces of information unless a profile definition specifically calls
- for this behavior. Unless specifically forbidden by a particular
- profile definition, a text/directory content type can contain
- arbitrary attribute/value pairs.
-
- The value of the "profile" parameter is defined as follows. Profile
- names are case insensitive (i.e., the profile name "vCard" is the
- same as "VCARD" and "vcard" and "vcArD").
-
- profile = x-name / iana-token
-
- x-name = "x-" 1*(ALPHA / DIGIT / "-")
- ; Names beginning with "x-" or "X-" are
- ; reserved for experimental use not intended for released
- ; products, or for use in bilateral agreements.
-
- iana-token = <a publicly-defined extension token, registered
- with IANA, as specified in Section 9 of this
- document>
-
-5.5. Encoding considerations
-
- The default encoding is 8bit. Otherwise, as specified by the
- Content-Transfer-Encoding header field.
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 5]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-5.6. Security considerations
-
- Directory information can be public or it can be protected from
- unauthorized access by the directory service in which it resides.
- Once the information leaves its native service, there can be no
- guarantee that the same care will be taken by all services handling
- the information. Furthermore, this specification defines no access
- control mechanism by which information can be protected, or by which
- access control information can be conveyed. Note that the integrity
- and privacy of a text/directory body part can be protected by
- enclosing it within an appropriate MIME-based security mechanism.
-
-5.7. Interoperability considerations
-
- In order to make sense of directory information, applications must
- share a common understanding of the types of information contained
- within the Content-Type (the directory schema). This schema
- information is not defined in this document, but rather in companion
- documents (e.g., [MIME-VCARD]) that follow the requirements specified
- in this document, or in bilateral agreements between communicating
- parties.
-
-5.8. Published specification
-
- The text/directory Content-Type contains directory information,
- typically pertaining to a single directory entity or group of
- entities. The content consists of one or more lines in the format
- given below.
-
-5.8.1. Line delimiting and folding
-
- Individual lines within the MIME text/directory Content Type body are
- delimited by the [RFC-822] line break, which is a CRLF sequence
- (ASCII decimal 13, followed by ASCII decimal 10). Long logical lines
- of text can be split into a multiple-physical-line representation
- using the following folding technique.
-
- A logical line MAY be continued on the next physical line anywhere
- between two characters by inserting a CRLF immediately followed by a
- single white space character (space, ASCII decimal 32, or horizontal
- tab, ASCII decimal 9). At least one character must be present on the
- folded line. Any sequence of CRLF followed immediately by a single
- white space character is ignored (removed) when processing the
- content type. For example the line:
-
- DESCRIPTION:This is a long description that exists on a long line.
-
- Can be represented as:
-
-
-
-Howes, et. al. Standards Track [Page 6]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- DESCRIPTION:This is a long description
- that exists on a long line.
-
- It could also be represented as:
-
- DESCRIPTION:This is a long descrip
- tion that exists o
- n a long line.
-
- The process of moving from this folded multiple-line representation
- of a type definition to its single line representation is called
- unfolding. Unfolding is accomplished by regarding CRLF immediately
- followed by a white space character (namely HTAB ASCII decimal 9 or
- SPACE ASCII decimal 32) as equivalent to no characters at all (i.e.,
- the CRLF and single white space character are removed).
-
-5.8.2. ABNF content-type definition
-
- The following ABNF uses the notation of RFC 2234, which also defines
- CRLF, WSP, DQUOTE, VCHAR, ALPHA, and DIGIT. After the unfolding of
- any folded lines as described above, the syntax for a line of this
- content type is as follows:
-
- contentline = [group "."] name *(";" param) ":" value CRLF
- ; When parsing a content line, folded lines MUST first
- ; be unfolded according to the unfolding procedure
- ; described above.
- ; When generating a content line, lines longer than 75
- ; characters SHOULD be folded according to the folding
- ; procedure described above.
-
- group = 1*(ALPHA / DIGIT / "-")
-
- name = x-name / iana-token
-
- iana-token = 1*(ALPHA / DIGIT / "-")
- ; identifier registered with IANA
-
- x-name = "x-" 1*(ALPHA / DIGIT / "-")
- ; Names that begin with "x-" or "X-" are
- ; reserved for experimental use, not intended for released
- ; products, or for use in bilateral agreements.
-
- param = param-name "=" param-value *("," param-value)
-
- param-name = x-name / iana-token
-
- param-value = ptext / quoted-string
-
-
-
-Howes, et. al. Standards Track [Page 7]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- ptext = *SAFE-CHAR
-
- value = *VALUE-CHAR
- / valuespec ; valuespec defined in section 5.8.4
-
- quoted-string = DQUOTE *QSAFE-CHAR DQUOTE
-
- NON-ASCII = %x80-FF
- ; use restricted by charset parameter
- ; on outer MIME object (UTF-8 preferred)
-
- QSAFE-CHAR = WSP / %x21 / %x23-7E / NON-ASCII
- ; Any character except CTLs, DQUOTE
-
- SAFE-CHAR = WSP / %x21 / %x23-2B / %x2D-39 / %x3C-7E / NON-ASCII
- ; Any character except CTLs, DQUOTE, ";", ":", ","
-
- VALUE-CHAR = WSP / VCHAR / NON-ASCII
- ; any textual character
-
- A line that begins with a white space character is a continuation of
- the previous line, as described above. The white space character and
- immediately preceeding CRLF should be discarded when reconstructing
- the original line. Note that this line-folding convention differs
- from that found in RFC 822, in that the sequence <CRLF><WSP> found
- anywhere in the content indicates a continued line and should be
- removed.
-
- Various type names and the format of the corresponding values are
- defined as specified in Section 11. Specifications MAY impose
- ordering on the type constructs within a body part, though none is
- required by default. The various x-name constructs are used for
- bilaterally-agreed upon type names, parameter names and parameter
- values, or for use in experimental settings.
-
- Type names and parameter names are case insensitive (e.g., the type
- name "fn" is the same as "FN" and "Fn"). Parameter values MAY be case
- sensitive or case insensitive, depending on their definition.
-
- The group construct is used to group related attributes together.
- The group name is a syntactic convention used to indicate that all
- type names prefaced with the same group name SHOULD be grouped
- together when displayed by an application. It has no other
- significance. Implementations that do not understand or support
- grouping MAY simply strip off any text before a "." to the left of
- the type name and present the types and values as normal.
-
-
-
-
-
-Howes, et. al. Standards Track [Page 8]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Each attribute defined in the text/directory body MAY have multiple
- values, if allowed in the definition of the profile in which the
- attribute is used. The general rule for encoding multi-valued items
- is to simply create a new content line for each value (including the
- type name). However, it should be noted that some value types
- support encoding multiple values in a single content line by
- separating the values with a comma ",". This approach has been taken
- for several of the content types defined below (date, time, integer,
- float), for space-saving reasons.
-
-5.8.3. Pre-defined Parameters
-
- The following parameters and value types are defined for general use.
-
- predefined-param = encodingparm
- / valuetypeparm
- / languageparm
- / contextparm
-
- encodingparm = "encoding" "=" encodingtype
-
- encodingtype = "b" ; from RFC 2047
- / iana-token ; registered as described in
- ; section 15 of this document
-
- valuetypeparm = "value" "=" valuetype
-
- valuetype = "uri" ; genericurl from secion 5 of RFC 1738
- / "text"
- / "date"
- / "time"
- / "date-time" ; date time
- / "integer"
- / "boolean"
- / "float"
- / x-name
- / iana-token ; registered as described in
- ; section 15 of this document
-
- languageparm = "language" "=" Language-Tag
- ; Language-Tag is defined in section 2 of RFC 1766
-
- contextparm = "context" "=" context
-
- context = x-name
- / iana-token
-
-
-
-
-
-Howes, et. al. Standards Track [Page 9]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- The "language" type parameter is used to identify data in multiple
- languages. There is no concept of "default" language, except as
- specified by any "Content-Language" MIME header parameter that is
- present. The value of the "language" type parameter is a language
- tag as defined in Section 2 of [RFC-1766].
-
- The "context" type parameter is used to identify a context (e.g., a
- protocol) used in interpreting the value. This is used, for example,
- in the "source" type, defined below.
-
- The "encoding" type parameter is used to specify an alternate
- encoding for a value. If the value contains a CRLF, it must be
- encoded, since CRLF is used to separate lines in the content-type
- itself. Currently, only the "b" encoding is supported.
-
- The "b" encoding can also be useful for binary values that are mixed
- with other text information in the body part (e.g., a certificate).
- Using a per-value "b" encoding in this case leaves the other
- information in a more readable form. The encoded base 64 value can be
- split across multiple physical lines in the content type by using the
- line folding technique described above.
-
- The Content-Transfer-Encoding header field is used to specify the
- encoding used for the body part as a whole. The "encoding" type
- parameter is used to specify an encoding for a particular value
- (e.g., a certificate). In this case, the Content-Transfer-Encoding
- header might specify "8bit", while the one certificate value might
- specify an encoding of "b" via an "encoding=b" type parameter.
-
- The Content-Transfer-Encoding and the encodings of individual types
- given by the "encoding" type parameter are independent of one
- another. When encoding a text/directory body part for transmission,
- individual type encodings are performed first, then the entire body
- part is encoded according to the Content-Transfer-Encoding. When
- decoding a text/directory body part, the Content-Transfer-Encoding is
- decoded first, and then any individual types with an "encoding" type
- parameter are decoded.
-
- The "value" parameter is optional, and is used to identify the value
- type (data type) and format of the value. The use of these
- predefined formats is encouraged even if the value parameter is not
- explicity used. By defining a standard set of value types and their
- formats, existing parsing and processing code can be leveraged.
-
- Including the value type explicitly as part of each property provides
- an extra hint to keep parsing simple and support more generalized
- applications. For example a search engine would not have to know the
- particular value types for all of the items for which it is
-
-
-
-Howes, et. al. Standards Track [Page 10]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- searching. Because the value type is explicit in the definition, the
- search engine could look for dates in any item type and provide
- results that can still be interpreted.
-
-5.8.4. Pre-defined Value Types
-
- The format for values corresponding to the predefined valuetype
- specifications given above are defined.
-
- valuespec = text-list
- / genericurl ; from section 5 of RFC 1738
- / date-list
- / time-list
- / date-time-list
- / boolean
- / integer-list
- / float-list
- / iana-valuespec
-
- text-list = *TEXT-LIST-CHAR *("," *TEXT-LIST-CHAR)
-
- TEXT-LIST-CHAR = "\\" / "\," / "\n"
- / <any VALUE-CHAR except , or \ or newline>
- ; Backslashes, newlines, and commas must be encoded.
- ; \n or \N can be used to encode a newline.
-
- date-list = date *("," date)
-
- time-list = time *("," time)
-
- date-time-list = date "T" time *("," date "T" time)
-
- boolean = "TRUE" / "FALSE"
-
- integer-list = integer *("," integer)
-
- integer = [sign] 1*DIGIT
-
- float-list = float *("," float)
-
- float = [sign] 1*DIGIT ["." 1*DIGIT]
-
- sign = "+" / "-"
-
- date = date-fullyear ["-"] date-month ["-"] date-mday
-
- date-fullyear = 4 DIGIT
-
-
-
-
-Howes, et. al. Standards Track [Page 11]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- date-month = 2 DIGIT ;01-12
-
- date-mday = 2 DIGIT ;01-28, 01-29, 01-30, 01-31
- ;based on month/year
-
- time = time-hour [":"] time-minute [":"] time-second [time-secfrac]
- [time-zone]
-
- time-hour = 2 DIGIT ;00-23
-
- time-minute = 2 DIGIT ;00-59
-
- time-second = 2 DIGIT ;00-60 (leap second)
-
- time-secfrac = "," 1*DIGIT
-
- time-zone = "Z" / time-numzone
-
- time-numzome = sign time-hour [":"] time-minute
-
- iana-valuespec = <a publicly-defined valuetype format, registered
- with IANA, as defined in section 15 of this
- document>
-
- Some specific notes on the value types and formats:
-
- "text": The "text" value type should be used to identify values that
- contain human-readable text. The character set and language in which
- the text is represented is controlled by the charset content-header
- and the language type parameter and content-header.
-
- Examples for "text":
- this is a text value
- this is one value,this is another
- this is a single value\, with a comma encoded
-
- A formatted text line break in a text value type MUST be represented
- as the character sequence backslash (ASCII decimal 92) followed by a
- Latin small letter n (ASCII decimal 110) or a Latin capital letter N
- (ASCII decimal 78), that is "\n" or "\N".
-
- For example a multiple line DESCRIPTION value of:
-
- Mythical Manager
- Hyjinx Software Division
- BabsCo, Inc.
-
- could be represented as:
-
-
-
-Howes, et. al. Standards Track [Page 12]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- DESCRIPTION:Mythical Manager\nHyjinx Software Division\n
- BabsCo\, Inc.\n
-
- demonstrating the \n literal formatted line break technique, the
- CRLF-followed-by-space line folding technique, and the backslash
- escape technique.
-
- "uri": The "uri" value type should be used to identify values that
- are referenced by a URI (including a Content-ID URI), instead of
- encoded in-line. These value references might be used if the value is
- too large, or otherwise undesirable to include directly. The format
- for the URI is as defined in RFC 1738.
-
- Examples for "uri":
- http://www.foobar.com/my/picture.jpg
- ldap://ldap.foobar.com/cn=babs%20jensen
-
- "date", "time", and "date-time": Each of these value types is based
- on a subset of the definitions in ISO 8601 standard. Profiles MAY
- place further restrictions on "date" and "time" values. Multiple
- "date" and "time" values can be specified using the comma-separated
- notation, unless restricted by a profile.
-
- Examples for "date":
- 1985-04-12
- 1996-08-05,1996-11-11
- 19850412
-
- Examples for "time":
- 10:22:00
- 102200
- 10:22:00.33
- 10:22:00.33Z
- 10:22:33,11:22:00
- 10:22:00-08:00
-
- Examples for "date-time":
- 1996-10-22T14:00:00Z
- 1996-08-11T12:34:56Z
- 19960811T123456Z
- 1996-10-22T14:00:00Z,1996-08-11T12:34:56Z
-
- "boolean": The "boolean" value type is used to express boolen values.
- These values are case insensitive.
-
- Examples: TRUE
- false
- True
-
-
-
-Howes, et. al. Standards Track [Page 13]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- "integer": The "integer" value type is used to express signed
- integers in decimal format. If sign is not specified, the value is
- assumed positive "+". Multiple "integer" values can be specified
- using the comma-separated notation, unless restricted by a profile.
-
- Examples: 1234567890
- -1234556790
- +1234556790,432109876
-
- "float": The "float" value type is used to express real numbers. If
- sign is not specified, the value is assumed positive "+". Multiple
- "float" values can be specified using the comma-separated notation,
- unless restricted by a profile.
-
- Examples: 20.30
- 1000000.0000001
- 1.333,3.14
-
-5.9. Applications which use this media type
-
- Applications which use this media type: Various
-
-5.10. Additional information
-
- Additional information: None
-
-5.11. Person & email address to contact for further information
-
- Tim Howes
- Netscape Communications Corp.
- 501 East Middlefield Rd.
- Mountain View, CA 94041
- USA
- howes@netscape.com
- +1 415 937 3419
-
-5.12. Intended usage
-
- Intended usage: COMMON
-
-
-
-
-
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 14]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-5.13. Author/Change controller
-
- Tim Howes
- Netscape Communications Corp.
- 501 East Middlefield Rd.
- Mountain View, CA 94041
- USA
- howes@netscape.com
- +1 415 937 3419
-
- Mark Smith
- Netscape Communications Corp.
- 501 East Middlefield Rd.
- Mountain View, CA 94041
- USA
- mcs@netscape.com
- +1 415 937 3477
-
- Frank Dawson
- Lotus Development Corporation
- 6544 Battleford Drive
- Raleigh, NC 27613-3502
- USA
- frank_dawson@lotus.com
- +1-919-676-9515
-
-6. Predefined Types
-
- The following types are generally useful regardless of the profile
- being carried and are defined below using the text/directory MIME
- type registration template defined in Section 11.1 of this document.
- These types MAY be included in any profile, unless explicitly
- forbidden in the profile definition.
-
-6.1. SOURCE Type Definition
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME type SOURCE
-
- Type name: SOURCE
-
- Type purpose: To identify the source of directory information
- contained in the content type.
-
- Type encoding: 8bit
-
- Type valuetype: uri
-
-
-
-
-Howes, et. al. Standards Track [Page 15]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Type special notes: The SOURCE type is used to provide the means by
- which applications knowledgable in the given directory service
- protocol can obtain additional or more up-to-date information from
- the directory service. It contains a URI as defined in [RFC-1738]
- and/or other information referencing the directory entity or entities
- to which the information pertains. When directory information is
- available from more than one source, the sending entity can pick what
- it considers to be the best source, or multiple SOURCE types can be
- included. The interpretation of the value for a SOURCE type can
- depend on the setting of the CONTEXT type parameter. The value of the
- CONTEXT type parameter MUST be compatible with the value of the uri
- prefix.
-
- Type example:
- SOURCE;CONTEXT=LDAP:ldap://ldap.host/cn=Babs%20Jensen,
- %20o=Babsco,%20c=US
-
-6.2. NAME Type Definition
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME type NAME
-
- Type name: NAME
-
- Type purpose: To identify the displayable name of the directory
- entity to which information in the content type pertains.
-
- Type encoding: 8bit
-
- Type valuetype: text
-
- Type special notes: The NAME type is used to convey the display name
- of the entity to which the directory information pertains.
-
- Type example:
- NAME:Babs Jensen's Contact Information
-
-6.3. PROFILE Type Definition
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME type PROFILE
-
- Type name: PROFILE
-
- Type purpose: To identify the type of directory entity to which
- information in the content type pertains.
-
- Type encoding: 8bit
-
-
-
-Howes, et. al. Standards Track [Page 16]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Type valuetype: A profile name, registered as described in Section 9
- of this document or bilaterally agreed upon as described in Section
- 5.
-
- Type special notes: The PROFILE type is used to convey the type of
- the entity to which the directory information in the rest of the body
- part pertains. It should be the same as the "profile" header
- parameter, if present.
-
- Type example:
- PROFILE:vCard
-
-6.4. BEGIN Type Definition
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME type BEGIN
-
- Type name: BEGIN
-
- Type purpose: To denote the beginning of a syntactic entity within a
- text/directory content-type.
-
- Type encoding: 8bit
-
- Type valuetype: text, containing a profile name, registered as
- described in Section 9 of this document or bilaterally-agreed upon as
- described in Section 5.
-
- Type special notes: The BEGIN type is used in conjunction with the
- END type to delimit a profile containing a related set of properties
- within an text/directory content-type. This construct can be used
- instead of or in addition to wrapping separate sets of information
- inside additional MIME headers. It is provided for applications that
- wish to define content that can contain multiple entities within the
- same text/directory content-type or to define content that can be
- identifiable outside of a MIME environment.
-
- Type example:
- BEGIN:VCARD
-
-6.5. END Type Definition
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME type END
-
- Type name: END
-
-
-
-
-
-Howes, et. al. Standards Track [Page 17]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Type purpose: To denote the end of a syntactic entity within a
- text/directory content-type.
-
- Type encoding: 8bit
-
- Type valuetype: text, containing a profile name, registered as
- described in Section 9 of this document or bilaterally-agreed upon as
- described in Section 5.
-
- Type special notes: The END type is used in conjunction with the
- BEGIN type to delimit a profile containing a related set of
- properties within an text/directory content-type. This construct can
- be used instead of or in addition to wrapping separate sets of
- information inside additional MIME headers. It is provided for
- applications that wish to define content that can contain multiple
- entities within the same text/directory content-type or to define
- content that can be identifiable outside of a MIME environment.
-
- Type example:
- END: VCARD
-
-7. Use of the multipart/related Content-Type
-
- The multipart/related Content-Type can be used to hold directory
- information comprised of both text and non-text information or
- directory information that already has a natural MIME representation.
- The root body part within the multipart/related body part is
- specified as defined in [RFC-2112] by a "start" parameter, or it is
- the first body part in the absence of such a parameter. The root
- body part must have a Content-Type of "text/directory". This part
- holds inline information and makes reference to subsequent body parts
- holding additional text or non-text directory information via their
- Content-ID URIs as explained in Section 5.
-
- The body parts referred to do not have to be in any particular order,
- except as noted above for the root body part.
-
-8. Examples
-
- The following examples are for illustrative purposes only and are not
- part of the definition.
-
-
-
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 18]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-8.1. Example 1
-
- The first example illustrates simple use of the text/directory
- Content-Type. Note that no "profile" parameter is given, so an
- application may not know what kind of directory entity the
- information applies to. Note also the use of both hypothetical
- official and bilaterally agreed upon types.
-
- From: Whomever@wherever.com
- To: Someone@somewhere.com
- Subject: whatever
- MIME-Version: 1.0
- Message-ID: <id1@host.net>
- Content-Type: text/directory
- Content-ID: <id2@host.com>
-
- cn:Babs Jensen
- cn:Barbara J Jensen
- sn:Jensen
- email:babs@umich.edu
- phone:+1 313 747-4454
- x-id:1234567890
-
-8.2. Example 2
-
- The next example illustrates the use of the Quoted-Printable transfer
- encoding defined in [RFC 2045] to include non-ASCII character in some
- of the information returned, and the use of the optional "name" and
- "source" types. It also illustrates the use of an "encoding" type
- parameter to encode a certificate value in "b". A "vCard" profile
- [MIME- VCARD] is used for the example.
-
-Content-Type: text/directory;
- charset="iso-8859-1";
- profile="vCard"
-Content-ID: <id3@host.com>
-Content-Transfer-Encoding: Quoted-Printable
-
-begin:VCARD
-source:ldap://cn=3Dbjorn%20Jensen, o=3Duniversity%20of%20Michigan, c=3DUS
-name:Bjorn Jensen
-fn:Bj=F8rn Jensen
-n:Jensen;Bj=F8rn
-email;type=3Dinternet:bjorn@umich.edu
-tel;type=3Dwork,voice,msg:+1 313 747-4454
-key;type=3Dx509;encoding=3DB:dGhpcyBjb3VsZCBiZSAKbXkgY2VydGlmaWNhdGUK
-end:VCARD
-
-
-
-
-Howes, et. al. Standards Track [Page 19]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-8.3. Example 3
-
- The next example illustrates the use of multi-valued type parameters,
- the "language" type parameter, the "value" type parameter, folding of
- long lines, the \n encoding for formatted lines, attribute grouping,
- and the inline "b" encoding. A "vCard" profile [MIME-VCARD] is used
- for the example.
-
-Content-Type: text/directory; profile="vcard"; charset=iso-8859-1
-Content-ID: <id3@host.com>
-Content-Transfer-Encoding: Quoted-Printable
-
-begin:vcard
-source:ldap://cn=3DMeister%20Berger,o=3DUniversitaet%20Goerlitz,c=3DDE
-name:Meister Berger
-fn:Meister Berger
-n:Berger;Meister
-bday;value=3Ddate:1963-09-21
-o:Universit=E6t G=F6rlitz
-title:Mayor
-title;language=3Dde;value=3Dtext:Burgermeister
-note:The Mayor of the great city of
- Goerlitz in the great country of Germany.
-email;internet:mb@goerlitz.de
-home.tel;type=3Dfax,voice,msg:+49 3581 123456
-home.label:Hufenshlagel 1234\n
- 02828 Goerlitz\n
- Deutschland
-key;type=3DX509;encoding=3Db:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQ
- AwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bmljYXRpb25zI
- ENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0ZW1zMRwwGgYDVQQD
- ExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNjE5NDc1OVoXDTk3MTIwMzE5NDc
- 1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYDVQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW
- 9ucyBDb3JwLjEYMBYGA1UEAxMPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBF
- hJob3dlc0BuZXRzY2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqG
- SIb3DQEBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2dXc
- oX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MBEGCWCGSAGG+E
- IBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau+hUMbsQukjANBgkqhkiG9
- w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIPmx93HGp0Kgyx1jIVMyNgsemeAwBM+M
- SlhMfcpbTrONwNjZYW8vJDSoi//yrZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8V
- UMk1U7jt8LYpo4YULU7UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ=3D=3D
-end:vcard
-
-
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 20]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-8.4. Example 4
-
- The final example illustrates the use of the multipart/related
- Content-Type to include non-textual directory data via the "uri"
- encoding to refer to other body parts within the same message, or to
- external values. Note that no "profile" parameter is given, so an
- application may not know what kind of directory entity the
- information applies to. Note also the use of both hypothetical
- official and bilaterally agreed upon types.
-
-Content-Type: multipart/related;
- boundary=woof;
- type="text/directory";
- start="<id5@host.com>"
-Content-ID: <id4@host.com>
-
---woof
-Content-Type: text/directory; charset="iso-8859-1"
-Content-ID: <id5@host.com>
-Content-Transfer-Encoding: Quoted-Printable
-
-source:ldap://cn=3DBjorn%20Jensen,o=3DUniversity%20of%20Michigan,c=3DUS
-cn:Bj=F8rn Jensen
-sn:Jensen
-email:bjorn@umich.edu
-image;value=3Duri:cid:id6@host.com
-image;value=3Duri;format=3Djpeg:ftp://some.host/some/path.jpg
-sound;value=3Duri:cid:id7@host.com
-phone:+1 313 747-4454
-
---woof
-Content-Type: image/jpeg
-Content-ID: <id6@host.com>
-
-<...image data...>
-
---woof
-Content-Type: message/external-body;
- name="myvoice.au";
- site="myhost.com";
- access-type=ANON-FTP;
- directory="pub/myname";
- mode="image"
-
-Content-Type: audio/basic
-Content-ID: <id7@host.com>
-
---woof--
-
-
-
-Howes, et. al. Standards Track [Page 21]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-9. Registration of new profiles
-
- This section defines procedures by which new profiles are registered
- with the IANA and made available to the Internet community. Note that
- non-IANA profiles can be used by bilateral agreement, provided the
- associated profile names follow the "X-" convention defined above.
-
- The procedures defined here are designed to allow public comment and
- review of new profiles, while posing only a small impediment to the
- definition of new profiles.
-
- Registration of a new profile is accomplished by the following steps.
-
-9.1. Define the profile
-
- A profile is defined by completing the following template.
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME profile XXX
-
- Profile name:
-
- Profile purpose:
-
- Profile types:
-
- Profile special notes (optional):
-
- Intended usage: (one of COMMON, LIMITED USE or OBSOLETE)
-
- The explanation of what goes in each field in the template follows.
-
- Profile name: The name of the profile as it will appear in the
- text/directory MIME Content-Type "profile" header parameter, or the
- predefined "profile" type name.
-
- Profile purpose: The purpose of the profile (e.g., to represent
- information about people, printers, documents, etc.). Give a short
- but clear description.
-
- Profile types: The list of types associated with the profile. This
- list of types is to be expected but not required in the profile,
- unless otherwise noted in the profile definition. Other types not
- mentioned in the profile definition MAY also be present. Note that
- any new types referenced by the profile MUST be defined separately as
- described in Section 10.
-
-
-
-
-
-Howes, et. al. Standards Track [Page 22]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Profile special notes: Any special notes about the profile, how it is
- to be used, etc. This section of the template can also be used to
- define an ordering on the types that appear in the Content-Type, if
- such an ordering is required.
-
-9.2. Post the profile definition
-
- The profile description must be posted to the new profile discussion
- list, ietf-mime-direct@imc.org
-
-9.3. Allow a comment period
-
- Discussion on the new profile must be allowed to take place on the
- list for a minimum of two weeks. Consensus must be reached on the
- profile before proceeding to step 4.
-
-9.4. Submit the profile for approval
-
- Once the two-week comment period has elapsed, and the proposer is
- convinced consensus has been reached on the profile, the registration
- application should be submitted to the Profile Reviewer for approval.
- The Profile Reviewer is appointed by the Application Area Directors
- and can either accept or reject the profile registration. An accepted
- registration is passed on by the Profile Reviewer to the IANA for
- inclusion in the official IANA profile registry. The registration may
- be rejected for any of the following reasons. 1) Insufficient comment
- period; 2) Consensus not reached; 3) Technical deficiencies raised on
- the list or elsewhere have not been addressed. The Profile Reviewer's
- decision to reject a profile can be appealed by the proposer to the
- IESG, or the objections raised can be addressed by the proposer and
- the profile resubmitted.
-
-10. Profile Change Control
-
- Existing profiles can be changed using the same process by which they
- were registered.
-
- Define the change
-
- Post the change
-
- Allow a comment period
-
- Submit the changed profile for approval
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 23]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Note that the original author or any other interested party can
- propose a change to an existing profile, but that such changes should
- only be proposed when there are serious omissions or errors in the
- published specification. The Profile Reviewer can object to a change
- if it is not backwards compatible, but is not required to do so.
-
- Profile definitions can never be deleted from the IANA registry, but
- profiles which are no longer believed to be useful can be declared
- OBSOLETE by a change to their "intended use" field.
-
-11. Registration of new types
-
- This section defines procedures by which new types are registered
- with the IANA. Note that non-IANA types can be used by bilateral
- agreement, provided the associated types names follow the "X-"
- convention defined above.
-
- The procedures defined here are designed to allow public comment and
- review of new types, while posing only a small impediment to the
- definition of new types.
-
- Registration of a new type is accomplished by the following steps.
-
-11.1. Define the type
-
- A type is defined by completing the following template.
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME type XXX
-
- Type name:
-
- Type purpose:
-
- Type encoding:
-
- Type valuetype:
-
- Type special notes (optional):
-
- Intended usage: (one of COMMON, LIMITED USE or OBSOLETE)
-
- The meaning of each field in the template is as follows.
-
- Type name: The name of the type, as it will appear in the body of an
- text/directory MIME Content-Type "type: value" line to the left of
- the colon ":".
-
-
-
-
-Howes, et. al. Standards Track [Page 24]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Type purpose: The purpose of the type (e.g., to represent a name,
- postal address, IP address, etc.). Give a short but clear
- description.
-
- Type encoding: The default encoding a value of the type must have in
- the body of a text/directory MIME Content-Type.
-
- Type valuetype: The format a value of the type must have in the body
- of a text/directory MIME Content-Type. This description must be
- precise and must not violate the general encoding rules defined in
- section 5 of this document.
-
- Type special notes: Any special notes about the type, how it is to be
- used, etc.
-
-11.2. Post the type definition
-
- The type description must be posted to the new type discussion list,
- ietf-mime-direct@imc.org
-
-11.3. Allow a comment period
-
- Discussion on the new type must be allowed to take place on the list
- for a minimum of two weeks. Consensus must be reached on the type
- before proceeding to step 4.
-
-11.4. Submit the type for approval
-
- Once the two-week comment period has elapsed, and the proposer is
- convinced consensus has been reached on the type, the registration
- application should be submitted to the Profile Reviewer for approval.
- The Profile Reviewer is appointed by the Application Area Directors
- and can either accept or reject the type registration. An accepted
- registration is passed on by the Profile Reviewer to the IANA for
- inclusion in the official IANA profile registry. The registration can
- be rejected for any of the following reasons. 1) Insufficient comment
- period; 2) Consensus not reached; 3) Technical deficiencies raised on
- the list or elsewhere have not been addressed. The Profile
- Reviewer's decision to reject a type can be appealed by the proposer
- to the IESG, or the objections raised can be addressed by the
- proposer and the type resubmitted.
-
-
-
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 25]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-12. Type Change Control
-
- Existing types can be changed using the same process by which they
- were registered.
-
- Define the change
-
- Post the change
-
- Allow a comment period
-
- Submit the type for approval
-
- Note that the original author or any other interested party can
- propose a change to an existing type, but that such changes should
- only be proposed when there are serious omissions or errors in the
- published specification. The Profile Reviewer can object to a change
- if it is not backwards compatible, but is not required to do so.
-
- Type definitions can never be deleted from the IANA registry, but
- types which are nolonger believed to be useful can be declared
- OBSOLETE by a change to their "intended use" field.
-
-13. Registration of new parameters
-
- This section defines procedures by which new parameters are
- registered with the IANA and made available to the Internet
- community. Note that non-IANA parameters can be used by bilateral
- agreement, provided the associated parameters names follow the "X-"
- convention defined above.
-
- The procedures defined here are designed to allow public comment and
- review of new parameters, while posing only a small impediment to the
- definition of new parameters.
-
- Registration of a new parameter is accomplished by the following
- steps.
-
-13.1. Define the parameter
-
- A parameter is defined by completing the following template.
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME type parameter XXX
-
- Parameter name:
-
- Parameter purpose:
-
-
-
-Howes, et. al. Standards Track [Page 26]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- Parameter values:
-
- Parameter special notes (optional):
-
- Intended usage: (one of COMMON, LIMITED USE or OBSOLETE)
-
- The explanation of what goes in each field in the template follows.
-
- Parameter name: The name of the parameter as it will appear in the
- text/directory MIME Content-Type.
-
- Parameter purpose: The purpose of the parameter (e.g., to represent
- the format of an image, type of a phone number, etc.). Give a short
- but clear description. If defining a general paramemter like "format"
- or "type" keep in mind that other applications might wish to extend
- its use.
-
- Parameter values: The list or description of values associated with
- the parameter.
-
- Parameter special notes: Any special notes about the parameter, how
- it is to be used, etc.
-
-13.2. Post the parameter definition
-
- The parameter description must be posted to the new parameter
- discussion list, ietf-mime-direct@imc.org
-
-13.3. Allow a comment period
-
- Discussion on the new parameter must be allowed to take place on the
- list for a minimum of two weeks. Consensus must be reached on the
- parameter before proceeding to step 4.
-
-13.4. Submit the parameter for approval
-
- Once the two-week comment period has elapsed, and the proposer is
- convinced consensus has been reached on the parameter, the
- registration application should be submitted to the Profile Reviewer
- for approval. The Profile Reviewer is appointed by the Application
- Area Directors and can either accept or reject the parameter
- registration. An accepted registration is passed on by the Profile
- Reviewer to the IANA for inclusion in the official IANA parameter
- registry. The registration can be rejected for any of the following
- reasons. 1) Insufficient comment period; 2) Consensus not reached; 3)
- Technical deficiencies raised on the list or elsewhere have not been
- addressed. The Profile Reviewer's decision to reject a profile can be
- appealed by the proposer to the IESG, or the objections raised can be
-
-
-
-Howes, et. al. Standards Track [Page 27]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- addressed by the proposer and the parameter registration resubmitted.
-
-14. Parameter Change Control
-
- Existing parameters can be changed using the same process by which
- they were registered.
-
- Define the change
-
- Post the change
-
- Allow a comment period
-
- Submit the parameter for approval
-
- Note that the original author or any other interested party can
- propose a change to an existing parameter, but that such changes
- should only be proposed when there are serious omissions or errors in
- the published specification. The Profile Reviewer can object to a
- change if it is not backwards compatible, but is not required to do
- so.
-
- Parameter definitions can never be deleted from the IANA registry,
- but parameters which are nolonger believed to be useful can be
- declared OBSOLETE by a change to their "intended use" field.
-
-15. Registration of new value types
-
- This section defines procedures by which new value types are
- registered with the IANA and made available to the Internet
- community. Note that non-IANA value types can be used by bilateral
- agreement, provided the associated value types names follow the "X-"
- convention defined above.
-
- The procedures defined here are designed to allow public comment and
- review of new value types, while posing only a small impediment to
- the definition of new value types.
-
- Registration of a new value types is accomplished by the following
- steps.
-
-15.1. Define the value type
-
- A value type is defined by completing the following template.
-
- To: ietf-mime-direct@imc.org
- Subject: Registration of text/directory MIME value type XXX
-
-
-
-
-Howes, et. al. Standards Track [Page 28]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- value type name:
-
- value type purpose:
-
- value type format:
-
- value type special notes (optional):
-
- Intended usage: (one of COMMON, LIMITED USE or OBSOLETE)
-
- The explanation of what goes in each field in the template follows.
-
- value type name: The name of the value type as it will appear in the
- text/directory MIME Content-Type.
-
- value type purpose: The purpose of the value type. Give a short but
- clear description.
-
- value type format: The definition of the format for the value,
- usually using ABNF grammar.
-
- value type special notes: Any special notes about the value type, how
- it is to be used, etc.
-
-15.2. Post the value type definition
-
- The value type description must be posted to the new value type
- discussion list, ietf-mime-direct@imc.org
-
-15.3. Allow a comment period
-
- Discussion on the new value type must be allowed to take place on the
- list for a minimum of two weeks. Consensus must be reached before
- proceeding to step 4.
-
-15.4. Submit the value type for approval
-
- Once the two-week comment period has elapsed, and the proposer is
- convinced consensus has been reached on the value type, the
- registration application should be submitted to the Profile Reviewer
- for approval. The Profile Reviewer is appointed by the Application
- Area Directors and can either accept or reject the value type
- registration. An accepted registration should be passed on by the
- Profile Reviewer to the IANA for inclusion in the official IANA value
- type registry. The registration can be rejected for any of the
- following reasons. 1) Insufficient comment period; 2) Consensus not
- reached; 3) Technical deficiencies raised on the list or elsewhere
- have not been addressed. The Profile Reviewer's decision to reject a
-
-
-
-Howes, et. al. Standards Track [Page 29]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- profile can be appealed by the proposer to the IESG, or the
- objections raised can be addressed by the proposer and the value type
- registration resubmitted.
-
-16. Security Considerations
-
- Internet mail is subject to many well known security attacks,
- including monitoring, replay, and forgery. Care should be taken by
- any directory service in allowing information to leave the scope of
- the service itself, where any access controls can no longer be
- guaranteed. Applications should also take care to display directory
- data in a "safe" environment (e.g., PostScript-valued types).
-
-17. Acknowledgements
-
- The registration procedures defined here were shamelessly lifted from
- the MIME registration RFC.
-
- The many valuable comments contributed by members of the IETF ASID
- working group are gratefully acknowledged, as are the contributions
- of the Versit Consortium. Chris Newman was especially helpful in
- navigating the intricacies of ABNF lore.
-
-18. References
-
- [RFC-1777] Yeong, W., Howes, T., and S. Kille, "Lightweight
- Directory Access Protocol", RFC 1777, March 1995.
-
- [RFC-1778] Howes, T., Kille, S., Yeong, W., and C. Robbins, "The
- String Representation of Standard Attribute Syntaxes",
- RFC 1778, March 1995.
-
- [RFC-822] Crocker, D., "Standard for the Format of ARPA Internet
- Text Messages", STD 11, RFC 822, August 1982.
-
- [RFC-2045] Borenstein, N., and N. Freed, "Multipurpose Internet
- Mail Extensions (MIME) Part One: Format of Internet
- Message Bodies", RFC 2045, November 1996.
-
- [RFC-2046] Moore, K., "Multipurpose Internet Mail Extensions (MIME)
- Part Two: Media Types", RFC 2046, November 1996.
-
- [RFC-2048] Freed, N., Klensin, J., and J. Postel, "Multipurpose
- Internet Mail Extensions (MIME) Part Four: Registration
- Procedures", RFC 2048, November 1996.
-
- [RFC-1766] Alvestrand, H., "Tags for the Identification of
- Languages", RFC 1766, March 1995.
-
-
-
-Howes, et. al. Standards Track [Page 30]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
- [RFC-2112] Levinson, E., "The MIME Multipart/Related Content-type",
- RFC 2112, March 1997.
-
- [X500] "Information Processing Systems - Open Systems
- Interconnection - The Directory: Overview of Concepts,
- Models and Services", ISO/IEC JTC 1/SC21, International
- Standard 9594-1, 1988.
-
- [RFC-1835] Deutsch, P., Schoultz, R., Faltstrom, P., and C. Weider,
- "Architecture of the WHOIS++ service", RFC 1835, August
- 1995.
-
- [RFC-1738] Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform
- Resource Locators (URL)", RFC 1738, December 1994.
-
- [MIME-VCARD] Dawson, F., and T. Howes, "VCard MIME Directory
- Profile", RFC 2426, September 1998.
-
- [VCARD] Internet Mail Consortium, "vCard - The Electronic
- Business Card", Version 2.1,
- http://www.imc.com/pdi/vcard-21.txt, September, 1996.
-
- [RFC-2119] Bradner, S., "Key words for use in RFCs to Indicate
- Requirement Levels", BCP 14, RFC 2119, March 1997.
-
- [RFC-2234] Crocker, D., and P. Overell, "Augmented BNF for Syntax
- Specifications: ABNF", RFC 2234, November 1997.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 31]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-19. Authors' Addresses
-
- Tim Howes
- Netscape Communications Corp.
- 501 East Middlefield Rd.
- Mountain View, CA 94041
- USA
-
- Phone: +1.415.937.3419
- EMail: howes@netscape.com
-
-
- Mark Smith
- Netscape Communications Corp.
- 501 East Middlefield Rd.
- Mountain View, CA 94041
- USA
-
- Phone: +1.415.937.3477
- EMail: mcs@netscape.com
-
-
- Frank Dawson
- Lotus Development Corporation
- 6544 Battleford Drive
- Raleigh, NC 27613
- USA
-
- Phone: +1-919-676-9515
- EMail: frank_dawson@lotus.com
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 32]
-
-RFC 2425 MIME Content-Type for Directory Information September 1998
-
-
-20. Full Copyright Statement
-
- Copyright (C) The Internet Society (1998). All Rights Reserved.
-
- This document and translations of it may be copied and furnished to
- others, and derivative works that comment on or otherwise explain it
- or assist in its implementation may be prepared, copied, published
- and distributed, in whole or in part, without restriction of any
- kind, provided that the above copyright notice and this paragraph are
- included on all such copies and derivative works. However, this
- document itself may not be modified in any way, such as by removing
- the copyright notice or references to the Internet Society or other
- Internet organizations, except as needed for the purpose of
- developing Internet standards in which case the procedures for
- copyrights defined in the Internet Standards process must be
- followed, or as required to translate it into languages other than
- English.
-
- The limited permissions granted above are perpetual and will not be
- revoked by the Internet Society or its successors or assigns.
-
- This document and the information contained herein is provided on an
- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
- TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
- HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Howes, et. al. Standards Track [Page 33]
-
diff --git a/addressbook/backend/ebook/docs/rfc2426.txt b/addressbook/backend/ebook/docs/rfc2426.txt
deleted file mode 100644
index a393a67c98..0000000000
--- a/addressbook/backend/ebook/docs/rfc2426.txt
+++ /dev/null
@@ -1,2355 +0,0 @@
-
-
-
-
-
-
-Network Working Group F. Dawson
-Request for Comments: 2426 Lotus Development Corporation
-Category: Standards Track T. Howes
- Netscape Communications
- September 1998
-
-
- vCard MIME Directory Profile
-
-Status of this Memo
-
- This document specifies an Internet standards track protocol for the
- Internet community, and requests discussion and suggestions for
- improvements. Please refer to the current edition of the "Internet
- Official Protocol Standards" (STD 1) for the standardization state
- and status of this protocol. Distribution of this memo is unlimited.
-
-Copyright Notice
-
- Copyright (C) The Internet Society (1998). All Rights Reserved.
-
-Abstract
-
- This memo defines the profile of the MIME Content-Type [MIME-DIR] for
- directory information for a white-pages person object, based on a
- vCard electronic business card. The profile definition is independent
- of any particular directory service or protocol. The profile is
- defined for representing and exchanging a variety of information
- about an individual (e.g., formatted and structured name and delivery
- addresses, email address, multiple telephone numbers, photograph,
- logo, audio clips, etc.). The directory information used by this
- profile is based on the attributes for the person object defined in
- the X.520 and X.521 directory services recommendations. The profile
- also provides the method for including a [VCARD] representation of a
- white-pages directory entry within the MIME Content-Type defined by
- the [MIME-DIR] document.
-
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY" and "OPTIONAL" in this
- document are to be interpreted as described in [RFC 2119].
-
-
-
-
-
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 1]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-Table of Contents
-
- Overview.........................................................3
- 1. THE VCARD MIME DIRECTORY PROFILE REGISTRATION.................4
- 2. MIME DIRECTORY FEATURES.......................................5
- 2.1 PREDEFINED TYPE USAGE ......................................5
- 2.1.1 BEGIN and END Type ......................................5
- 2.1.2 NAME Type ...............................................5
- 2.1.3 PROFILE Type ............................................5
- 2.1.4 SOURCE Type .............................................5
- 2.2 PREDEFINED TYPE PARAMETER USAGE ............................6
- 2.3 PREDEFINED VALUE TYPE USAGE ................................6
- 2.4 EXTENSIONS TO THE PREDEFINED VALUE TYPES ...................6
- 2.4.1 BINARY ..................................................6
- 2.4.2 VCARD ...................................................6
- 2.4.3 PHONE-NUMBER ............................................7
- 2.4.4 UTC-OFFSET ..............................................7
- 2.5 STRUCTURED TYPE VALUES .....................................7
- 2.6 LINE DELIMITING AND FOLDING ................................8
- 3. VCARD PROFILE FEATURES........................................8
- 3.1 IDENTIFICATION TYPES .......................................8
- 3.1.1 FN Type Definition ......................................8
- 3.1.2 N Type Definition .......................................9
- 3.1.3 NICKNAME Type Definition ................................9
- 3.1.4 PHOTO Type Definition ..................................10
- 3.1.5 BDAY Type Definition ...................................11
- 3.2 DELIVERY ADDRESSING TYPES .................................11
- 3.2.1 ADR Type Definition ....................................11
- 3.2.2 LABEL Type Definition ..................................13
- 3.3 TELECOMMUNICATIONS ADDRESSING TYPES .......................13
- 3.3.1 TEL Type Definition ....................................14
- 3.3.2 EMAIL Type Definition ..................................15
- 3.3.3 MAILER Type Definition .................................15
- 3.4 GEOGRAPHICAL TYPES ........................................16
- 3.4.1 TZ Type Definition .....................................16
- 3.4.2 GEO Type Definition ....................................16
- 3.5 ORGANIZATIONAL TYPES ......................................17
- 3.5.1 TITLE Type Definition ..................................17
- 3.5.2 ROLE Type Definition ...................................18
- 3.5.3 LOGO Type Definition ...................................18
- 3.5.4 AGENT Type Definition ..................................19
- 3.5.5 ORG Type Definition ....................................20
- 3.6 EXPLANATORY TYPES .........................................20
- 3.6.1 CATEGORIES Type Definition .............................20
- 3.6.2 NOTE Type Definition ...................................21
- 3.6.3 PRODID Type Definition .................................21
- 3.6.4 REV Type Definition ....................................22
- 3.6.5 SORT-STRING Type Definition ............................22
-
-
-
-Dawson & Howes Standards Track [Page 2]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- 3.6.6 SOUND Type Definition ..................................23
- 3.6.7 UID Type Definition ....................................24
- 3.6.8 URL Type Definition ....................................25
- 3.6.9 VERSION Type Definition ................................25
- 3.7 SECURITY TYPES ............................................25
- 3.7.1 CLASS Type Definition ..................................26
- 3.7.2 KEY Type Definition ....................................26
- 3.8 EXTENDED TYPES ............................................27
- 4. FORMAL GRAMMAR...............................................27
- 5. DIFFERENCES FROM VCARD V2.1..................................37
- 6. ACKNOWLEDGEMENTS.............................................39
- 7. AUTHORS' ADDRESSES...........................................39
- 8. SECURITY CONSIDERATIONS......................................39
- 9. REFERENCES...................................................40
- 10. FULL COPYRIGHT STATEMENT....................................42
-
-Overview
-
- The [MIME-DIR] document defines a MIME Content-Type for holding
- different kinds of directory information. The directory information
- can be based on any of a number of directory schemas. This document
- defines a [MIME-DIR] usage profile for conveying directory
- information based on one such schema; that of the white-pages type of
- person object.
-
- The schema is based on the attributes for the person object defined
- in the X.520 and X.521 directory services recommendations. The schema
- has augmented the basic attributes defined in the X.500 series
- recommendation in order to provide for an electronic representation
- of the information commonly found on a paper business card. This
- schema was first defined in the [VCARD] document. Hence, this [MIME-
- DIR] profile is referred to as the vCard MIME Directory Profile.
-
- A directory entry based on this usage profile can include traditional
- directory, white-pages information such as the distinguished name
- used to uniquely identify the entry, a formatted representation of
- the name used for user-interface or presentation purposes, both the
- structured and presentation form of the delivery address, various
- telephone numbers and organizational information associated with the
- entry. In addition, traditional paper business card information such
- as an image of an organizational logo or identify photograph can be
- included in this person object.
-
- The vCard MIME Directory Profile also provides support for
- representing other important information about the person associated
- with the directory entry. For instance, the date of birth of the
- person; an audio clip describing the pronunciation of the name
- associated with the directory entry, or some other application of the
-
-
-
-Dawson & Howes Standards Track [Page 3]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- digital sound; longitude and latitude geo-positioning information
- related to the person associated with the directory entry; date and
- time that the directory information was last updated; annotations
- often written on a business card; Uniform Resource Locators (URL) for
- a website; public key information. The profile also provides support
- for non-standard extensions to the schema. This provides the
- flexibility for implementations to augment the current capabilities
- of the profile in a standardized way. More information about this
- electronic business card format can be found in [VCARD].
-
-1. The vCard Mime Directory Profile Registration
-
- This profile is identified by the following [MIME-DIR] registration
- template information. Subsequent sections define the profile
- definition.
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME profile VCARD
-
- Profile name: VCARD
-
- Profile purpose: To hold person object or white-pages type of
- directory information. The person schema captured in the directory
- entries is that commonly found in an electronic business card.
-
- Predefined MIME Directory value specifications used: uri, date,
- date-time, float
-
- New value specifications: This profile places further constraints on
- the [MIME-DIR] text value specification. In addition, it adds a
- binary, phone-number, utc-offset and vcard value specifications.
-
- Predefined MIME Directory types used: SOURCE, NAME, PROFILE, BEGIN,
- END.
-
- Predefined MIME Directory parameters used: ENCODING, VALUE, CHARSET,
- LANGUAGE, CONTEXT.
-
- New types: FN, N, NICKNAME, PHOTO, BDAY, ADR, LABEL, TEL, EMAIL,
- MAILER, TZ, GEO, TITLE, ROLE, LOGO, AGENT, ORG, CATEGORIES, NOTE,
- PRODID, REV, SORT-STRING, SOUND, URL, UID, VERSION, CLASS, KEY
-
- New parameters: TYPE
-
- Profile special notes: The vCard object MUST contain the FN, N and
- VERSION types. The type-grouping feature of [MIME-DIR] is supported
- by this profile to group related vCard properties about a directory
-
-
-
-Dawson & Howes Standards Track [Page 4]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- entry. For example, vCard properties describing WORK or HOME related
- characteristics can be grouped with a unique group label.
-
- The profile permits the use of non-standard types (i.e., those
- identified with the prefix string "X-") as a flexible method for
- implementations to extend the functionality currently defined within
- this profile.
-
-2. MIME Directory Features
-
- The vCard MIME Directory Profile makes use of many of the features
- defined by [MIME-DIR]. The following sections either clarify or
- extend the content-type definition of [MIME-DIR].
-
-2.1 Predefined Type Usage
-
- The vCard MIME Directory Profile uses the following predefined types
- from [MIME-DIR].
-
-2.1.1 BEGIN and END Type
-
- The content entity MUST begin with the BEGIN type with a value of
- "VCARD". The content entity MUST end with the END type with a value
- of "VCARD".
-
-2.1.2 NAME Type
-
- If the NAME type is present, then its value is the displayable,
- presentation text associated with the source for the vCard, as
- specified in the SOURCE type.
-
-2.1.3 PROFILE Type
-
- If the PROFILE type is present, then its value MUST be "VCARD".
-
-2.1.4 SOURCE Type
-
- If the SOURCE type is present, then its value provides information
- how to find the source for the vCard.
-
-
-
-
-
-
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 5]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-2.2 Predefined Type Parameter Usage
-
- The vCard MIME Directory Profile uses the following predefined type
- parameters as defined by [MIME-DIR].
-
- - LANGUAGE
-
- - ENCODING
-
- - VALUE
-
-2.3 Predefined VALUE Type Usage
-
- The predefined data type values specified in [MIME-DIR] MUST NOT be
- repeated in COMMA separated value lists except within the N,
- NICKNAME, ADR and CATEGORIES value types.
-
- The text value type defined in [MIME-DIR] is further restricted such
- that any SEMI-COLON character (ASCII decimal 59) in the value MUST be
- escaped with the BACKSLASH character (ASCII decimal 92).
-
-2.4 Extensions To The Predefined VALUE Types
-
- The predefined data type values specified in [MIME-DIR] have been
- extended by the vCard profile to include a number of value types that
- are specific to this profile.
-
-2.4.1 BINARY
-
- The "binary" value type specifies that the type value is inline,
- encoded binary data. This value type can be specified in the PHOTO,
- LOGO, SOUND, and KEY types.
-
- If inline encoded binary data is specified, the ENCODING type
- parameter MUST be used to specify the encoding format. The binary
- data MUST be encoded using the "B" encoding format. Long lines of
- encoded binary data SHOULD BE folded to 75 characters using the
- folding method defined in [MIME-DIR].
-
- The value type is defined by the following notation:
-
- binary = <A "B" binary encoded string as defined by [RFC 2047].>
-
-2.4.2 VCARD
-
- The "vcard" value type specifies that the type value is another
- vCard. This value type can be specified in the AGENT type. The value
- type is defined by this specification. Since each of the type
-
-
-
-Dawson & Howes Standards Track [Page 6]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- declarations with in the vcard value type are being specified within
- a text value themselves, they MUST be terminated with the backslash
- escape sequence "\n" or "\N", instead of the normal newline character
- sequence CRLF. In addition, any COMMA character (ASCII decimal 44),
- SEMI-COLON character (ASCII decimal 59) and COLON character (ASCII
- decimal 58) MUST be escaped with the BACKSLASH character (ASCII
- decimal 92). For example, with the AGENT type a value would be
- specified as:
-
- AGENT:BEGIN:VCARD\nFN:Joe Friday\nTEL:+1-919-555-7878\n
- TITLE:Area Administrator\, Assistant\n EMAIL\;TYPE=INTERN\n
- ET:jfriday@host.com\nEND:VCARD\n
-
-2.4.3 PHONE-NUMBER
-
- The "phone-number" value type specifies that the type value is a
- telephone number. This value type can be specified in the TEL type.
- The value type is a text value that has the special semantics of a
- telephone number as defined in [CCITT E.163] and [CCITT X.121].
-
-2.4.4 UTC-OFFSET
-
- The "utc-offset" value type specifies that the type value is a signed
- offset from UTC. This value type can be specified in the TZ type.
-
- The value type is an offset from Coordinated Universal Time (UTC). It
- is specified as a positive or negative difference in units of hours
- and minutes (e.g., +hh:mm). The time is specified as a 24-hour clock.
- Hour values are from 00 to 23, and minute values are from 00 to 59.
- Hour and minutes are 2-digits with high order zeroes required to
- maintain digit count. The extended format for ISO 8601 UTC offsets
- MUST be used. The extended format makes use of a colon character as a
- separator of the hour and minute text fields.
-
- The value is defined by the following notation:
-
- time-hour = 2DIGIT ;00-23
- time-minute = 2DIGIT ;00-59
- utc-offset = ("+" / "-") time-hour ":" time-minute
-
-2.5 Structured Type Values
-
- Compound type values are delimited by a field delimiter, specified by
- the SEMI-COLON character (ASCII decimal 59). A SEMI-COLON in a
- component of a compound property value MUST be escaped with a
- BACKSLASH character (ASCII decimal 92).
-
-
-
-
-
-Dawson & Howes Standards Track [Page 7]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Lists of values are delimited by a list delimiter, specified by the
- COMMA character (ASCII decimal 44). A COMMA character in a value MUST
- be escaped with a BACKSLASH character (ASCII decimal 92).
-
- This profile supports the type grouping mechanism defined in [MIME-
- DIR]. Grouping of related types is a useful technique to communicate
- common semantics concerning the properties of a vCard.
-
-2.6 Line Delimiting and Folding
-
- This profile supports the same line delimiting and folding methods
- defined in [MIME-DIR]. Specifically, when parsing a content line,
- folded lines must first be unfolded according to the unfolding
- procedure described in [MIME-DIR]. After generating a content line,
- lines longer than 75 characters SHOULD be folded according to the
- folding procedure described in [MIME DIR].
-
- Folding is done after any content encoding of a type value. Unfolding
- is done before any decoding of a type value in a content line.
-
-3. vCard Profile Features
-
- The vCard MIME Directory Profile Type contains directory information,
- typically pertaining to a single directory entry. The information is
- described using an attribute schema that is tailored for capturing
- personal contact information. The vCard can include attributes that
- describe identification, delivery addressing, telecommunications
- addressing, geographical, organizational, general explanatory and
- security and access information about the particular object
- associated with the vCard.
-
-3.1 Identification Types
-
- These types are used in the vCard profile to capture information
- associated with the identification and naming of the person or
- resource associated with the vCard.
-
-3.1.1 FN Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type FN
-
- Type name:FN
-
- Type purpose: To specify the formatted text corresponding to the name
- of the object the vCard represents.
-
-
-
-
-Dawson & Howes Standards Track [Page 8]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: This type is based on the semantics of the X.520
- Common Name attribute. The property MUST be present in the vCard
- object.
-
- Type example:
-
- FN:Mr. John Q. Public\, Esq.
-
-3.1.2 N Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type N
-
- Type name: N
-
- Type purpose: To specify the components of the name of the object the
- vCard represents.
-
- Type encoding: 8bit
-
- Type value: A single structured text value. Each component can have
- multiple values.
-
- Type special note: The structured type value corresponds, in
- sequence, to the Family Name, Given Name, Additional Names, Honorific
- Prefixes, and Honorific Suffixes. The text components are separated
- by the SEMI-COLON character (ASCII decimal 59). Individual text
- components can include multiple text values (e.g., multiple
- Additional Names) separated by the COMMA character (ASCII decimal
- 44). This type is based on the semantics of the X.520 individual name
- attributes. The property MUST be present in the vCard object.
-
- Type example:
-
- N:Public;John;Quinlan;Mr.;Esq.
-
- N:Stevenson;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P.
-
-3.1.3 NICKNAME Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type NICKNAME
-
-
-
-Dawson & Howes Standards Track [Page 9]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type name: NICKNAME
-
- Type purpose: To specify the text corresponding to the nickname of
- the object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: One or more text values separated by a COMMA character
- (ASCII decimal 44).
-
- Type special note: The nickname is the descriptive name given instead
- of or in addition to the one belonging to a person, place, or thing.
- It can also be used to specify a familiar form of a proper name
- specified by the FN or N types.
-
- Type example:
-
- NICKNAME:Robbie
-
- NICKNAME:Jim,Jimmie
-
-3.1.4 PHOTO Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type PHOTO
-
- Type name: PHOTO
-
- Type purpose: To specify an image or photograph information that
- annotates some aspect of the object the vCard represents.
-
- Type encoding: The encoding MUST be reset to "b" using the ENCODING
- parameter in order to specify inline, encoded binary data. If the
- value is referenced by a URI value, then the default encoding of 8bit
- is used and no explicit ENCODING parameter is needed.
-
- Type value: A single value. The default is binary value. It can also
- be reset to uri value. The uri value can be used to specify a value
- outside of this MIME entity.
-
- Type special notes: The type can include the type parameter "TYPE" to
- specify the graphic image format type. The TYPE parameter values MUST
- be one of the IANA registered image formats or a non-standard image
- format.
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 10]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type example:
-
- PHOTO;VALUE=uri:http://www.abc.com/pub/photos
- /jqpublic.gif
-
-
- PHOTO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
- AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
- ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
- <...remainder of "B" encoded binary data...>
-
-3.1.5 BDAY Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type BDAY
-
- Type name: BDAY
-
- Type purpose: To specify the birth date of the object the vCard
- represents.
-
- Type encoding: 8bit
-
- Type value: The default is a single date value. It can also be reset
- to a single date-time value.
-
- Type examples:
-
- BDAY:1996-04-15
-
- BDAY:1953-10-15T23:10:00Z
-
- BDAY:1987-09-27T08:30:00-06:00
-
-3.2 Delivery Addressing Types
-
- These types are concerned with information related to the delivery
- addressing or label for the vCard object.
-
-3.2.1 ADR Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type ADR
-
- Type name: ADR
-
-
-
-
-Dawson & Howes Standards Track [Page 11]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type purpose: To specify the components of the delivery address for
- the vCard object.
-
- Type encoding: 8bit
-
- Type value: A single structured text value, separated by the
- SEMI-COLON character (ASCII decimal 59).
-
- Type special notes: The structured type value consists of a sequence
- of address components. The component values MUST be specified in
- their corresponding position. The structured type value corresponds,
- in sequence, to the post office box; the extended address; the street
- address; the locality (e.g., city); the region (e.g., state or
- province); the postal code; the country name. When a component value
- is missing, the associated component separator MUST still be
- specified.
-
- The text components are separated by the SEMI-COLON character (ASCII
- decimal 59). Where it makes semantic sense, individual text
- components can include multiple text values (e.g., a "street"
- component with multiple lines) separated by the COMMA character
- (ASCII decimal 44).
-
- The type can include the type parameter "TYPE" to specify the
- delivery address type. The TYPE parameter values can include "dom" to
- indicate a domestic delivery address; "intl" to indicate an
- international delivery address; "postal" to indicate a postal
- delivery address; "parcel" to indicate a parcel delivery address;
- "home" to indicate a delivery address for a residence; "work" to
- indicate delivery address for a place of work; and "pref" to indicate
- the preferred delivery address when more than one address is
- specified. These type parameter values can be specified as a
- parameter list (i.e., "TYPE=dom;TYPE=postal") or as a value list
- (i.e., "TYPE=dom,postal"). This type is based on semantics of the
- X.520 geographical and postal addressing attributes. The default is
- "TYPE=intl,postal,parcel,work". The default can be overridden to some
- other set of values by specifying one or more alternate values. For
- example, the default can be reset to "TYPE=dom,postal,work,home" to
- specify a domestic delivery address for postal delivery to a
- residence that is also used for work.
-
- Type example: In this example the post office box and the extended
- address are absent.
-
- ADR;TYPE=dom,home,postal,parcel:;;123 Main
- Street;Any Town;CA;91921-1234
-
-
-
-
-
-Dawson & Howes Standards Track [Page 12]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-3.2.2 LABEL Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type LABEL
-
- Type name: LABEL
-
- Type purpose: To specify the formatted text corresponding to delivery
- address of the object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: The type value is formatted text that can be used
- to present a delivery address label for the vCard object. The type
- can include the type parameter "TYPE" to specify delivery label type.
- The TYPE parameter values can include "dom" to indicate a domestic
- delivery label; "intl" to indicate an international delivery label;
- "postal" to indicate a postal delivery label; "parcel" to indicate a
- parcel delivery label; "home" to indicate a delivery label for a
- residence; "work" to indicate delivery label for a place of work; and
- "pref" to indicate the preferred delivery label when more than one
- label is specified. These type parameter values can be specified as a
- parameter list (i.e., "TYPE=dom;TYPE=postal") or as a value list
- (i.e., "TYPE=dom,postal"). This type is based on semantics of the
- X.520 geographical and postal addressing attributes. The default is
- "TYPE=intl,postal,parcel,work". The default can be overridden to some
- other set of values by specifying one or more alternate values. For
- example, the default can be reset to "TYPE=intl,post,parcel,home" to
- specify an international delivery label for both postal and parcel
- delivery to a residential location.
-
- Type example: A multi-line address label.
-
- LABEL;TYPE=dom,home,postal,parcel:Mr.John Q. Public\, Esq.\n
- Mail Drop: TNE QB\n123 Main Street\nAny Town\, CA 91921-1234
- \nU.S.A.
-
-3.3 Telecommunications Addressing Types
-
- These types are concerned with information associated with the
- telecommunications addressing of the object the vCard represents.
-
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 13]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-3.3.1 TEL Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type TEL
-
- Type name: TEL
-
- Type purpose: To specify the telephone number for telephony
- communication with the object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: A single phone-number value.
-
- Type special notes: The value of this type is specified in a
- canonical form in order to specify an unambiguous representation of
- the globally unique telephone endpoint. This type is based on the
- X.500 Telephone Number attribute.
-
- The type can include the type parameter "TYPE" to specify intended
- use for the telephone number. The TYPE parameter values can include:
- "home" to indicate a telephone number associated with a residence,
- "msg" to indicate the telephone number has voice messaging support,
- "work" to indicate a telephone number associated with a place of
- work, "pref" to indicate a preferred-use telephone number, "voice" to
- indicate a voice telephone number, "fax" to indicate a facsimile
- telephone number, "cell" to indicate a cellular telephone number,
- "video" to indicate a video conferencing telephone number, "pager" to
- indicate a paging device telephone number, "bbs" to indicate a
- bulletin board system telephone number, "modem" to indicate a MODEM
- connected telephone number, "car" to indicate a car-phone telephone
- number, "isdn" to indicate an ISDN service telephone number, "pcs" to
- indicate a personal communication services telephone number. The
- default type is "voice". These type parameter values can be specified
- as a parameter list (i.e., "TYPE=work;TYPE=voice") or as a value list
- (i.e., "TYPE=work,voice"). The default can be overridden to another
- set of values by specifying one or more alternate values. For
- example, the default TYPE of "voice" can be reset to a WORK and HOME,
- VOICE and FAX telephone number by the value list
- "TYPE=work,home,voice,fax".
-
- Type example:
-
- TEL;TYPE=work,voice,pref,msg:+1-213-555-1234
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 14]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-3.3.2 EMAIL Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type EMAIL
-
- Type name: EMAIL
-
- Type purpose: To specify the electronic mail address for
- communication with the object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: The type can include the type parameter "TYPE" to
- specify the format or preference of the electronic mail address. The
- TYPE parameter values can include: "internet" to indicate an Internet
- addressing type, "x400" to indicate a X.400 addressing type or "pref"
- to indicate a preferred-use email address when more than one is
- specified. Another IANA registered address type can also be
- specified. The default email type is "internet". A non-standard value
- can also be specified.
-
- Type example:
-
- EMAIL;TYPE=internet:jqpublic@xyz.dom1.com
-
- EMAIL;TYPE=internet:jdoe@isp.net
-
- EMAIL;TYPE=internet,pref:jane_doe@abc.com
-
-3.3.3 MAILER Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type MAILER
-
- Type name: MAILER
-
- Type purpose: To specify the type of electronic mail software that is
- used by the individual associated with the vCard.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
-
-
-
-
-Dawson & Howes Standards Track [Page 15]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type special notes: This information can provide assistance to a
- correspondent regarding the type of data representation which can be
- used, and how they can be packaged. This property is based on the
- private MIME type X-Mailer that is generally implemented by MIME user
- agent products.
-
- Type example:
-
- MAILER:PigeonMail 2.1
-
-3.4 Geographical Types
-
- These types are concerned with information associated with
- geographical positions or regions associated with the object the
- vCard represents.
-
-3.4.1 TZ Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type TZ
-
- Type name: TZ
-
- Type purpose: To specify information related to the time zone of the
- object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: The default is a single utc-offset value. It can also be
- reset to a single text value.
-
- Type special notes: The type value consists of a single value.
-
- Type examples:
-
- TZ:-05:00
-
- TZ;VALUE=text:-05:00; EST; Raleigh/North America
- ;This example has a single value, not a structure text value.
-
-3.4.2 GEO Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type GEO
-
- Type name: GEO
-
-
-
-Dawson & Howes Standards Track [Page 16]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type purpose: To specify information related to the global
- positioning of the object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: A single structured value consisting of two float values
- separated by the SEMI-COLON character (ASCII decimal 59).
-
- Type special notes: This type specifies information related to the
- global position of the object associated with the vCard. The value
- specifies latitude and longitude, in that order (i.e., "LAT LON"
- ordering). The longitude represents the location east and west of the
- prime meridian as a positive or negative real number, respectively.
- The latitude represents the location north and south of the equator
- as a positive or negative real number, respectively. The longitude
- and latitude values MUST be specified as decimal degrees and should
- be specified to six decimal places. This will allow for granularity
- within a meter of the geographical position. The text components are
- separated by the SEMI-COLON character (ASCII decimal 59). The simple
- formula for converting degrees-minutes-seconds into decimal degrees
- is:
-
- decimal = degrees + minutes/60 + seconds/3600.
-
- Type example:
-
- GEO:37.386013;-122.082932
-
-3.5 Organizational Types
-
- These types are concerned with information associated with
- characteristics of the organization or organizational units of the
- object the vCard represents.
-
-3.5.1 TITLE Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type TITLE
-
- Type name: TITLE
-
- Type purpose: To specify the job title, functional position or
- function of the object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
-
-
-Dawson & Howes Standards Track [Page 17]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type special notes: This type is based on the X.520 Title attribute.
-
- Type example:
-
- TITLE:Director\, Research and Development
-
-3.5.2 ROLE Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type ROLE
-
- Type name: ROLE
-
- Type purpose: To specify information concerning the role, occupation,
- or business category of the object the vCard represents.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: This type is based on the X.520 Business Category
- explanatory attribute. This property is included as an organizational
- type to avoid confusion with the semantics of the TITLE type and
- incorrect usage of that type when the semantics of this type is
- intended.
-
- Type example:
-
- ROLE:Programmer
-
-3.5.3 LOGO Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type LOGO
-
- Type name: LOGO
-
- Type purpose: To specify a graphic image of a logo associated with
- the object the vCard represents.
-
- Type encoding: The encoding MUST be reset to "b" using the ENCODING
- parameter in order to specify inline, encoded binary data. If the
- value is referenced by a URI value, then the default encoding of 8bit
- is used and no explicit ENCODING parameter is needed.
-
-
-
-
-
-Dawson & Howes Standards Track [Page 18]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type value: A single value. The default is binary value. It can also
- be reset to uri value. The uri value can be used to specify a value
- outside of this MIME entity.
-
- Type special notes: The type can include the type parameter "TYPE" to
- specify the graphic image format type. The TYPE parameter values MUST
- be one of the IANA registered image formats or a non-standard image
- format.
-
- Type example:
-
- LOGO;VALUE=uri:http://www.abc.com/pub/logos/abccorp.jpg
-
- LOGO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
- AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
- ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
- <...the remainder of "B" encoded binary data...>
-
-3.5.4 AGENT Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type AGENT
-
- Type name: AGENT
-
- Type purpose: To specify information about another person who will
- act on behalf of the individual or resource associated with the
- vCard.
-
- Type encoding: 8-bit
-
- Type value: The default is a single vcard value. It can also be reset
- to either a single text or uri value. The text value can be used to
- specify textual information. The uri value can be used to specify
- information outside of this MIME entity.
-
- Type special notes: This type typically is used to specify an area
- administrator, assistant, or secretary for the individual associated
- with the vCard. A key characteristic of the Agent type is that it
- represents somebody or something that is separately addressable.
-
- Type example:
-
- AGENT;VALUE=uri:
- CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com
-
-
-
-
-
-Dawson & Howes Standards Track [Page 19]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- AGENT:BEGIN:VCARD\nFN:Susan Thomas\nTEL:+1-919-555-
- 1234\nEMAIL\;INTERNET:sthomas@host.com\nEND:VCARD\n
-
-3.5.5 ORG Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type ORG
-
- Type name: ORG
-
- Type purpose: To specify the organizational name and units associated
- with the vCard.
-
- Type encoding: 8bit
-
- Type value: A single structured text value consisting of components
- separated the SEMI-COLON character (ASCII decimal 59).
-
- Type special notes: The type is based on the X.520 Organization Name
- and Organization Unit attributes. The type value is a structured type
- consisting of the organization name, followed by one or more levels
- of organizational unit names.
-
- Type example: A type value consisting of an organizational name,
- organizational unit #1 name and organizational unit #2 name.
-
- ORG:ABC\, Inc.;North American Division;Marketing
-
-3.6 Explanatory Types
-
- These types are concerned with additional explanations, such as that
- related to informational notes or revisions specific to the vCard.
-
-3.6.1 CATEGORIES Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type CATEGORIES
-
- Type name: CATEGORIES
-
- Type purpose: To specify application category information about the
- vCard.
-
- Type encoding: 8bit
-
-
-
-
-
-Dawson & Howes Standards Track [Page 20]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type value: One or more text values separated by a COMMA character
- (ASCII decimal 44).
-
- Type example:
-
- CATEGORIES:TRAVEL AGENT
-
- CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY
-
-3.6.2 NOTE Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type NOTE
-
- Type name: NOTE
-
- Type purpose: To specify supplemental information or a comment that
- is associated with the vCard.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: The type is based on the X.520 Description
- attribute.
-
- Type example:
-
- NOTE:This fax number is operational 0800 to 1715
- EST\, Mon-Fri.
-
-3.6.3 PRODID Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type PRODID
-
- Type name: PRODID
-
- Type purpose: To specify the identifier for the product that created
- the vCard object.
-
- Type encoding: 8-bit
-
- Type value: A single text value.
-
-
-
-
-
-Dawson & Howes Standards Track [Page 21]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type special notes: Implementations SHOULD use a method such as that
- specified for Formal Public Identifiers in ISO 9070 to assure that
- the text value is unique.
-
- Type example:
-
- PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN
-
-3.6.4 REV Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type REV
-
- Type name: REV
-
- Type purpose: To specify revision information about the current
- vCard.
-
- Type encoding: 8-bit
-
- Type value: The default is a single date-time value. Can also be
- reset to a single date value.
-
- Type special notes: The value distinguishes the current revision of
- the information in this vCard for other renditions of the
- information.
-
- Type example:
-
- REV:1995-10-31T22:27:10Z
-
- REV:1997-11-15
-
-3.6.5 SORT-STRING Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type SORT-STRING
-
- Type Name: SORT-STRING
-
- Type purpose: To specify the family name or given name text to be
- used for national-language-specific sorting of the FN and N types.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
-
-
-Dawson & Howes Standards Track [Page 22]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type special notes: The sort string is used to provide family name or
- given name text that is to be used in locale- or national-language-
- specific sorting of the formatted name and structured name types.
- Without this information, sorting algorithms could incorrectly sort
- this vCard within a sequence of sorted vCards. When this type is
- present in a vCard, then this family name or given name value is used
- for sorting the vCard.
-
- Type examples: For the case of family name sorting, the following
- examples define common sort string usage with the FN and N types.
-
- FN:Rene van der Harten
- N:van der Harten;Rene;J.;Sir;R.D.O.N.
- SORT-STRING:Harten
-
- FN:Robert Pau Shou Chang
- N:Pau;Shou Chang;Robert
- SORT-STRING:Pau
-
- FN:Osamu Koura
- N:Koura;Osamu
- SORT-STRING:Koura
-
- FN:Oscar del Pozo
- N:del Pozo Triscon;Oscar
- SORT-STRING:Pozo
-
- FN:Chistine d'Aboville
- N:d'Aboville;Christine
- SORT-STRING:Aboville
-
-3.6.6 SOUND Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type SOUND
-
- Type name: SOUND
-
- Type purpose: To specify a digital sound content information that
- annotates some aspect of the vCard. By default this type is used to
- specify the proper pronunciation of the name type value of the vCard.
-
- Type encoding: The encoding MUST be reset to "b" using the ENCODING
- parameter in order to specify inline, encoded binary data. If the
- value is referenced by a URI value, then the default encoding of 8bit
- is used and no explicit ENCODING parameter is needed.
-
-
-
-
-Dawson & Howes Standards Track [Page 23]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type value: A single value. The default is binary value. It can also
- be reset to uri value. The uri value can be used to specify a value
- outside of this MIME entity.
-
- Type special notes: The type can include the type parameter "TYPE" to
- specify the audio format type. The TYPE parameter values MUST be one
- of the IANA registered audio formats or a non-standard audio format.
-
- Type example:
-
- SOUND;TYPE=BASIC;VALUE=uri:CID:JOHNQPUBLIC.part8.
- 19960229T080000.xyzMail@host1.com
-
- SOUND;TYPE=BASIC;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
- AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
- ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
- <...the remainder of "B" encoded binary data...>
-
-3.6.7 UID Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type UID
-
- Type name: UID
-
- Type purpose: To specify a value that represents a globally unique
- identifier corresponding to the individual or resource associated
- with the vCard.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: The type is used to uniquely identify the object
- that the vCard represents.
-
- The type can include the type parameter "TYPE" to specify the format
- of the identifier. The TYPE parameter value should be an IANA
- registered identifier format. The value can also be a non-standard
- format.
-
- Type example:
-
- UID:19950401-080045-40000F192713-0052
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 24]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-3.6.8 URL Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type URL
-
- Type name: URL
-
- Type purpose: To specify a uniform resource locator associated with
- the object that the vCard refers to.
-
- Type encoding: 8bit
-
- Type value: A single uri value.
-
- Type example:
-
- URL:http://www.swbyps.restaurant.french/~chezchic.html
-
-3.6.9 VERSION Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type VERSION
-
- Type name: VERSION
-
- Type purpose: To specify the version of the vCard specification used
- to format this vCard.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: The property MUST be present in the vCard object.
- The value MUST be "3.0" if the vCard corresponds to this
- specification.
-
- Type example:
-
- VERSION:3.0
-
-3.7 Security Types
-
- These types are concerned with the security of communication pathways
- or access to the vCard.
-
-
-
-
-
-Dawson & Howes Standards Track [Page 25]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-3.7.1 CLASS Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type CLASS
-
- Type name: CLASS
-
- Type purpose: To specify the access classification for a vCard
- object.
-
- Type encoding: 8bit
-
- Type value: A single text value.
-
- Type special notes: An access classification is only one component of
- the general security model for a directory service. The
- classification attribute provides a method of capturing the intent of
- the owner for general access to information described by the vCard
- object.
-
- Type examples:
-
- CLASS:PUBLIC
-
- CLASS:PRIVATE
-
- CLASS:CONFIDENTIAL
-
-3.7.2 KEY Type Definition
-
- To: ietf-mime-directory@imc.org
-
- Subject: Registration of text/directory MIME type KEY
-
- Type name: KEY
-
- Type purpose: To specify a public key or authentication certificate
- associated with the object that the vCard represents.
-
- Type encoding: The encoding MUST be reset to "b" using the ENCODING
- parameter in order to specify inline, encoded binary data. If the
- value is a text value, then the default encoding of 8bit is used and
- no explicit ENCODING parameter is needed.
-
- Type value: A single value. The default is binary. It can also be
- reset to text value. The text value can be used to specify a text
- key.
-
-
-
-Dawson & Howes Standards Track [Page 26]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- Type special notes: The type can also include the type parameter TYPE
- to specify the public key or authentication certificate format. The
- parameter type should specify an IANA registered public key or
- authentication certificate format. The parameter type can also
- specify a non-standard format.
-
- Type example:
-
- KEY;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA
- wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX
- Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
- ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj
- E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD
- VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx
- MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz
- Y2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ
- EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2
- dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB
- EGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau
- +hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP
- mx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//y
- rZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7
- UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ==
-
-3.8 Extended Types
-
- The types defined by this document can be extended with private types
- using the non-standard, private values mechanism defined in [RFC
- 2045]. Non-standard, private types with a name starting with "X-" may
- be defined bilaterally between two cooperating agents without outside
- registration or standardization.
-
-4. Formal Grammar
-
- The following formal grammar is provided to assist developers in
- building parsers for the vCard.
-
- This syntax is written according to the form described in RFC 2234,
- but it references just this small subset of RFC 2234 literals:
-
- ;*******************************************
- ; Commonly Used Literal Definition
- ;*******************************************
-
- ALPHA = %x41-5A / %x61-7A
- ; Latin Capital Letter A-Latin Capital Letter Z /
- ; Latin Small Letter a-Latin Small Letter z
-
-
-
-
-Dawson & Howes Standards Track [Page 27]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- CHAR = %x01-7F
- ; Any C0 Controls and Basic Latin, excluding NULL from
- ; Code Charts, pages 7-6 through 7-9 in [UNICODE]
-
- CR = %x0D
- ; Carriage Return
-
- LF = %0A
- ; Line Feed
-
- CRLF = CR LF
- ; Internet standard newline
-
- ;CTL = %x00-1F / %x7F
- ; Controls. Not used, but referenced in comments.
-
- DIGIT = %x30-39
- ; Digit Zero-Digit Nine
-
- DQUOTE = %x22
- ; Quotation Mark
-
- HTAB = %x09
- ; Horizontal Tabulation
-
- SP = %x20
- ; space
-
- VCHAR = %x21-7E
- ; Visible (printing) characters
-
- WSP = SP / HTAB
- ; White Space
-
- ;*******************************************
- ; Basic vCard Definition
- ;*******************************************
-
- vcard_entity = 1*(vcard)
-
- vcard = [group "."] "BEGIN" ":" "VCARD" 1*CRLF
- 1*(contentline)
- ;A vCard object MUST include the VERSION, FN and N types.
- [group "."] "END" ":" "VCARD" 1*CRLF
-
- contentline = [group "."] name *(";" param ) ":" value CRLF
- ; When parsing a content line, folded lines must first
- ; be unfolded according to the unfolding procedure
-
-
-
-Dawson & Howes Standards Track [Page 28]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- ; described above. When generating a content line, lines
- ; longer than 75 characters SHOULD be folded according to
- ; the folding procedure described in [MIME DIR].
-
- group = 1*(ALPHA / DIGIT / "-")
-
- name = iana-token / x-name
- ; Parsing of the param and value is
- ; based on the "name" or type identifier
- ; as defined in ABNF sections below
-
- iana-token = 1*(ALPHA / DIGIT / "-")
- ; vCard type or parameter identifier registered with IANA
-
- x-name = "X-" 1*(ALPHA / DIGIT / "-")
- ; Reserved for non-standard use
-
- param = param-name "=" param-value *("," param-value)
-
- param-name = iana-token / x-name
-
- param-value = ptext / quoted-string
-
- ptext = *SAFE-CHAR
-
- value = *VALUE-CHAR
-
- quoted-string = DQUOTE QSAFE-CHAR DQUOTE
-
- NON-ASCII = %x80-FF
- ; Use is restricted by CHARSET parameter
- ; on outer MIME object (UTF-8 preferred)
-
- QSAFE-CHAR = WSP / %x21 / %x23-7E / NON-ASCII
- ; Any character except CTLs, DQUOTE
-
- SAFE-CHAR = WSP / %x21 / %x23-2B / %x2D-39 / %x3C-7E / NON-ASCII
- ; Any character except CTLs, DQUOTE, ";", ":", ","
-
- VALUE-CHAR = WSP / VCHAR / NON-ASCII
- ; Any textual character
-
- ;*******************************************
- ; vCard Type Definition
- ;
- ; Provides type-specific definitions for how the
- ; "value" and "param" are defined.
- ;*******************************************
-
-
-
-Dawson & Howes Standards Track [Page 29]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- ;For name="NAME"
- param = ""
- ; No parameters allowed
-
- value = text-value
-
- ;For name="PROFILE"
- param = ""
- ; No parameters allowed
-
- value = text-value
- ; Value MUST be the case insensitive value "VCARD
-
- ;For name="SOURCE"
- param = source-param
- ; No parameters allowed
-
- value = uri
-
- source-param = ("VALUE" "=" "uri")
- / ("CONTEXT" "=" "word")
- ; Parameter value specifies the protocol context
- ; for the uri value.
- / (x-name "=" *SAFE-CHAR)
-
- ;For name="FN"
- ;This type MUST be included in a vCard object.
- param = text-param
- ; Text parameters allowed
-
- value = text-value
-
- ;For name="N"
- ;This type MUST be included in a vCard object.
-
- param = text-param
- ; Text parameters allowed
-
- value = n-value
-
- n-value = 0*4(text-value *("," text-value) ";")
- text-value *("," text-value)
- ; Family; Given; Middle; Prefix; Suffix.
- ; Example: Public;John;Quincy,Adams;Reverend Dr. III
-
- ;For name="NICKNAME"
- param = text-param
- ; Text parameters allowed
-
-
-
-Dawson & Howes Standards Track [Page 30]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- value = text-list
-
- ;For name="PHOTO"
- param = img-inline-param
- ; Only image parameters allowed
-
- param =/ img-refer-param
- ; Only image parameters allowed
-
- value = img-inline-value
- ; Value and parameter MUST match
-
- value =/ img-refer-value
- ; Value and parameter MUST match
-
- ;For name="BDAY"
- param = ("VALUE" "=" "date")
- ; Only value parameter allowed
-
- param =/ ("VALUE" "=" "date-time")
- ; Only value parameter allowed
-
- value = date-value
- ; Value MUST match value type
-
- value =/ date-time-value
- ; Value MUST match value type
-
- ;For name="ADR"
- param = adr-param / text-param
- ; Only adr and text parameters allowed
-
- value = adr-value
-
- ;For name="LABEL"
- param = adr-param / text-param
- ; Only adr and text parameters allowed
-
- value = text-value
-
- ;For name="TEL"
- param = tel-param
- ; Only tel parameters allowed
-
- value = phone-number-value
-
- tel-param = "TYPE" "=" tel-type *("," tel-type)
-
-
-
-
-Dawson & Howes Standards Track [Page 31]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- tel-type = "HOME" / "WORK" / "PREF" / "VOICE" / "FAX" / "MSG"
- / "CELL" / "PAGER" / "BBS" / "MODEM" / "CAR" / "ISDN"
- / "VIDEO" / "PCS" / iana-token / x-name
- ; Values are case insensitive
-
- ;For name="EMAIL"
- param = email-param
- ; Only email parameters allowed
-
- value = text-value
-
- email-param = "TYPE" "=" email-type ["," "PREF"]
- ; Value is case insensitive
-
- email-type = "INTERNET" / "X400" / iana-token / "X-" word
- ; Values are case insensitive
-
- ;For name="MAILER"
- param = text-param
- ; Only text parameters allowed
-
- value = text-value
-
- ;For name="TZ"
- param = ""
- ; No parameters allowed
-
- value = utc-offset-value
-
- ;For name="GEO"
- param = ""
- ; No parameters allowed
-
- value = float-value ";" float-value
-
- ;For name="TITLE"
- param = text-param
- ; Only text parameters allowed
-
- value = text-value
-
- ;For name="ROLE"
- param = text-param
- ; Only text parameters allowed
-
- value = text-value
-
- ;For name="LOGO"
-
-
-
-Dawson & Howes Standards Track [Page 32]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- param = img-inline-param / img-refer-param
- ; Only image parameters allowed
-
- value = img-inline-value / img-refer-value
- ; Value and parameter MUST match
-
- ;For name="AGENT"
- param = agent-inline-param
-
- param =/ agent-refer-param
-
- value = agent-inline-value
- ; Value and parameter MUST match
-
- value =/ agent-refer-value
- ; Value and parameter MUST match
-
- agent-inline-param = ""
- ; No parameters allowed
-
- agent-refer-param = "VALUE" "=" "uri"
- ; Only value parameter allowed
-
- agent-inline-value = text-value
- ; Value MUST be a valid vCard object
-
- agent-refer-value = uri
- ; URI MUST refer to image content of given type
-
- ;For name="ORG"
-
- param = text-param
- ; Only text parameters allowed
-
- value = org-value
-
- org-value = *(text-value ";") text-value
- ; First is Organization Name, remainder are Organization Units.
-
- ;For name="CATEGORIES"
- param = text-param
- ; Only text parameters allowed
-
- value = text-list
-
- ;For name="NOTE"
- param = text-param
- ; Only text parameters allowed
-
-
-
-Dawson & Howes Standards Track [Page 33]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- value = text-value
-
- ;For name="PRODID"
- param = ""
- ; No parameters allowed
-
- value = text-value
-
- ;For name="REV"
- param = ["VALUE" =" "date-time"]
- ; Only value parameters allowed. Values are case insensitive.
-
- param =/ "VALUE" =" "date"
- ; Only value parameters allowed. Values are case insensitive.
-
- value = date-time-value
-
- value =/ date-value
-
- ;For name="SORT-STRING"
- param = text-param
- ; Only text parameters allowed
-
- value = text-value
-
- ;For name="SOUND"
- param = snd-inline-param
- ; Only sound parameters allowed
-
- param =/ snd-refer-param
- ; Only sound parameters allowed
-
- value = snd-line-value
- ; Value MUST match value type
-
- value =/ snd-refer-value
- ; Value MUST match value type
-
- snd-inline-value = binary-value CRLF
- ; Value MUST be "b" encoded audio content
-
- snd-inline-param = ("VALUE" "=" "binary"])
- / ("ENCODING" "=" "b")
- / ("TYPE" "=" *SAFE-CHAR)
- ; Value MUST be an IANA registered audio type
-
- snd-refer-value = uri
- ; URI MUST refer to audio content of given type
-
-
-
-Dawson & Howes Standards Track [Page 34]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- snd-refer-param = ("VALUE" "=" "uri")
- / ("TYPE" "=" word)
- ; Value MUST be an IANA registered audio type
-
- ;For name="UID"
- param = ""
- ; No parameters allowed
-
- value = text-value
-
- ;For name="URL"
- param = ""
- ; No parameters allowed
-
- value = uri
-
- ;For name="VERSION"
- ;This type MUST be included in a vCard object.
- param = ""
- ; No parameters allowed
-
- value = text-value
- ; Value MUST be "3.0"
-
- ;For name="CLASS"
- param = ""
- ; No parameters allowed
-
- value = "PUBLIC" / "PRIVATE" / "CONFIDENTIAL"
- / iana-token / x-name
- ; Value are case insensitive
-
- ;For name="KEY"
- param = key-txt-param
- ; Only value and type parameters allowed
-
- param =/ key-bin-param
- ; Only value and type parameters allowed
-
- value = text-value
-
- value =/ binary-value
-
- key-txt-param = "TYPE" "=" keytype
-
- key-bin-param = ("TYPE" "=" keytype)
- / ("ENCODING" "=" "b")
- ; Value MUST be a "b" encoded key or certificate
-
-
-
-Dawson & Howes Standards Track [Page 35]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- keytype = "X509" / "PGP" / iana-token / x-name
- ; Values are case insensitive
-
- ;For name="X-" non-standard type
- param = text-param / (x-name "=" param-value)
- ; Only text or non-standard parameters allowed
-
- value = text-value
-
- ;*******************************************
- ; vCard Commonly Used Parameter Definition
- ;*******************************************
-
- text-param = ("VALUE" "=" "ptext")
- / ("LANGUAGE" "=" langval)
- / (x-name "=" param-value)
-
- langval = <a language string as defined in RFC 1766>
-
- img-inline-value = binary-value
- ;Value MUST be "b" encoded image content
-
- img-inline-param
-
- img-inline-param = ("VALUE" "=" "binary")
- / ("ENCODING" "=" "b")
- / ("TYPE" "=" param-value
- ;TYPE value MUST be an IANA registered image type
-
- img-refer-value = uri
- ;URI MUST refer to image content of given type
-
- img-refer-param = ("VALUE" "=" "uri")
- / ("TYPE" "=" param-value)
- ;TYPE value MUST be an IANA registered image type
-
- adr-param = ("TYPE" "=" adr-type *("," adr-type))
- / (text-param)
-
- adr-type = "dom" / "intl" / "postal" / "parcel" / "home"
- / "work" / "pref" / iana-type / x-name
-
- adr-value = 0*6(text-value ";") text-value
- ; PO Box, Extended Address, Street, Locality, Region, Postal
- ; Code, Country Name
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 36]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- ;*******************************************
- ; vCard Type Value Definition
- ;*******************************************
-
- text-value-list = 1*text-value *("," 1*text-value)
-
- text-value = *(SAFE-CHAR / ":" / DQUOTE / ESCAPED-CHAR)
-
- ESCAPED-CHAR = "\\" / "\;" / "\," / "\n" / "\N")
- ; \\ encodes \, \n or \N encodes newline
- ; \; encodes ;, \, encodes ,
-
- binary-value = <A "b" encoded text value as defined in [RFC 2047]>
-
- date-value = <A single date value as defined in [MIME-DIR]>
-
- time-value = <A single time value as defined in [MIME-DIR]>
-
- date-time-value = <A single date-time value as defined in [MIME-DIR]
-
- float-value = <A single float value as defined in [MIME-DIR]>
-
- phone-number-value = <A single text value as defined in [CCITT
- E.163] and [CCITT X.121]>
-
- uri-value = <A uri value as defined in [MIME-DIR]>
-
- utc-offset-value = ("+" / "-") time-hour ":" time-minute
- time-hour = 2DIGIT ;00-23
- time-minute = 2DIGIT ;00-59
-
-5. Differences From vCard v2.1
-
- This specification has been reviewed by the IETF community. The
- review process introduced a number of differences from the [VCARD]
- version 2.1. These differences require that vCard objects conforming
- to this specification have a different version number than a vCard
- conforming to [VCARD]. The differences include the following:
-
- . The QUOTED-PRINTABLE inline encoding has been eliminated.
- Only the "B" encoding of [RFC 2047] is an allowed value for
- the ENCODING parameter.
-
- . The method for specifying CRLF character sequences in text
- type values has been changed. The CRLF character sequence in
- a text type value is specified with the backslash character
- sequence "\n" or "\N".
-
-
-
-
-Dawson & Howes Standards Track [Page 37]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- . Any COMMA or SEMICOLON in a text type value must be backslash
- escaped.
-
- . VERSION value corresponding to this specification MUST be
- "3.0".
-
- . The [MIME-DIR] predefined types of SOURCE, NAME and PROFILE
- are allowed.
-
- . The [MIME-DIR] VALUE type parameter for value data typing is
- allowed. In addition, there are extensions made to these type
- values for additional value types used in this specification.
-
- . The [VCARD] CHARSET type parameter has been eliminated.
- Character set can only be specified on the CHARSET parameter
- on the Content-Type MIME header field.
-
- . The [VCARD] support for non-significant WSP character has
- been eliminated.
-
- . The "TYPE=" prefix to parameter values is required. In
- [VCARD] this was optional.
-
- . LOGO, PHOTO and SOUND multimedia formats MUST be either IANA
- registered types or non-standard types.
-
- . Inline binary content must be "B" encoded and folded. A blank
- line after the encoded binary content is no longer required.
-
- . TEL values can be identified as personal communication
- services telephone numbers with the PCS type parameter value.
-
- . The CATEGORIES, CLASS, NICKNAME, PRODID and SORT-STRING types
- have been added.
-
- . The VERSION, N and FN types MUST be specified in a vCard.
- This identifies the version of the specification that the
- object was formatted to. It also assures that every vCard
- will include both a structured and formatted name that can be
- used to identify the object.
-
-
-
-
-
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 38]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-6. Acknowledgements
-
- The many valuable comments contributed by members of the IETF ASID
- working group are gratefully acknowledged, as are the contributions
- by Roland Alden, Stephen Bartlett, Alec Dun, Patrik Faltstrom, Daniel
- Gurney, Bruce Johnston, Daniel Klaussen, Pete Miller, Keith Moore,
- Vinod Seraphin, Michelle Watkins. Chris Newman was especially helpful
- in navigating the intricacies of ABNF lore.
-
-7. Authors' Addresses
-
- BEGIN:vCard
- VERSION:3.0
- FN:Frank Dawson
- ORG:Lotus Development Corporation
- ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive
- ;Raleigh;NC;27613-3502;U.S.A.
- TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
- TEL;TYPE=FAX,WORK:+1-919-676-9564
- EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
- EMAIL;TYPE=INTERNET:fdawson@earthlink.net
- URL:http://home.earthlink.net/~fdawson
- END:vCard
-
-
- BEGIN:vCard
- VERSION:3.0
- FN:Tim Howes
- ORG:Netscape Communications Corp.
- ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View;
- CA; 94043;U.S.A.
- TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419
- TEL;TYPE=FAX,WORK:+1-415-528-4164
- EMAIL;TYPE=INTERNET:howes@netscape.com
- END:vCard
-
-8. Security Considerations
-
- vCards can carry cryptographic keys or certificates, as described in
- Section 3.7.2.
-
- Section 3.7.1 specifies a desired security classification policy for
- a particular vCard. That policy is not enforced in any way.
-
- The vCard objects have no inherent authentication or privacy, but can
- easily be carried by any security mechanism that transfers MIME
- objects with authentication or privacy. In cases where threats of
- "spoofed" vCard information is a concern, the vCard SHOULD BE
-
-
-
-Dawson & Howes Standards Track [Page 39]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- transported using one of these secure mechanisms.
-
- The information in a vCard may become out of date. In cases where the
- vitality of data is important to an originator of a vCard, the "URL"
- type described in section 3.6.8 SHOULD BE specified. In addition, the
- "REV" type described in section 3.6.4 can be specified to indicate
- the last time that the vCard data was updated.
-
-9. References
-
- [ISO 8601] ISO 8601:1988 - Data elements and interchange formats -
- Information interchange - Representation of dates and
- times - The International Organization for
- Standardization, June, 1988.
-
- [ISO 8601 TC] ISO 8601, Technical Corrigendum 1 - Data elements and
- interchange formats - Information interchange -
- Representation of dates and times - The International
- Organization for Standardization, May, 1991.
-
- [ISO 9070] ISO 9070, Information Processing - SGML support
- facilities - Registration Procedures for Public Text
- Owner Identifiers, April, 1991.
-
- [CCITT E.163] Recommendation E.163 - Numbering Plan for The
- International Telephone Service, CCITT Blue Book,
- Fascicle II.2, pp. 128-134, November, 1988.
-
- [CCITT X.121] Recommendation X.121 - International Numbering Plan for
- Public Data Networks, CCITT Blue Book, Fascicle VIII.3,
- pp. 317-332, November, 1988.
-
- [CCITT X.520] Recommendation X.520 - The Directory - Selected
- Attribute Types, November 1988.
-
- [CCITT X.521] Recommendation X.521 - The Directory - Selected Object
- Classes, November 1988.
-
- [MIME-DIR] Howes, T., Smith, M., and F. Dawson, "A MIME Content-
- Type for Directory Information", RFC 2425, September
- 1998.
-
- [RFC 1738] Berners-Lee, T., Masinter, L., and M. McCahill,
- "Uniform Resource Locators (URL)", RFC 1738, December
- 1994.
-
- [RFC 1766] Alvestrand, H., "Tags for the Identification of
- Languages", RFC 1766, March 1995.
-
-
-
-Dawson & Howes Standards Track [Page 40]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
- [RFC 1872] Levinson, E., "The MIME Multipart/Related Content-
- type", RFC 1872, December 1995.
-
- [RFC 2045] Freed, N., and N. Borenstein, "Multipurpose Internet
- Mail Extensions (MIME) - Part One: Format of Internet
- Message Bodies", RFC 2045, November 1996.
-
- [RFC 2046] Freed, N., and N. Borenstein, "Multipurpose Internet
- Mail Extensions (MIME) - Part Two: Media Types", RFC
- 2046, November 1996.
-
- [RFC 2047] Moore, K., "Multipurpose Internet Mail Extensions
- (MIME) - Part Three: Message Header Extensions for
- Non-ASCII Text", RFC 2047, November 1996.
-
- [RFC 2048] Freed, N., Klensin, J., and J. Postel, "Multipurpose
- Internet Mail Extensions (MIME) - Part Four:
- Registration Procedures", RFC 2048, January 1997.
-
- [RFC 2119] Bradner, S., "Key words for use in RFCs to Indicate
- Requirement Levels", BCP 14, RFC 2119, March 1997.
-
- [RFC 2234] Crocker, D., and P. Overell, "Augmented BNF for Syntax
- Specifications: ABNF", RFC 2234, November 1997.
-
- [UNICODE] "The Unicode Standard - Version 2.0", The Unicode
- Consortium, July 1996.
-
- [VCARD] Internet Mail Consortium, "vCard - The Electronic
- Business Card Version 2.1",
- http://www.imc.org/pdi/vcard-21.txt, September 18,
- 1996.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 41]
-
-RFC 2426 vCard MIME Directory Profile September 1998
-
-
-10. Full Copyright Statement
-
- Copyright (C) The Internet Society (1998). All Rights Reserved.
-
- This document and translations of it may be copied and furnished to
- others, and derivative works that comment on or otherwise explain it
- or assist in its implementation may be prepared, copied, published
- and distributed, in whole or in part, without restriction of any
- kind, provided that the above copyright notice and this paragraph are
- included on all such copies and derivative works. However, this
- document itself may not be modified in any way, such as by removing
- the copyright notice or references to the Internet Society or other
- Internet organizations, except as needed for the purpose of
- developing Internet standards in which case the procedures for
- copyrights defined in the Internet Standards process must be
- followed, or as required to translate it into languages other than
- English.
-
- The limited permissions granted above are perpetual and will not be
- revoked by the Internet Society or its successors or assigns.
-
- This document and the information contained herein is provided on an
- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
- TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
- HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Dawson & Howes Standards Track [Page 42]
-
diff --git a/addressbook/backend/ebook/docs/vcard-21.txt b/addressbook/backend/ebook/docs/vcard-21.txt
deleted file mode 100644
index 64716ebf15..0000000000
--- a/addressbook/backend/ebook/docs/vcard-21.txt
+++ /dev/null
@@ -1,1544 +0,0 @@
-vCard
-The Electronic Business Card
-Version 2.1
-
-A versit Consortium Specification
-September 18, 1996
-
-
-Copyrights
-© 1996, International Business Machines Corp., Lucent Technologies, Inc., and Siemens. All rights reserved.
-Permission is granted to copy and distribute this publication provided that it is reproduced in its entirety without modification and includes the above copyright notice and this permission notice.
-No licenses, express or implied, are granted with respect to any of the technology described in this publication. International Business Machines Corp., Lucent Technologies, Inc., and Siemens retain all their intellectual property rights in the technology described in this publication.
-Even though International Business Machines Corp., Lucent Technologies, Inc., and Siemens have reviewed this specification, INTERNATIONAL BUSINESS MACHINES CORP., LUCENT TECHNOLOGIES, INC, AND SIEMENS, MAKE NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS PUBLICATION, ITS QUALITY OR ACCURACY, NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS SPECIFICATION IS DELIVERED "AS IS" AND THE READER ASSUMES THE ENTIRE RISK AS TO ITS QUALITY, ACCURACY OR SUITABILITY FOR ANY PARTICULAR PURPOSE..
-IN NO EVENT WILL INTERNATIONAL BUSINESS MACHINES CORP., LUCENT TECHNOLOGIES, INC, AND SIEMENS, BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS PUBLICATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-This publication is provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by the Government are subject to restrictions set forth in DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
-
-
-Trademarks
-versit, the versit logo, versitcard, vCard, and vCalendar are trademarks of Apple Computer, Inc., AT&T Corp., International Business Machines Corp., and Siemens.
-Apple, is a trademarks of Apple Computer, Inc. registered in the U.S. and other countries.
-AT&T and ATTMail are registered trademarks of AT&T Corp.
-IBM, IBM Mail, and OS/2 are registered trademarks of International Business Machines Corporation.
-America Online is a registered trademark of America Online, Inc.
-CompuServe, CompuServe Information Services are registered trademarks of Compuserve Incorporated.
-MCIMail is a registered trademark of MCI Communications Corporation.
-Microsoft is a registered trademark, and Microsoft Windows is a trademark of Microsoft Corporation.
-Prodigy is a registered trademark of Prodigy Services Company.
-Unicode is a registered trademark of Unicode, Inc.
-
-
-Contributors
-Roland Alden
-Greg Ames, Ames & Associates
-Masanari Arai, Puma Technologies
-Stephen W. Bartlett
-Donal Carroll
-Liang-Jye Chang, Starfish Software
-Frank Dawson, IBM Corporation
-Ken Dobson, IntelliLink Inc.
-Scott Feldstein, Nimble Software, Inc.
-Anik Ganguly, OnTime/Division of FTP Software.
-Beijing Goo, Microsoft
-Arvind K. Goyal, Lotus Development Corporation
-Gary Hand, IBM Corporation
-Tim Howes, Netscape Communications Corporation
-Mark Joseph, Attachmate Corporation
-Kerry Kelly, Now Software, Inc.
-Phac Letuan, Apple Computer, Inc.
-Pat Megowan, Counterpoint Sytems Foundry Inc.
-Tohri Mori, IBM Japan/Salutation Consortium
-Ravi Pandya, NetManage, Inc.
-Geoff Ralston, Four11 Corporation
-Steven Rummel, Lucent Technologies
-Michael Santullo, Four11 Corporation
-Vinod Seraphin, Lotus Development Corporation
-Dexter Seely, Corex Technologies, Inc.
-Vlad Shmunis, Ring Zero Systems Inc.
-Dean Stevens, Now Software, Inc.
-Michelle Watkins, Netscape Communications Corporation
-Horst Widlewski, Siemens
-
-
-Reference Information
-The cited references contain provisions which, through reference in this specification, constitute provisions of this specification. At the time of publication, the indicated versions in the following references were valid. Parties to agreements based on this specification are encouraged to research the possibility of revised standards.
-* ANSI X3.4-1977, Code for Information Interchange, American National Standards Institute, 1977.
-* CCITT (ITU) Recommendation E.163, Numbering Plan for The International Telephone Service, CCITT Blue Book, Fascicle II.2, pp. 128-134, November, 1988.
-* CCITT (ITU) Recommendation G.721, 32 kbit/s Adaptive Differential Pulse Code Modulation (ADPCM), CCITT Red Book, Fascicle III.4, November, 1988.
-* CCITT (ITU) Recommendation X.121, International Numbering Plan for Public Data Networks, CCITT Blue Book, Fascicle VIII.3, pp. 317-332, November, 1988.
-* CCITT (ITU) Recommendations X.500-X.521, Data Communication Networks: Directory, CCITT Blue Book, Fascicle VIII.8, November, 1988.
-* CCITT Recommendation X.520, The Directory-Selected Attribute Types, 1988.
-* CCITT Recommendation X.521, The Directory-Selected Object Classes, 1988.
-* IETF RFC 1738, Universal Resource Locator, December 1994.
-* IETF Network Working Group RFC 1766, Tags for the Identification of Languages, March 1995.
-* IETF Network Working Group Draft, A MIME Content-Type for Directory Information, January 1996. Available from the University of Michigan, 535 W. William St., Ann Arbor, MI 48103-4943, FTP://ds.internic.net/Internet-Drafts/draft-ietf-asid-mime-direct-01.txt.
-* IETF Network Working Group Draft, An Application/Directory MIME Content-Type Electronic Business Card Profile, May 1996. Available FTP://ds.internic.net/Internet-Drafts/draft-ietf-asid-mime-vcard-00.txt.
-* IETF Network Working Group Draft, UTF-8, A Transformation Format of UNICODE and ISO 10646, July 1996. Available from FTP://ds.internic.net/Internet-Drafts/draft-yergeau-utf8-01.txt.
-* ISO 639, Code for The Representation of names of languages, International Organization for Standardization, April, 1988.
-* ISO 3166, Codes for The Representation of names of countries, International Organization for Standardization, December, 1993.
-* ISO 8601, Data elements and interchange formats-Information interchange-Representation of dates and times, International Organization for Standardization, June, 1988.
-* ISO 8601, Technical Corrigendum 1, Data elements and interchange formats-Information interchange-Representation of dates and times, International Organization for Standardization, May, 1991.
-* ISO 8859-1, Information Processing-8-Bit single-byte coded graphic character sets-Part 1: Latin Alphabet No. 1, International Organization for Standardization, February, 1987.
-* ISO 9070, Information Processing-SGML support facilities-Registration Procedures for Public Text Owner Identifiers, 1990-02-01.[DS1]
-ï ISO/IEC 9070, Information TechnologyóSGML Support FacilitiesóRegistration Procedures for Public Text Owner Identifiers, Second Edition, International Organization for Standardization, April, 1991.
-ï ISO/IEC 11180, Postal addressing, International Organization for Standardization, 1993.
-ï Appleís Representation of a Canonical Static DeviceID in The Telephony Suite, version 1.0, Apple Computer, Inc., 1993.
-* Microsoft TAPI in Microsoft Windows 3.1 Telephony Programmers' Guide, version 1.0, Microsoft Corporation, 1993.
-* RFC1521, MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies, Network Working Group, September, 1993.
-* The Unicode Standard, Version 1.1: Version 1.0, Volume 1 (ISBN 0-201-56788-1), version 1.0, volume 2 (ISBN 0-20-60845-6) and Unicode Technical Report #4, The Unicode Standard, version 1.1, The Unicode Consortium, October, 1991. Both references to be published by Addison-Wesley.
-
-
-versit Update
-versit is a multivendor development initiative of the communication and computer industries, founded by Apple, AT&T, IBM and Siemens. The versit parties believe that great potential exists in improving the nature of communications in the business world-permitting companies to better manage their quality, productivity, customer satisfaction and cost of operations, while expanding the market opportunities for a variety of product and service vendors. versit parties will jointly define and support open specifications that facilitate and promote the interoperability of advanced personal information and communication devices, networks and services.
-The versit vision is to enable diverse communication and computing devices, applications and services from competing vendors to interoperate in all environments. Through developing a series of specifications for interoperability among diverse communications and computing devices, applications, networks and services, versit 's vision will become a reality.
-versit 's primary development areas are in:
-* Personal Data Interchange (PDI)
-* Computer Telephone Integration (CTI)
-* Conferencing and Messaging (C&M)
-* Wired and Wireless connectivity
-versit specifications are directed at both the decision makers and the implementation teams of:
-* Equipment Manufacturers
-* Independent Software Vendors
-* Information Service Providers
-* Online Service Providers
-* Software Houses
-* Users
-versit specifications are made available to any interested party. In turn, versit encourages the support of our goals by soliciting feedback on versit specifications.
-
-All comments relating to versit or the material within this specification should be submitted to:
-versit
-(800) 803-6240
-+1 (201) 327-2803 (Outside USA)
-pdi@versit.com
-http://www.versit.com/pdi
-
-
-Contents
-Section 1 : Introduction
-1.1 Overview
-1.2 Scope
-1.3 Contents
-1.4 Definitions and Abbreviations
-Section 2 : vCard Specificiation
-2.1 Encoding Characteristics
-2.1.1 vCard Object
-2.1.2 Property
-2.1.3 Delimiters
-2.1.4 Grouping
-2.1.4.1 vCard Grouping
-2.1.4.2 Property Grouping
-2.1.5 Encodings
-2.1.6 Character Set
-2.1.7 Language
-2.1.8 Value Location
-2.1.9 Binary Values
-2.2 Identification Properties
-2.2.1 Formatted Name
-2.2.2 Name
-2.2.3 Photograph
-2.2.3.1 Photo Format Type
-2.2.4 Birthdate
-2.3 Delivery Addressing Properties
-2.3.1 Delivery Address
-2.3.1.1 Delivery Address Type
-2.3.2 Delivery Label
-2.3.2.1 Delivery Label Type
-2.4 Telecommunications Addressing Properties
-2.4.1 Telephone Number
-2.4.1.1 Telephone Type
-2.4.2 Electronic Mail
-2.4.2.1 Electronic Mail Type
-2.4.3 Mailer
-2.4.4 Geographical Properties
-2.4.5 Time Zone
-2.4.6 Geographic Position
-2.5 Organizational Properties
-2.5.1 Title
-2.5.2 Business Category
-2.5.3 Logo
-2.5.3.1 Logo Format Type
-2.5.4 Agent
-2.5.5 Organization Name and Organizational Unit
-2.6 Explanatory Properties
-2.6.1 Comment
-2.6.2 Last Revision
-2.6.3 Sound
-2.6.3.1 Sound Digital Audio Type
-2.6.4 Uniform Resource Locator
-2.6.5 Unique Identifier
-2.6.6 Version
-2.7 Security Properties
-2.7.1 Public Key
-2.7.2 Key Type
-2.8 Miscellaneous Properties
-2.8.1 Extensions
-2.9 Formal Definition
-Section 3 : Internet Recommendations
-3.1 Recommended Practice with SMTP/MIME
-3.1.1 Text/Plain Content Type
-3.1.2 Text/X-vCard Content Type
-3.1.3 Application/Directory Content Type
-3.2 Recommended Practice with HTTP/HTML
-3.2.1 Form Element Usage
-3.2.2 Mapping To INPUT Element Attribute Names
-3.2.3 Example HTML Code
-Section 4 : UI Support Recommendations
-4.1 File System
-4.2 Clipboard
-4.3 Drag/Drop
-Section 5 : Conformance
-
-
-
-Section 1 : Introduction
-[DS2]
-Personal Data Interchange (PDI) occurs every time two or more individuals communicate, in either a business or personal context, face-to-face, or across space and time. Such interchanges frequently include the exchange of informal information, such as business cards, telephone numbers, addresses, dates and times of appointments, etc. Augmenting PDI with electronics and telecommunications can help ensure that information is quickly and reliably communicated, stored, organized and easily located when needed.
-Personal information, by nature, is complex and diverse. Currently, proprietary standards exist to structure some types of PDI information, but no single, open specification comprehensively addresses the needs of collecting and communicating PDI information across many common communication channels such as telephones, voice-mail, e-mail, and face-to-face meetings. versit is developing a comprehensive family of PDI technologies based on open specifications and interoperability agreements to help meet this technology need.
-Overview
-This specification defines a format for an electronic business card, or vCard. The format is suitable as an interchange format between applications or systems. The format is defined independent of the particular method used to transport it. The transport for this exchange might be a file system, point-to-point asynchronous communication, wired-network transport, or some form of unwired transport.
-A vCard is a data stream consisting of one or more vCard objects. The individual vCard definitions can be identified and parsed within the datastream. The vCard data stream may exist as a persistent form in a file system, document management system, network connection between two network endpoints, or in any other digital transport that has an abstraction of a stream of bytes.
-Conceptually, a vCard Writer creates vCard data streams and a vCard Reader interprets vCard data streams. The vCard Reader and Writer may be implemented as a single application or as separate applications. It is not the intent of this specification to define the implementation of these processes beyond some fundamental capabilities related to the format of the vCard data stream and a common set of conformance requirements .
-This specification provides for a clear-text encoding that is intended to be based on the syntax used by the MIME specification (RFC 1521).
-The encoding of this specification can be used in environments which are constrained to 7-bit transfer encodings, short line lengths, and low bandwidth. In addition, the encoding is simple in order to facilitate the implementation of reader and writer applications on small platforms, such as Personal Digital Assistants (PDA), cellular telephones, or alphanumeric pagers.
-Scope
-The vCard is intended to be used for exchanging information about people and resources. In today's business environment, this information is typically exchanged on business cards. It is appropriate, then that this specification define this information in terms of a paradigm based on an electronic business card object.
-The ultimate destination for this information is often a collection of business cards, Rolodex® file, or electronic contact manager. Prior to the introduction of the vCard specification, users of such applications typically had to re-key the original information, often transcribing it from paper business cards. With the advent of the vCard specification, this information can be exchanged in an automated fashion.
-The basis for the data types supported by this specification have their origin in openly defined, international standards and in additional capabilities based on enhancements suggested by the demonstration of the exchange of prototypical vCards using the Internet based World-Wide-Web, Infra-red data transport, and simultaneous voice and data (SVD) modems.
-The "person" object defined by the CCITT X.500 Series Recommendation for Directory Services was the primary reference for the properties that are defined by this specification. Every attempt was made to make it possible to map the X.520/X.521 attributes and objects into and out of an instance of a vCard. The vCard specification has extended the capabilities that have been defined within the CCITT X.500 Series Recommendation to allow the exchange of additional information often recorded on business cards and electronic contact managers. For example, this specification provides support for exchanging graphic images representing company logos, photographs of individuals, geo-positioning information, and other extensions to properties defined by the X.500 Recommendation.
-The specification of all date and time values are defined in terms of the ISO 8601 standard for representation of dates and times. ISO 8601 supersedes all other international standards defined at the time this specification was drafted.
-The paradigm of an electronic business card is related to the concepts of an entry in a LAN/WAN directory or an electronic mail address book or distribution list. However, the requirements of the electronic business card go beyond the definitions of a "person" object found in either the CCITT X.500 Series Recommendation, network directory services, or electronic mail address book products. The vCard specification is needed to address the requirements for an interchange format for the "person" personal data type or object.
-Personal data applications such as Personal Information Managers (PIM) often provide an import/export capability using Comma Separated Value (CSV) or Tab Delimited Files (TDF) formats. However, these solutions do not preserve the intent of the originating application. When a CSV and TDF format is used by a PIM, the meta-data or semantics of the originating object are only apparent to a similar version of the originating application. Exchange of data between such applications is another important application of an industry-standard specification for an electronic business card interchange format, such as the vCard specification.
-Contents
-This specification is separated into eight sections:
-* "Section 1 : Introduction" introduces PDI and the vCard specification with an overview, scope statement and section on definitions and abbreviations.
-* "Section 2 : vCard Specification" defines the semantics and syntax for the vCard.
-* "Section 3 : Internet Recommendations" specifies a set of guidelines to facilitate the exchange of vCard objects over Internet protocols such as HTTP using HTML and SMTP using MIME.
-* "Section 4 : UI Support Recommendations" specifies a set of guidelines to facilitate the exchange of vCard objects at the desktop user interface using the file system, clipboard and drag/drop capabilities of the operating system.
-* "Section 5 : Conformance" defines minimum conformance requirements to consider while developing support for this vCard specification.
-Definitions and Abbreviations
-Definitions and abbreviations used within this specification follow.
-Electronic Business Card: Also known as vCard.
-FPI: Formal Public Identifier. A string expression that represents a public identifier for an object. FPI syntax is defined by ISO 9070.
-GUID: Globally Unique IDentifier
-Internet: A WAN connecting thousands of disparate networks in industry, education, government, and research. The Internet uses TCP/IP as the standard for transmitting information.
-ISO: Organization for International Standardization; a worldwide federation of national standards bodies (ISO Member bodies).
-MIME: Multipurpose Internet Mail Extensions, as defined in RFC1521.
-PDA: Personal Digital Assistant computing device
-PDI: Personal Data Interchange, a collaborative application area which involves the communication of data between people who have a business or personal relationship, but do not necessarily share a common computing infrastructure.
-PIM: Personal Information Manager
-RFC#### documents: Internet "Request For Comment" documents (i.e., RFC822, RFC1521, etc.).
-URL: Uniform Resource Locator; a string expression that can represent any resource on the Internet or local system. RFC 1738 defines the syntax for an URL.
-UTC: Universal Time Coordinated; also known as UCT, for Universal Coordinated Time.
-vCard: The generic term for an electronic, virtual information card that can be transferred between computers, PDAs, or other electronic devices through telephone lines, or e-mail networks, or infrared links. How, when, why, and where vCard are used depends on the applications developed utilizing a vCard.
-versitcard: a vCard.
-WAN: Wide-Area Network
-
-
-Section 2 : vCard Specificiation
-[DS3]
-This section defines the semantics and syntax for the vCard.
-A vCard is a collection of one or more properties. A property is a uniquely named value. A set of properties can be grouped within a vCard. For example, the properties for a telephone number and comment can be grouped in order to preserve the coupling of the annotation with the telephone number. In addition to property groupings, a vC. versit is developing a comprehensive family of PDI technologies based on open specifications and interoperability agreements to help meet this technology need.
-Overview
-This specification defines a format for an electronic business card, or vCard. The format is suitable as an interchange format between applications or systems. The format is defined independent of the particular method used to transport it. The transport for this exchange might be a file system, point-to-point asynchronous communication, wired-network transport, or some form of unwired transport.
-A vCard is a data stream consisting of one or more vCard objects. The individual vCard definitions can be identified and parsed within the datastream. The vCard data stream may exist as a persistent form in a file system, document management system, network connection between two network endpoints, or in any other digital transport that has an abstraction of a stream of bytes.
-Conceptually, a vCard Writer creates vCard data streams and a vCard Reader interprets vCard data streams. The vCard Reader and Writer may be implemented as a single application or as separate applications. It is not the intent of this specification to define the implementation of these processes beyond some fundamental capabilities related to the format of the vCard data stream and a common set of conformance requirements .
-This specification provides for a clear-text encoding that is intended to be based on the syntax used by the MIME specification (RFC 1521).
-The encoding of this specification can be used in environments which are constrained to 7-bit transfer encodings, short line lengths, and low bandwidth. In addition, the encoding is simple in order to facilitate the implementation of reader and writer applications on small platforms, such as Personal Digital Assistants (PDA), cellular telephones, or alphanumeric pagers.
-Scope
-The vCard is intended to be used for exchanging information about people and resources. In today's business environment, this information is typically exchanged on business cards. It is appropriate, then that this specification define this information in terms of a paradigm based on an electronic business card object.
-The ultimate destination for this information is often a collection of business cards, Rolodex® file, or electronic contact manager. Prior to the introduction of the vCard specification, users of such applications typically had to re-key the original information, often transcribing it from paper business cards. With the advent of the vCard specification, this information can be exchanged in an automated fashion.
-The basis for the data types supported by this specification have their origin in openly defined, international standards and in additional capabilities based on enhancements suggested by the demonstration of the exchange of prototypical vCards using the Internet based World-Wide-Web, Infra-red data transport, and simultaneous voice and data (SVD) modems.
-The "person" object defined by the CCITT X.500 Series Recommendation for Directory Services was the primary reference for the properties that are defined by this specification. Every attempt was made to make it possible to map the X.520/X.521 attributes and objects into and out of an instance of a vCard. The vCard specification has extended the capabilities that have been defined within the CCITT X.500 Series Recommendation to allow the exchange of additional information often recorded on business cards and electronic contact managers. For example, this specification provides support for exchanging graphic images representing company logos, photographs of individuals, geo-positioning information, and other extensions to properties defined by the X.500 Recommendation.
-The specification of all date and time values are defined in terms of the ISO 8601 standard for representation of dates and times. ISO 8601 supersedes all other international standards defined at the time this specification was drafted.
-The paradigm of an electronic business card is related to the concepts of aQuoted-Printable lines of text must also be limited to less than 76 characters. The 76 characters does not include the CRLF (RFC 822) line break sequence. For example a multiple line LABEL property value of:
-123 Winding Way
-Any Town, CA 12345
-USA
-Would be represented in a Quoted-Printable encoding as:
-LABEL;ENCODING=QUOTED-PRINTABLE:123 Winding Way=0D=0A=
- Any Town, CA 12345=0D=0A=
- USA
-Property parameter substrings are delimited by a field delimiter, specified by the Semi-colon character (ASCII decimal 59). A Semi-colon in a property parameter value must be escaped with a Backslash character (ASCII 92).
-Compound property values are property values that also make use of the Semi-colon, field delimiter to separate positional components of the value. For example, the Name property is made up of the Family Name, Given Name, etc. components. A Semi-colon in a component of a compound property value must be escaped with a Backslash character (ASCII 92).
-Grouping
-There are two forms of grouping or collections supported within the vCard. A collection of vCard objects can be grouped and a collection of properties within an individual vCard can be grouped.
-vCard Grouping
-The vCard data stream can consist of multiple vCard objects. The vCard data stream can, sequentially, contain one or more vCard objects., In addition, the vCard data stream can contain a property whose value is a nested vCard. In both of these cases, each vCard object will be delimited by the vCard Delimiters. The vCard Reader conforming to this specification must be able to parse and process any of these combinations of vCard Groupings. The support for vCard Grouping is optional for a vCard Writer conforming to this specification.
-Property Grouping
-A Property Grouping is the definition of a method for specifying a collection of related properties within a vCard object. There is no requirement on a vCard reader that it preserve the property group name. However, the vCard reader is required to preserve the grouping of the properties.
-The Property Grouping is identified by a character string prefix to the property name; separated by the Period character (ASCII decimal 46).
-The grouping of a comment property with a telephone property is shown in the following example:
-A.TEL;HOME:+1-213-555-1234
-A.NOTE:This is my vacation home.
-The vCard Reader conforming to this specification must be able to parse and process the property grouping. The support for Property Grouping is optional for a vCard Writer conforming to this specification.
-Encodings
-The default encoding for the vCard object is 7-Bit. The default encoding can be overridden for an individual property value by using the "ENCODING" property parameter. This parameter value can be either "BASE64", "QUOTED-PRINTABLE", or "8BIT". This parameter may be used on any property.
-Some transports (e.g., MIME based electronic mail) may also provide an encoding property at the transport wrapper level. This property can be used in these cases for transporting a vCard data stream that has been defined using a default encoding other than 7-bit (e.g., 8-bit).
-Character Set
-The default character set is ASCII. The default character set can be overridden for an individual property value by using the "CHARSET" property parameter. This property parameter may be used on any property. However, the use of this parameter on some properties may not make sense.
-Any character set registered with the Internet Assigned Numbers Authority (IANA) can be specified by this property parameter. For example, ISO 8859-8 or the Latin/Hebrew character set is specified by:
-ADR;CHARSET=ISO-8859-8:...
-Some transports (e.g., MIME based electronic mail) may also provide a character set property at the transport wrapper level. This property can be used in these cases for transporting a vCard data stream that has been defined using a default character set other than ASCII (e.g., UTF-8).
-Language
-The default language is "en-US" (US English). The default language can be overridden for an individual property value by using the "LANGUAGE" property parameter. The values for this property are a string consistent with RFC 1766, Tags for the Identification of Languages. This property parameter may be used on any property. However, the use of this parameter on some properties, such as PHOTO, LOGO, SOUND, TEL, may not make sense. Canadian French would be specified by this parameter by the following:
-ADR;LANGUAGE=fr-CA:...
-Value Location
-The default location of the property value is inline with the property. However, for some properties, such as those that specify multimedia values, it is efficient to organize the property value as a separate entity (e.g., a file out on the network). The property parameter "VALUE" can be specified to override the "INLINE" location of the property value. In the case of the vCard being transported within a MIME email message, the property value can be specified as being located in a separate MIME entity with the "Content-ID" value, or "CID" for short. In this case, the property value is the Content-ID for the MIME entity containing the property value. In addition, the property value can be specified as being located out on the network within some Internet resource with the "URL" value. In this case, the property value is the Uniform Resource Locator for the Internet resource containing the property value. This property parameter may be used on any property. However, the use of this parameter on some properties may not make sense; for example the Version, Time Zone, Comment, Unique Identifier, properties . The following specifies a value not located inline with the vCard but out in the Internet:
-PHOTO;VALUE=URL;TYPE=GIF:http://www.abc.com/dir_photos/my_photo.gif
-SOUND;VALUE=CONTENT-ID:<jsmith.part3.960817T083000.xyzMail@host1.com
-Binary Values
-The vCard format supports inclusion of binary information, such as computer graphic images, digital audio, or video graphic images. The binary information may either be referenced with a Uniform Reference Locator (URL) or placed inline in the vCard as the value of a property. Inline binary information is included as a property value after being encoded into clear-text with a Base 64 (default) or Quoted-Printable encoding
-Identification Properties
-These property types are concerned with information associated with the identification and naming of the individual or resource associated with the vCard object.
-Formatted Name
-This property specifies the formatted name string associated with the vCard object. This is the way that the name is to be displayed. It can contain desired honorific prefixes, suffixes, titles, etc. For example, "Mr. John Q. Public, Jr.", Dr. Ann Tyler, or Hon. Judge Blackwell. This property is based on the semantics of the X.520 Common Name attribute.
-This property is identified by the property name FN. The following is an example of the Formatted Name property:
-FN:Mr. John Q. Public, Esq.
-Support for this property is optional for vCard Writers conforming to this specification.
-Name
-This property specifies a structured representation of the name of the person, place or thing associated with the vCard object.
-This property is identified by the property name N. This property is defined to encapsulate the individual components of an object's name. The property value consists of the components of the name specified as positional fields separated by the Field Delimiter character (ASCII decimal 59). The property value is a concatenation of the Family Name (first field), Given Name (second field), Additional Names (third field), Name Prefix (fourth field), and Name Suffix (fifth field) strings. The following is an example of the Name property for a person:
-N:Public;John;Quinlan;Mr.;Esq.
-The following is an example of the Name property for a resource or place:
-N:Veni, Vidi, Vici;The Restaurant.
-Support for this property is mandatory for vCard Writers conforming to this specification. All vCard data streams should include this property to facilitate a common property for collating and sorting of vCard objects.
-Photograph
-This property specifies an image or photograph of the individual associated with the vCard.
-The property is identified by the property name PHOTO. For example, the following syntax is an example of a referenced image file:
-PHOTO;VALUE=URL:file:///jqpublic.gif
- The following example is the syntax for including an inline GIF image file, using the Base 64 encoding:
-PHOTO;ENCODING=BASE64;TYPE=GIF:
- R0lGODdhfgA4AOYAAAAAAK+vr62trVIxa6WlpZ+fnzEpCEpzlAha/0Kc74+PjyGM
- SuecKRhrtX9/fzExORBSjCEYCGtra2NjYyF7nDGE50JrhAg51qWtOTl7vee1MWu1
- 50o5e3PO/3sxcwAx/4R7GBgQOcDAwFoAQt61hJyMGHuUSpRKIf8A/wAY54yMjHtz
-...
-Support for this property is optional for vCard Writers conforming to this specification.
-Photo Format Type
-This property parameter is provided to specify the graphics format for the Photo property value. The property parameter includes the following values:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates Graphics Interchange Format
-GIF
-
-Indicates ISO Computer Graphics Metafile
-CGM
-
-Indicates MS Windows Metafile
-WMF
-
-Indicates MS Windows Bitmap
-BMP
-
-Indicates IBM PM Metafile
-MET
-
-Indicates IBM PM Bitmap
-PMB
-
-Indicates MS Windows DIB
-DIB
-
-Indicates an Apple Picture format
-PICT
-
-Indicates a Tagged Image File Format
-TIFF
-
-Indicates Adobe PostScript format
-PS
-
-Indicates Adobe Page Description Format
-PDF
-
-Indicates ISO JPEG format
-JPEG
-
-Indicates ISO MPEG format
-MPEG
-
-Indicates ISO MPEG version 2 format
-MPEG2
-
-Indicates Intel AVI format
-AVI
-
-Indicates Apple QuickTime format
-QTIME
-
-
-Birthdate
-This property specifies the date of birth of the individual associated with the vCard. The value for this property is a calendar date in a complete representation consistent with ISO 8601.
-This property is identified by the property name BDAY. The property value is a string conforming to the ISO 8601 calendar date, complete representation, in either basic or extended format. The following example is in the basic format of ISO 8601:
-BDAY:19950415
-The following example is in the extended format of ISO 8601:
-BDAY:1995-04-15
-Support for this property is optional for vCard Writers conforming to this specification.
-Delivery Addressing Properties
-Delivery Address
-This property specifies a structured representation of the physical delivery address for the vCard object. The property is made up of components that are based on the X.500 Post Office Box attribute, the X.520 Street Address geographical attribute, the X.520 Locality Name geographical attribute, the X.520 State or Province Name geographical attribute, the X.520 Postal Code attribute, and the X.520 Country Name geographical attribute.
-This property is identified by the property name ADR. The property value consists of components of the address specified as positional fields separated by the Field Delimiter character (ASCII decimal 59). The property value is a concatenation of the Post Office Address (first field) Extended Address (second field), Street (third field), Locality (fourth field), Region (fifth field), Postal Code (six field), and Country (seventh field) strings. An example of this property follows:
-ADR;DOM;HOME:P.O. Box 101;Suite 101;123 Main Street;Any Town;CA;91921-1234;
-Support for this property is optional for vCard Writers conforming to this specification.
-Delivery Address Type
-This property parameter specifies the sub-types of physical delivery that is associated with the delivery address. For example, the label may need to be differentiated for Home, Work, Parcel, Postal, Domestic, and International physical delivery. One or more sub-types can be specified for a given delivery address.
-The property parameter can have one or more of the following values:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates a domestic address
-DOM
-
-Indicates an international address (Default)
-INTL
-
-Indicates a postal delivery address (Default)
-POSTAL
-
-Indicates a parcel delivery address (Default)
-PARCEL
-
-Indicates a home delivery address
-HOME
-
-Indicates a work delivery address (Default)
-WORK
-
-
-The default property parameter is overridden to some other set of values by specifying one or more alternate values. For example, the default of a delivery for INTL, WORK, POSTAL and PARCEL can be reset to DOM, POSTAL, WORK and HOME in the following example:
-ADR;DOM;WORK;HOME;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;
-Delivery Label
-This property specifies the addressing label for physical delivery to the person/object associated with the vCard. The property is intended to include the information necessary to create a formatted delivery address label. Typical information includes the name, street address, possibly a Post Office or mail drop, city, state or province, zip or postal code. An international delivery label would also include the country name.
-This property is based on the semantics of the X.520 Postal Address attribute. This specification has added semantics to those defined by the X.500 Series standard for differentiating Home, Work, Parcel, Postal, Domestic, and International delivery label types.
-This property is identified by the property name LABEL. This property specifies the formatted delivery address label for the vCard object. An example of a domestic delivery label follows:
-LABEL;DOM;POSTAL;ENCODING=QUOTED-PRINTABLE:P. O. Box 456=0D=0A=
-123 Main Street=0D=0A=
-Any Town, CA 91921-1234
-An example of an international delivery label follows:
-LABEL;INTL;PARCEL,ENCODING=QUOTED-PRINTABLE:Suite 101=0D=0A=
-123 Main Street=0D=0A=
-Any Town, CA 91921-1234=0D=0A=
-U.S.A.
-Support for this property is optional for vCard Writers conforming to this specification. A vCard Reader supporting this property and conforming to this specification should support a minimum of four lines of text for this property.
-Delivery Label Type
-This property parameter specifies the sub-types of physical delivery that is associated with the delivery label. For example, the label may need to be differentiated for Home, Work, Parcel, Postal, Domestic, and International physical delivery. One or more sub-types can be specified for a given delivery label.
-The property parameter can have one or more of the following values:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates a domestic address
-DOM
-
-Indicates an international address (Default)
-INTL
-
-Indicates a postal delivery address (Default)
-POSTAL
-
-Indicates a parcel delivery address (Default)
-PARCEL
-
-Indicates a home delivery address
-HOME
-
-Indicates a work delivery address (Default)
-WORK
-
-
-The default property parameter is overridden to some other set of values by specifying one or more alternate values. For example, the default of a delivery for INTL, WORK, POSTAL and PARCEL can be reset to DOM and HOME in the following example:
-LABEL;DOM;HOME,ENCODING=QUOTED-PRINTABLE:Suite 101=0D=0A=
-123 Main Street=0D=0A=
-Any Town, CA 91921-1234
-Telecommunications Addressing Properties
-These property types are concerned with information associated with the telecommunications addressing of the vCard object.
-Telephone Number
-This property specifies the canonical number string for a telephone number for telephony communication with the vCard object. The value of this property is specified in a canonical form in order to specify an unambiguous representation of the globally unique telephony endpoint. This property is based on the X.520 Telephone Number attribute.
-The canonical form cannot be dialed without first being transformed by a dialing algorithm. The dialing algorithm combines the canonical number string with knowledge of the local dialing procedures, in effect at the time of call placement to produce actual dialing instructions. The actual dialing algorithm is outside the scope of this specification.
-Two important canonical forms allowed by this specification are:
-* Apple Computer's Representation of a Canonical Static DeviceID in The Telephony Suite, version 1.0,
-* Microsoft TAPI in the Microsoft Windows 3.1 Telephony Programmer's Guide, version 1.0.
-Software which creates this property can store a string in these allowed formats. Dialing software should be prepared to parse numbers from either of the supported formats; as neither format is considered to be technically costly to support.
-This property is identified by the property name TEL. An example of this property follows:
-TEL;PREF;WORK;MSG;FAX:+1-800-555-1234
-Support for this property is optional for vCard Writers conforming to this specification.
-Telephone Type
-This property parameter specifies the sub-type of telephone that is associated with the telephone number (e.g., Home, Work, Cellular, Facsimile, Video, Modem, Message Service, or Preferred). One or more sub-type values can be specified for a given telephone number.
-The property parameter can have one or more of the following values:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates preferred number
-PREF
-
-Indicates a work number
-WORK
-
-Indicates a home number
-HOME
-
-Indicates a voice number (Default)
-VOICE
-
-Indicates a facsimile number
-FAX
-
-Indicates a messaging service on the number
-MSG
-
-Indicates a cellular number
-CELL
-
-Indicates a pager number
-PAGER
-
-Indicates a bulletin board service number
-BBS
-
-Indicates a MODEM number
-MODEM
-
-Indicates a car-phone number
-CAR
-
-Indicates an ISDN number
-ISDN
-
-Indicates a video-phone number
-VIDEO
-
-The default property parameter is overridden to some other set of values by specifying one or more alternate values. For example, the default of a VOICE telephone number can be reset to a WORK and HOME, VOICE and FAX telephone number in the following example:
-TEL;WORK;HOME;VOICE;FAX:+1-800-555-1234
-Electronic Mail
-This property specifies the address for electronic mail communication with the vCard object. The address is in the form of a specific addressing type. For example, the Internet mail address for John Public might be "John.Public@abc.com" or the CompuServe Information Service address might be "71234,5678".This property is identified by the property name EMAIL.
-An example of this property follows:
-EMAIL;INTERNET:john.public@abc.com
-Support for this property is optional for vCard Writers conforming to this specification.
-Electronic Mail Type
-This property parameter specifies the type of electronic mail address. The following are some example values for this property parameter:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates America On-Line
-AOL
-
-Indicates AppleLink
-AppleLink
-
-Indicates AT&T Mail
-ATTMail
-
-Indicates CompuServe Information Service
-CIS
-
-Indicates eWorld
-eWorld
-
-Indicates Internet SMTP (default)
-INTERNET
-
-Indicates IBM Mail
-IBMMail
-
-Indicates MCI Mail
-MCIMail
-
-Indicates PowerShare
-POWERSHARE
-
-Indicates Prodigy information service
-PRODIGY
-
-Indicates Telex number
-TLX
-
-Indicates X.400 service
-X400
-
-
-Mailer
-This property parameter specifies the type of electronic mail software that is in use by the individual associated with the vCard object. This information may provide assistance to a correspondent regarding the type of data representation which can be used, and how they may be packaged. This property parameter is based on currently accepted practices within the Internet MIME community with the "X-Mailer" header field.
-This property is identified by the property name MAILER. Support for this property is optional for vCard Writers conforming to this specification. An example of this property follows:
-MAILER:ccMail 2.2
-Geographical Properties
-These property types are concerned with geographical positions or region information associated with the vCard object.
-Time Zone
-This property specifies information related to the standard time zone of the vCard object. The time zone is a string as specified in a manner consistent with ISO 8601. It is an offset from Coordinated Universal Time (UTC). An ISO 8601 UTC offset, in basic format, is specified as a positive or negative difference in units of hours and minutes (e.g., +hhmm). If minutes are zero, then they may be omitted and the format would be specified in units of hours (e.g., +hh). The time is specified as a 24-hour clock. Hour valult property parameter is overridden to some other set of values by specifying one or more alternate values. For example, the default of a delivery for INTL, WORK, POSTAL and PARCEL can be reset to DOM, POSTAL, WORK and HOME in the following example:
-ADR;DOM;WORK;HOME;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;
-Delivery Label
-This property specifies the addressing label for physical delivery to the person/object associated with the vCard. The property is intended to include the information necessary to create a formatted delivery address label. Typical information includes the name, street address, possibly a Post Office or mail drop, city, state or province, zip or postal code. An international delivery label would also include the country name.
-This property is based on the semantics of the X.520 Postal Address attribute. This specification has added semantics to those defined by the X.500 Series standard for differentiating Home, Work, Parcel, Postal, Domestic, and International delivery label types.
-This property is identified by the property name LABEL. This property specifies the formatted delivery address label for the vCard object. An example of a domestic delivery label follows:
-LABEL;DOM;POSTAL;ENCODING=QUOTED-PRINTABLE:P. O. Box 456=0D=0A=
-123 Main Street=0D=0A=
-Any Town, CA 91921-1234
-An example of an international delivery label follows:
-LABEL;INTL;PARCEL,ENCODING=QUOTED-PRINTABLE:Suite 101=0D=0A=
-123 Main Street=0D=0A=
-Any Town, CA 91921-1234=0D=0A=
-U.S.A.
-Support for this property is optional for vCard Writers conforming to this specification. A vCard Reader supporting this property and conforming to this specification should support a minimum of four lines of text for this property.
-Delivery Label Type
-This property parameter specifies the sub-types of physical delivery that is associated with the delivery label. For example, the label may need to be differentiated for Home, Work, Parcel, Postal, Domestic, and International physical delivery. One or more sub-types can be specified for a given delivery label.
-The property parameter can have one or more of the following values:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates a domestic address
-DOM
-
-Indicates an international address (Default)
-INTL
-
-Indicates a postal delivery address (Default)
-POSTAL
-
-Indicates a parcel delivery address (Default)
-PARCEL
-
-Indicates a home delivery address
-HOME
-
-Indicates a work delivery address (Default)
-WORK
-
-
-The default property parameter is overridden to some other set of values by specifying one or more alternate values. For example, the default of a delivery for INTL, WORK, POSTAL and PARCEL can be reset to DOM and HOME in the following example:
-LABEL;DOM;HOME,ENCODING=QUOTED-PRINTABLE:Suite 101=0D=0A=
-123 Main Street=0D=0A=
-Any Town, CA 91921-1234
-Telecommunications Addressing Properties
-These property types are concerned with information associated with the telecommunications addressing of the vCard object.
-Telephone Number
-This property specifies the canonical number string for a telephone number for telephony communication with the vCard object. The value of this property is specified in a canonical form in order to specify an unambiguous representation of the globally unique telephony endpoint. This property is based on the X.520 Telephone Number attribute.
-The canonical form cannot be dialed without first being transformed by a dialing algorithm. The dialing algorithm combines the canonical number string with knowledge of the local dialing procedures, in effect at the time of call placement to produce actual dialing instructions. The actual dialing algorithm is outside the scope of this specification.
-Two important canonical forms allowed by this specification are:
-* Apple Computer's Representation of a Canonical Static DeviceID in The Telephony Suite, version 1.0,
-* Microsoft TAPI in the Microsoft Windows 3.1 Telephony Programmer's Guide, version 1.0.
-Software which creates this property can store a string in these allowed formats. Dialing s
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates Graphics Interchange Format
-GIF
-
-Indicates ISO Computer Graphics Metafile
-CGM
-
-Indicates MS Windows Metafile
-WMF
-
-Indicates MS Windows Bitmap
-BMP
-
-Indicates IBM PM Metafile
-MET
-
-Indicates IBM PM Bitmap
-PMB
-
-Indicates MS Windows DIB
-DIB
-
-Indicates an Apple Picture format
-PICT
-
-Indicates Tagged Image File Format
-TIFF
-
-Indicates Adobe Page Description Format
-PDF
-
-Indicates Adobe PostScript
-PS
-
-Indicates ISO JPEG format
-JPEG
-
-Indicates ISO MPEG format
-MPEG
-
-Indicates ISO MPEG version 2 format
-MPEG2
-
-Indicates Intel AVI format
-AVI
-
-Indicates Apple QuickTime format
-QTIME
-
-
-Agent
-This property specifies information about another person who will act on behalf of the vCard object. Typically this would be an area administrator, assistant, or secretary for the individual. A key characteristic of the Agent property is that it represents somebody or something which is separately addressable. For example, if all phone calls or e-mail messages are normally screened by an agent, this property may not be needed. On the other hand, if an agent can act as a proxy, and may otherwise need to be contacted separately, then an Agent property is useful.
-This property is equivalent to nesting another vCard with the specified vCard.
-This property is identified by the property name AGENT. The value of this property is a string containing another vCard object. An example of this property follows:
-AGENT:
-BEGIN:VCARD
-VERSION:2.1
-N:Friday;Fred
-TEL;WORK;VOICE:+1-213-555-1234
-TEL;WORK;FAX:+1-213-555-5678
-END:VCARD
-Support for this property is optional for vCard Writers conforming to this specification.
-Organization Name and Organizational Unit
-This property specifies the name and optionally the unit(s) of the organization associated with the vCard object. This property is based on the X.520 Organization Name attribute and the X.520 Organization Unit attribute. For example, "The AB Corporation" and the "North American Division".
-This property is identified by the property name ORG. This property is defined to encapsulate the Organization Name and Organization Unit properties as sub-properties. The property value consists of the components of the organization specified as positional fields separated by the Field Delimiter (ASCII decimal 59). The property value is a concatenation of the Organization Name (first field), Organizational Unit (second field) strings. Additional positional fields, if specified, contain additional Organizational Units. The following is an example of the Organization property:
-ORG:ABC, Inc.;North American Division;Marketing
-Support for this property is optional for vCard Writers conforming to this specification.
-Explanatory Properties
-These property types are concerned with additional explanations, such as that related to national language support, annotation, or encoding of binary information about the vCard object.
-Comment
-This property specifies supplemental information or a comment that is associated with the vCard. With the use of property grouping, the association can be limited to a group of properties. The property is based on the X.520 Description attribute.
-This property is identified by the property name NOTE. An example of this property follows:
-NOTE;ENCODING=QUOTED-PRINTABLE:This facsimile machine if operational=
- 0830 to 1715 hours=0D=0A=
-Monday through Friday. Call +1-213-555-1234 if you have problems=0D=0A=
-with access to the machine.
-Support for this property is optional for vCard Writers conforming to this specification.
-Last Revision
-This property specifies the combination of the calendar date and time of day of the last update to the vCard object. The property value is a character string conforming to the basic or extended format of ISO 8601. The value can either be in terms of local time or UTC.
-This property is identified by the property name REV. Valid values for this property are a character string representing a combination of the calendar date and time of day conforming to the basic or extended format of ISO 8601. The time of day can be either local time or UTC. The following example is in the basic format and local time of ISO 8601:
-REV:19951031T222710
-The following example is in the extended format and UTC time of ISO 8601:
-REV:1995-10-31T22:27:10Z
-Support for this property is optional for vCard Writers conforming to this specification.
-Sound
-This property specifies a sound annotation for the vCard object. By default, if this property is not grouped with other properties it specifies the pronunciation of the Formatted Name property of the vCard object. Such information may be in the form of a string of characters representing a phonetic sound or in the form of a digitized sound, or both; subject to the limitations imposed by the encoding used to communicate the vCard.
-This property is identified by the property name SOUND. Valid values for this property are either a string representation, a reference to a digital audio representation, or an inline digital audio representation of the phonetic pronunciation of the Formatted Name property. The following example shows the string based phonetic representation:
-SOUND:JON Q PUBLIK
-The following example shows the digtial sound representation and URL based value:
-SOUND;VALUE=URL:file///multimed/audio/jqpublic.wav
-The following example shows the digtial sound representation and INLINE value:
-SOUND;WAVE;BASE64:
- UklGRhAsAABXQVZFZm10IBAAAAABAAEAESsAABErAAABAAgAZGF0YesrAACAg4eC
- eXR4e3uAhoiIiYmKjIiDfnx5eX6CgoKEhYWDenV5fH6BhISGiIiDfHZ2eXt/hIiK
- jY2IhH12d3Vyc3uDiIiFf3l7fn18eXl+houFf319fnyAgHl5eoCIiISChIeAfnt2
-...
-Support for this property is optional for vCard Writers conforming to this specification.
-Sound Digital Audio Type
-This property parameteris provided to specify the type of the digital audio Pronunciation for the vCard object. The property parameter can have the following values:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates Wave format
-WAVE
-
-Indicates MIME basic audio type
-PCM
-
-Indicates AIFF format
-AIFF
-
-
-Uniform Resource Locator
-This property specifies a value that represents a Uniform Resource Locator (URL). An URL is a representation of an Internet location that can be used to obtain real-time information about the vCard object. Application of this property might be to specify the location of a publicly accessible directory where up-to-date or additional information on the individual or resource associated with a vCard can be found.
-This property is identified by the property name URL. Valid values for this property are a string conforming to the IETF RFC 1738, Uniform Resource Locators. The following is an example of this property:
-URL:http://abc.com/pub/directory/northam/jpublic.ecd
-Support for this property is optional for vCard Writers conforming to this specification.
-Unique Identifier
-This property specifies a value that represents a persistent, globally unique identifier associated with the object. The property can be used as a mechanism to relate different vCard objects. Some examples of valid forms of unique identifiers would include ISO 9070 formal public identifiers (FPI), X.500 distinguished names, machine-generated "random" numbers with a statistically high likelihood of being globally unique and Uniform Resource Locators (URL). If an URL is specified, it is suggested that the URL reference a service which will produce an updated version of the vCard.
-This property is identified by the property name UID. This property is provided to enable a vCard Reader and Writer to uniquely identify either a vCard object instance or properties within a vCard object. Valid values for this property are a unique character string. The following is an example of this property:
-UID:19950401-080045-40000F192713-0052
-Support for this property is optional for vCard Writers conforming to this specification.
-Version
-This property specifies the identifier corresponding to the highest version number of the vCard Specification supported by the implementation that created the vCard object. The value of this property must be 2.1 to correspond to this specification..
-This property is identified by the property name VERSION. The following is an example of this property:
-VERSION:2.1
-Support for this property is mandatory for implementations conforming to this specification. This property must appear within the vCard data stream.
-Security Properties
-These property types are concerned with the security of the information in the vCard object.
-Public Key
-This property specifies the public encryption key associated with the vCard object.
-This property is identified by the property name KEY. Valid values for this property are a public key that conforms to a bilaterally agreed to representation. If the representation is a binary format, then the public key must be further encoded. The default format is clear-text. If a binary format is used, then it is specified by the property parameter. Support for this property is optional for vCard Writers conforming to this specification.
-Key Type
-This property parameter is provided to specify the type of the public key for the vCard object. The property parameter can have the following values:
-
-Description
-Property Parameter Value
-
-TYPE=
-
-
-Indicates a X.509 public key certificate type of key
-X509
-
-Indicates an IETF PGP type of key
-PGP
-
-Miscellaneous Properties
-Extensions
-The vCard provides a ìstandard mechanism for doing non-standard thingsî. This extension support is provided for implementers to "push the envelope" on the existing version of the specification. Extension properties are specified by property and/or property parameter names that have the initial sub-string of X- (the two character sequence: Capital X character followed by the Dash character. It is recommended that vendors concatenate onto this sentinel an added short sub-string to identify the vendor. This will facilitate readability of the extensions and minimize possible collision of names between different vendors. For example, the following might be the ABC vendor's extension for a video-clip form of identification property:
-X-ABC-VIDEO;MPEG2:http://lonestar.bubbas.org/billibob.mpg
-or, the following example might be an extension for grouping vCard objects into a distribution list for the Design Work Group.
-BEGIN:VCARD
-VERSION:2.1
-X-DL;Design Work Group:List Item 1;List Item 2;List Item 3
-BEGIN:VCARD
-UID:List Item 1
-N:John Smith
-TEL:+1-213-555-1111
-END:VCARD
-BEGIN:VCARD
-UID:List Item 2
-N:I. M. Big
-TEL:+1-213-555-9999
-END:VCARD
-BEGIN:VCARD
-UID:List Item 3
-N:Jane Doe
-TEL:+1-213-555-5555
-END:VCARD
-END:VCARD
-At present, there is no registration authority for names of extension properties.
-Support for this property is mandatory for implementations conforming to this specification. However, an implementation may not be able to act on the extension property. Conformance only requires that an implementation be able to parse vCard data streams with extensions. The implementation need not act on them.
-Formal Definition
-The following modified Backus-Naur Notation (BNF) is provided to assist developers in building parsers for the vCard.
-This syntax is written according to the form described in RFC 822, but it references just this small subset of RFC 822 literals:
- CR = <ASCII CR, carriage return> ; ( 15, 13.)
- LF = <ASCII LF, linefeed> ; ( 12, 10.)
- CRLF = CR LF
- SPACE = <ASCII SP, space> ; ( 40, 32.)
- HTAB = <ASCII HT, horizontal-tab> ; ( 11, 9.)
-All literal property names are valid as upper, lower, or mixed case.
-ws = 1*(SPACE / HTAB)
- ; "whitespace," one or more spaces or tabs
-wsls = 1*(SPACE / HTAB / CRLF)
- ; whitespace with line separators
-word = <any printable 7bit us-ascii except []=:., >
-groups = groups "." word
- / word
-vcard_file = [wsls] vcard [wsls]
-vcard = "BEGIN" [ws] ":" [ws] "VCARD" [ws] 1*CRLF
- items *CRLF "END" [ws] ":" [ws] "VCARD"
-items = items *CRLF item
- / item
- ; these may be "folded"
-item = [groups "."] name
- [params] ":" value CRLF
- / [groups "."] "ADR"
- [params] ":" addressparts CRLF
- / [groups "."] "ORG"
- [params] ":" orgparts CRLF
- / [groups "."] "N"
- [params] ":" nameparts CRLF
- / [groups "."] "AGENT"
- [params] ":" vcard CRLF
- ; these may be "folded"
-name = "LOGO" / "PHOTO" / "LABEL" / "FN" / "TITLE"
- / "SOUND" / "VERSION" / "TEL" / "EMAIL" / "TZ" / "GEO" / "NOTE"
- / "URL" / "BDAY" / "ROLE" / "REV" / "UID" / "KEY"
- / "MAILER" / "X-" word
- ; these may be "folded"
-value = 7bit / quoted-printable / base64
-7bit = <7bit us-ascii printable chars, excluding CR LF>
-8bit = <MIME RFC 1521 8-bit text>
-quoted-printable = <MIME RFC 1521 quoted-printable text>
-base64 = <MIME RFC 1521 base64 text>
- ; the end of the text is marked with two CRLF sequences
- ; this results in one blank line before the start of the next property
-params = ";" [ws] paramlist
-paramlist = paramlist [ws] ";" [ws] param
- / param
-param = "TYPE" [ws] "=" [ws] ptypeval
- / "VALUE" [ws] "=" [ws] pvalueval
- / "ENCODING" [ws] "=" [ws] pencodingval
- / "CHARSET" [ws] "=" [ws] charsetval
- / "LANGUAGE" [ws] "=" [ws] langval
- / "X-" word [ws] "=" [ws] word
- / knowntype
-ptypeval = knowntype / "X-" word
-pvalueval = "INLINE" / "URL" / "CONTENT-ID" / "CID" / "X-" word
-pencodingval = "7BIT" / "8BIT" / "QUOTED-PRINTABLE" / "BASE64" / "X-" word
-charsetval = <a character set string as defined in Section 7.1 of
- RFC 1521>
-langval = <a language string as defined in RFC 1766>
-addressparts = 0*6(strnosemi ";") strnosemi
- ; PO Box, Extended Addr, Street, Locality, Region, Postal Code,
- Country Name
-orgparts = *(strnosemi ";") strnosemi
- ; First is Organization Name, remainder are Organization Units.
-nameparts = 0*4(strnosemi ";") strnosemi
- ; Family, Given, Middle, Prefix, Suffix.
- ; Example:Public;John;Q.;Reverend Dr.;III, Esq.
-strnosemi = *(*nonsemi ("\;" / "\" CRLF)) *nonsemi
- ; To include a semicolon in this string, it must be escaped
- ; with a "\" character.
-nonsemi = <any non-control ASCII except ";">
-knowntype = "DOM" / "INTL" / "POSTAL" / "PARCEL" / "HOME" / "WORK"
- / "PREF" / "VOICE" / "FAX" / "MSG" / "CELL" / "PAGER"
- / "BBS" / "MODEM" / "CAR" / "ISDN" / "VIDEO"
- / "AOL" / "APPLELINK" / "ATTMAIL" / "CIS" / "EWORLD"
- / "INTERNET" / "IBMMAIL" / "MCIMAIL"
- / "POWERSHARE" / "PRODIGY" / "TLX" / "X400"
- / "GIF" / "CGM" / "WMF" / "BMP" / "MET" / "PMB" / "DIB"
- / "PICT" / "TIFF" / "PDF" / "PS" / "JPEG" / "QTIME"
- / "MPEG" / "MPEG2" / "AVI"
- / "WAVE" / "AIFF" / "PCM"
- / "X509" / "PGP"
-
-
-Section 3 : Internet Recommendations
-[DS4] 1
-Recommended Practice with SMTP/MIME
-The vCard information can be transported through SMTP/MIME based electronic mail services. Interoperability of vCard information over SMTP/MIME transports can be better assured by following a common set of recommended practices for encapsulation of the vCard.
-Text/Plain Content Type
-Without any change to existing SMTP or MIME compliant user agents, a vCard can be included within Internet email messages. This might be the case for an existing, simple user agent such as a legacy SMTP mail system. While this approach provides for transport of vCards over SMTP services, it does not allow for the end user to take advantage of the full capabilities of either the vCard or Internet email (i.e., MIME) functionality.
-The following demonstrates how a vCard can be included as an epilog to a SMTP message made up of a RFC 822 message. This may be an initial method for incorporating vCard objects into SMTP messages.
-Date: Thr, 25 Jan 96 0932 EDT
-From: john.smith@host.com
-Subject: Re: RFC822 vCard Example
-Sender: john.smith@host.com
-To: smartin@host2.com
-Message-ID: <JOHNSMITH.960125T091020.xyzMail@host3.com>
-
-Steve: Thanks for the call earlier today. I am unable to
-use your material at this time. Please feel free to contact
-me in the future.
-BEGIN:VCARD
-VERSION:2.1
-N:Smith;John;M.;Mr.;Esq.
-TEL;WORK;VOICE;MSG:+1 (919) 555-1234
-TEL;WORK;FAX:+1 (919) 555-9876
-ADR;WORK;PARCEL;POSTAL;DOM:Suite 101;1 Central St.;Any Town;NC;27654
-END:VCARD
-The following example demonstrates how a vCard can be included as a separate text/plain content portion within current MIME user agents.
-Date: Fri, 26 Jan 1996 07:53:00 -0500
-From: smartin@host2.com
-Subject: RE: Text/Plain MIME vCard Example
-To: fdawson@VNET.IBM.COM
-Mime-Version: 1.0
-Content-Type: multipart/mixed; boundary=vcard
-Message-ID: <ABC-1.00-Note-martin-steve-0824475754>
-
---vcard
-Content-Type:text/plain; charset=us-ascii
-Content-Transfer-Encoding: 7bit
-John: I have looked over my material and feel that you may
-have over looked a couple of appropriate pieces. Please give
-me a call so that we can discuss further.
---vcard
-Content-Type:text/plain; charset=us-ascii; name="MARTIN.VCF"
-
-BEGIN:VCARD
-VERSION:2.1
-N:Martin;Stephen
-TEL;HOME;VOICE:+1 (210) 555-1357
-TEL;HOME;FAX:+1 (210) 555-0864
-ADR;WORK;PARCEL;POSTAL;DOM:123 Cliff Ave.;Big Town;CA;97531
-END:VCARD
---vcard--
-Text/X-vCard Content Type
-A vCard object may also be transferred in a (RFC 1521) MIME entity as a non-standard "text/x-vCard" content-type. This (RFC 1521) MIME type maybe useful in those cases where the MIME compliant messaging service does not yet support the "application/directory" and "multipart/related" MIME content-types and yet the specificity of a calendaring and scheduling media type is required.
-The following example demonstrates how a vCard can be included as a separate non-standard text/x-vCard content portion within current MIME user agents.
-Date: Fri, 26 Jan 1996 07:53:00 +0000
-From: smartin@host2.com
-Subject: RE: Text/x-vCard MIME vCard Example
-To: fdawson@VNET.IBM.COM
-Mime-Version: 1.0
-Content-Type: multipart/mixed; boundary=vcard
-Message-ID: <ABC-1.00-Note-martin-steve-0824475754>
-
---vcard
-Content-Type:text/plain; charset=us-ascii
-Content-Transfer-Encoding: 7bit
-John: I have looked over my material and feel that you may
-have over looked a couple of appropriate pieces. Please give
-me a call so that we can discuss further.
---vcard
-Content-Type:text/x-vCard; charset=us-ascii; name="MARTIN.VCF"
-
-BEGIN:VCARD
-VERSION:2.1N:Martin;Stephen
-TEL;HOME;VOICE:+1 (210) 555-1357
-TEL;HOME;FAX:+1 (210) 555-0864
-ADR;WORK;PARCEL;POSTAL;DOM:123 Cliff Ave.;Big Town;CA;97531
-END:VCARD
---vcard--
-Application/Directory Content Type
-The Internet Engineering Task Force (IETF) Access and Searching of Internet Directories (ASID) working group has produced an Internet Draft defining the "application/directory" MIME content type. The current draft name is draft-ietf-asid-mime-direct-01.txt. This specification is intended to be aligned with this work. Internet Drafts are working documents of an IETF working group, valid for at most six months, and should be considered "works in progress".
-This MIME content type was designed to be used to transport directory information across MIME based electronic mail services. The internet draft is directly applicable to the exchange of business card data, such as that defined by the vCard specification.
-The versit PDI Team has worked within the IETF ASID Working Group to draft an application/directory profile that registers the method for transporting a vCard as an application/directory Content-Type. The current draft name is draft-ietf-asid-mime-vcard-00.txt. This work is expected to be progressed to a Request For Comment after the publication of this version of the vCard specification. In the interim, the following guidelines are provided to describe how a vCard might be conveyed using the application/directory draft specification.
-A vCard should be included in a MIME message that has a Content-Type header field value of "multipart/related". The vCard is included in the message as the primary body part. The position of the body part entity can also be specified with the "start=" parameter. This MIME body part entity has a Content-Type body part header field value of "application/directory" with a "profile" parameter value of "vcard". Any vCard binary information, such as a logo, picture, or digital audio pronunciation can be included inline within the vCard, as is specified by the vCard specification. Preferably, the binary information should be extracted from the vCard object and contained in the MIME message as secondary body part entities. The binary content in the secondary body part entities can be referenced from within the vCard object through the use of the "VALUE=" property parameter. In this latter case, the binary information should be transformed into a content type nominally supported by MIME user agents. For image content, this would be the Graphics Image Format (GIF) or Joint Picture Encoding Group (JPEG) formats. For audio content, this would be the 8-bit mu-law (PCM) format specified by the MIME specification.
-The following example defines how this might be specified:
-Date: Mon, 29 Jan 96 0830 EDT
-From: john.smith@host.com
-Subject: Re: MIME application/directory vCard Example
-Sender: john.smith@host.com
-To: smartin@host2.com
-Message-ID: <JOHNSMITH.960129T083020.xyzMail@host3.com>
-Content-Type: multipart/related; boundary="vcard";
- type=application/directory;
- start=<JOHNSMITH.part1.960129T083020.xyzMail@host3.com>
---vcard
-Content-Type: application/directory; charset=us-ascii;
- source="file://versit.or2"; profile="vcard"
-Content-ID: <<JOHNSMITH.part1.960129T083020.xyzMail@host3.com>
-BEGIN:VCARD
-VERSION:2.1
-N:Smith;John;M.;Mr.;Esq.
-TEL;WORK;VOICE;MSG:+1 (919) 555-1234
-TEL;CELL:+1 (919) 554-6758
-TEL;WORK;FAX:+1 (919) 555-9876
-PHOTO;GIF;MIME:<<JOHNSMITH.part3.960129T083020.xyzMail@host3.com>
-ADR;WORK;PARCEL;POSTAL;DOM:Suite 101;1 Central St.;Any Town;NC;27654
-END:VCARD
---vcard
-Content-Type: text/plain; charset=us-ascii
-Content-ID: <<JOHNSMITH.part2.960129T083020.xyzMail@host3.com>
-Steve:
-I am not in the office today. You may want to try
-reaching me either on my cellular telephone or fax your
-new ideas to my office.
-Let's setup a face-to-face meeting later this week, after I review
-your updated material. I am including a picture in my business card
-data, since we have not met yet.
--- John
---vcard
-Content-Type: image/gif
-Content-ID: <<JOHNSMITH.part3.960129T083020.xyzMail@host3.com>
-...image data would go here...
---vcard--
-Recommended Practice with HTTP/HTML
-A vCard object should be transferred over HTTP with the non-standard MIME type/subtype value of "text/x-vCard". The non-standard subtype should be used because the vCard has not been registered as a MIME media type with the IANA.
-The vCard information can be captured with a FORM type of HTML document. Interoperability of of vCard information can be better assured by following a common set of recommended practices for mapping vCard information into and out of HTML documents.
-Form Element Usage
-The HTML FORM element is a useful method for capturing data intended for input into individual vCard property values. The following recommended practices are provided for such use.
-Mapping To INPUT Element Attribute Names
-An HTML form data set is a useful mechanism for capturing vCard data within the Internet WWW. The use of a consistent naming scheme for the name attributes within a form element will permit implementations to support automatic fill-in of forms with existing vCard data. In addition, such a consistent naming scheme will provide a greater assurance of interoperability between HTML based applications that use vCard data.
-The following table provides a recommended mapping of vCard properties and name attributes within a form element.
-Identification Properties
-Description
-Attribute Name
-Comment
-
-Formatted Name
-FN
-
-
-Name
-N
-Individual components of name property are captured as separate input elements with the names N.Family, N.First, N.Middle, N.Prefix, N.Suffix.
-
-Photograph
-PHOTO
-Only the URL based specification is supported by this mapping. Value is the URL for the graphic.
-
-Photograph Format Type
-PHOTO.Type
-Where the value is one of the enumerated strings defined by the vCard specification.
-
-Birthdate
-BDAY
-
-
-
-Delivery Addressing Properties
-Description
-Attribute Name
-Comment
-
-Delivery Address
-ADR
-TYPE=TEXTAREA
-
-Address Type
-ADR.x
-TYPE=CHECKBOX. Separate input elements are used to capture the possible delivery types. The elements are named ADR.x, where x is one of the enumerated strings defined by the vCard specification.
-
-Delivery Label
-LABEL
-
-
-Label Type
-LABEL.x
-TYPE=CHECKBOX. Separate input elements are used to capture the possible delivery types. The elements are named LABEL.x, where x is one of the enumerated strings defined by the vCard specification.
-
-
-Telecommunications Addressing Properties
-Description
-Attribute Name
-Comment
-
-Telephone Number
-TEL
-
-
-Telephone Type
-TEL.x
-TYPE=CHECKBOX. Separate input elements are used to capture the possible telephone types. The elements are named TEL.x, where x is one of the enumerated strings defined by the vCard specification.
-
-Electronic Mail Address
-EMAIL
-
-
-Electronic Mail Address Type
-EMAIL.Type
-Selection option from a list of alternatives.
-
-Mailer
-MAILER
-
-
-
-Geographical Properties
-Description
-Attribute Name
-Comment
-
-Time Zone
-TZ
-
-
-Geographic Position
-GEO
-
-
-
-Organizational Properties
-Description
-Attribute Name
-Comment
-
-Title
-TITLE
-
-
-Business Category
-ROLE
-
-
-Logo
-LOGO
-Only the URL based specification is supported by this mapping. Value is the URL for the graphic.
-
-Logo Format Type
-LOGO.Type
-Where the value is one of the enumerated strings defined by the vCard specification.
-
-Agent
-
-Captured through a separate form element using the mapping defined in these tables.
-
-Organization
-ORG
-TYPE=TEXT. Separate input elements for the organizational name and unit. The name ORG.Name is used to capture the organizational name. The name ORG.UNIT is used to capture the organizational unit. If there are multiple organizational units, it is captured in a form with name attributes ORG.UNIT1, ORG.UNIT2, etc.
-
-
-Explanatory Properties
-Description
-Attribute Name
-Comment
-
-Comment
-NOTE
-TYPE=TEXT
-
-Last Revision
-REV
-A hidden field.
-
-Version
-VERSION
-A hidden field with the value set to the string ì2.1î.
-
-Language
-LANG
-A hidden field with the value set to the string associated with the default language used in the form (e.g., US-eng).
-
-Sound
-SOUND
-TYPE=TEXT
-
-Sound Type
-N/A
-
-
-Uniform Resource Locator
-URL
-TYPE=TEXT
-
-Unique Identifier
-UID
-TYPE=TEXT
-
-Binary Encoding
-BE.x
-Where x is one of the enumerated encoding types defined by the vCard specification.
-
-
-Security Properties
-Description
-Attribute Name
-Comment
-
-Public Key
-KEY
-
-
-Key Type
-KEY.Type.x
-Where x is one of the enumerated encoding types defined by the vCard specification.
-
-MISCELLANEOUS PROPERTIES
-
-
-
-Extensions
-X-x
-Where x is a string defined by the extension author.
-
-
-Where multiple properties (e.g., telephone numbers) appear, a label prefix should be used. For example, telephone #1 might have a name attribute of ìA.TELî, telephone #2 might have a name attribute of ìB.TELî, etc.
-Example HTML Code
-The following HTML code is an example of the use of the mapping of INPUT element attributes names to vCard property names. The code can be used to capture input data for creating a vCard on a Web homepage.
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<head>
-<title>Create Your Own Versitcard</title>
-</head>
-<IMG src="versit.gif">
-<h1>Create Your Own Versitcard</h1>
-<P> Fill out this form and we'll
-create a <b>Versitcard</b> for you and send it to the email address of your choice,
-along with more information on the Versitcard format.</P>
-<hr><!-- Identification And Organizational Properties -->
-<FORM METHOD="POST" ACTION="/cgi-bin/vcard-maker">
-Formatted Name:<INPUT name="FN" type=text size=32 maxlength=64
-value=""><br>
-Phoenetic Pronunciation:<INPUT name="SOUND" type=text size=32 maxlength=128 value=""><br>
-Company Name:<INPUT name="ORG.Name" type=text size=32 maxlength=64
-value=""><br>
-Company Unit:<INPUT name="ORG.Unit" type=text size=32
-maxlength=64 value=""><br>
-Title:<INPUT name="TITLE" type=text size=32 maxlength=64
-value="">
-<hr><!-- Name Property Component Values -->
-Family Name:<INPUT name="N.Family" type=text size=32 maxlength=64
-value=""><br>
-Given Name:<INPUT name="N.Given" type=text size=32
-maxlength=64 value=""><br>
-Middle Name:<INPUT name="N.Middle" type=type size=32
-maxlength=64 value=""><br>
-Name Prefix:<INPUT name="N.Prefix" type=type size=32
-maxlength=64 value=""><br>
-Name Suffix:<INPUT name="N.Suffix" type=type size=32
-maxlength=64 value=""><br>
-<hr><!-- Delivery Addressing Properties -->
-Delivery Label:<TEXTAREA name="LABEL" cols=64 ROWS=5>
-</TEXTAREA><br><br>
-Post Office Address:<INPUT name="ADR.POAddr" type=text size=32
-maxlength=64 value=""><br>
-Extended Address:<INPUT name="ADR.ExtAddr" type=text size=32
-maxlength=64 value=""><br>
-Street Address:<INPUT name="ADR.Street" type=text size=62
-maxlength=128 value=""><br>
-City:<INPUT name="ADR.Locality" type=text size=16 maxlength=32
-value="">
-Region:<INPUT name="ADR.Region" type=text size=16 maxlength=32
-value="">
-Postal Code:<INPUT name="ADR.PostalCode" type=text size=16 maxlength=32
-value=""><br>
-Country Name:<INPUT name="ADR.CountryName" type=text size=16 maxlength=32 value="USA">
-<INPUT type=checkbox name="ADR.Work" value=WORK checked>Work
-<INPUT type=checkbox name="ADR.Home" value=HOME>Home
-<INPUT type=checkbox name="ADR.Parcel" value=PARCEL checked>Parcel <INPUT type=checkbox name="ADR.Postal" value=POSTAL checked>Postal<br>
-<hr><!-- Geographical Properties -->
-TimeZone:<INPUT name="TZ" type=text size=3 maxlength=8
-value="-06">
-Location:<INPUT name="GEO" type=text size=16 maxlength=32 value=""><br>
-<hr><!-- Telephony Addressing Properties -->
-<!-- Telephone #1 -->
-Telephone #1:<INPUT type=text name="A.TEL" size=20 maxlength=40 value="+1 (000) 000-0000"><br>
-<INPUT type=checkbox name="A.TEL.Work" value=WORK checked>Work
-<INPUT type=checkbox name="A.TEL.Home" value=HOME>Home
-<INPUT type=checkbox name="A.TEL.Voice" value=VOICE checked>Voice
-<INPUT type=checkbox name="A.TEL.Msg" value=MSG checked>Msg <INPUT type=checkbox name="A.TEL.Fax" value=FAX>Fax <INPUT type=checkbox name="A.TEL.Prefer" value=PREFER checked>Preferred<br>
-<hr><!-- Telephone #2 -->
-Telephone #2:<INPUT type=text name="B.TEL" size=20 maxlength=40 value="+1 (000) 000-0000"><br>
-<INPUT type=checkbox name="B.TEL.Work" value=WORK checked>Work <INPUT type=checkbox name="B.TEL.Home" value=HOME>Home
-<INPUT type=checkbox name="B.TEL.Voice" value=VOICE>Voice <INPUT type=checkbox name="B.TEL.Msg" value=MSG>Msg
-<INPUT type=checkbox name="B.TEL.Fax" value=FAX checked>Fax
-<INPUT type=checkbox name="B.TEL.Prefer" value=PREFER>Preferred<br>
-<hr><!-- Telephone #3 -->
-Telephone #3:<INPUT type=text name= "C.TEL" size=20 maxlength=40 value="+1 (000) 000-0000"><br>
-<INPUT type=checkbox name="C.TEL.Work" value=WORK>Work
-<INPUT type=checkbox name="C.TEL.Home" value=HOME checked>Home <INPUT type=checkbox name="C.TEL.Voice" value=VOICE checked>Voice <INPUT type=checkbox name="C.TEL.Msg" value=MSG checked>Msg
-<INPUT type=checkbox name="C.TEL.Fax" value=FAX checked>Fax <INPUT type=checkbox name="D.Prefer" value=PREFER>Preferred<br>
-<hr><!-- Email D -->
-EmailAddress: <select name="D.EMAILTYPE">
-<option selected>INTERNET:
-<option>CompuServe:
-<option>AOL:
-<option>Prodigy:
-<option>eWorld:
-<option>AppleLink:
-<option>AppleTalk:
-<option>PowerShare:
-<option>IBMMail:
-<option>ATTMail:
-<option>MCIMail:
-<option>X.400:
-<option>TLX:
-</select><INPUT type=text name="D.EMAIL" size=32 maxlength=64 value="">
-<INPUT type=checkbox name="D.EMAIL.Work" value=WORK checked>Work <INPUT type=checkbox name="D.EMAIL.Home" value=HOME checked>Home<br>
-<hr><!-- End of vCard Input -->
-Send my Versitcard to this <b>internet</b> email address:
-<INPUT type=text name="SENDTOADDR" size=32 maxlength=64 value=""><br> Press <INPUT TYPE=SUBMIT value="Send"> to send the form now. Or, press <INPUT TYPE=RESET value="Reset"> to reset values to the form defaults.
-</form>
-</body>
-
-
-Section 4 : UI Support Recommendations
-[DS5]
-When integrating vCard support into an application, an implementor needs to consider a number of user interface (UI) implications. Most appliss Type
-ADR.x
-TYPE=CHECKBOX. Separate input elements are used to capture the possible delivery types. The elements are named ADR.x, where x is one of the enumerated strings defined by the vCard specification.
-
-Delivery Label
-LABEL
-
-
-Label Type
-LABEL.x
-TYPE=CHECKBOX. Separate input elements are used to capture the possible delivery types. The elements are named LABEL.x, where x is one of the enumerated strings defined by the vCard specification.
-
-
-Telecommunications Addressing Properties
-Description
-Attribute Name
-Comment
-
-Telephone Number
-TEL
-
-
-Telephone Type
-TEL.x
-TYPE=CHECKBOX. Separate input elements are used to capture the possible telephone types. The elements are named TEL.x, where x is one of the enumerated strings defined by the vCard specification.
-
-Electronic Mail Address
-EMAIL
-
-
-Electronic Mail Address Type
-EMAIL.Type
-Selection option from a list of alternatives.
-
-Mailer
-MAILER
-
-
-
-Geographical Properties
-Description
-Attribute Name
-Comment
-
-Time Zone
-TZ
-
-
-Geographic Position
-GEO
-
-
-
-Organizational Properties
-Description
-Attribute Name
-Comment
-
-Title
-TITLE
-
-
-Business Category
-ROLE
-
-
-Logo
-LOGO
-Only the URL based specification is supported by this mapping. Value is the URL for the graphic.
-
-Logo Format Type
-LOGO.Type
-Where the value is one of the enumerated strings defined by the vCard specification.
-
-Agent
-
-Captured through a separate form element using the mapping defined in these tables.
-
-Organization
-ORG
-TYPE=TEXT. Separate input elements for the organizational name and unit. The name ORG.Name is used to capture the organizational name. The name ORG.UNIT is used to capture the organizational unit. If there are multiple organizational units, it is captured in a form with name attributes ORG.UNIT1, ORG.UNIT2, etc.
-
-
-Explanatory Properties
-Description
-Attribute Name
-Comment
-
-Comment
-NOTE
-TYPE=TEXT
-
-Last Revision
-REV
-A hidden field.
-
-Version
-VERSION
-A hidden field with the value set to the string ì2.1î.
-
-Language
-LANG
-A hidden field with the value set to the string associated with the default language used in the form (e.g., US-eng).
-
-Sound
-SOUND
-TYPE=TEXT
-
-Sound Type
-N/A
-
-
-Uniform Resource Locator
-URL
-TYPE=TEXT
-
-Unique Identifier
-UID
-TYPE=TEXT
-
-Binary Encoding
-BE.x
-Where x is one of the enumerated encoding types defined by the vCard specification.
-
-
-Security Properties
-Description
-Attribute Name
-Comment
-
-Public Key
-KEY
-
-
-Key Type
-KEY.Type.x
-Where x is one of the enumerated encoding types defined by the vCard specification.
-
-MISCELLANEOUS PROPERTIES
-
-
-
-Extensions
-X-x
-Where x is a string defined by the extension author.
-
-
-Where multiple properties (e.g., telephone numbers) appear, a label prefix should be used. For example, telephone #1 might have a name attribute of ìA.TELî, telephone #2 might have a name attribute of ìB.TELî, etc.
-Example HTML Code
-The following HTML code is an example of the use of the mapping of INPUT element attributes names to vCard property names. The code can be used to capture input data for creating a vCard on a Web homepage.
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<head>
-<title>Create Your Own Versitcard</title>
-</head>
-<IMG src="versit.gif">
-<h1>Create Your Own Versitcard</h1>
-<P> Fill out this form and we'll
-create a <b>Versitcard</b> for you and send it to the email address of your choice,
-along with more information on the Versitcard format.</P>
-<hr><!-- Identification And Organizational Properties -->
-<FORM METHOD="POST" ACTION="/cgi-bin/vcard-maker">
-Formatted Name:<INPUT name="FN" type=text size=32 maxlength=64
-value=""><br>
-Phoenetic Pronunciation:<INPUT name="SOUND" type=text size=32 maxlength=128 value=""><br>
-Company Name:<INPUT name="ORG.Name" type=text size=32 maxlength=64
-value=""><br>
-Company Unit:<INPUT name="ORG.Unit" type=text size=32
-maxlength=64 value=""><br>
-Title:<INPUT name="TITLE" type=text size=32 maxlength=64
-value="">
-<hr><!-- Name Property Component Values -->
-Family Name:<INPUT nies.
-All forms of vCard Grouping must be able to be parsed and processed.
-Property Grouping must be able to be parsed and processed.
-Additionally, in order for a vCard Writer to conform to this specification it must meet the following additional criteria:
-Must be able to send at least the Version, Formatted Name, Name, Address, Telephone, Email, and Mailer properties.
-
-
-[DS1]This entry (merged from the ìTRIAL USE (TU)î document) appears to be a duplicate of the already-existing entry that follows, except for the publicaton/edition date. I would assume that itís OK to delete this item, but, Ö
-[DS2]This entry/line in the section is assigned the style for the level 1 heading. This is done so that a section number can be given in the chapter title (style "chptr_title") and so that "heading 1" (more specifically, the format/heading numbering of the form "1. Overview") can be "skipped," and the appropriate form for the next-level of heading can be properly displayed (eg., "1.1 Overview"). It is, and must be, formatted as "hidden text" prior to pagination and/or printing.
-[DS3]This entry/line in the section is assigned the style for the level 1 heading. This is done so that a section number can be given in the chapter title (style "chptr_title") and so that "heading 1" (more specifically, the format/heading numbering of the form "1. Overview") can be "skipped," and the appropriate form for the next-level of heading can be properly displayed (eg., "1.1 Overview"). It is, and must be, formatted as "hidden text" prior to pagination and/or printing.
-[DS4]This entry/line in the section is assigned the style for the level 1 heading. This is done so that a section number can be given in the chapter title (style "chptr_title") and so that "heading 1" (more specifically, the format/heading numbering of the form "1. Overview") can be "skipped," and the appropriate form for the next-level of heading can be properly displayed (eg., "1.1 Overview"). It is, and must be, formatted as "hidden text" prior to pagination and/or printing.
-[DS5]This entry/line in the section is assigned the style for the level 1 heading. This is done so that a section number can be given in the chapter title (style ìchptr_title") and so that "heading 1" (more specifically, the format/heading numbering of the form "1. Overview") can be "skipped," and the appropriate form for the next-level of heading can be properly displayed (eg., "1.1 Overview"). It is, and must be, formatted as "hidden text" prior to pagination and/or printing.
-[DS6]This entry/line in the section is assigned the style for the level 1 heading. This is done so that a section number can be given in the chapter title (style ìchptr_title") and so that "heading 1" (more specifically, the format/heading numbering of the form "1. Overview") can be "skipped," and the appropriate form for the next-level of heading can be properly displayed (eg., "1.1 Overview"). It is, and must be, formatted as "hidden text" prior to pagination and/or printing.
-
-
-
-
-
-
-
-$paratext[Pr.Preface]
-
-
-
-
-
-
-
-
-vi vCard Specification, Version 2.1
-
- v
-
-versit Update vii
-
-
-
-
-
-
-
-36 vCard Specification, Version 2.1
-
- xi
-
-
-
-
- 39
-
-
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c
deleted file mode 100644
index 9d6d876045..0000000000
--- a/addressbook/backend/ebook/e-book-listener.c
+++ /dev/null
@@ -1,797 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Exports the BookListener interface. Maintains a queue of messages
- * which come in on the interface.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <config.h>
-#include <bonobo/bonobo-main.h>
-#include "e-book-listener.h"
-#include "e-book-marshal.h"
-
-static EBookStatus e_book_listener_convert_status (GNOME_Evolution_Addressbook_BookListener_CallStatus status);
-
-enum {
- RESPONSES_QUEUED,
- LAST_SIGNAL
-};
-
-static guint e_book_listener_signals [LAST_SIGNAL];
-
-static BonoboObjectClass *parent_class;
-
-struct _EBookListenerPrivate {
- GList *response_queue;
- gint timeout_id;
-
- guint timeout_lock : 1;
- guint stopped : 1;
-};
-
-static void
-response_free (EBookListenerResponse *resp)
-{
- if (resp == NULL)
- return;
-
- g_free (resp->msg);
- g_free (resp->id);
-
- if (resp->book != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (resp->book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_listener_destroy: "
- "Exception destroying book "
- "in response queue!\n");
- }
-
- CORBA_exception_free (&ev);
- }
-
- if (resp->cursor != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (resp->cursor, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_listener_destroy: "
- "Exception destroying cursor "
- "in response queue!\n");
- }
-
- CORBA_exception_free (&ev);
- }
-
- if (resp->book_view != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (resp->book_view, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_listener_destroy: "
- "Exception destroying book_view "
- "in response queue!\n");
- }
-
- CORBA_exception_free (&ev);
- }
-
- g_free (resp);
-}
-
-static gboolean
-e_book_listener_check_queue (EBookListener *listener)
-{
- if (listener->priv->timeout_lock)
- return TRUE;
-
- listener->priv->timeout_lock = TRUE;
-
- if (listener->priv->response_queue != NULL && !listener->priv->stopped) {
- g_signal_emit (listener, e_book_listener_signals [RESPONSES_QUEUED], 0);
- }
-
- if (listener->priv->response_queue == NULL || listener->priv->stopped) {
- listener->priv->timeout_id = 0;
- listener->priv->timeout_lock = FALSE;
- bonobo_object_unref (BONOBO_OBJECT (listener)); /* release the timeout's reference */
- return FALSE;
- }
-
- listener->priv->timeout_lock = FALSE;
- return TRUE;
-}
-
-static void
-e_book_listener_queue_response (EBookListener *listener,
- EBookListenerResponse *response)
-{
- if (response == NULL)
- return;
-
- if (listener->priv->stopped) {
- response_free (response);
- return;
- }
-
- listener->priv->response_queue = g_list_append (listener->priv->response_queue, response);
-
- if (listener->priv->timeout_id == 0) {
-
- /* 20 == an arbitrary small integer */
- listener->priv->timeout_id = g_timeout_add (20, (GSourceFunc) e_book_listener_check_queue, listener);
-
- /* Hold a reference on behalf of the timeout */
- bonobo_object_ref (BONOBO_OBJECT (listener));
-
- }
-}
-
-/* Add, Remove, Modify */
-static void
-e_book_listener_queue_generic_response (EBookListener *listener,
- EBookListenerOperation op,
- EBookStatus status)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = op;
- resp->status = status;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_open_response (EBookListener *listener,
- EBookStatus status,
- GNOME_Evolution_Addressbook_Book book)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = OpenBookResponse;
- resp->status = status;
- resp->book = book;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_open_progress (EBookListener *listener,
- const char *msg,
- short percent)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = OpenProgressEvent;
- resp->msg = g_strdup (msg);
- resp->percent = percent;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-
-static void
-e_book_listener_queue_create_card_response (EBookListener *listener,
- EBookStatus status,
- const char *id)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = CreateCardResponse;
- resp->status = status;
- resp->id = g_strdup (id);
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_get_vcard_response (EBookListener *listener,
- EBookStatus status,
- const char *vcard)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = GetCardResponse;
- resp->status = status;
- resp->vcard = g_strdup (vcard);
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_get_cursor_response (EBookListener *listener,
- EBookStatus status,
- GNOME_Evolution_Addressbook_CardCursor cursor)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = GetCursorResponse;
- resp->status = status;
- resp->cursor = cursor;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_get_view_response (EBookListener *listener,
- EBookStatus status,
- GNOME_Evolution_Addressbook_BookView book_view)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = GetBookViewResponse;
- resp->status = status;
- resp->book_view = book_view;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_get_changes_response (EBookListener *listener,
- EBookStatus status,
- GNOME_Evolution_Addressbook_BookView book_view)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = GetChangesResponse;
- resp->status = status;
- resp->book_view = book_view;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_link_status (EBookListener *listener,
- gboolean connected)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = LinkStatusEvent;
- resp->connected = connected;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_writable_status (EBookListener *listener,
- gboolean writable)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = WritableStatusEvent;
- resp->writable = writable;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_authentication_response (EBookListener *listener,
- EBookStatus status)
-{
- EBookListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = AuthenticationResponse;
- resp->status = status;
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_get_supported_fields_response (EBookListener *listener,
- EBookStatus status,
- const GNOME_Evolution_Addressbook_stringlist *fields)
-{
- EBookListenerResponse *resp;
- int i;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = GetSupportedFieldsResponse;
- resp->status = status;
- resp->list = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
-
- for (i = 0; i < fields->_length; i ++) {
- e_list_append (resp->list, fields->_buffer[i]);
- }
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-e_book_listener_queue_get_supported_auth_methods_response (EBookListener *listener,
- EBookStatus status,
- const GNOME_Evolution_Addressbook_stringlist *auth_methods)
-{
- EBookListenerResponse *resp;
- int i;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookListenerResponse, 1);
-
- resp->op = GetSupportedAuthMethodsResponse;
- resp->status = status;
- resp->list = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
-
- for (i = 0; i < auth_methods->_length; i ++) {
- e_list_append (resp->list, auth_methods->_buffer[i]);
- }
-
- e_book_listener_queue_response (listener, resp);
-}
-
-static void
-impl_BookListener_respond_create_card (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const CORBA_char* id,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_create_card_response (
- listener,
- e_book_listener_convert_status (status),
- id);
-}
-
-static void
-impl_BookListener_respond_remove_cards (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_generic_response (
- listener, RemoveCardResponse,
- e_book_listener_convert_status (status));
-}
-
-static void
-impl_BookListener_respond_modify_card (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_generic_response (
- listener, ModifyCardResponse,
- e_book_listener_convert_status (status));
-}
-
-static void
-impl_BookListener_respond_get_vcard (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const CORBA_char* card,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_get_vcard_response (
- listener,
- e_book_listener_convert_status (status),
- g_strdup (card));
-}
-
-static void
-impl_BookListener_respond_get_cursor (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_CardCursor cursor,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
- GNOME_Evolution_Addressbook_CardCursor cursor_copy;
-
- cursor_copy = bonobo_object_dup_ref (cursor, ev);
-
- if (ev->_major != CORBA_NO_EXCEPTION) {
- g_warning ("EBookListener: Exception while duplicating CardCursor!\n");
- return;
- }
-
- e_book_listener_queue_get_cursor_response (
- listener,
- e_book_listener_convert_status (status),
- cursor_copy);
-}
-
-static void
-impl_BookListener_respond_get_view (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_BookView book_view,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
- GNOME_Evolution_Addressbook_BookView book_view_copy;
-
- book_view_copy = bonobo_object_dup_ref (book_view, ev);
-
- if (ev->_major != CORBA_NO_EXCEPTION) {
- g_warning ("EBookListener: Exception while duplicating BookView.\n");
- return;
- }
-
- e_book_listener_queue_get_view_response (
- listener,
- e_book_listener_convert_status (status),
- book_view_copy);
-}
-
-static void
-impl_BookListener_respond_get_changes (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_BookView book_view,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
- GNOME_Evolution_Addressbook_BookView book_view_copy;
-
- book_view_copy = bonobo_object_dup_ref (book_view, ev);
-
- if (ev->_major != CORBA_NO_EXCEPTION) {
- g_warning ("EBookListener: Exception while duplicating BookView.\n");
- return;
- }
-
- e_book_listener_queue_get_changes_response (
- listener,
- e_book_listener_convert_status (status),
- book_view_copy);
-}
-
-static void
-impl_BookListener_respond_open_book (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_Book book,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
- GNOME_Evolution_Addressbook_Book book_copy;
-
- book_copy = bonobo_object_dup_ref (book, ev);
-
- if (ev->_major != CORBA_NO_EXCEPTION) {
- g_warning ("EBookListener: Exception while duplicating Book!\n");
- return;
- }
-
- e_book_listener_queue_open_response (
- listener,
- e_book_listener_convert_status (status),
- book_copy);
-}
-
-static void
-impl_BookListener_report_open_book_progress (PortableServer_Servant servant,
- const CORBA_char *status_message,
- const CORBA_short percent,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_open_progress (
- listener, status_message, percent);
-}
-
-static void
-impl_BookListener_respond_authentication_result (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_authentication_response (
- listener, status);
-}
-
-static void
-impl_BookListener_response_get_supported_fields (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_stringlist *fields,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_get_supported_fields_response (
- listener, status, fields);
-}
-
-static void
-impl_BookListener_response_get_supported_auth_methods (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const GNOME_Evolution_Addressbook_stringlist *auth_methods,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_get_supported_auth_methods_response (
- listener, status, auth_methods);
-}
-
-static void
-impl_BookListener_report_connection_status (PortableServer_Servant servant,
- const CORBA_boolean connected,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_link_status (
- listener, connected);
-}
-
-static void
-impl_BookListener_report_writable (PortableServer_Servant servant,
- const CORBA_boolean writable,
- CORBA_Environment *ev)
-{
- EBookListener *listener = E_BOOK_LISTENER (bonobo_object (servant));
-
- e_book_listener_queue_writable_status (listener, writable);
-}
-
-/**
- * e_book_listener_check_pending:
- * @listener: the #EBookListener
- *
- * Returns: the number of items on the response queue,
- * or -1 if the @listener is isn't an #EBookListener.
- */
-int
-e_book_listener_check_pending (EBookListener *listener)
-{
- g_return_val_if_fail (listener != NULL, -1);
- g_return_val_if_fail (E_IS_BOOK_LISTENER (listener), -1);
-
- return g_list_length (listener->priv->response_queue);
-}
-
-/**
- * e_book_listener_pop_response:
- * @listener: the #EBookListener for which a request is to be popped
- *
- * Returns: an #EBookListenerResponse if there are responses on the
- * queue to be returned; %NULL if there aren't, or if the @listener
- * isn't an EBookListener.
- */
-EBookListenerResponse *
-e_book_listener_pop_response (EBookListener *listener)
-{
- EBookListenerResponse *resp;
- GList *popped;
-
- g_return_val_if_fail (listener != NULL, NULL);
- g_return_val_if_fail (E_IS_BOOK_LISTENER (listener), NULL);
-
- if (listener->priv->response_queue == NULL)
- return NULL;
-
- resp = listener->priv->response_queue->data;
-
- popped = listener->priv->response_queue;
- listener->priv->response_queue =
- g_list_remove_link (listener->priv->response_queue,
- listener->priv->response_queue);
- g_list_free_1 (popped);
-
- return resp;
-}
-
-static EBookStatus
-e_book_listener_convert_status (const GNOME_Evolution_Addressbook_BookListener_CallStatus status)
-{
- switch (status) {
- case GNOME_Evolution_Addressbook_BookListener_Success:
- return E_BOOK_STATUS_SUCCESS;
- case GNOME_Evolution_Addressbook_BookListener_RepositoryOffline:
- return E_BOOK_STATUS_REPOSITORY_OFFLINE;
- case GNOME_Evolution_Addressbook_BookListener_PermissionDenied:
- return E_BOOK_STATUS_PERMISSION_DENIED;
- case GNOME_Evolution_Addressbook_BookListener_CardNotFound:
- return E_BOOK_STATUS_CARD_NOT_FOUND;
- case GNOME_Evolution_Addressbook_BookListener_CardIdAlreadyExists:
- return E_BOOK_STATUS_CARD_ID_ALREADY_EXISTS;
- case GNOME_Evolution_Addressbook_BookListener_ProtocolNotSupported:
- return E_BOOK_STATUS_PROTOCOL_NOT_SUPPORTED;
- case GNOME_Evolution_Addressbook_BookListener_AuthenticationFailed:
- return E_BOOK_STATUS_AUTHENTICATION_FAILED;
- case GNOME_Evolution_Addressbook_BookListener_AuthenticationRequired:
- return E_BOOK_STATUS_AUTHENTICATION_REQUIRED;
- case GNOME_Evolution_Addressbook_BookListener_TLSNotAvailable:
- return E_BOOK_STATUS_TLS_NOT_AVAILABLE;
- case GNOME_Evolution_Addressbook_BookListener_NoSuchBook:
- return E_BOOK_STATUS_NO_SUCH_BOOK;
- case GNOME_Evolution_Addressbook_BookListener_OtherError:
- return E_BOOK_STATUS_OTHER_ERROR;
- default:
- g_warning ("e_book_listener_convert_status: Unknown status "
- "from card server: %d\n", (int) status);
- return E_BOOK_STATUS_UNKNOWN;
-
- }
-}
-
-static void
-e_book_listener_construct (EBookListener *listener)
-{
- /* nothing to do here */
-}
-
-/**
- * e_book_listener_new:
- * @book: the #EBook for which the listener is to be bound
- *
- * Creates and returns a new #EBookListener for the book.
- *
- * Returns: a new #EBookListener
- */
-EBookListener *
-e_book_listener_new ()
-{
- EBookListener *listener;
-
- listener = g_object_new (E_TYPE_BOOK_LISTENER, NULL);
-
- e_book_listener_construct (listener);
-
- return listener;
-}
-
-static void
-e_book_listener_init (EBookListener *listener)
-{
- listener->priv = g_new0 (EBookListenerPrivate, 1);
-}
-
-void
-e_book_listener_stop (EBookListener *listener)
-{
- g_return_if_fail (E_IS_BOOK_LISTENER (listener));
-
- listener->priv->stopped = TRUE;
-}
-
-static void
-e_book_listener_dispose (GObject *object)
-{
- EBookListener *listener = E_BOOK_LISTENER (object);
-
- if (listener->priv) {
- GList *l;
-
- /* Remove our response queue handler: In theory, this
- can never happen since we always hold a reference
- to the listener while the timeout is running. */
- if (listener->priv->timeout_id) {
- g_source_remove (listener->priv->timeout_id);
- }
-
- /* Clean up anything still sitting in response_queue */
- for (l = listener->priv->response_queue; l != NULL; l = l->next) {
- EBookListenerResponse *resp = l->data;
-
- response_free (resp);
- }
- g_list_free (listener->priv->response_queue);
-
- g_free (listener->priv);
-
- listener->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_book_listener_class_init (EBookListenerClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- POA_GNOME_Evolution_Addressbook_BookListener__epv *epv;
-
- parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
-
- e_book_listener_signals [RESPONSES_QUEUED] =
- g_signal_new ("responses_queued",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookListenerClass, responses_queued),
- NULL, NULL,
- e_book_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- object_class->dispose = e_book_listener_dispose;
-
- epv = &klass->epv;
- epv->notifyOpenBookProgress = impl_BookListener_report_open_book_progress;
- epv->notifyBookOpened = impl_BookListener_respond_open_book;
- epv->notifyCardCreated = impl_BookListener_respond_create_card;
- epv->notifyCardsRemoved = impl_BookListener_respond_remove_cards;
- epv->notifyCardModified = impl_BookListener_respond_modify_card;
- epv->notifyAuthenticationResult = impl_BookListener_respond_authentication_result;
- epv->notifySupportedFields = impl_BookListener_response_get_supported_fields;
- epv->notifySupportedAuthMethods = impl_BookListener_response_get_supported_auth_methods;
- epv->notifyCardRequested = impl_BookListener_respond_get_vcard;
- epv->notifyCursorRequested = impl_BookListener_respond_get_cursor;
- epv->notifyViewRequested = impl_BookListener_respond_get_view;
- epv->notifyChangesRequested = impl_BookListener_respond_get_changes;
- epv->notifyConnectionStatus = impl_BookListener_report_connection_status;
- epv->notifyWritable = impl_BookListener_report_writable;
-}
-
-BONOBO_TYPE_FUNC_FULL (
- EBookListener,
- GNOME_Evolution_Addressbook_BookListener,
- BONOBO_TYPE_OBJECT,
- e_book_listener);
diff --git a/addressbook/backend/ebook/e-book-listener.h b/addressbook/backend/ebook/e-book-listener.h
deleted file mode 100644
index 1b02dd4bb6..0000000000
--- a/addressbook/backend/ebook/e-book-listener.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * A client-side GObject which exposes the
- * Evolution:BookListener interface.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __E_BOOK_LISTENER_H__
-#define __E_BOOK_LISTENER_H__
-
-#include <bonobo/bonobo-object.h>
-#include <ebook/addressbook.h>
-#include <ebook/e-book-types.h>
-#include <e-util/e-list.h>
-
-#define E_TYPE_BOOK_LISTENER (e_book_listener_get_type ())
-#define E_BOOK_LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_LISTENER, EBookListener))
-#define E_BOOK_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_LISTENER, EBookListenerClass))
-#define E_IS_BOOK_LISTENER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_LISTENER))
-#define E_IS_BOOK_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_LISTENER))
-#define E_BOOK_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_LISTENER, EBookListenerClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EBookListener EBookListener;
-typedef struct _EBookListenerClass EBookListenerClass;
-typedef struct _EBookListenerPrivate EBookListenerPrivate;
-
-struct _EBookListener {
- BonoboObject parent;
- EBookListenerPrivate *priv;
-};
-
-struct _EBookListenerClass {
- BonoboObjectClass parent;
-
- POA_GNOME_Evolution_Addressbook_BookListener__epv epv;
- /*
- * Signals
- */
- void (*responses_queued) (void);
-};
-
-typedef enum {
- /* Async responses */
- OpenBookResponse,
- CreateCardResponse,
- RemoveCardResponse,
- ModifyCardResponse,
- GetCardResponse,
- GetCursorResponse,
- GetBookViewResponse,
- GetChangesResponse,
- AuthenticationResponse,
- GetSupportedFieldsResponse,
- GetSupportedAuthMethodsResponse,
-
- /* Async events */
- LinkStatusEvent,
- WritableStatusEvent,
- OpenProgressEvent,
-} EBookListenerOperation;
-
-typedef struct {
- EBookListenerOperation op;
-
- /* For most Response notifications */
- EBookStatus status;
-
- /* For OpenBookResponse */
- GNOME_Evolution_Addressbook_Book book;
-
- /* For GetCursorResponse */
- GNOME_Evolution_Addressbook_CardCursor cursor;
-
- /* For GetBookViewReponse */
- GNOME_Evolution_Addressbook_BookView book_view;
-
- /* For GetSupportedFields/GetSupportedAuthMethods */
- EList *list;
-
- /* For OpenProgressEvent */
- char *msg;
- short percent;
-
- /* For LinkStatusEvent */
- gboolean connected;
-
- /* For WritableStatusEvent */
- gboolean writable;
-
- /* For Card[Added|Removed|Modified]Event */
- char *id;
- char *vcard;
-} EBookListenerResponse;
-
-
-EBookListener *e_book_listener_new (void);
-int e_book_listener_check_pending (EBookListener *listener);
-EBookListenerResponse *e_book_listener_pop_response (EBookListener *listener);
-GType e_book_listener_get_type (void);
-void e_book_listener_stop (EBookListener *listener);
-
-G_END_DECLS
-
-#endif /* ! __E_BOOK_LISTENER_H__ */
diff --git a/addressbook/backend/ebook/e-book-marshal.list b/addressbook/backend/ebook/e-book-marshal.list
deleted file mode 100644
index 680ea039a3..0000000000
--- a/addressbook/backend/ebook/e-book-marshal.list
+++ /dev/null
@@ -1,5 +0,0 @@
-NONE:NONE
-NONE:BOOL
-NONE:POINTER
-NONE:STRING
-NONE:INT
diff --git a/addressbook/backend/ebook/e-book-types.h b/addressbook/backend/ebook/e-book-types.h
deleted file mode 100644
index b1900e77ed..0000000000
--- a/addressbook/backend/ebook/e-book-types.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * A client-side GObject which exposes the
- * Evolution:BookListener interface.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __E_BOOK_TYPES_H__
-#define __E_BOOK_TYPES_H__
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-typedef enum {
- E_BOOK_STATUS_SUCCESS,
- E_BOOK_STATUS_UNKNOWN,
- E_BOOK_STATUS_REPOSITORY_OFFLINE,
- E_BOOK_STATUS_PERMISSION_DENIED,
- E_BOOK_STATUS_CARD_NOT_FOUND,
- E_BOOK_STATUS_CARD_ID_ALREADY_EXISTS,
- E_BOOK_STATUS_PROTOCOL_NOT_SUPPORTED,
- E_BOOK_STATUS_CANCELLED,
- E_BOOK_STATUS_AUTHENTICATION_FAILED,
- E_BOOK_STATUS_AUTHENTICATION_REQUIRED,
- E_BOOK_STATUS_TLS_NOT_AVAILABLE,
- E_BOOK_STATUS_NO_SUCH_BOOK,
- E_BOOK_STATUS_OTHER_ERROR
-} EBookStatus;
-
-typedef enum {
- E_BOOK_VIEW_STATUS_SUCCESS,
- E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED,
- E_BOOK_VIEW_STATUS_SIZE_LIMIT_EXCEEDED,
- E_BOOK_VIEW_STATUS_INVALID_QUERY,
- E_BOOK_VIEW_STATUS_QUERY_REFUSED,
- E_BOOK_VIEW_STATUS_OTHER_ERROR,
- E_BOOK_VIEW_STATUS_UNKNOWN
-} EBookViewStatus;
-
-typedef enum {
- E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS,
- E_BOOK_SIMPLE_QUERY_STATUS_CANCELLED,
- E_BOOK_SIMPLE_QUERY_STATUS_OTHER_ERROR
-} EBookSimpleQueryStatus;
-
-G_END_DECLS
-
-#endif /* ! __E_BOOK_TYPES_H__ */
diff --git a/addressbook/backend/ebook/e-book-util.c b/addressbook/backend/ebook/e-book-util.c
deleted file mode 100644
index cc00d045f4..0000000000
--- a/addressbook/backend/ebook/e-book-util.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-book-util.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include "e-book-util.h"
-
-#include <string.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <e-util/e-config-listener.h>
-#include "e-card-compare.h"
-
-typedef struct _CommonBookInfo CommonBookInfo;
-struct _CommonBookInfo {
- EBookCommonCallback cb;
- gpointer closure;
-};
-
-char *
-e_book_expand_uri (const char *uri)
-{
- if (!strncmp (uri, "file:", 5)) {
- int length = strlen (uri);
- int offset = 5;
-
- if (!strncmp (uri, "file://", 7))
- offset = 7;
-
- if (length < 3 || strcmp (uri + length - 3, ".db")) {
- /* we assume it's a dir and glom addressbook.db onto the end. */
-
- char *ret_val;
- char *file_name;
-
- file_name = g_build_filename(uri + offset, "addressbook.db", NULL);
- ret_val = g_strdup_printf("file://%s", file_name);
- g_free(file_name);
- return ret_val;
- }
- }
-
- return g_strdup (uri);
-}
-
-static void
-got_uri_book_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- CommonBookInfo *info = (CommonBookInfo *) closure;
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- info->cb (book, info->closure);
- } else {
- if (book)
- g_object_unref (book);
- info->cb (NULL, info->closure);
- }
- g_free (info);
-}
-
-void
-e_book_load_address_book_by_uri (EBook *book, const char *uri, EBookCallback open_response, gpointer closure)
-{
- char *real_uri;
-
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
- g_return_if_fail (open_response != NULL);
-
- real_uri = e_book_expand_uri (uri);
-
- e_book_load_uri (book, real_uri, open_response, closure);
-
- g_free (real_uri);
-}
-
-void
-e_book_use_address_book_by_uri (const char *uri, EBookCommonCallback cb, gpointer closure)
-{
- EBook *book;
- CommonBookInfo *info;
-
- g_return_if_fail (cb != NULL);
-
- info = g_new0 (CommonBookInfo, 1);
- info->cb = cb;
- info->closure = closure;
-
- book = e_book_new ();
- e_book_load_address_book_by_uri (book, uri, got_uri_book_cb, info);
-}
-
-EConfigListener *
-e_book_get_config_database ()
-{
- static EConfigListener *config_db;
-
- if (config_db == NULL)
- config_db = e_config_listener_new ();
-
- return config_db;
-}
-
-static EBook *common_default_book = NULL;
-
-static void
-got_default_book_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- CommonBookInfo *info = (CommonBookInfo *) closure;
-
- if (status == E_BOOK_STATUS_SUCCESS) {
-
- /* We try not to leak in a race condition where the
- default book got loaded twice. */
-
- if (common_default_book) {
- g_object_unref (book);
- book = common_default_book;
- }
-
- info->cb (book, info->closure);
-
- if (common_default_book == NULL) {
- common_default_book = book;
- }
-
- } else {
- if (book)
- g_object_unref (book);
- info->cb (NULL, info->closure);
-
- }
- g_free (info);
-}
-
-void
-e_book_use_default_book (EBookCommonCallback cb, gpointer closure)
-{
- EBook *book;
- CommonBookInfo *info;
-
- g_return_if_fail (cb != NULL);
-
- if (common_default_book != NULL) {
- cb (common_default_book, closure);
- return;
- }
-
- info = g_new0 (CommonBookInfo, 1);
- info->cb = cb;
- info->closure = closure;
-
- book = e_book_new ();
- e_book_load_default_book (book, got_default_book_cb, info);
-}
-
-static char *default_book_uri;
-
-static char*
-get_local_book_uri (void)
-{
- char *filename;
- char *uri;
-
- filename = g_build_filename (g_get_home_dir(),
- "evolution/local/Contacts/addressbook.db",
- NULL);
- uri = g_strdup_printf ("file://%s", filename);
-
- g_free (filename);
-
- return uri;
-}
-
-static void
-set_default_book_uri_local (void)
-{
- g_free (default_book_uri);
-
- default_book_uri = get_local_book_uri ();
-}
-
-static void
-set_default_book_uri (char *val)
-{
- if (default_book_uri)
- g_free (default_book_uri);
-
- if (val) {
- default_book_uri = e_book_expand_uri (val);
- g_free (val);
- }
- else {
- set_default_book_uri_local ();
- }
-}
-
-#define DEFAULT_CONTACTS_URI_PATH "/apps/evolution/shell/default_folders/contacts_uri"
-static void
-default_folder_listener (EConfigListener *cl, const char *key, gpointer data)
-{
- char *val;
-
- if (strcmp (key, DEFAULT_CONTACTS_URI_PATH))
- return;
-
- val = e_config_listener_get_string (cl, DEFAULT_CONTACTS_URI_PATH);
-
- set_default_book_uri (val);
-}
-
-static void
-set_default_book_uri_from_config_db (void)
-{
- char *val;
- EConfigListener* config_db;
-
- config_db = e_book_get_config_database ();
- val = e_config_listener_get_string_with_default (config_db, DEFAULT_CONTACTS_URI_PATH, NULL, NULL);
-
- g_signal_connect (config_db,
- "key_changed",
- G_CALLBACK (default_folder_listener), NULL);
-
- set_default_book_uri (val);
-}
-
-typedef struct {
- gpointer closure;
- EBookCallback open_response;
-} DefaultBookClosure;
-
-static void
-e_book_default_book_open (EBook *book, EBookStatus status, gpointer closure)
-{
- DefaultBookClosure *default_book_closure = closure;
- gpointer user_closure = default_book_closure->closure;
- EBookCallback user_response = default_book_closure->open_response;
-
- g_free (default_book_closure);
-
- /* If there's a transient error, report it to the caller, but
- * if the old default folder has disappeared, fall back to the
- * local contacts folder instead, except when the default
- * folder is also the local folder.
- */
- if (status == E_BOOK_STATUS_PROTOCOL_NOT_SUPPORTED ||
- status == E_BOOK_STATUS_NO_SUCH_BOOK) {
- char *local_uri = get_local_book_uri();
- if (strcmp (local_uri, default_book_uri)) {
- set_default_book_uri_local ();
- e_book_load_default_book (book, user_response, user_closure);
- }
- else
- user_response (book, status, user_closure);
- g_free (local_uri);
- } else {
- user_response (book, status, user_closure);
- }
-}
-
-void
-e_book_load_default_book (EBook *book, EBookCallback open_response, gpointer closure)
-{
- const char *uri;
- DefaultBookClosure *default_book_closure;
-
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
- g_return_if_fail (open_response != NULL);
-
- uri = e_book_get_default_book_uri ();
-
- default_book_closure = g_new (DefaultBookClosure, 1);
-
- default_book_closure->closure = closure;
- default_book_closure->open_response = open_response;
-
- e_book_load_uri (book, uri,
- e_book_default_book_open, default_book_closure);
-
-}
-
-const char *
-e_book_get_default_book_uri ()
-{
- if (!default_book_uri)
- set_default_book_uri_from_config_db ();
-
- return default_book_uri;
-}
-
-/*
- *
- * Simple Query Stuff
- *
- */
-
-typedef struct _SimpleQueryInfo SimpleQueryInfo;
-struct _SimpleQueryInfo {
- guint tag;
- EBook *book;
- gchar *query;
- EBookSimpleQueryCallback cb;
- gpointer closure;
- EBookView *view;
- guint add_tag;
- guint seq_complete_tag;
- GList *cards;
- gboolean cancelled;
-};
-
-static void
-book_add_simple_query (EBook *book, SimpleQueryInfo *info)
-{
- GList *pending = g_object_get_data (G_OBJECT(book), "sq_pending");
- pending = g_list_prepend (pending, info);
- g_object_set_data (G_OBJECT (book), "sq_pending", pending);
-}
-
-static SimpleQueryInfo *
-book_lookup_simple_query (EBook *book, guint tag)
-{
- GList *pending = g_object_get_data (G_OBJECT (book), "sq_pending");
- while (pending) {
- SimpleQueryInfo *sq = pending->data;
- if (sq->tag == tag)
- return sq;
- pending = g_list_next (pending);
- }
- return NULL;
-}
-
-static void
-book_remove_simple_query (EBook *book, SimpleQueryInfo *info)
-{
- GList *pending = g_object_get_data (G_OBJECT (book), "sq_pending");
- GList *i;
-
- for (i=pending; i != NULL; i = g_list_next (i)) {
- if (i->data == info) {
- pending = g_list_remove_link (pending, i);
- g_list_free_1 (i);
- break;
- }
- }
- g_object_set_data (G_OBJECT (book), "sq_pending", pending);
-}
-
-static guint
-book_issue_tag (EBook *book)
-{
- gpointer ptr = g_object_get_data (G_OBJECT (book), "sq_tag");
- guint tag = GPOINTER_TO_UINT (ptr);
- if (tag == 0)
- tag = 1;
- g_object_set_data (G_OBJECT (book), "sq_tag", GUINT_TO_POINTER (tag+1));
- return tag;
-}
-
-static SimpleQueryInfo *
-simple_query_new (EBook *book, const char *query, EBookSimpleQueryCallback cb, gpointer closure)
-{
- SimpleQueryInfo *sq = g_new0 (SimpleQueryInfo, 1);
-
- sq->tag = book_issue_tag (book);
- sq->book = book;
- g_object_ref (book);
- sq->query = g_strdup (query);
- sq->cb = cb;
- sq->closure = closure;
- sq->cancelled = FALSE;
-
- /* Automatically add ourselves to the EBook's pending list. */
- book_add_simple_query (book, sq);
-
- return sq;
-}
-
-static void
-simple_query_disconnect (SimpleQueryInfo *sq)
-{
- if (sq->add_tag) {
- g_signal_handler_disconnect (sq->view, sq->add_tag);
- sq->add_tag = 0;
- }
-
- if (sq->seq_complete_tag) {
- g_signal_handler_disconnect (sq->view, sq->seq_complete_tag);
- sq->seq_complete_tag = 0;
- }
-
- if (sq->view) {
- g_object_unref (sq->view);
- sq->view = NULL;
- }
-}
-
-static void
-simple_query_free (SimpleQueryInfo *sq)
-{
- simple_query_disconnect (sq);
-
- /* Remove ourselves from the EBook's pending list. */
- book_remove_simple_query (sq->book, sq);
-
- g_free (sq->query);
-
- if (sq->book)
- g_object_unref (sq->book);
-
- g_list_foreach (sq->cards, (GFunc) g_object_unref, NULL);
- g_list_free (sq->cards);
-
- g_free (sq);
-}
-
-static void
-simple_query_card_added_cb (EBookView *view, const GList *cards, gpointer closure)
-{
- SimpleQueryInfo *sq = closure;
-
- if (sq->cancelled)
- return;
-
- sq->cards = g_list_concat (sq->cards, g_list_copy ((GList *) cards));
- g_list_foreach ((GList *) cards, (GFunc) g_object_ref, NULL);
-}
-
-static void
-simple_query_sequence_complete_cb (EBookView *view, EBookViewStatus status, gpointer closure)
-{
- SimpleQueryInfo *sq = closure;
-
- /* Disconnect signals, so that we don't pick up any changes to the book that occur
- in our callback */
- simple_query_disconnect (sq);
- if (! sq->cancelled)
- sq->cb (sq->book, E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS, sq->cards, sq->closure);
- simple_query_free (sq);
-}
-
-static void
-simple_query_book_view_cb (EBook *book, EBookStatus status, EBookView *book_view, gpointer closure)
-{
- SimpleQueryInfo *sq = closure;
-
- if (sq->cancelled) {
- simple_query_free (sq);
- return;
- }
-
- if (status != E_BOOK_STATUS_SUCCESS) {
- simple_query_disconnect (sq);
- sq->cb (sq->book, E_BOOK_SIMPLE_QUERY_STATUS_OTHER_ERROR, NULL, sq->closure);
- simple_query_free (sq);
- return;
- }
-
- sq->view = book_view;
- g_object_ref (book_view);
-
- sq->add_tag = g_signal_connect (sq->view, "card_added",
- G_CALLBACK (simple_query_card_added_cb), sq);
- sq->seq_complete_tag = g_signal_connect (sq->view, "sequence_complete",
- G_CALLBACK (simple_query_sequence_complete_cb), sq);
-}
-
-guint
-e_book_simple_query (EBook *book, const char *query, EBookSimpleQueryCallback cb, gpointer closure)
-{
- SimpleQueryInfo *sq;
-
- g_return_val_if_fail (book && E_IS_BOOK (book), 0);
- g_return_val_if_fail (query, 0);
- g_return_val_if_fail (cb, 0);
-
- sq = simple_query_new (book, query, cb, closure);
- e_book_get_book_view (book, (gchar *) query, simple_query_book_view_cb, sq);
-
- return sq->tag;
-}
-
-void
-e_book_simple_query_cancel (EBook *book, guint tag)
-{
- SimpleQueryInfo *sq;
-
- g_return_if_fail (book && E_IS_BOOK (book));
-
- sq = book_lookup_simple_query (book, tag);
-
- if (sq) {
- sq->cancelled = TRUE;
- sq->cb (sq->book, E_BOOK_SIMPLE_QUERY_STATUS_CANCELLED, NULL, sq->closure);
- } else {
- g_warning ("Simple query tag %d is unknown", tag);
- }
-}
-
-/*
- *
- * Specialized Queries
- *
- */
-
-typedef struct _NameEmailQueryInfo NameEmailQueryInfo;
-struct _NameEmailQueryInfo {
- gchar *name;
- gchar *email;
- EBookSimpleQueryCallback cb;
- gpointer closure;
-};
-
-static void
-name_email_query_info_free (NameEmailQueryInfo *info)
-{
- if (info) {
- g_free (info->name);
- g_free (info->email);
- g_free (info);
- }
-}
-
-static void
-name_and_email_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- NameEmailQueryInfo *info = closure;
- GList *filtered_cards = NULL;
-
- while (cards) {
- ECard *card = E_CARD (cards->data);
- if ((info->name == NULL || e_card_compare_name_to_string (card, info->name) >= E_CARD_MATCH_VAGUE)
- && (info->email == NULL || e_card_email_match_string (card, info->email))) {
- filtered_cards = g_list_append (filtered_cards, card);
- }
- cards = g_list_next (cards);
- }
-
- info->cb (book, status, filtered_cards, info->closure);
-
- g_list_free (filtered_cards);
-
- name_email_query_info_free (info);
-}
-
-guint
-e_book_name_and_email_query (EBook *book,
- const gchar *name,
- const gchar *email,
- EBookSimpleQueryCallback cb,
- gpointer closure)
-{
- NameEmailQueryInfo *info;
- gchar *email_query=NULL, *name_query=NULL, *query;
- guint tag;
-
- g_return_val_if_fail (book && E_IS_BOOK (book), 0);
- g_return_val_if_fail (cb != NULL, 0);
-
- if (name && !*name)
- name = NULL;
- if (email && !*email)
- email = NULL;
-
- if (name == NULL && email == NULL)
- return 0;
-
- /* Build our e-mail query.
- * We only query against the username part of the address, to avoid not matching
- * fred@foo.com and fred@mail.foo.com. While their may be namespace collisions
- * in the usernames of everyone out there, it shouldn't be that bad. (Famous last words.)
- */
- if (email) {
- const gchar *t = email;
- while (*t && *t != '@')
- ++t;
- if (*t == '@') {
- email_query = g_strdup_printf ("(beginswith \"email\" \"%.*s@\")", t-email, email);
-
- } else {
- email_query = g_strdup_printf ("(beginswith \"email\" \"%s\")", email);
- }
- }
-
- /* Build our name query.
- * We only do name-query stuff if we don't have an e-mail address. Our basic assumption
- * is that the username part of the email is good enough to keep the amount of stuff returned
- * in the query relatively small.
- */
- if (name && !email) {
- gchar *name_cpy = g_strdup (name), *qjoined;
- gchar **namev;
- gint i, count=0;
-
- g_strstrip (name_cpy);
- namev = g_strsplit (name_cpy, " ", 0);
- for (i=0; namev[i]; ++i) {
- if (*namev[i]) {
- char *str = namev[i];
-
- namev[i] = g_strdup_printf ("(contains \"file_as\" \"%s\")", namev[i]);
- ++count;
-
- g_free (str);
- }
- }
-
- qjoined = g_strjoinv (" ", namev);
- if (count > 1) {
- name_query = g_strdup_printf ("(or %s)", qjoined);
- } else {
- name_query = qjoined;
- qjoined = NULL;
- }
-
- g_free (name_cpy);
- g_strfreev (namev);
- g_free (qjoined);
- }
-
- /* Assemble our e-mail & name queries */
- if (email_query && name_query) {
- query = g_strdup_printf ("(and %s %s)", email_query, name_query);
- } else if (email_query) {
- query = email_query;
- email_query = NULL;
- } else if (name_query) {
- query = name_query;
- name_query = NULL;
- } else
- return 0;
-
- info = g_new0 (NameEmailQueryInfo, 1);
- info->name = g_strdup (name);
- info->email = g_strdup (email);
- info->cb = cb;
- info->closure = closure;
-
- tag = e_book_simple_query (book, query, name_and_email_cb, info);
-
- g_free (email_query);
- g_free (name_query);
- g_free (query);
-
- return tag;
-}
-
-/*
- * Simple nickname query
- */
-
-typedef struct _NicknameQueryInfo NicknameQueryInfo;
-struct _NicknameQueryInfo {
- gchar *nickname;
- EBookSimpleQueryCallback cb;
- gpointer closure;
-};
-
-static void
-nickname_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- NicknameQueryInfo *info = closure;
-
- if (info->cb)
- info->cb (book, status, cards, info->closure);
-
- g_free (info->nickname);
- g_free (info);
-}
-
-guint
-e_book_nickname_query (EBook *book,
- const char *nickname,
- EBookSimpleQueryCallback cb,
- gpointer closure)
-{
- NicknameQueryInfo *info;
- gchar *query;
- guint retval;
-
- g_return_val_if_fail (E_IS_BOOK (book), 0);
- g_return_val_if_fail (nickname != NULL, 0);
-
- /* The empty-string case shouldn't generate a warning. */
- if (! *nickname)
- return 0;
-
- info = g_new0 (NicknameQueryInfo, 1);
- info->nickname = g_strdup (nickname);
- info->cb = cb;
- info->closure = closure;
-
- query = g_strdup_printf ("(is \"nickname\" \"%s\")", info->nickname);
-
- retval = e_book_simple_query (book, query, nickname_cb, info);
-
- g_free (query);
-
- return retval;
-}
-
-/*
- * Convenience routine to check for addresses in the local address book.
- */
-
-typedef struct _HaveAddressInfo HaveAddressInfo;
-struct _HaveAddressInfo {
- gchar *email;
- EBookHaveAddressCallback cb;
- gpointer closure;
-};
-
-static void
-have_address_query_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- HaveAddressInfo *info = (HaveAddressInfo *) closure;
-
- info->cb (book,
- info->email,
- cards && (status == E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS) ? E_CARD (cards->data) : NULL,
- info->closure);
-
- g_free (info->email);
- g_free (info);
-}
-
-static void
-have_address_book_open_cb (EBook *book, gpointer closure)
-{
- HaveAddressInfo *info = (HaveAddressInfo *) closure;
-
- if (book) {
-
- e_book_name_and_email_query (book, NULL, info->email, have_address_query_cb, info);
-
- } else {
-
- info->cb (NULL, info->email, NULL, info->closure);
-
- g_free (info->email);
- g_free (info);
-
- }
-}
-
-void
-e_book_query_address_default (const gchar *email,
- EBookHaveAddressCallback cb,
- gpointer closure)
-{
- HaveAddressInfo *info;
-
- g_return_if_fail (email != NULL);
- g_return_if_fail (cb != NULL);
-
- info = g_new0 (HaveAddressInfo, 1);
- info->email = g_strdup (email);
- info->cb = cb;
- info->closure = closure;
-
- e_book_use_default_book (have_address_book_open_cb, info);
-}
-
-/* bad place for this i know. */
-int
-e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
-{
- gchar *s1 = g_utf8_casefold(str1, len);
- gchar *s2 = g_utf8_casefold(str2, len);
- int rv;
-
- rv = g_utf8_collate (s1, s2);
-
- g_free (s1);
- g_free (s2);
-
- return rv;
-}
-
-int
-e_utf8_casefold_collate (const gchar *str1, const gchar *str2)
-{
- return e_utf8_casefold_collate_len (str1, str2, -1);
-}
-
diff --git a/addressbook/backend/ebook/e-book-util.h b/addressbook/backend/ebook/e-book-util.h
deleted file mode 100644
index 39eb135332..0000000000
--- a/addressbook/backend/ebook/e-book-util.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-book-util.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_BOOK_UTIL_H__
-#define __E_BOOK_UTIL_H__
-
-#include "e-book.h"
-#include "e-util/e-config-listener.h"
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-moniker-util.h>
-
-G_BEGIN_DECLS
-
-/* Callbacks for asynchronous functions. */
-typedef void (*EBookCommonCallback) (EBook *book, gpointer closure);
-typedef void (*EBookSimpleQueryCallback) (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure);
-typedef void (*EBookHaveAddressCallback) (EBook *book, const gchar *addr, ECard *card, gpointer closure);
-
-/* expand file:///foo/foo/ to file:///foo/foo/addressbook.db */
-char *e_book_expand_uri (const char *uri);
-
-void e_book_load_address_book_by_uri (EBook *book,
- const char *uri,
- EBookCallback open_response,
- gpointer closure);
-void e_book_use_address_book_by_uri (const char *uri,
- EBookCommonCallback cb,
- gpointer closure);
-
-void e_book_use_default_book (EBookCommonCallback cb,
- gpointer closure);
-void e_book_load_default_book (EBook *book,
- EBookCallback open_response,
- gpointer closure);
-const char *e_book_get_default_book_uri (void);
-
-/* config database interface. */
-EConfigListener *e_book_get_config_database (void);
-
-/* Simple Query Interface. */
-guint e_book_simple_query (EBook *book,
- const char *query,
- EBookSimpleQueryCallback cb,
- gpointer closure);
-void e_book_simple_query_cancel (EBook *book,
- guint tag);
-
-/* Specialized Name/Email Queries */
-guint e_book_name_and_email_query (EBook *book,
- const char *name,
- const char *email,
- EBookSimpleQueryCallback cb,
- gpointer closure);
-guint e_book_nickname_query (EBook *book,
- const char *nickname,
- EBookSimpleQueryCallback cb,
- gpointer closure);
-
-/* Returns the ECard associated to email in the callback,
- or NULL if no match is found in the default address book. */
-void e_book_query_address_default (const gchar *email,
- EBookHaveAddressCallback cb,
- gpointer closure);
-
-int e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len);
-int e_utf8_casefold_collate (const gchar *str1, const gchar *str2);
-
-G_END_DECLS
-
-#endif /* __E_BOOK_UTIL_H__ */
-
diff --git a/addressbook/backend/ebook/e-book-view-listener.c b/addressbook/backend/ebook/e-book-view-listener.c
deleted file mode 100644
index 668c442a9a..0000000000
--- a/addressbook/backend/ebook/e-book-view-listener.c
+++ /dev/null
@@ -1,449 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Exports the BookViewListener interface. Maintains a queue of messages
- * which come in on the interface.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <config.h>
-#include <bonobo/bonobo-main.h>
-#include "e-book-view-listener.h"
-#include "e-book-view.h"
-#include "e-card.h"
-#include "e-book-marshal.h"
-
-static EBookViewStatus e_book_view_listener_convert_status (GNOME_Evolution_Addressbook_BookViewListener_CallStatus status);
-
-enum {
- RESPONSES_QUEUED,
- LAST_SIGNAL
-};
-
-static guint e_book_view_listener_signals [LAST_SIGNAL];
-
-static BonoboObjectClass *parent_class;
-
-struct _EBookViewListenerPrivate {
- GList *response_queue;
- gint timeout_id;
-
- guint timeout_lock : 1;
- guint stopped : 1;
-};
-
-static gboolean
-e_book_view_listener_check_queue (EBookViewListener *listener)
-{
- if (listener->priv->timeout_lock)
- return TRUE;
-
- listener->priv->timeout_lock = TRUE;
-
- if (listener->priv->response_queue != NULL && !listener->priv->stopped) {
- g_signal_emit (listener, e_book_view_listener_signals [RESPONSES_QUEUED], 0);
- }
-
- if (listener->priv->response_queue == NULL || listener->priv->stopped) {
- listener->priv->timeout_id = 0;
- listener->priv->timeout_lock = FALSE;
- bonobo_object_unref (BONOBO_OBJECT (listener));
- return FALSE;
- }
-
- listener->priv->timeout_lock = FALSE;
- return TRUE;
-}
-
-static void
-e_book_view_listener_queue_response (EBookViewListener *listener,
- EBookViewListenerResponse *response)
-{
- if (response == NULL)
- return;
-
- if (listener->priv->stopped) {
- /* Free response and return */
- g_list_foreach (response->ids, (GFunc)g_free, NULL);
- g_list_free (response->ids);
- g_list_foreach (response->cards, (GFunc) g_object_unref, NULL);
- g_list_free (response->cards);
- g_free (response->message);
- g_free (response);
- return;
- }
-
- /* a slight optimization for huge ldap queries. if there's an
- existing Add response on the end of the queue, and we're an
- Add response, we just glom the two lists of cards
- together */
- if (response->op == CardAddedEvent) {
- GList *last = g_list_last (listener->priv->response_queue);
- EBookViewListenerResponse *last_resp = NULL;
-
- if (last) last_resp = last->data;
-
- if (last_resp && last_resp->op == CardAddedEvent ) {
- response->cards = g_list_concat (last_resp->cards, response->cards);
- g_free (response);
- /* there should already be a timeout since the
- queue isn't empty, so we'll just return
- here */
- return;
- }
- else
- listener->priv->response_queue = g_list_append (last, response);
- }
- else
- listener->priv->response_queue = g_list_append (listener->priv->response_queue, response);
-
- if (listener->priv->timeout_id == 0) {
-
- /* Here, 20 == an arbitrary small number */
- listener->priv->timeout_id = g_timeout_add (20, (GSourceFunc) e_book_view_listener_check_queue, listener);
-
- /* Hold a reference to the listener on behalf of the timeout */
- bonobo_object_ref (BONOBO_OBJECT (listener));
- }
-}
-
-/* Add, Remove, Modify */
-static void
-e_book_view_listener_queue_status_event (EBookViewListener *listener,
- EBookViewListenerOperation op,
- EBookViewStatus status)
-{
- EBookViewListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookViewListenerResponse, 1);
-
- resp->op = op;
- resp->status = status;
- resp->ids = NULL;
- resp->cards = NULL;
- resp->message = NULL;
-
- e_book_view_listener_queue_response (listener, resp);
-}
-
-/* Add, Remove, Modify */
-static void
-e_book_view_listener_queue_idlist_event (EBookViewListener *listener,
- EBookViewListenerOperation op,
- const GNOME_Evolution_Addressbook_CardIdList *ids)
-{
- EBookViewListenerResponse *resp;
- int i;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookViewListenerResponse, 1);
-
- resp->op = op;
- resp->status = E_BOOK_VIEW_STATUS_SUCCESS;
- resp->ids = NULL;
- resp->cards = NULL;
- resp->message = NULL;
-
- for (i = 0; i < ids->_length; i ++) {
- resp->ids = g_list_prepend (resp->ids, g_strdup (ids->_buffer[i]));
- }
-
- e_book_view_listener_queue_response (listener, resp);
-}
-
-/* Add, Remove, Modify */
-static void
-e_book_view_listener_queue_sequence_event (EBookViewListener *listener,
- EBookViewListenerOperation op,
- const GNOME_Evolution_Addressbook_VCardList *cards)
-{
- EBookViewListenerResponse *resp;
- int i;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookViewListenerResponse, 1);
-
- resp->op = op;
- resp->status = E_BOOK_VIEW_STATUS_SUCCESS;
- resp->ids = NULL;
- resp->cards = NULL;
- resp->message = NULL;
-
- for ( i = 0; i < cards->_length; i++ ) {
- resp->cards = g_list_append(resp->cards, e_card_new(cards->_buffer[i]));
- }
-
- e_book_view_listener_queue_response (listener, resp);
-}
-
-/* Status Message */
-static void
-e_book_view_listener_queue_message_event (EBookViewListener *listener,
- EBookViewListenerOperation op,
- const char *message)
-{
- EBookViewListenerResponse *resp;
-
- if (listener->priv->stopped)
- return;
-
- resp = g_new0 (EBookViewListenerResponse, 1);
-
- resp->op = op;
- resp->status = E_BOOK_VIEW_STATUS_SUCCESS;
- resp->ids = NULL;
- resp->cards = NULL;
- resp->message = g_strdup(message);
-
- e_book_view_listener_queue_response (listener, resp);
-}
-
-static void
-impl_BookViewListener_notify_card_added (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_VCardList *cards,
- CORBA_Environment *ev)
-{
- EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object (servant));
-
- e_book_view_listener_queue_sequence_event (
- listener, CardAddedEvent, cards);
-}
-
-static void
-impl_BookViewListener_notify_cards_removed (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_CardIdList *ids,
- CORBA_Environment *ev)
-{
- EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object (servant));
-
- e_book_view_listener_queue_idlist_event (listener, CardsRemovedEvent, ids);
-}
-
-static void
-impl_BookViewListener_notify_card_changed (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_VCardList *cards,
- CORBA_Environment *ev)
-{
- EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object (servant));
-
- e_book_view_listener_queue_sequence_event (
- listener, CardModifiedEvent, cards);
-}
-
-static void
-impl_BookViewListener_notify_sequence_complete (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookViewListener_CallStatus status,
- CORBA_Environment *ev)
-{
- EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object (servant));
-
- e_book_view_listener_queue_status_event (listener, SequenceCompleteEvent,
- e_book_view_listener_convert_status (status));
-}
-
-static void
-impl_BookViewListener_notify_status_message (PortableServer_Servant servant,
- const char *message,
- CORBA_Environment *ev)
-{
- EBookViewListener *listener = E_BOOK_VIEW_LISTENER (bonobo_object (servant));
-
- e_book_view_listener_queue_message_event (listener, StatusMessageEvent, message);
-}
-
-/**
- * e_book_view_listener_check_pending:
- * @listener: the #EBookViewListener
- *
- * Returns: the number of items on the response queue,
- * or -1 if the @listener is isn't an #EBookViewListener.
- */
-int
-e_book_view_listener_check_pending (EBookViewListener *listener)
-{
- g_return_val_if_fail (listener != NULL, -1);
- g_return_val_if_fail (E_IS_BOOK_VIEW_LISTENER (listener), -1);
-
- return g_list_length (listener->priv->response_queue);
-}
-
-/**
- * e_book_view_listener_pop_response:
- * @listener: the #EBookViewListener for which a request is to be popped
- *
- * Returns: an #EBookViewListenerResponse if there are responses on the
- * queue to be returned; %NULL if there aren't, or if the @listener
- * isn't an EBookViewListener.
- */
-EBookViewListenerResponse *
-e_book_view_listener_pop_response (EBookViewListener *listener)
-{
- EBookViewListenerResponse *resp;
- GList *popped;
-
- g_return_val_if_fail (listener != NULL, NULL);
- g_return_val_if_fail (E_IS_BOOK_VIEW_LISTENER (listener), NULL);
-
- if (listener->priv->response_queue == NULL)
- return NULL;
-
- resp = listener->priv->response_queue->data;
-
- popped = listener->priv->response_queue;
- listener->priv->response_queue =
- g_list_remove_link (listener->priv->response_queue,
- listener->priv->response_queue);
- g_list_free_1 (popped);
-
- return resp;
-}
-
-static EBookViewStatus
-e_book_view_listener_convert_status (const GNOME_Evolution_Addressbook_BookViewListener_CallStatus status)
-{
- switch (status) {
- case GNOME_Evolution_Addressbook_BookViewListener_Success:
- return E_BOOK_VIEW_STATUS_SUCCESS;
- case GNOME_Evolution_Addressbook_BookViewListener_SearchTimeLimitExceeded:
- return E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED;
- case GNOME_Evolution_Addressbook_BookViewListener_SearchSizeLimitExceeded:
- return E_BOOK_VIEW_STATUS_SIZE_LIMIT_EXCEEDED;
- case GNOME_Evolution_Addressbook_BookViewListener_InvalidQuery:
- return E_BOOK_VIEW_STATUS_INVALID_QUERY;
- case GNOME_Evolution_Addressbook_BookViewListener_QueryRefused:
- return E_BOOK_VIEW_STATUS_QUERY_REFUSED;
- case GNOME_Evolution_Addressbook_BookViewListener_OtherError:
- return E_BOOK_VIEW_STATUS_OTHER_ERROR;
- default:
- g_warning ("e_book_view_listener_convert_status: Unknown status "
- "from card server: %d\n", (int) status);
- return E_BOOK_VIEW_STATUS_UNKNOWN;
-
- }
-}
-
-static void
-e_book_view_listener_construct (EBookViewListener *listener)
-{
- /* nothing needed here */
-}
-
-/**
- * e_book_view_listener_new:
- * @book: the #EBookView for which the listener is to be bound
- *
- * Creates and returns a new #EBookViewListener for the book.
- *
- * Returns: a new #EBookViewListener
- */
-EBookViewListener *
-e_book_view_listener_new ()
-{
- EBookViewListener *listener;
-
- listener = g_object_new (E_TYPE_BOOK_VIEW_LISTENER, NULL);
-
- e_book_view_listener_construct (listener);
-
- return listener;
-}
-
-static void
-e_book_view_listener_init (EBookViewListener *listener)
-{
- listener->priv = g_new0 (EBookViewListenerPrivate, 1);
- listener->priv->response_queue = NULL;
- listener->priv->timeout_id = 0;
- listener->priv->timeout_lock = FALSE;
- listener->priv->stopped = FALSE;
-}
-
-void
-e_book_view_listener_stop (EBookViewListener *listener)
-{
- g_return_if_fail (E_IS_BOOK_VIEW_LISTENER (listener));
- listener->priv->stopped = TRUE;
-}
-
-static void
-e_book_view_listener_dispose (GObject *object)
-{
- EBookViewListener *listener = E_BOOK_VIEW_LISTENER (object);
-
- if (listener->priv) {
- GList *l;
- /* Remove our response queue handler: In theory, this
- can never happen since we always hold a reference
- to the listener while the timeout is running. */
- if (listener->priv->timeout_id) {
- g_source_remove (listener->priv->timeout_id);
- }
-
- /* Clear out the queue */
- for (l = listener->priv->response_queue; l != NULL; l = l->next) {
- EBookViewListenerResponse *resp = l->data;
-
- g_list_foreach (resp->ids, (GFunc)g_free, NULL);
- g_list_free (resp->ids);
-
- g_list_foreach(resp->cards, (GFunc) g_object_unref, NULL);
- g_list_free(resp->cards);
- resp->cards = NULL;
-
- g_free (resp->message);
- resp->message = NULL;
-
- g_free (resp);
- }
- g_list_free (listener->priv->response_queue);
-
- g_free (listener->priv);
- listener->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_book_view_listener_class_init (EBookViewListenerClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- POA_GNOME_Evolution_Addressbook_BookViewListener__epv *epv;
-
- parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
-
- e_book_view_listener_signals [RESPONSES_QUEUED] =
- g_signal_new ("responses_queued",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookViewListenerClass, responses_queued),
- NULL, NULL,
- e_book_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- object_class->dispose = e_book_view_listener_dispose;
-
- epv = &klass->epv;
- epv->notifyCardChanged = impl_BookViewListener_notify_card_changed;
- epv->notifyCardsRemoved = impl_BookViewListener_notify_cards_removed;
- epv->notifyCardAdded = impl_BookViewListener_notify_card_added;
- epv->notifySequenceComplete = impl_BookViewListener_notify_sequence_complete;
- epv->notifyStatusMessage = impl_BookViewListener_notify_status_message;
-}
-
-BONOBO_TYPE_FUNC_FULL (
- EBookViewListener,
- GNOME_Evolution_Addressbook_BookViewListener,
- BONOBO_TYPE_OBJECT,
- e_book_view_listener);
diff --git a/addressbook/backend/ebook/e-book-view-listener.h b/addressbook/backend/ebook/e-book-view-listener.h
deleted file mode 100644
index fd1c1395a7..0000000000
--- a/addressbook/backend/ebook/e-book-view-listener.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * A client-side GObject which exposes the
- * Evolution:BookViewListener interface.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __E_BOOK_VIEW_LISTENER_H__
-#define __E_BOOK_VIEW_LISTENER_H__
-
-#include <bonobo/bonobo-object.h>
-#include <ebook/e-book-types.h>
-#include <ebook/addressbook.h>
-
-#define E_TYPE_BOOK_VIEW_LISTENER (e_book_view_listener_get_type ())
-#define E_BOOK_VIEW_LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListener))
-#define E_BOOK_VIEW_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListenerClass))
-#define E_IS_BOOK_VIEW_LISTENER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_VIEW_LISTENER))
-#define E_IS_BOOK_VIEW_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_VIEW_LISTENER))
-#define E_BOOK_VIEW_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_VIEW_LISTENER, EBookViewListenerClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EBookViewListener EBookViewListener;
-typedef struct _EBookViewListenerClass EBookViewListenerClass;
-typedef struct _EBookViewListenerPrivate EBookViewListenerPrivate;
-
-struct _EBookViewListener {
- BonoboObject parent;
- EBookViewListenerPrivate *priv;
-};
-
-struct _EBookViewListenerClass {
- BonoboObjectClass parent;
-
- POA_GNOME_Evolution_Addressbook_BookViewListener__epv epv;
-
- /*
- * Signals
- */
- void (*responses_queued) (void);
-};
-
-typedef enum {
- /* Async events */
- CardAddedEvent,
- CardsRemovedEvent,
- CardModifiedEvent,
- SequenceCompleteEvent,
- StatusMessageEvent,
-} EBookViewListenerOperation;
-
-typedef struct {
- EBookViewListenerOperation op;
-
- /* For SequenceComplete */
- EBookViewStatus status;
-
- /* For CardsRemovedEvent */
- GList *ids;
-
- /* For Card[Added|Modified]Event */
- GList *cards; /* Of type ECard. */
-
- /* For StatusMessageEvent */
- char *message;
-
-} EBookViewListenerResponse;
-
-EBookViewListener *e_book_view_listener_new (void);
-int e_book_view_listener_check_pending (EBookViewListener *listener);
-EBookViewListenerResponse *e_book_view_listener_pop_response (EBookViewListener *listener);
-GType e_book_view_listener_get_type (void);
-void e_book_view_listener_stop (EBookViewListener *listener);
-
-G_END_DECLS
-
-#endif /* ! __E_BOOK_VIEW_LISTENER_H__ */
diff --git a/addressbook/backend/ebook/e-book-view.c b/addressbook/backend/ebook/e-book-view.c
deleted file mode 100644
index e1f4b1623c..0000000000
--- a/addressbook/backend/ebook/e-book-view.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * The Evolution addressbook client object.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 1999, 2000, Ximian, Inc.
- */
-
-#include <config.h>
-
-#include "addressbook.h"
-#include "e-card-cursor.h"
-#include "e-book-view-listener.h"
-#include "e-book-view.h"
-#include "e-book.h"
-#include "e-book-marshal.h"
-
-static GObjectClass *parent_class;
-
-struct _EBookViewPrivate {
- GNOME_Evolution_Addressbook_BookView corba_book_view;
-
- EBook *book;
-
- EBookViewListener *listener;
-
- int responses_queued_id;
-};
-
-enum {
- CARD_CHANGED,
- CARD_REMOVED,
- CARD_ADDED,
- SEQUENCE_COMPLETE,
- STATUS_MESSAGE,
- LAST_SIGNAL
-};
-
-static guint e_book_view_signals [LAST_SIGNAL];
-
-static void
-add_book_iterator (gpointer data, gpointer closure)
-{
- ECard *card = E_CARD (data);
- EBook *book = E_BOOK (closure);
-
- e_card_set_book (card, book);
-}
-
-static void
-e_book_view_do_added_event (EBookView *book_view,
- EBookViewListenerResponse *resp)
-{
- if (book_view->priv->book)
- g_list_foreach (resp->cards, add_book_iterator, book_view->priv->book);
-
- g_signal_emit (book_view, e_book_view_signals [CARD_ADDED], 0,
- resp->cards);
-
- g_list_foreach (resp->cards, (GFunc) g_object_unref, NULL);
- g_list_free (resp->cards);
-}
-
-static void
-e_book_view_do_modified_event (EBookView *book_view,
- EBookViewListenerResponse *resp)
-{
- if (book_view->priv->book)
- g_list_foreach (resp->cards, add_book_iterator, book_view->priv->book);
-
- g_signal_emit (book_view, e_book_view_signals [CARD_CHANGED], 0,
- resp->cards);
-
- g_list_foreach (resp->cards, (GFunc) g_object_unref, NULL);
- g_list_free (resp->cards);
-}
-
-static void
-e_book_view_do_removed_event (EBookView *book_view,
- EBookViewListenerResponse *resp)
-{
- g_signal_emit (book_view, e_book_view_signals [CARD_REMOVED], 0,
- resp->ids);
-
- g_list_foreach (resp->ids, (GFunc) g_free, NULL);
- g_list_free (resp->ids);
-}
-
-static void
-e_book_view_do_complete_event (EBookView *book_view,
- EBookViewListenerResponse *resp)
-{
- g_signal_emit (book_view, e_book_view_signals [SEQUENCE_COMPLETE], 0,
- resp->status);
-}
-
-static void
-e_book_view_do_status_message_event (EBookView *book_view,
- EBookViewListenerResponse *resp)
-{
- g_signal_emit (book_view, e_book_view_signals [STATUS_MESSAGE], 0,
- resp->message);
- g_free(resp->message);
-}
-
-
-/*
- * Reading notices out of the EBookViewListener's queue.
- */
-static void
-e_book_view_check_listener_queue (EBookViewListener *listener, EBookView *book_view)
-{
- EBookViewListenerResponse *resp;
-
- resp = e_book_view_listener_pop_response (listener);
-
- if (resp == NULL)
- return;
-
- switch (resp->op) {
- case CardAddedEvent:
- e_book_view_do_added_event (book_view, resp);
- break;
- case CardModifiedEvent:
- e_book_view_do_modified_event (book_view, resp);
- break;
- case CardsRemovedEvent:
- e_book_view_do_removed_event (book_view, resp);
- break;
- case SequenceCompleteEvent:
- e_book_view_do_complete_event (book_view, resp);
- break;
- case StatusMessageEvent:
- e_book_view_do_status_message_event (book_view, resp);
- break;
- default:
- g_error ("EBookView: Unknown operation %d in listener queue!\n",
- resp->op);
- break;
- }
-
- g_free (resp);
-}
-
-static gboolean
-e_book_view_construct (EBookView *book_view, GNOME_Evolution_Addressbook_BookView corba_book_view, EBookViewListener *listener)
-{
- CORBA_Environment ev;
- g_return_val_if_fail (book_view != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK_VIEW (book_view), FALSE);
-
- /*
- * Copy in the corba_book_view.
- */
- CORBA_exception_init (&ev);
-
- book_view->priv->corba_book_view = bonobo_object_dup_ref(corba_book_view, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_view_construct: Exception duplicating corba_book_view.\n");
- CORBA_exception_free (&ev);
- book_view->priv->corba_book_view = NULL;
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- /*
- * Create our local BookListener interface.
- */
- book_view->priv->listener = listener;
- book_view->priv->responses_queued_id = g_signal_connect (book_view->priv->listener, "responses_queued",
- G_CALLBACK (e_book_view_check_listener_queue), book_view);
-
- bonobo_object_ref(BONOBO_OBJECT(book_view->priv->listener));
-
- return TRUE;
-}
-
-/**
- * e_book_view_new:
- */
-EBookView *
-e_book_view_new (GNOME_Evolution_Addressbook_BookView corba_book_view, EBookViewListener *listener)
-{
- EBookView *book_view;
-
- book_view = g_object_new (E_TYPE_BOOK_VIEW, NULL);
-
- if (! e_book_view_construct (book_view, corba_book_view, listener)) {
- g_object_unref (book_view);
- return NULL;
- }
-
- return book_view;
-}
-
-void
-e_book_view_set_book (EBookView *book_view, EBook *book)
-{
- g_return_if_fail (book_view && E_IS_BOOK_VIEW (book_view));
- g_return_if_fail (book && E_IS_BOOK (book));
- g_return_if_fail (book_view->priv->book == NULL);
-
- book_view->priv->book = book;
- g_object_ref (book);
-}
-
-void
-e_book_view_stop (EBookView *book_view)
-{
- g_return_if_fail (book_view && E_IS_BOOK_VIEW (book_view));
- if (book_view->priv->listener)
- e_book_view_listener_stop (book_view->priv->listener);
-}
-
-static void
-e_book_view_init (EBookView *book_view)
-{
- book_view->priv = g_new0 (EBookViewPrivate, 1);
- book_view->priv->book = NULL;
- book_view->priv->corba_book_view = CORBA_OBJECT_NIL;
- book_view->priv->listener = NULL;
- book_view->priv->responses_queued_id = 0;
-}
-
-static void
-e_book_view_dispose (GObject *object)
-{
- EBookView *book_view = E_BOOK_VIEW (object);
- CORBA_Environment ev;
-
- if (book_view->priv) {
- if (book_view->priv->book) {
- g_object_unref (book_view->priv->book);
- }
-
- if (book_view->priv->corba_book_view) {
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (book_view->priv->corba_book_view, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("EBookView: Exception while releasing BookView\n");
- }
-
- CORBA_exception_free (&ev);
- }
-
- if (book_view->priv->listener) {
- if (book_view->priv->responses_queued_id)
- g_signal_handler_disconnect(book_view->priv->listener,
- book_view->priv->responses_queued_id);
- e_book_view_listener_stop (book_view->priv->listener);
- bonobo_object_unref (BONOBO_OBJECT(book_view->priv->listener));
- }
-
- g_free (book_view->priv);
- book_view->priv = NULL;
- }
-
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static void
-e_book_view_class_init (EBookViewClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- e_book_view_signals [CARD_CHANGED] =
- g_signal_new ("card_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookViewClass, card_changed),
- NULL, NULL,
- e_book_marshal_NONE__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- e_book_view_signals [CARD_ADDED] =
- g_signal_new ("card_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookViewClass, card_added),
- NULL, NULL,
- e_book_marshal_NONE__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- e_book_view_signals [CARD_REMOVED] =
- g_signal_new ("card_removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookViewClass, card_removed),
- NULL, NULL,
- e_book_marshal_NONE__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- e_book_view_signals [SEQUENCE_COMPLETE] =
- g_signal_new ("sequence_complete",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookViewClass, sequence_complete),
- NULL, NULL,
- e_book_marshal_NONE__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
-
- e_book_view_signals [STATUS_MESSAGE] =
- g_signal_new ("status_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookViewClass, status_message),
- NULL, NULL,
- e_book_marshal_NONE__STRING,
- G_TYPE_NONE, 1,
- G_TYPE_STRING);
-
- object_class->dispose = e_book_view_dispose;
-}
-
-/**
- * e_book_view_get_type:
- */
-GType
-e_book_view_get_type (void)
-{
- static GType type = 0;
-
- if (! type) {
- GTypeInfo info = {
- sizeof (EBookViewClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) e_book_view_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EBookView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_book_view_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "EBookView", &info, 0);
- }
-
- return type;
-}
diff --git a/addressbook/backend/ebook/e-book-view.h b/addressbook/backend/ebook/e-book-view.h
deleted file mode 100644
index bd7a97d1d5..0000000000
--- a/addressbook/backend/ebook/e-book-view.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * The Evolution addressbook client object.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 1999, 2000, Ximian, Inc.
- */
-
-#ifndef __E_BOOK_VIEW_H__
-#define __E_BOOK_VIEW_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <ebook/e-card.h>
-#include <ebook/e-book-view-listener.h>
-
-#define E_TYPE_BOOK_VIEW (e_book_view_get_type ())
-#define E_BOOK_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK_VIEW, EBookView))
-#define E_BOOK_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_BOOK_VIEW, EBookViewClass))
-#define E_IS_BOOK_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK_VIEW))
-#define E_IS_BOOK_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK_VIEW))
-#define E_BOOK_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK_VIEW, EBookViewClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EBookView EBookView;
-typedef struct _EBookViewClass EBookViewClass;
-typedef struct _EBookViewPrivate EBookViewPrivate;
-
-struct _EBook; /* Forward reference */
-
-struct _EBookView {
- GObject parent;
- EBookViewPrivate *priv;
-};
-
-struct _EBookViewClass {
- GObjectClass parent;
-
- /*
- * Signals.
- */
- void (* card_changed) (EBookView *book_view, const GList *cards);
- void (* card_removed) (EBookView *book_view, const GList *ids);
- void (* card_added) (EBookView *book_view, const GList *cards);
- void (* sequence_complete) (EBookView *book_view, EBookViewStatus status);
- void (* status_message) (EBookView *book_view, const char *message);
-};
-
-/* Creating a new addressbook. */
-EBookView *e_book_view_new (GNOME_Evolution_Addressbook_BookView corba_book_view, EBookViewListener *listener);
-
-GType e_book_view_get_type (void);
-
-void e_book_view_set_book (EBookView *book_view, struct _EBook *book);
-
-void e_book_view_stop (EBookView *book_view);
-
-G_END_DECLS
-
-#endif /* ! __E_BOOK_VIEW_H__ */
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
deleted file mode 100644
index 9e1250bd0e..0000000000
--- a/addressbook/backend/ebook/e-book.c
+++ /dev/null
@@ -1,1700 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * The Evolution addressbook client object.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 1999, 2000, Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <string.h>
-#include <bonobo-activation/bonobo-activation.h>
-
-#include "addressbook.h"
-#include "e-card-cursor.h"
-#include "e-book-listener.h"
-#include "e-book.h"
-#include "e-book-marshal.h"
-#include "e-util/e-component-listener.h"
-
-static GObjectClass *parent_class;
-
-#define CARDSERVER_OAF_ID "OAFIID:GNOME_Evolution_Wombat_ServerFactory"
-
-typedef enum {
- URINotLoaded,
- URILoading,
- URILoaded
-} EBookLoadState;
-
-struct _EBookPrivate {
- GList *book_factories;
- GList *iter;
-
- /* cached capabilites */
- char *cap;
- gboolean cap_queried;
-
- EBookListener *listener;
- EComponentListener *comp_listener;
-
- GNOME_Evolution_Addressbook_Book corba_book;
-
- EBookLoadState load_state;
-
- /*
- * The operation queue. New operations are appended to the
- * end of the queue. When responses come back from the PAS,
- * the op structures are popped off the front of the queue.
- */
- GList *pending_ops;
-
- guint op_tag;
-
- gchar *uri;
-
- gulong listener_signal;
- gulong died_signal;
-};
-
-enum {
- OPEN_PROGRESS,
- WRITABLE_STATUS,
- LINK_STATUS,
- BACKEND_DIED,
- LAST_SIGNAL
-};
-
-static guint e_book_signals [LAST_SIGNAL];
-
-typedef struct {
- guint tag;
- gboolean active;
- gpointer cb;
- gpointer closure;
- EBookViewListener *listener;
-} EBookOp;
-
-/*
- * Local response queue management.
- */
-
-static void
-e_book_op_free (EBookOp *op)
-{
- if (op->listener) {
- bonobo_object_unref (BONOBO_OBJECT (op->listener));
- op->listener = NULL;
- }
- g_free (op);
-}
-
-static guint
-e_book_queue_op (EBook *book,
- gpointer cb,
- gpointer closure,
- EBookViewListener *listener)
-{
- EBookOp *op;
-
- op = g_new0 (EBookOp, 1);
- op->tag = book->priv->op_tag++;
- op->active = TRUE;
- op->cb = cb;
- op->closure = closure;
- op->listener = listener;
-
- if (op->listener)
- bonobo_object_ref (BONOBO_OBJECT (op->listener));
-
- book->priv->pending_ops =
- g_list_append (book->priv->pending_ops, op);
-
- return op->tag;
-}
-
-/*
- * Local response queue management.
- */
-static void
-e_book_unqueue_op (EBook *book)
-{
- EBookOp *op;
- GList *removed;
-
- removed = g_list_last (book->priv->pending_ops);
-
- if (removed) {
- book->priv->pending_ops = g_list_remove_link (book->priv->pending_ops,
- removed);
- op = removed->data;
- e_book_op_free (op);
- g_list_free_1 (removed);
- book->priv->op_tag--;
- }
-}
-
-static EBookOp *
-e_book_pop_op (EBook *book)
-{
- GList *popped;
- EBookOp *op;
-
- if (book->priv->pending_ops == NULL)
- return NULL;
-
- op = book->priv->pending_ops->data;
-
- popped = book->priv->pending_ops;
- book->priv->pending_ops =
- g_list_remove_link (book->priv->pending_ops,
- book->priv->pending_ops);
-
- g_list_free_1 (popped);
-
- return op;
-}
-
-static gboolean
-e_book_cancel_op (EBook *book, guint tag)
-{
- GList *iter;
- gboolean cancelled = FALSE;
-
- for (iter = book->priv->pending_ops; iter != NULL && !cancelled; iter = g_list_next (iter)) {
- EBookOp *op = iter->data;
- if (op->tag == tag) {
- op->active = FALSE;
- cancelled = TRUE;
- }
- }
-
- return cancelled;
-}
-
-static void
-e_book_do_response_create_card (EBook *book,
- EBookListenerResponse *resp)
-{
- EBookOp *op;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_create_card: Cannot find operation "
- "in local op queue!\n");
- return;
- }
-
- if (op->cb)
- ((EBookIdCallback) op->cb) (book, resp->status, resp->id, op->closure);
- g_free (resp->id);
- e_book_op_free (op);
-}
-
-static void
-e_book_do_response_generic (EBook *book,
- EBookListenerResponse *resp)
-{
- EBookOp *op;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_generic: Cannot find operation "
- "in local op queue!\n");
- }
-
- if (op->cb)
- ((EBookCallback) op->cb) (book, resp->status, op->closure);
-
- e_book_op_free (op);
-}
-
-static void
-e_book_do_response_get_vcard (EBook *book,
- EBookListenerResponse *resp)
-{
- EBookOp *op;
- ECard *card;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_get_vcard: Cannot find operation "
- "in local op queue!\n");
- return;
- }
- if (resp->vcard != NULL) {
-
- card = e_card_new(resp->vcard);
-
- if (card != NULL) {
- e_card_set_book (card, book);
- if (op->cb) {
- if (op->active)
- ((EBookCardCallback) op->cb) (book, resp->status, card, op->closure);
- else
- ((EBookCardCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- g_object_unref(card);
- } else {
- ((EBookCursorCallback) op->cb) (book, resp->status, NULL, op->closure);
- }
- } else {
- ((EBookCardCallback) op->cb) (book, resp->status, NULL, op->closure);
- }
-
- g_free (resp->vcard);
- e_book_op_free (op);
-}
-
-static void
-e_book_do_response_get_cursor (EBook *book,
- EBookListenerResponse *resp)
-{
- CORBA_Environment ev;
- EBookOp *op;
- ECardCursor *cursor;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_get_cursor: Cannot find operation "
- "in local op queue!\n");
- return;
- }
-
- cursor = e_card_cursor_new(resp->cursor);
-
- if (cursor != NULL) {
- if (op->cb) {
- if (op->active)
- ((EBookCursorCallback) op->cb) (book, resp->status, cursor, op->closure);
- else
- ((EBookCursorCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- /*
- * Release the remote GNOME_Evolution_Addressbook_Book in the PAS.
- */
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (resp->cursor, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_do_response_get_cursor: Exception releasing "
- "remote GNOME_Evolution_Addressbook_CardCursor interface!\n");
- }
-
- CORBA_exception_free (&ev);
-
- g_object_unref(cursor);
- } else {
- ((EBookCursorCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- e_book_op_free (op);
-}
-
-static void
-e_book_do_response_get_view (EBook *book,
- EBookListenerResponse *resp)
-{
- CORBA_Environment ev;
- EBookOp *op;
- EBookView *book_view;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_get_view: Cannot find operation "
- "in local op queue!\n");
- return;
- }
-
- book_view = e_book_view_new (resp->book_view, op->listener);
-
- if (book_view != NULL) {
- e_book_view_set_book (book_view, book);
-
- /* Only execute the callback if the operation is still flagged as active (i.e. hasn't
- been cancelled. This is mildly wasteful since we unnecessaryily create the
- book_view, etc... but I'm leery of tinkering with the CORBA magic. */
- if (op->cb) {
- if (op->active)
- ((EBookBookViewCallback) op->cb) (book, resp->status, book_view, op->closure);
- else
- ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- /*
- * Release the remote GNOME_Evolution_Addressbook_Book in the PAS.
- */
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (resp->book_view, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_do_response_get_view: Exception releasing "
- "remote GNOME_Evolution_Addressbook_BookView interface!\n");
- }
-
- CORBA_exception_free (&ev);
-
- g_object_unref(book_view);
- } else {
- e_book_view_listener_stop (op->listener);
- ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- e_book_op_free (op);
-}
-
-static void
-e_book_do_response_get_changes (EBook *book,
- EBookListenerResponse *resp)
-{
- CORBA_Environment ev;
- EBookOp *op;
- EBookView *book_view;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_get_changes: Cannot find operation "
- "in local op queue!\n");
- return;
- }
-
- book_view = e_book_view_new (resp->book_view, op->listener);
-
- if (book_view != NULL) {
- e_book_view_set_book (book_view, book);
-
- if (op->cb) {
- if (op->active)
- ((EBookBookViewCallback) op->cb) (book, resp->status, book_view, op->closure);
- else
- ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- /*
- * Release the remote GNOME_Evolution_Addressbook_BookView in the PAS.
- */
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (resp->book_view, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_do_response_get_changes: Exception releasing "
- "remote GNOME_Evolution_Addressbook_BookView interface!\n");
- }
-
- CORBA_exception_free (&ev);
-
- g_object_unref(book_view);
- } else {
- e_book_view_listener_stop (op->listener);
- ((EBookBookViewCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- e_book_op_free (op);
-}
-
-static void
-backend_died_cb (EComponentListener *cl, gpointer user_data)
-{
- EBook *book = user_data;
-
- book->priv->load_state = URINotLoaded;
- g_signal_emit (book, e_book_signals [BACKEND_DIED], 0);
-}
-
-static void
-e_book_do_response_open (EBook *book,
- EBookListenerResponse *resp)
-{
- EBookOp *op;
-
- if (resp->status == E_BOOK_STATUS_SUCCESS) {
- book->priv->corba_book = resp->book;
- book->priv->load_state = URILoaded;
-
- book->priv->comp_listener = e_component_listener_new (book->priv->corba_book);
- book->priv->died_signal = g_signal_connect (book->priv->comp_listener, "component_died",
- G_CALLBACK (backend_died_cb), book);
- }
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_open: Cannot find operation "
- "in local op queue!\n");
- return;
- }
-
- if (op->cb)
- ((EBookCallback) op->cb) (book, resp->status, op->closure);
- e_book_op_free (op);
-}
-
-static void
-e_book_do_progress_event (EBook *book,
- EBookListenerResponse *resp)
-{
- g_signal_emit (book, e_book_signals [OPEN_PROGRESS], 0,
- resp->msg, resp->percent);
-
- g_free (resp->msg);
-}
-
-static void
-e_book_do_link_event (EBook *book,
- EBookListenerResponse *resp)
-{
- g_signal_emit (book, e_book_signals [LINK_STATUS], 0,
- resp->connected);
-}
-
-static void
-e_book_do_writable_event (EBook *book,
- EBookListenerResponse *resp)
-{
- g_signal_emit (book, e_book_signals [WRITABLE_STATUS], 0,
- resp->writable);
-}
-
-static void
-e_book_do_response_get_supported_fields (EBook *book,
- EBookListenerResponse *resp)
-{
- EBookOp *op;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_get_supported_fields: Cannot find operation "
- "in local op queue!\n");
- return;
- }
-
- if (op->cb) {
- if (op->active)
- ((EBookFieldsCallback) op->cb) (book, resp->status, resp->list, op->closure);
- else
- ((EBookFieldsCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- g_object_unref(resp->list);
-
- e_book_op_free (op);
-}
-
-static void
-e_book_do_response_get_supported_auth_methods (EBook *book,
- EBookListenerResponse *resp)
-{
- EBookOp *op;
-
- op = e_book_pop_op (book);
-
- if (op == NULL) {
- g_warning ("e_book_do_response_get_supported_auth_methods: Cannot find operation "
- "in local op queue!\n");
- return;
- }
-
- if (op->cb) {
- if (op->active)
- ((EBookAuthMethodsCallback) op->cb) (book, resp->status, resp->list, op->closure);
- else
- ((EBookAuthMethodsCallback) op->cb) (book, E_BOOK_STATUS_CANCELLED, NULL, op->closure);
- }
-
- g_object_unref(resp->list);
-
- e_book_op_free (op);
-}
-
-/*
- * Reading notices out of the EBookListener's queue.
- */
-static void
-e_book_check_listener_queue (EBookListener *listener, EBook *book)
-{
- EBookListenerResponse *resp;
-
- resp = e_book_listener_pop_response (listener);
-
- if (resp == NULL)
- return;
-
- switch (resp->op) {
- case CreateCardResponse:
- e_book_do_response_create_card (book, resp);
- break;
- case RemoveCardResponse:
- case ModifyCardResponse:
- case AuthenticationResponse:
- e_book_do_response_generic (book, resp);
- break;
- case GetCardResponse:
- e_book_do_response_get_vcard (book, resp);
- break;
- case GetCursorResponse:
- e_book_do_response_get_cursor (book, resp);
- break;
- case GetBookViewResponse:
- e_book_do_response_get_view(book, resp);
- break;
- case GetChangesResponse:
- e_book_do_response_get_changes(book, resp);
- break;
- case OpenBookResponse:
- e_book_do_response_open (book, resp);
- break;
- case GetSupportedFieldsResponse:
- e_book_do_response_get_supported_fields (book, resp);
- break;
- case GetSupportedAuthMethodsResponse:
- e_book_do_response_get_supported_auth_methods (book, resp);
- break;
-
- case OpenProgressEvent:
- e_book_do_progress_event (book, resp);
- break;
- case LinkStatusEvent:
- e_book_do_link_event (book, resp);
- break;
- case WritableStatusEvent:
- e_book_do_writable_event (book, resp);
- break;
- default:
- g_error ("EBook: Unknown operation %d in listener queue!\n",
- resp->op);
- }
-
- g_free (resp);
-}
-
-/**
- * e_book_load_uri:
- */
-
-typedef struct {
- char *uri;
- EBookCallback open_response;
- gpointer closure;
-} EBookLoadURIData;
-
-static void e_book_load_uri_from_factory (EBook *book,
- GNOME_Evolution_Addressbook_BookFactory factory,
- EBookLoadURIData *load_uri_data);
-
-static void
-e_book_load_uri_step (EBook *book, EBookStatus status, EBookLoadURIData *data)
-{
- /* iterate to the next possible CardFactory, or fail
- if it's the last one */
- book->priv->iter = book->priv->iter->next;
- if (book->priv->iter) {
- GNOME_Evolution_Addressbook_BookFactory factory = book->priv->iter->data;
- e_book_load_uri_from_factory (book, factory, data);
- }
- else {
- EBookCallback cb = data->open_response;
- gpointer closure = data->closure;
-
- /* reset the load_state to NotLoaded so people can
- attempt another load_uri on the book. */
- book->priv->load_state = URINotLoaded;
-
- g_free (data);
-
- cb (book, status, closure);
- }
-}
-
-static void
-e_book_load_uri_open_cb (EBook *book, EBookStatus status, EBookLoadURIData *data)
-{
- if (status == E_BOOK_STATUS_SUCCESS) {
- EBookCallback cb = data->open_response;
- gpointer closure = data->closure;
-
- g_free (data);
-
- cb (book, status, closure);
- }
- else {
- e_book_load_uri_step (book, status, data);
- }
-}
-
-static void
-e_book_load_uri_from_factory (EBook *book,
- GNOME_Evolution_Addressbook_BookFactory factory,
- EBookLoadURIData *load_uri_data)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- e_book_queue_op (book, e_book_load_uri_open_cb, load_uri_data, NULL);
-
- GNOME_Evolution_Addressbook_BookFactory_openBook (
- factory, book->priv->uri,
- bonobo_object_corba_objref (BONOBO_OBJECT (book->priv->listener)),
- &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_load_uri: CORBA exception while opening addressbook!\n");
- e_book_unqueue_op (book);
- CORBA_exception_free (&ev);
- e_book_load_uri_step (book, E_BOOK_STATUS_OTHER_ERROR, load_uri_data);
- }
-
- CORBA_exception_free (&ev);
-
-}
-
-static gboolean
-activate_factories_for_uri (EBook *book, const char *uri)
-{
- CORBA_Environment ev;
- Bonobo_ServerInfoList *info_list = NULL;
- int i;
- char *protocol, *query, *colon;
- gboolean retval = FALSE;
-
- colon = strchr (uri, ':');
- if (!colon) {
- g_warning ("e_book_load_uri: Unable to determine protocol in the URI\n");
- return FALSE;
- }
-
- protocol = g_strndup (uri, colon-uri);
- query = g_strdup_printf ("repo_ids.has ('IDL:GNOME/Evolution/BookFactory:1.0')"
- " AND addressbook:supported_protocols.has ('%s')", protocol
- );
-
- CORBA_exception_init (&ev);
-
- info_list = bonobo_activation_query (query, NULL, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Eeek! Cannot perform bonobo-activation query for book factories.");
- CORBA_exception_free (&ev);
- goto shutdown;
- }
-
- if (info_list->_length == 0) {
- g_warning ("Can't find installed BookFactory that handles protocol '%s'.", protocol);
- CORBA_exception_free (&ev);
- goto shutdown;
- }
-
- CORBA_exception_free (&ev);
-
- for (i = 0; i < info_list->_length; i ++) {
- const Bonobo_ServerInfo *info;
- GNOME_Evolution_Addressbook_BookFactory factory;
-
- info = info_list->_buffer + i;
-
- factory = bonobo_activation_activate_from_id (info->iid, 0, NULL, NULL);
-
- if (factory == CORBA_OBJECT_NIL)
- g_warning ("e_book_construct: Could not obtain a handle "
- "to the Personal Addressbook Server with IID `%s'\n", info->iid);
- else
- book->priv->book_factories = g_list_append (book->priv->book_factories,
- factory);
- }
-
- if (!book->priv->book_factories) {
- g_warning ("Couldn't activate any book factories.");
- goto shutdown;
- }
-
- retval = TRUE;
-
- shutdown:
- if (info_list)
- CORBA_free (info_list);
- g_free (query);
- g_free (protocol);
-
- return retval;
-}
-
-void
-e_book_load_uri (EBook *book,
- const char *uri,
- EBookCallback open_response,
- gpointer closure)
-{
- EBookLoadURIData *load_uri_data;
- GNOME_Evolution_Addressbook_BookFactory factory;
-
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
- g_return_if_fail (uri != NULL);
- g_return_if_fail (open_response != NULL);
-
- if (book->priv->load_state != URINotLoaded) {
- g_warning ("e_book_load_uri: Attempted to load a URI "
- "on a book which already has a URI loaded!\n");
- open_response (book, E_BOOK_STATUS_OTHER_ERROR, closure); /* XXX need a new status code here */
- return;
- }
-
- /* try to find a list of factories that can handle the protocol */
- if (!activate_factories_for_uri (book, uri)) {
- open_response (book, E_BOOK_STATUS_PROTOCOL_NOT_SUPPORTED, closure);
- return;
- }
-
- g_free (book->priv->uri);
- book->priv->uri = g_strdup (uri);
-
- /*
- * Create our local BookListener interface.
- */
- book->priv->listener = e_book_listener_new ();
- if (book->priv->listener == NULL) {
- g_warning ("e_book_load_uri: Could not create EBookListener!\n");
- open_response (NULL, E_BOOK_STATUS_OTHER_ERROR, closure); /* XXX need a new status code here */
- return;
- }
-
- book->priv->listener_signal = g_signal_connect (book->priv->listener, "responses_queued",
- G_CALLBACK (e_book_check_listener_queue), book);
-
- load_uri_data = g_new (EBookLoadURIData, 1);
- load_uri_data->open_response = open_response;
- load_uri_data->closure = closure;
-
- /* initialize the iterator, and load from the first one*/
- book->priv->iter = book->priv->book_factories;
-
- factory = book->priv->iter->data;
-
- e_book_load_uri_from_factory (book, factory, load_uri_data);
-
- book->priv->load_state = URILoading;
-}
-
-/**
- * e_book_unload_uri:
- */
-void
-e_book_unload_uri (EBook *book)
-{
- CORBA_Environment ev;
-
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
-
- /*
- * FIXME: Make sure this works if the URI is still being
- * loaded.
- */
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_unload_uri: No URI is loaded!\n");
- return;
- }
-
- /*
- * Release the remote GNOME_Evolution_Addressbook_Book in the PAS.
- */
- CORBA_exception_init (&ev);
-
- bonobo_object_release_unref (book->priv->corba_book, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_unload_uri: Exception releasing "
- "remote book interface!\n");
- }
-
- CORBA_exception_free (&ev);
-
- e_book_listener_stop (book->priv->listener);
- bonobo_object_unref (BONOBO_OBJECT (book->priv->listener));
-
- book->priv->listener = NULL;
- book->priv->load_state = URINotLoaded;
-}
-
-const char *
-e_book_get_uri (EBook *book)
-{
- g_return_val_if_fail (book && E_IS_BOOK (book), NULL);
-
- return book->priv->uri;
-}
-
-char *
-e_book_get_static_capabilities (EBook *book)
-{
- if (!book->priv->cap_queried) {
- CORBA_Environment ev;
- char *temp;
-
- CORBA_exception_init (&ev);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_unload_uri: No URI is loaded!\n");
- return g_strdup("");
- }
-
- temp = GNOME_Evolution_Addressbook_Book_getStaticCapabilities(book->priv->corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_static_capabilities: Exception "
- "during get_static_capabilities!\n");
- CORBA_exception_free (&ev);
- return g_strdup("");
- }
-
- book->priv->cap = g_strdup(temp);
- book->priv->cap_queried = TRUE;
-
- CORBA_free(temp);
-
- CORBA_exception_free (&ev);
- }
-
- return g_strdup (book->priv->cap);
-}
-
-gboolean
-e_book_check_static_capability (EBook *book, const char *cap)
-{
- gboolean rv = FALSE;
- char *caps = e_book_get_static_capabilities (book);
- if (!caps)
- return FALSE;
-
- /* XXX this is an inexact test but it works for our use */
- if (strstr (caps, cap))
- rv = TRUE;
-
- g_free (caps);
-
- return rv;
-}
-
-guint
-e_book_get_supported_fields (EBook *book,
- EBookFieldsCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
- guint tag;
-
- CORBA_exception_init (&ev);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_unload_uri: No URI is loaded!\n");
- return 0;
- }
-
- tag = e_book_queue_op (book, cb, closure, NULL);
-
- GNOME_Evolution_Addressbook_Book_getSupportedFields(book->priv->corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_supported_fields: Exception "
- "during get_supported_fields!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return 0;
- }
-
- CORBA_exception_free (&ev);
-
- return tag;
-}
-
-guint
-e_book_get_supported_auth_methods (EBook *book,
- EBookAuthMethodsCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
- guint tag;
-
- CORBA_exception_init (&ev);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_unload_uri: No URI is loaded!\n");
- return 0;
- }
-
- tag = e_book_queue_op (book, cb, closure, NULL);
-
- GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods(book->priv->corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_supported_auth_methods: Exception "
- "during get_supported_auth_methods!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return 0;
- }
-
- CORBA_exception_free (&ev);
-
- return tag;
-}
-
-static gboolean
-e_book_construct (EBook *book)
-{
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
-
- book->priv->book_factories = NULL;
-
- return TRUE;
-}
-
-/**
- * e_book_new:
- */
-EBook *
-e_book_new (void)
-{
- EBook *book;
-
- book = g_object_new (E_TYPE_BOOK, NULL);
-
- if (! e_book_construct (book)) {
- g_object_unref (book);
- return NULL;
- }
-
- return book;
-}
-
-/* User authentication. */
-
-void
-e_book_authenticate_user (EBook *book,
- const char *user,
- const char *passwd,
- const char *auth_method,
- EBookCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
-
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_authenticate_user: No URI loaded!\n");
- return;
- }
-
- CORBA_exception_init (&ev);
-
- e_book_queue_op (book, cb, closure, NULL);
-
- GNOME_Evolution_Addressbook_Book_authenticateUser (book->priv->corba_book,
- user,
- passwd,
- auth_method,
- &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_authenticate_user: Exception authenticating user with the PAS!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return;
- }
-
- CORBA_exception_free (&ev);
-}
-
-/* Fetching cards */
-
-/**
- * e_book_get_card:
- */
-guint
-e_book_get_card (EBook *book,
- const char *id,
- EBookCardCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
- guint tag;
-
- g_return_val_if_fail (book != NULL, 0);
- g_return_val_if_fail (E_IS_BOOK (book), 0);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_get_card: No URI loaded!\n");
- return 0;
- }
-
- CORBA_exception_init (&ev);
-
- tag = e_book_queue_op (book, cb, closure, NULL);
-
- GNOME_Evolution_Addressbook_Book_getVCard (book->priv->corba_book, (const GNOME_Evolution_Addressbook_VCard) id, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_card: Exception "
- "getting card!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return 0;
- }
-
- CORBA_exception_free (&ev);
-
- return tag;
-}
-
-/* Deleting cards. */
-
-/**
- * e_book_remove_card:
- */
-gboolean
-e_book_remove_card (EBook *book,
- ECard *card,
- EBookCallback cb,
- gpointer closure)
-{
- const char *id;
-
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
- g_return_val_if_fail (card != NULL, FALSE);
- g_return_val_if_fail (E_IS_CARD (card), FALSE);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_remove_card: No URI loaded!\n");
- return FALSE;
- }
-
- id = e_card_get_id (card);
- g_assert (id != NULL);
-
- return e_book_remove_card_by_id (book, id, cb, closure);
-}
-
-/**
- * e_book_remove_card_by_id:
- */
-gboolean
-e_book_remove_card_by_id (EBook *book,
- const char *id,
- EBookCallback cb,
- gpointer closure)
-
-{
- GList *list = NULL;
- gboolean rv;
-
- list = g_list_prepend (list, (char*)id);
-
- rv = e_book_remove_cards (book, list, cb, closure);
-
- g_list_free (list);
-
- return rv;
-}
-
-gboolean
-e_book_remove_cards (EBook *book,
- GList *ids,
- EBookCallback cb,
- gpointer closure)
-{
- GNOME_Evolution_Addressbook_CardIdList idlist;
- CORBA_Environment ev;
- GList *l;
- int num_ids, i;
-
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
- g_return_val_if_fail (ids != NULL, FALSE);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_remove_card_by_id: No URI loaded!\n");
- return FALSE;
- }
-
- CORBA_exception_init (&ev);
-
- e_book_queue_op (book, cb, closure, NULL);
-
- num_ids = g_list_length (ids);
- idlist._buffer = CORBA_sequence_GNOME_Evolution_Addressbook_CardId_allocbuf (num_ids);
- idlist._maximum = num_ids;
- idlist._length = num_ids;
-
- for (l = ids, i = 0; l; l=l->next, i ++) {
- idlist._buffer[i] = CORBA_string_dup (l->data);
- }
-
- GNOME_Evolution_Addressbook_Book_removeCards (book->priv->corba_book, &idlist, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_remove_card_by_id: CORBA exception "
- "talking to PAS!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- CORBA_free(idlist._buffer);
-
- return TRUE;
-}
-
-
-/* Adding cards. */
-
-/**
- * e_book_add_card:
- */
-gboolean
-e_book_add_card (EBook *book,
- ECard *card,
- EBookIdCallback cb,
- gpointer closure)
-
-{
- char *vcard;
- gboolean retval;
-
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
- g_return_val_if_fail (card != NULL, FALSE);
- g_return_val_if_fail (E_IS_CARD (card), FALSE);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_add_card: No URI loaded!\n");
- return FALSE;
- }
-
- vcard = e_card_get_vcard_assume_utf8 (card);
-
- if (vcard == NULL) {
- g_warning ("e_book_add_card: Cannot convert card to VCard string!\n");
- return FALSE;
- }
-
- retval = e_book_add_vcard (book, vcard, cb, closure);
-
- g_free (vcard);
-
- e_card_set_book (card, book);
-
- return retval;
-}
-
-/**
- * e_book_add_vcard:
- */
-gboolean
-e_book_add_vcard (EBook *book,
- const char *vcard,
- EBookIdCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
-
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
- g_return_val_if_fail (vcard != NULL, FALSE);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_add_vcard: No URI loaded!\n");
- return FALSE;
- }
-
- CORBA_exception_init (&ev);
-
- e_book_queue_op (book, (EBookCallback) cb, closure, NULL);
-
- GNOME_Evolution_Addressbook_Book_addCard (
- book->priv->corba_book, (const GNOME_Evolution_Addressbook_VCard) vcard, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_add_vcard: Exception adding card to PAS!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- return TRUE;
-}
-
-/* Modifying cards. */
-
-/**
- * e_book_commit_card:
- */
-gboolean
-e_book_commit_card (EBook *book,
- ECard *card,
- EBookCallback cb,
- gpointer closure)
-{
- char *vcard;
- gboolean retval;
-
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
- g_return_val_if_fail (card != NULL, FALSE);
- g_return_val_if_fail (E_IS_CARD (card), FALSE);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_commit_card: No URI loaded!\n");
- return FALSE;
- }
-
- vcard = e_card_get_vcard_assume_utf8 (card);
-
- if (vcard == NULL) {
- g_warning ("e_book_commit_card: Error "
- "getting VCard for card!\n");
- return FALSE;
- }
-
- retval = e_book_commit_vcard (book, vcard, cb, closure);
-
- g_free (vcard);
-
- e_card_set_book (card, book);
-
- return retval;
-}
-
-/**
- * e_book_commit_vcard:
- */
-gboolean
-e_book_commit_vcard (EBook *book,
- const char *vcard,
- EBookCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
-
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
- g_return_val_if_fail (vcard != NULL, FALSE);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_commit_vcard: No URI loaded!\n");
- return FALSE;
- }
-
- CORBA_exception_init (&ev);
-
- e_book_queue_op (book, cb, closure, NULL);
-
- GNOME_Evolution_Addressbook_Book_modifyCard (
- book->priv->corba_book, (const GNOME_Evolution_Addressbook_VCard) vcard, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_commit_vcard: Exception "
- "modifying card in PAS!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- return TRUE;
-}
-
-/**
- * e_book_check_connection:
- */
-gboolean
-e_book_check_connection (EBook *book)
-{
- CORBA_Environment ev;
-
- g_return_val_if_fail (book != NULL, FALSE);
- g_return_val_if_fail (E_IS_BOOK (book), FALSE);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_check_connection: No URI loaded!\n");
- return FALSE;
- }
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_Book_checkConnection (book->priv->corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_check_connection: Exception "
- "querying the PAS!\n");
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- return TRUE;
-}
-
-guint
-e_book_get_cursor (EBook *book,
- gchar *query,
- EBookCursorCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
- guint tag;
-
- g_return_val_if_fail (book != NULL, 0);
- g_return_val_if_fail (E_IS_BOOK (book), 0);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_check_connection: No URI loaded!\n");
- return 0;
- }
-
- CORBA_exception_init (&ev);
-
- tag = e_book_queue_op (book, cb, closure, NULL);
-
- GNOME_Evolution_Addressbook_Book_getCursor (book->priv->corba_book, query, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_all_cards: Exception "
- "querying list of cards!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return 0;
- }
-
- CORBA_exception_free (&ev);
-
- return tag;
-}
-
-guint
-e_book_get_book_view (EBook *book,
- const gchar *query,
- EBookBookViewCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
- EBookViewListener *listener;
- guint tag;
-
- g_return_val_if_fail (book != NULL, 0);
- g_return_val_if_fail (E_IS_BOOK (book), 0);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_get_book_view: No URI loaded!\n");
- return 0;
- }
-
- listener = e_book_view_listener_new();
-
- CORBA_exception_init (&ev);
-
- tag = e_book_queue_op (book, cb, closure, listener);
-
- GNOME_Evolution_Addressbook_Book_getBookView (book->priv->corba_book, bonobo_object_corba_objref(BONOBO_OBJECT(listener)), query, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_book_view: Exception "
- "getting book_view!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return 0;
- }
-
- CORBA_exception_free (&ev);
-
- return tag;
-}
-
-guint
-e_book_get_completion_view (EBook *book,
- const gchar *query,
- EBookBookViewCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
- EBookViewListener *listener;
- guint tag;
-
- g_return_val_if_fail (book != NULL, 0);
- g_return_val_if_fail (E_IS_BOOK (book), 0);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_get_completion_view: No URI loaded!\n");
- return 0;
- }
-
- listener = e_book_view_listener_new();
-
- CORBA_exception_init (&ev);
-
- tag = e_book_queue_op (book, cb, closure, listener);
-
- GNOME_Evolution_Addressbook_Book_getCompletionView (book->priv->corba_book,
- bonobo_object_corba_objref(BONOBO_OBJECT(listener)),
- query, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_completion_view: Exception "
- "getting completion_view!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return 0;
- }
-
- CORBA_exception_free (&ev);
-
- return tag;
-}
-
-guint
-e_book_get_changes (EBook *book,
- gchar *changeid,
- EBookBookViewCallback cb,
- gpointer closure)
-{
- CORBA_Environment ev;
- EBookViewListener *listener;
- guint tag;
-
- g_return_val_if_fail (book != NULL, 0);
- g_return_val_if_fail (E_IS_BOOK (book), 0);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_get_changes: No URI loaded!\n");
- return FALSE;
- }
-
- listener = e_book_view_listener_new();
-
- CORBA_exception_init (&ev);
-
- tag = e_book_queue_op (book, cb, closure, listener);
-
- GNOME_Evolution_Addressbook_Book_getChanges (book->priv->corba_book, bonobo_object_corba_objref(BONOBO_OBJECT(listener)), changeid, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_changes: Exception "
- "getting changes!\n");
- CORBA_exception_free (&ev);
- e_book_unqueue_op (book);
- return 0;
- }
-
- CORBA_exception_free (&ev);
-
- return tag;
-}
-
-/**
- * e_book_cancel
- */
-
-void
-e_book_cancel (EBook *book, guint tag)
-{
- g_return_if_fail (book != NULL);
- g_return_if_fail (E_IS_BOOK (book));
- g_return_if_fail (tag != 0);
-
- /* In an attempt to be useful, we take a bit of extra care in reporting
- errors. This might come in handy someday. */
- if (tag >= book->priv->op_tag)
- g_warning ("Attempt to cancel unassigned operation (%u)", tag);
- else if (! e_book_cancel_op (book, tag))
- g_warning ("Attempt to cancel unknown operation (%u)", tag);
-}
-
-/**
- * e_book_get_name:
- */
-char *
-e_book_get_name (EBook *book)
-{
- CORBA_Environment ev;
- char *retval;
- char *name;
-
- g_return_val_if_fail (book != NULL, NULL);
- g_return_val_if_fail (E_IS_BOOK (book), NULL);
-
- if (book->priv->load_state != URILoaded) {
- g_warning ("e_book_get_name: No URI loaded!\n");
- return NULL;
- }
-
- CORBA_exception_init (&ev);
-
- name = GNOME_Evolution_Addressbook_Book_getName (book->priv->corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("e_book_get_name: Exception getting name from PAS!\n");
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- CORBA_exception_free (&ev);
-
- if (name == NULL) {
- g_warning ("e_book_get_name: Got NULL name from PAS!\n");
- return NULL;
- }
-
- retval = g_strdup (name);
- CORBA_free (name);
-
- return retval;
-}
-
-static void
-e_book_init (EBook *book)
-{
- book->priv = g_new0 (EBookPrivate, 1);
- book->priv->load_state = URINotLoaded;
- book->priv->op_tag = 1;
- book->priv->uri = NULL;
-}
-
-static void
-e_book_dispose (GObject *object)
-{
- EBook *book = E_BOOK (object);
-
- if (book->priv) {
- CORBA_Environment ev;
- GList *l;
-
- if (book->priv->load_state == URILoaded)
- e_book_unload_uri (book);
-
- CORBA_exception_init (&ev);
-
- for (l = book->priv->book_factories; l; l = l->next) {
- CORBA_Object_release ((CORBA_Object)l->data, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("EBook: Exception while releasing BookFactory\n");
-
- CORBA_exception_free (&ev);
- CORBA_exception_init (&ev);
- }
- }
-
- CORBA_exception_free (&ev);
-
- if (book->priv->listener) {
- g_signal_handler_disconnect (book->priv->comp_listener, book->priv->listener_signal);
- bonobo_object_unref (book->priv->listener);
- book->priv->listener = NULL;
- }
-
- if (book->priv->comp_listener) {
- g_signal_handler_disconnect (book->priv->comp_listener, book->priv->died_signal);
- g_object_unref (book->priv->comp_listener);
- book->priv->comp_listener = NULL;
- }
-
- g_free (book->priv->cap);
-
- g_free (book->priv->uri);
-
- g_free (book->priv);
- book->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_book_class_init (EBookClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- e_book_signals [LINK_STATUS] =
- g_signal_new ("link_status",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookClass, link_status),
- NULL, NULL,
- e_book_marshal_NONE__BOOL,
- G_TYPE_NONE, 1,
- G_TYPE_BOOLEAN);
-
- e_book_signals [WRITABLE_STATUS] =
- g_signal_new ("writable_status",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookClass, writable_status),
- NULL, NULL,
- e_book_marshal_NONE__BOOL,
- G_TYPE_NONE, 1,
- G_TYPE_BOOLEAN);
-
- e_book_signals [BACKEND_DIED] =
- g_signal_new ("backend_died",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EBookClass, backend_died),
- NULL, NULL,
- e_book_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- object_class->dispose = e_book_dispose;
-}
-
-/**
- * e_book_get_type:
- */
-GType
-e_book_get_type (void)
-{
- static GType type = 0;
-
- if (! type) {
- GTypeInfo info = {
- sizeof (EBookClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) e_book_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EBook),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_book_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "EBook", &info, 0);
- }
-
- return type;
-}
diff --git a/addressbook/backend/ebook/e-book.h b/addressbook/backend/ebook/e-book.h
deleted file mode 100644
index d2c5a7bce4..0000000000
--- a/addressbook/backend/ebook/e-book.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * The Evolution addressbook client object.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 1999, 2000, Ximian, Inc.
- */
-
-#ifndef __E_BOOK_H__
-#define __E_BOOK_H__
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <ebook/e-card.h>
-#include <ebook/e-card-cursor.h>
-#include <ebook/e-book-view.h>
-#include <ebook/e-book-types.h>
-
-#define E_TYPE_BOOK (e_book_get_type ())
-#define E_BOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_BOOK, EBook))
-#define E_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_BOOK, EBookClass))
-#define E_IS_BOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_BOOK))
-#define E_IS_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_BOOK))
-#define E_BOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_BOOK, EBookClass))
-
-G_BEGIN_DECLS
-
-typedef struct _EBook EBook;
-typedef struct _EBookClass EBookClass;
-typedef struct _EBookPrivate EBookPrivate;
-
-struct _EBook {
- GObject parent;
- EBookPrivate *priv;
-};
-
-struct _EBookClass {
- GObjectClass parent;
-
- /*
- * Signals.
- */
- void (* open_progress) (EBook *book, const char *msg, short percent);
- void (* link_status) (EBook *book, gboolean connected);
- void (* writable_status) (EBook *book, gboolean writable);
- void (* backend_died) (EBook *book);
-};
-
-/* Callbacks for asynchronous functions. */
-typedef void (*EBookCallback) (EBook *book, EBookStatus status, gpointer closure);
-typedef void (*EBookOpenProgressCallback) (EBook *book,
- const char *status_message,
- short percent,
- gpointer closure);
-typedef void (*EBookIdCallback) (EBook *book, EBookStatus status, const char *id, gpointer closure);
-typedef void (*EBookCardCallback) (EBook *book, EBookStatus status, ECard *card, gpointer closure);
-typedef void (*EBookCursorCallback) (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer closure);
-typedef void (*EBookBookViewCallback) (EBook *book, EBookStatus status, EBookView *book_view, gpointer closure);
-typedef void (*EBookFieldsCallback) (EBook *book, EBookStatus status, EList *fields, gpointer closure);
-typedef void (*EBookAuthMethodsCallback) (EBook *book, EBookStatus status, EList *auth_methods, gpointer closure);
-
-/* Creating a new addressbook. */
-EBook *e_book_new (void);
-
-void e_book_load_uri (EBook *book,
- const char *uri,
- EBookCallback open_response,
- gpointer closure);
-void e_book_unload_uri (EBook *book);
-
-const char *e_book_get_uri (EBook *book);
-
-char *e_book_get_static_capabilities (EBook *book);
-gboolean e_book_check_static_capability (EBook *book, const char *cap);
-
-guint e_book_get_supported_fields (EBook *book,
- EBookFieldsCallback cb,
- gpointer closure);
-
-guint e_book_get_supported_auth_methods (EBook *book,
- EBookAuthMethodsCallback cb,
- gpointer closure);
-
-/* User authentication. */
-void e_book_authenticate_user (EBook *book,
- const char *user,
- const char *passwd,
- const char *auth_method,
- EBookCallback cb,
- gpointer closure);
-
-/* Fetching cards. */
-guint e_book_get_card (EBook *book,
- const char *id,
- EBookCardCallback cb,
- gpointer closure);
-
-/* Deleting cards. */
-gboolean e_book_remove_card (EBook *book,
- ECard *card,
- EBookCallback cb,
- gpointer closure);
-gboolean e_book_remove_card_by_id (EBook *book,
- const char *id,
- EBookCallback cb,
- gpointer closure);
-
-gboolean e_book_remove_cards (EBook *book,
- GList *id_list,
- EBookCallback cb,
- gpointer closure);
-
-/* Adding cards. */
-gboolean e_book_add_card (EBook *book,
- ECard *card,
- EBookIdCallback cb,
- gpointer closure);
-gboolean e_book_add_vcard (EBook *book,
- const char *vcard,
- EBookIdCallback cb,
- gpointer closure);
-
-/* Modifying cards. */
-gboolean e_book_commit_card (EBook *book,
- ECard *card,
- EBookCallback cb,
- gpointer closure);
-gboolean e_book_commit_vcard (EBook *book,
- const char *vcard,
- EBookCallback cb,
- gpointer closure);
-
-/* Checking to see if we're connected to the card repository. */
-gboolean e_book_check_connection (EBook *book);
-guint e_book_get_cursor (EBook *book,
- char *query,
- EBookCursorCallback cb,
- gpointer closure);
-
-guint e_book_get_book_view (EBook *book,
- const gchar *query,
- EBookBookViewCallback cb,
- gpointer closure);
-
-guint e_book_get_completion_view (EBook *book,
- const gchar *query,
- EBookBookViewCallback cb,
- gpointer closure);
-
-guint e_book_get_changes (EBook *book,
- char *changeid,
- EBookBookViewCallback cb,
- gpointer closure);
-
-/* Cancel a pending operation. */
-void e_book_cancel (EBook *book,
- guint tag);
-
-
-/* Getting the name of the repository. */
-char *e_book_get_name (EBook *book);
-
-GType e_book_get_type (void);
-
-G_END_DECLS
-
-#endif /* ! __E_BOOK_H__ */
diff --git a/addressbook/backend/ebook/e-card-compare.c b/addressbook/backend/ebook/e-card-compare.c
deleted file mode 100644
index 2413d987e5..0000000000
--- a/addressbook/backend/ebook/e-card-compare.c
+++ /dev/null
@@ -1,706 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-card-compare.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include <ctype.h>
-#include <string.h>
-#include "e-book-util.h"
-#include "e-card-compare.h"
-
-/* This is an "optimistic" combiner: the best of the two outcomes is
- selected. */
-static ECardMatchType
-combine_comparisons (ECardMatchType prev,
- ECardMatchType new_info)
-{
- if (new_info == E_CARD_MATCH_NOT_APPLICABLE)
- return prev;
- return (ECardMatchType) MAX ((gint) prev, (gint) new_info);
-}
-
-
-/*** Name comparisons ***/
-
-/* This *so* doesn't belong here... at least not implemented in a
- sucky way like this. But it can be fixed later. */
-
-/* This is very Anglocentric. */
-static gchar *name_synonyms[][2] = {
- { "jon", "john" }, /* Ah, the hacker's perogative */
- { "joseph", "joe" },
- { "robert", "bob" },
- { "gene", "jean" },
- { "jesse", "jessie" },
- { "ian", "iain" },
- { "richard", "dick" },
- { "william", "bill" },
- { "william", "will" },
- { "anthony", "tony" },
- { "michael", "mike" },
- { "eric", "erik" },
- { "elizabeth", "liz" },
- { "jeff", "geoff" },
- { "jeff", "geoffrey" },
- { "tom", "thomas" },
- { "dave", "david" },
- { "jim", "james" },
- { "abigal", "abby" },
- { "amanda", "amy" },
- { "amanda", "manda" },
- { "jennifer", "jenny" },
- { "christopher", "chris" },
- { "rebecca", "becca" },
- { "rebecca", "becky" },
- { "anderson", "andersen" },
- { "johnson", "johnsen" },
- /* We could go on and on... */
- /* We should add soundex here. */
- { NULL, NULL }
-};
-
-static gboolean
-name_fragment_match (const gchar *a, const gchar *b, gboolean strict)
-{
- gint len;
-
- if (!(a && b && *a && *b))
- return FALSE;
-
- /* If we are in 'strict' mode, b must match the beginning of a.
- So "Robert", "Rob" would match, but "Robert", "Robbie" wouldn't.
-
- If strict is FALSE, it is sufficient for the strings to share
- some leading characters. In this case, "Robert" and "Robbie"
- would match, as would "Dave" and "Dan". */
-
- if (strict) {
- len = g_utf8_strlen (b, -1);
- } else {
- len = MIN (g_utf8_strlen (a, -1), g_utf8_strlen (b, -1));
- }
-
- return !e_utf8_casefold_collate_len (a, b, len);
-}
-
-static gboolean
-name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean strict)
-{
- gint i;
-
- if (!(a && b && *a && *b))
- return FALSE;
-
- if (name_fragment_match (a, b, strict))
- return TRUE;
-
- /* Check for nicknames. Yes, the linear search blows. */
- for (i=0; name_synonyms[i][0]; ++i) {
-
- if (!e_utf8_casefold_collate (name_synonyms[i][0], a)
- && !e_utf8_casefold_collate (name_synonyms[i][1], b))
- return TRUE;
-
- if (!e_utf8_casefold_collate (name_synonyms[i][0], b)
- && !e_utf8_casefold_collate (name_synonyms[i][1], a))
- return TRUE;
- }
-
- return FALSE;
-}
-
-ECardMatchType
-e_card_compare_name_to_string (ECard *card, const gchar *str)
-{
- return e_card_compare_name_to_string_full (card, str, FALSE, NULL, NULL, NULL);
-}
-
-ECardMatchType
-e_card_compare_name_to_string_full (ECard *card, const gchar *str, gboolean allow_partial_matches,
- gint *matched_parts_out, ECardMatchPart *first_matched_part_out, gint *matched_character_count_out)
-{
- gchar **namev, **givenv = NULL, **addv = NULL, **familyv = NULL;
-
- gint matched_parts = E_CARD_MATCH_PART_NONE;
- ECardMatchPart first_matched_part = E_CARD_MATCH_PART_NONE;
- ECardMatchPart this_part_match = E_CARD_MATCH_PART_NOT_APPLICABLE;
- ECardMatchType match_type;
-
- gint match_count = 0, matched_character_count = 0, fragment_count;
- gint i, j;
- gchar *str_cpy, *s;
-
- g_return_val_if_fail (E_IS_CARD (card), E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (card->name != NULL, E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (str != NULL, E_CARD_MATCH_NOT_APPLICABLE);
-
- str_cpy = s = g_strdup (str);
- while (*s) {
- if (*s == ',' || *s == '"')
- *s = ' ';
- ++s;
- }
- namev = g_strsplit (str_cpy, " ", 0);
- g_free (str_cpy);
-
- if (card->name->given)
- givenv = g_strsplit (card->name->given, " ", 0);
- if (card->name->additional)
- addv = g_strsplit (card->name->additional, " ", 0);
- if (card->name->family)
- familyv = g_strsplit (card->name->family, " ", 0);
-
- fragment_count = 0;
- for (i = 0; givenv && givenv[i]; ++i)
- ++fragment_count;
- for (i = 0; addv && addv[i]; ++i)
- ++fragment_count;
- for (i = 0; familyv && familyv[i]; ++i)
- ++fragment_count;
-
- for (i = 0; namev[i] && this_part_match != E_CARD_MATCH_PART_NONE; ++i) {
-
- if (*namev[i]) {
-
- this_part_match = E_CARD_MATCH_PART_NONE;
-
- /* When we are allowing partials, we are strict about the matches we allow.
- Does this make sense? Not really, but it does the right thing for the purposes
- of completion. */
-
- if (givenv && this_part_match == E_CARD_MATCH_PART_NONE) {
- for (j = 0; givenv[j]; ++j) {
- if (name_fragment_match_with_synonyms (givenv[j], namev[i], allow_partial_matches)) {
-
- this_part_match = E_CARD_MATCH_PART_GIVEN_NAME;
-
- /* We remove a piece of a name once it has been matched against, so
- that "john john" won't match "john doe". */
- g_free (givenv[j]);
- givenv[j] = g_strdup ("");
- break;
- }
- }
- }
-
- if (addv && this_part_match == E_CARD_MATCH_PART_NONE) {
- for (j = 0; addv[j]; ++j) {
- if (name_fragment_match_with_synonyms (addv[j], namev[i], allow_partial_matches)) {
-
- this_part_match = E_CARD_MATCH_PART_ADDITIONAL_NAME;
-
- g_free (addv[j]);
- addv[j] = g_strdup ("");
- break;
- }
- }
- }
-
- if (familyv && this_part_match == E_CARD_MATCH_PART_NONE) {
- for (j = 0; familyv[j]; ++j) {
- if (allow_partial_matches ? name_fragment_match_with_synonyms (familyv[j], namev[i], allow_partial_matches)
- : !e_utf8_casefold_collate (familyv[j], namev[i])) {
-
- this_part_match = E_CARD_MATCH_PART_FAMILY_NAME;
-
- g_free (familyv[j]);
- familyv[j] = g_strdup ("");
- break;
- }
- }
- }
-
- if (this_part_match != E_CARD_MATCH_PART_NONE) {
- ++match_count;
- matched_character_count += g_utf8_strlen (namev[i], -1);
- matched_parts |= this_part_match;
- if (first_matched_part == E_CARD_MATCH_PART_NONE)
- first_matched_part = this_part_match;
- }
- }
- }
-
- match_type = E_CARD_MATCH_NONE;
-
- if (this_part_match != E_CARD_MATCH_PART_NONE) {
-
- if (match_count > 0)
- match_type = E_CARD_MATCH_VAGUE;
-
- if (fragment_count == match_count) {
-
- match_type = E_CARD_MATCH_EXACT;
-
- } else if (fragment_count == match_count + 1) {
-
- match_type = E_CARD_MATCH_PARTIAL;
-
- }
- }
-
- if (matched_parts_out)
- *matched_parts_out = matched_parts;
- if (first_matched_part_out)
- *first_matched_part_out = first_matched_part;
- if (matched_character_count_out)
- *matched_character_count_out = matched_character_count;
-
- g_strfreev (namev);
- g_strfreev (givenv);
- g_strfreev (addv);
- g_strfreev (familyv);
-
- return match_type;
-}
-
-ECardMatchType
-e_card_compare_name (ECard *card1, ECard *card2)
-{
- ECardName *a, *b;
- gint matches=0, possible=0;
- gboolean given_match = FALSE, additional_match = FALSE, family_match = FALSE;
-
- g_return_val_if_fail (E_IS_CARD (card1), E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (E_IS_CARD (card2), E_CARD_MATCH_NOT_APPLICABLE);
-
- a = card1->name;
- b = card2->name;
-
- if (a == NULL || b == NULL)
- return E_CARD_MATCH_NOT_APPLICABLE;
-
- if (a->given && b->given) {
- ++possible;
- if (name_fragment_match_with_synonyms (a->given, b->given, FALSE /* both inputs are complete */)) {
- ++matches;
- given_match = TRUE;
- }
- }
-
- if (a->additional && b->additional) {
- ++possible;
- if (name_fragment_match_with_synonyms (a->additional, b->additional, FALSE /* both inputs are complete */)) {
- ++matches;
- additional_match = TRUE;
- }
- }
-
- if (a->family && b->family) {
- ++possible;
- /* We don't allow "loose matching" (i.e. John vs. Jon) on family names */
- if (! e_utf8_casefold_collate (a->family, b->family)) {
- ++matches;
- family_match = TRUE;
- }
- }
-
- /* Now look at the # of matches and try to intelligently map
- an E_CARD_MATCH_* type to it. Special consideration is given
- to family-name matches. */
-
- if (possible == 0)
- return E_CARD_MATCH_NOT_APPLICABLE;
-
- if (possible == 1)
- return family_match ? E_CARD_MATCH_VAGUE : E_CARD_MATCH_NONE;
-
- if (possible == matches)
- return family_match ? E_CARD_MATCH_EXACT : E_CARD_MATCH_PARTIAL;
-
- if (possible == matches+1)
- return family_match ? E_CARD_MATCH_VAGUE : E_CARD_MATCH_NONE;
-
- return E_CARD_MATCH_NONE;
-}
-
-
-/*** Nickname Comparisons ***/
-
-ECardMatchType
-e_card_compare_nickname (ECard *card1, ECard *card2)
-{
- g_return_val_if_fail (card1 && E_IS_CARD (card1), E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (card2 && E_IS_CARD (card2), E_CARD_MATCH_NOT_APPLICABLE);
-
- return E_CARD_MATCH_NOT_APPLICABLE;
-}
-
-
-
-/*** E-mail Comparisons ***/
-
-static gboolean
-match_email_username (const gchar *addr1, const gchar *addr2)
-{
- gint c1, c2;
- if (addr1 == NULL || addr2 == NULL)
- return FALSE;
-
- while (*addr1 && *addr2 && *addr1 != '@' && *addr2 != '@') {
- c1 = isupper (*addr1) ? tolower (*addr1) : *addr1;
- c2 = isupper (*addr2) ? tolower (*addr2) : *addr2;
- if (c1 != c2)
- return FALSE;
- ++addr1;
- ++addr2;
- }
-
- return *addr1 == *addr2;
-}
-
-static gboolean
-match_email_hostname (const gchar *addr1, const gchar *addr2)
-{
- gint c1, c2;
- gboolean seen_at1, seen_at2;
- if (addr1 == NULL || addr2 == NULL)
- return FALSE;
-
- /* Walk to the end of each string. */
- seen_at1 = FALSE;
- if (*addr1) {
- while (*addr1) {
- if (*addr1 == '@')
- seen_at1 = TRUE;
- ++addr1;
- }
- --addr1;
- }
-
- seen_at2 = FALSE;
- if (*addr2) {
- while (*addr2) {
- if (*addr2 == '@')
- seen_at2 = TRUE;
- ++addr2;
- }
- --addr2;
- }
-
- if (!seen_at1 && !seen_at2)
- return TRUE;
- if (!seen_at1 || !seen_at2)
- return FALSE;
-
- while (*addr1 != '@' && *addr2 != '@') {
- c1 = isupper (*addr1) ? tolower (*addr1) : *addr1;
- c2 = isupper (*addr2) ? tolower (*addr2) : *addr2;
- if (c1 != c2)
- return FALSE;
- --addr1;
- --addr2;
- }
-
- /* This will match bob@foo.ximian.com and bob@ximian.com */
- return *addr1 == '.' || *addr2 == '.';
-}
-
-static ECardMatchType
-compare_email_addresses (const gchar *addr1, const gchar *addr2)
-{
- if (addr1 == NULL || *addr1 == 0 ||
- addr2 == NULL || *addr2 == 0)
- return E_CARD_MATCH_NOT_APPLICABLE;
-
- if (match_email_username (addr1, addr2))
- return match_email_hostname (addr1, addr2) ? E_CARD_MATCH_EXACT : E_CARD_MATCH_VAGUE;
-
- return E_CARD_MATCH_NONE;
-}
-
-ECardMatchType
-e_card_compare_email (ECard *card1, ECard *card2)
-{
- EIterator *i1, *i2;
- ECardMatchType match = E_CARD_MATCH_NOT_APPLICABLE;
-
- g_return_val_if_fail (card1 && E_IS_CARD (card1), E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (card2 && E_IS_CARD (card2), E_CARD_MATCH_NOT_APPLICABLE);
-
- if (card1->email == NULL || card2->email == NULL)
- return E_CARD_MATCH_NOT_APPLICABLE;
-
- i1 = e_list_get_iterator (card1->email);
- i2 = e_list_get_iterator (card2->email);
-
- /* Do pairwise-comparisons on all of the e-mail addresses. If
- we find an exact match, there is no reason to keep
- checking. */
- e_iterator_reset (i1);
- while (e_iterator_is_valid (i1) && match != E_CARD_MATCH_EXACT) {
- const gchar *addr1 = (const gchar *) e_iterator_get (i1);
-
- e_iterator_reset (i2);
- while (e_iterator_is_valid (i2) && match != E_CARD_MATCH_EXACT) {
- const gchar *addr2 = (const gchar *) e_iterator_get (i2);
-
- match = combine_comparisons (match, compare_email_addresses (addr1, addr2));
-
- e_iterator_next (i2);
- }
-
- e_iterator_next (i1);
- }
-
- g_object_unref (i1);
- g_object_unref (i2);
-
- return match;
-}
-
-ECardMatchType
-e_card_compare_address (ECard *card1, ECard *card2)
-{
- g_return_val_if_fail (card1 && E_IS_CARD (card1), E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (card2 && E_IS_CARD (card2), E_CARD_MATCH_NOT_APPLICABLE);
-
- /* Unimplemented */
-
- return E_CARD_MATCH_NOT_APPLICABLE;
-}
-
-ECardMatchType
-e_card_compare_telephone (ECard *card1, ECard *card2)
-{
- g_return_val_if_fail (card1 && E_IS_CARD (card1), E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (card2 && E_IS_CARD (card2), E_CARD_MATCH_NOT_APPLICABLE);
-
- /* Unimplemented */
-
- return E_CARD_MATCH_NOT_APPLICABLE;
-}
-
-ECardMatchType
-e_card_compare (ECard *card1, ECard *card2)
-{
- ECardMatchType result;
-
- g_return_val_if_fail (card1 && E_IS_CARD (card1), E_CARD_MATCH_NOT_APPLICABLE);
- g_return_val_if_fail (card2 && E_IS_CARD (card2), E_CARD_MATCH_NOT_APPLICABLE);
-
- result = E_CARD_MATCH_NONE;
- result = combine_comparisons (result, e_card_compare_name (card1, card2));
- result = combine_comparisons (result, e_card_compare_nickname (card1, card2));
- result = combine_comparisons (result, e_card_compare_email (card1, card2));
- result = combine_comparisons (result, e_card_compare_address (card1, card2));
- result = combine_comparisons (result, e_card_compare_telephone (card1, card2));
-
- return result;
-}
-
-typedef struct _MatchSearchInfo MatchSearchInfo;
-struct _MatchSearchInfo {
- ECard *card;
- GList *avoid;
- ECardMatchQueryCallback cb;
- gpointer closure;
-};
-
-static void
-match_search_info_free (MatchSearchInfo *info)
-{
- if (info) {
- g_object_unref (info->card);
-
- /* This should already have been deallocated, but just in case... */
- if (info->avoid) {
- g_list_foreach (info->avoid, (GFunc) g_object_unref, NULL);
- g_list_free (info->avoid);
- info->avoid = NULL;
- }
-
- g_free (info);
- }
-}
-
-static void
-simple_query_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- MatchSearchInfo *info = (MatchSearchInfo *) closure;
- ECardMatchType best_match = E_CARD_MATCH_NONE;
- ECard *best_card = NULL;
- GList *remaining_cards = NULL;
- const GList *i;
-
- if (status != E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS) {
- info->cb (info->card, NULL, E_CARD_MATCH_NONE, info->closure);
- match_search_info_free (info);
- return;
- }
-
- /* remove the cards we're to avoid from the list, if they're present */
- for (i = cards; i != NULL; i = g_list_next (i)) {
- ECard *this_card = E_CARD (i->data);
- GList *iterator;
- gboolean avoid = FALSE;
- for (iterator = info->avoid; iterator; iterator = iterator->next) {
- if (!strcmp (e_card_get_id (iterator->data), e_card_get_id (this_card))) {
- avoid = TRUE;
- break;
- }
- }
- if (!avoid)
- remaining_cards = g_list_prepend (remaining_cards, this_card);
- }
-
- remaining_cards = g_list_reverse (remaining_cards);
-
- for (i = remaining_cards; i != NULL; i = g_list_next (i)) {
- ECard *this_card = E_CARD (i->data);
- ECardMatchType this_match = e_card_compare (info->card, this_card);
- if ((gint)this_match > (gint)best_match) {
- best_match = this_match;
- best_card = this_card;
- }
- }
-
- g_list_free (remaining_cards);
-
- info->cb (info->card, best_card, best_match, info->closure);
- match_search_info_free (info);
-}
-
-#define MAX_QUERY_PARTS 10
-static void
-use_common_book_cb (EBook *book, gpointer closure)
-{
- MatchSearchInfo *info = (MatchSearchInfo *) closure;
- ECard *card = info->card;
- gchar *query_parts[MAX_QUERY_PARTS];
- gint p=0;
- gchar *query, *qj;
- int i;
-
- if (book == NULL) {
- info->cb (info->card, NULL, E_CARD_MATCH_NONE, info->closure);
- match_search_info_free (info);
- return;
- }
-
-#if 0
- if (card->nickname && *card->nickname)
- query_parts[p++] = g_strdup_printf ("(beginswith \"nickname\" \"%s\")", card->nickname);
-#endif
-
- if (card->name->given && strlen (card->name->given) > 1)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", card->name->given);
-
- if (card->name->additional && strlen (card->name->additional) > 1)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", card->name->additional);
-
- if (card->name->family && strlen (card->name->family) > 1)
- query_parts[p++] = g_strdup_printf ("(contains \"full_name\" \"%s\")", card->name->family);
-
-
- if (card->email) {
- EIterator *iter = e_list_get_iterator (card->email);
- while (e_iterator_is_valid (iter) && p < MAX_QUERY_PARTS) {
- gchar *addr = g_strdup (e_iterator_get (iter));
- if (addr && *addr) {
- gchar *s = addr;
- while (*s) {
- if (*s == '@') {
- *s = '\0';
- break;
- }
- ++s;
- }
- query_parts[p++] = g_strdup_printf ("(beginswith \"email\" \"%s\")", addr);
- g_free (addr);
- }
- e_iterator_next (iter);
- }
- }
-
-
-
- /* Build up our full query from the parts. */
- query_parts[p] = NULL;
- qj = g_strjoinv (" ", query_parts);
- for(i = 0; query_parts[i] != NULL; i++)
- g_free(query_parts[i]);
- if (p > 0) {
- query = g_strdup_printf ("(or %s)", qj);
- g_free (qj);
- } else {
- query = qj;
- }
-
- e_book_simple_query (book, query, simple_query_cb, info);
-
- g_free (query);
-}
-
-void
-e_card_locate_match (ECard *card, ECardMatchQueryCallback cb, gpointer closure)
-{
- MatchSearchInfo *info;
-
- g_return_if_fail (card && E_IS_CARD (card));
- g_return_if_fail (cb != NULL);
-
- info = g_new (MatchSearchInfo, 1);
- info->card = card;
- g_object_ref (card);
- info->cb = cb;
- info->closure = closure;
- info->avoid = NULL;
-
- e_book_use_default_book (use_common_book_cb, info);
-}
-
-/**
- * e_card_locate_match_full:
- * @book: The book to look in. If this is NULL, use the default
- * addressbook.
- * @card: The card to compare to.
- * @avoid: A list of cards to not match. These will not show up in the search.
- * @cb: The function to call.
- * @closure: The closure to add to the call.
- *
- * Look for the best match and return it using the ECardMatchQueryCallback.
- **/
-void
-e_card_locate_match_full (EBook *book, ECard *card, GList *avoid, ECardMatchQueryCallback cb, gpointer closure)
-{
- MatchSearchInfo *info;
-
- g_return_if_fail (card && E_IS_CARD (card));
- g_return_if_fail (cb != NULL);
-
- info = g_new (MatchSearchInfo, 1);
- info->card = card;
- g_object_ref (card);
- info->cb = cb;
- info->closure = closure;
- info->avoid = g_list_copy (avoid);
- g_list_foreach (info->avoid, (GFunc) g_object_ref, NULL);
-
- if (book)
- use_common_book_cb (book, info);
- else
- e_book_use_default_book (use_common_book_cb, info);
-}
-
diff --git a/addressbook/backend/ebook/e-card-compare.h b/addressbook/backend/ebook/e-card-compare.h
deleted file mode 100644
index 07ccb54e89..0000000000
--- a/addressbook/backend/ebook/e-card-compare.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-card-compare.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_CARD_COMPARE_H__
-#define __E_CARD_COMPARE_H__
-
-#include "e-book.h"
-#include "e-card.h"
-
-typedef enum {
- E_CARD_MATCH_NOT_APPLICABLE = 0,
- E_CARD_MATCH_NONE = 1,
- E_CARD_MATCH_VAGUE = 2,
- E_CARD_MATCH_PARTIAL = 3,
- E_CARD_MATCH_EXACT = 4
-} ECardMatchType;
-
-typedef enum {
- E_CARD_MATCH_PART_NOT_APPLICABLE = -1,
- E_CARD_MATCH_PART_NONE = 0,
- E_CARD_MATCH_PART_GIVEN_NAME = 1<<0,
- E_CARD_MATCH_PART_ADDITIONAL_NAME = 1<<2,
- E_CARD_MATCH_PART_FAMILY_NAME = 1<<3
-} ECardMatchPart;
-
-typedef void (*ECardMatchQueryCallback) (ECard *card, ECard *match, ECardMatchType type, gpointer closure);
-
-ECardMatchType e_card_compare_name_to_string (ECard *card, const gchar *str);
-
-ECardMatchType e_card_compare_name_to_string_full (ECard *card, const gchar *str,
- gboolean allow_partial_matches,
- gint *matched_parts, ECardMatchPart *first_matched_part,
- gint *matched_character_count);
-
-ECardMatchType e_card_compare_name (ECard *card1, ECard *card2);
-ECardMatchType e_card_compare_nickname (ECard *card1, ECard *card2);
-ECardMatchType e_card_compare_email (ECard *card1, ECard *card2);
-ECardMatchType e_card_compare_address (ECard *card1, ECard *card2);
-ECardMatchType e_card_compare_telephone (ECard *card1, ECard *card2);
-
-ECardMatchType e_card_compare (ECard *card1, ECard *card2);
-
-void e_card_locate_match (ECard *card, ECardMatchQueryCallback cb, gpointer closure);
-void e_card_locate_match_full (EBook *book, ECard *card, GList *avoid, ECardMatchQueryCallback cb, gpointer closure);
-
-
-
-#endif /* __E_CARD_COMPARE_H__ */
-
diff --git a/addressbook/backend/ebook/e-card-cursor.c b/addressbook/backend/ebook/e-card-cursor.c
deleted file mode 100644
index 0aa9c8c1e0..0000000000
--- a/addressbook/backend/ebook/e-card-cursor.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-card-cursor.c: Implements card cursors.
- *
- * Author:
- * Christopher James Lahey <clahey@ximian.com.
- */
-
-#include <config.h>
-#include "addressbook.h"
-#include "e-card-cursor.h"
-
-struct _ECardCursorPrivate {
- GNOME_Evolution_Addressbook_CardCursor corba_cursor;
-};
-
-/*
- * A pointer to our parent object class
- */
-static GObjectClass *parent_class;
-
-/*
- * Implemented GObject::dispose
- */
-static void
-e_card_cursor_dispose (GObject *object)
-{
- ECardCursor *cursor = E_CARD_CURSOR (object);
-
- if (cursor->priv) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_CardCursor_unref( cursor->priv->corba_cursor, &ev );
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("e_card_cursor_destroy: Exception unreffing "
- "corba cursor.\n");
- CORBA_exception_free (&ev);
- CORBA_exception_init (&ev);
- }
-
- CORBA_Object_release (cursor->priv->corba_cursor, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("e_card_cursor_destroy: Exception releasing "
- "corba cursor.\n");
- }
-
- CORBA_exception_free (&ev);
-
- g_free ( cursor->priv );
- cursor->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-/**
- * e_card_cursor_get_length:
- * @cursor: the #ECardCursor whose length is being queried
- *
- * Returns: the number of items the cursor references, or -1 there's
- * an error.
- */
-long
-e_card_cursor_get_length (ECardCursor *cursor)
-{
- if ( cursor->priv->corba_cursor != CORBA_OBJECT_NIL ) {
- CORBA_Environment ev;
- long ret_val;
-
- CORBA_exception_init (&ev);
-
- ret_val = GNOME_Evolution_Addressbook_CardCursor_count (cursor->priv->corba_cursor, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("e_card_cursor_get_length: Exception during "
- "get_length corba call.\n");
- ret_val = -1;
- }
-
- CORBA_exception_free (&ev);
-
- return ret_val;
- }
- else
- return -1;
-}
-
-/**
- * e_card_cursor_get_nth:
- * @cursor: an #ECardCursor object
- * @n: the index of the item requested
- *
- * Gets an #ECard based on an index.
- *
- * Returns: a new #ECard on success, or %NULL on failure.
- */
-ECard *
-e_card_cursor_get_nth (ECardCursor *cursor,
- const long n)
-{
- if ( cursor->priv->corba_cursor != CORBA_OBJECT_NIL ) {
- CORBA_Environment en;
- CORBA_char *vcard;
- ECard *card;
-
- CORBA_exception_init (&en);
-
- vcard = GNOME_Evolution_Addressbook_CardCursor_getNth(cursor->priv->corba_cursor, n, &en);
-
- if (en._major != CORBA_NO_EXCEPTION) {
- g_warning("e_card_cursor_get_nth: Exception during "
- "get_nth corba call.\n");
- }
-
- CORBA_exception_free (&en);
-
- card = e_card_new (vcard);
-
- CORBA_free(vcard);
-
- return card;
- }
- else
- return e_card_new("");
-}
-
-static void
-e_card_cursor_class_init (ECardCursorClass *klass)
-{
- GObjectClass *object_class = (GObjectClass *) klass;
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- object_class->dispose = e_card_cursor_dispose;
-}
-
-static void
-e_card_cursor_init (ECardCursor *cursor)
-{
- cursor->priv = g_new(ECardCursorPrivate, 1);
- cursor->priv->corba_cursor = CORBA_OBJECT_NIL;
-}
-
-GType
-e_card_cursor_get_type (void)
-{
- static GType type = 0;
-
- if (!type){
- static const GTypeInfo info = {
- sizeof (ECardCursorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_card_cursor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECardCursor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_card_cursor_init,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "ECardCursor", &info, 0);
- }
-
- return type;
-}
-
-/**
- * e_card_cursor_construct:
- * @cursor: an #ECardCursor object
- * @corba_cursor: an #GNOME_Evolution_Addressbook_CardCursor
- *
- * Wraps an #GNOME_Evolution_Addressbook_CardCursor object inside the #ECardCursor
- * @cursor object.
- *
- * Returns: a new #ECardCursor on success, or %NULL on failure.
- */
-ECardCursor *
-e_card_cursor_construct (ECardCursor *cursor,
- GNOME_Evolution_Addressbook_CardCursor corba_cursor)
-{
- CORBA_Environment ev;
- g_return_val_if_fail (cursor != NULL, NULL);
- g_return_val_if_fail (E_IS_CARD_CURSOR (cursor), NULL);
- g_return_val_if_fail (corba_cursor != CORBA_OBJECT_NIL, NULL);
-
- CORBA_exception_init (&ev);
-
- /*
- * Initialize cursor
- */
- cursor->priv->corba_cursor = CORBA_Object_duplicate(corba_cursor, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("e_card_cursor_construct: Exception duplicating "
- "corba cursor.\n");
- CORBA_exception_free (&ev);
- CORBA_exception_init (&ev);
- }
-
- GNOME_Evolution_Addressbook_CardCursor_ref(cursor->priv->corba_cursor, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("e_card_cursor_construct: Exception reffing "
- "corba cursor.\n");
- }
-
- CORBA_exception_free (&ev);
-
- /*
- * Success: return the GType we were given
- */
- return cursor;
-}
-
-/**
- * e_card_cursor_new:
- * @cursor: the #GNOME_Evolution_Addressbook_CardCursor to be wrapped
- *
- * Creates a new #ECardCursor, which wraps an #GNOME_Evolution_Addressbook_CardCursor
- * object.
- *
- * Returns: a new #ECardCursor on success, or %NULL on failure.
- */
-ECardCursor *
-e_card_cursor_new (GNOME_Evolution_Addressbook_CardCursor corba_cursor)
-{
- ECardCursor *cursor;
-
- cursor = g_object_new (E_TYPE_CARD_CURSOR, NULL);
-
- return e_card_cursor_construct (cursor,
- corba_cursor);
-}
diff --git a/addressbook/backend/ebook/e-card-cursor.h b/addressbook/backend/ebook/e-card-cursor.h
deleted file mode 100644
index b8da39f023..0000000000
--- a/addressbook/backend/ebook/e-card-cursor.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __E_CARD_CURSOR_H__
-#define __E_CARD_CURSOR_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <ebook/addressbook.h>
-#include <ebook/e-card.h>
-
-#define E_TYPE_CARD_CURSOR (e_card_cursor_get_type ())
-#define E_CARD_CURSOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CARD_CURSOR, ECardCursor))
-#define E_CARD_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CARD_CURSOR, ECardCursorClass))
-#define E_IS_CARD_CURSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CARD_CURSOR))
-#define E_IS_CARD_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CARD_CURSOR))
-#define E_CARD_CURSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD_CURSOR, ECardCursorClass))
-
-G_BEGIN_DECLS
-
-typedef struct _ECardCursor ECardCursor;
-typedef struct _ECardCursorPrivate ECardCursorPrivate;
-typedef struct _ECardCursorClass ECardCursorClass;
-
-struct _ECardCursor {
- GObject parent;
- ECardCursorPrivate *priv;
-};
-
-struct _ECardCursorClass {
- GObjectClass parent;
-};
-
-/* Creating a new addressbook. */
-ECardCursor *e_card_cursor_new (GNOME_Evolution_Addressbook_CardCursor corba_cursor);
-ECardCursor *e_card_cursor_construct (ECardCursor *cursor,
- GNOME_Evolution_Addressbook_CardCursor corba_cursor);
-
-GType e_card_cursor_get_type (void);
-
-/* Fetching cards. */
-long e_card_cursor_get_length (ECardCursor *cursor);
-ECard *e_card_cursor_get_nth (ECardCursor *cursor,
- const long nth);
-G_END_DECLS
-
-#endif /* ! __E_CARD_CURSOR_H__ */
diff --git a/addressbook/backend/ebook/e-card-pairs.h b/addressbook/backend/ebook/e-card-pairs.h
deleted file mode 100644
index f82f948ebb..0000000000
--- a/addressbook/backend/ebook/e-card-pairs.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* GnomeCard - a graphical contact manager.
- *
- * pairs.h: This file is part of GnomeCard.
- *
- * Copyright (C) 1999 The Free Software Foundation
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __E_CARD_PAIRS_H__
-#define __E_CARD_PAIRS_H__
-
-#include <libversit/vcc.h>
-#include <ebook/e-card.h>
-
-
-#if 0
-struct pair
-{
- char *str;
- ECardPropertyType i ;
-};
-
-struct pair prop_lookup[] = {
- { VCFullNameProp, PROP_FNAME },
- { VCNameProp, PROP_NAME },
- { VCPhotoProp, PROP_PHOTO },
- { VCBirthDateProp, PROP_BDAY },
- { VCAdrProp, PROP_DELADDR },
- { VCDeliveryLabelProp, PROP_DELLABEL },
- { VCTelephoneProp, PROP_PHONE },
- { VCEmailAddressProp, PROP_EMAIL },
- { VCMailerProp, PROP_MAILER },
- { VCTimeZoneProp, PROP_TIMEZN },
- { VCGeoProp, PROP_GEOPOS },
- { VCTitleProp, PROP_TITLE },
- { VCBusinessRoleProp, PROP_ROLE },
- { VCLogoProp, PROP_LOGO },
- { VCAgentProp, PROP_AGENT },
- { VCOrgProp, PROP_ORG },
- { VCCategoriesProp, PROP_CATEGORIES },
- { VCCommentProp, PROP_COMMENT },
- { VCLastRevisedProp, PROP_REV },
- { VCPronunciationProp, PROP_SOUND },
- { VCURLProp, PROP_URL },
- { VCUniqueStringProp, PROP_UID },
- { VCVersionProp, PROP_VERSION },
- { VCPublicKeyProp, PROP_KEY },
- { VCValueProp, PROP_VALUE },
- { VCEncodingProp, PROP_ENCODING },
- { VCQuotedPrintableProp, PROP_QUOTED_PRINTABLE },
- { VC8bitProp, PROP_8BIT },
- { VCBase64Prop, PROP_BASE64 },
- { VCLanguageProp, PROP_LANG },
- { VCCharSetProp, PROP_CHARSET },
- { NULL, PROP_NONE} };
-
-struct pair photo_pairs[] = {
- { VCGIFProp, PHOTO_GIF },
- { VCCGMProp, PHOTO_CGM },
- { VCWMFProp, PHOTO_WMF },
- { VCBMPProp, PHOTO_BMP },
- { VCMETProp, PHOTO_MET },
- { VCPMBProp, PHOTO_PMB },
- { VCDIBProp, PHOTO_DIB },
- { VCPICTProp, PHOTO_PICT },
- { VCTIFFProp, PHOTO_TIFF },
- { VCPDFProp, PHOTO_PDF },
- { VCPSProp, PHOTO_PS },
- { VCJPEGProp, PHOTO_JPEG },
- { VCMPEGProp, PHOTO_MPEG },
- { VCMPEG2Prop, PHOTO_MPEG2 },
- { VCAVIProp, PHOTO_AVI },
- { VCQuickTimeProp, PHOTO_QTIME },
- { NULL, 0 } };
-
-struct pair email_pairs[] = {
- { VCAOLProp, EMAIL_AOL },
- { VCAppleLinkProp, EMAIL_APPLE_LINK },
- { VCATTMailProp, EMAIL_ATT },
- { VCCISProp, EMAIL_CIS },
- { VCEWorldProp, EMAIL_EWORLD },
- { VCInternetProp, EMAIL_INET },
- { VCIBMMailProp, EMAIL_IBM },
- { VCMCIMailProp, EMAIL_MCI },
- { VCPowerShareProp, EMAIL_POWERSHARE },
- { VCProdigyProp, EMAIL_PRODIGY },
- { VCTLXProp, EMAIL_TLX },
- { VCX400Prop, EMAIL_X400 },
- { NULL, 0 } };
-
-struct pair sound_pairs[] = {
- { VCAIFFProp, SOUND_AIFF },
- { VCPCMProp, SOUND_PCM },
- { VCWAVEProp, SOUND_WAVE },
- { NULL, 0 } };
-
-struct pair key_pairs[] = {
- { VCX509Prop, KEY_X509 },
- { VCPGPProp, KEY_PGP },
- { NULL, 0 } };
-
-
-#endif
-#endif /* ! __E_CARD_PAIRS_H__ */
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
deleted file mode 100644
index b9e32762fe..0000000000
--- a/addressbook/backend/ebook/e-card-simple.c
+++ /dev/null
@@ -1,1344 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Arturo Espinosa (arturo@nuclecu.unam.mx)
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 1999 The Free Software Foundation
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <bonobo/bonobo-i18n.h>
-#include <gal/util/e-util.h>
-
-#include <libversit/vcc.h>
-#include "e-card-simple.h"
-
-/* Object property IDs */
-enum {
- PROP_0,
- PROP_CARD,
-};
-
-static GObjectClass *parent_class;
-
-typedef enum _ECardSimpleInternalType ECardSimpleInternalType;
-typedef struct _ECardSimpleFieldData ECardSimpleFieldData;
-
-enum _ECardSimpleInternalType {
- E_CARD_SIMPLE_INTERNAL_TYPE_STRING,
- E_CARD_SIMPLE_INTERNAL_TYPE_DATE,
- E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS,
- E_CARD_SIMPLE_INTERNAL_TYPE_PHONE,
- E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL,
- E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL,
- E_CARD_SIMPLE_INTERNAL_TYPE_BOOL,
-};
-
-struct _ECardSimpleFieldData {
- ECardSimpleField field;
- char *ecard_field;
- char *name;
- char *short_name;
- int list_type_index;
- ECardSimpleInternalType type;
-};
-
-/* This order must match the order in the .h. */
-
-/* the ecard_field data below should only be used for TYPE_STRING,
- TYPE_DATE, and TYPE_SPECIAL fields. that is, it's only valid for
- e-cards for those types. it is used as a unique name for fields
- for the get_supported functionality. */
-static ECardSimpleFieldData field_data[] =
-{
- { E_CARD_SIMPLE_FIELD_FILE_AS, "file_as", N_("File As"), "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_FULL_NAME, "full_name", N_("Name"), N_("Name"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_EMAIL, "email", N_("Email"), N_("Email"), E_CARD_SIMPLE_EMAIL_ID_EMAIL, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL },
- { E_CARD_SIMPLE_FIELD_PHONE_PRIMARY, "primary_phone", N_("Primary"), N_("Prim"), E_CARD_SIMPLE_PHONE_ID_PRIMARY, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_ASSISTANT, "assistant_phone", N_("Assistant"), N_("Assistant"),E_CARD_SIMPLE_PHONE_ID_ASSISTANT, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, "business_phone", N_("Business"), N_("Bus"), E_CARD_SIMPLE_PHONE_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_CALLBACK, "callback_phone", N_("Callback"), N_("Callback"), E_CARD_SIMPLE_PHONE_ID_CALLBACK, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_COMPANY, "company_phone", N_("Company"), N_("Comp"), E_CARD_SIMPLE_PHONE_ID_COMPANY, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_HOME, "home_phone", N_("Home"), N_("Home"), E_CARD_SIMPLE_PHONE_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_ORG, "org", N_("Organization"), N_("Org"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, "business_address",N_("Business"), N_("Bus"), E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS },
- { E_CARD_SIMPLE_FIELD_ADDRESS_HOME, "home_address", N_("Home"), N_("Home"), E_CARD_SIMPLE_ADDRESS_ID_HOME, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS },
- { E_CARD_SIMPLE_FIELD_PHONE_MOBILE, "mobile_phone", N_("Mobile"), N_("Mobile"), E_CARD_SIMPLE_PHONE_ID_MOBILE, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_CAR, "car_phone", N_("Car"), N_("Car"), E_CARD_SIMPLE_PHONE_ID_CAR, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, "business_fax", N_("Business Fax"), N_("Bus Fax"), E_CARD_SIMPLE_PHONE_ID_BUSINESS_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX, "home_fax", N_("Home Fax"), N_("Home Fax"), E_CARD_SIMPLE_PHONE_ID_HOME_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2, "business_phone_2",N_("Business 2"), N_("Bus 2"), E_CARD_SIMPLE_PHONE_ID_BUSINESS_2, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_HOME_2, "home_phone_2", N_("Home 2"), N_("Home 2"), E_CARD_SIMPLE_PHONE_ID_HOME_2, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_ISDN, "isdn", N_("ISDN"), N_("ISDN"), E_CARD_SIMPLE_PHONE_ID_ISDN, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_OTHER, "other_phone", N_("Other"), N_("Other"), E_CARD_SIMPLE_PHONE_ID_OTHER, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX, "other_fax", N_("Other Fax"), N_("Other Fax"), E_CARD_SIMPLE_PHONE_ID_OTHER_FAX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_PAGER, "pager", N_("Pager"), N_("Pager"), E_CARD_SIMPLE_PHONE_ID_PAGER, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_RADIO, "radio", N_("Radio"), N_("Radio"), E_CARD_SIMPLE_PHONE_ID_RADIO, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_TELEX, "telex", N_("Telex"), N_("Telex"), E_CARD_SIMPLE_PHONE_ID_TELEX, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_PHONE_TTYTDD, "tty", N_("TTY"), N_("TTY"), E_CARD_SIMPLE_PHONE_ID_TTYTDD, E_CARD_SIMPLE_INTERNAL_TYPE_PHONE },
- { E_CARD_SIMPLE_FIELD_ADDRESS_OTHER, "other_address", N_("Other"), N_("Other"), E_CARD_SIMPLE_ADDRESS_ID_OTHER, E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS },
- { E_CARD_SIMPLE_FIELD_EMAIL_2, "email_2", N_("Email 2"), N_("Email 2"), E_CARD_SIMPLE_EMAIL_ID_EMAIL_2, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL },
- { E_CARD_SIMPLE_FIELD_EMAIL_3, "email_3", N_("Email 3"), N_("Email 3"), E_CARD_SIMPLE_EMAIL_ID_EMAIL_3, E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL },
- { E_CARD_SIMPLE_FIELD_URL, "url", N_("Web Site"), N_("Url"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_ORG_UNIT, "org_unit", N_("Department"), N_("Dep"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_OFFICE, "office", N_("Office"), N_("Off"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_TITLE, "title", N_("Title"), N_("Title"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_ROLE, "role", N_("Profession"), N_("Prof"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_MANAGER, "manager", N_("Manager"), N_("Man"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_ASSISTANT, "assistant", N_("Assistant"), N_("Ass"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_NICKNAME, "nickname", N_("Nickname"), N_("Nick"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_SPOUSE, "spouse", N_("Spouse"), N_("Spouse"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_NOTE, "note", N_("Note"), N_("Note"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_CALURI, "caluri", N_("Calendar URI"), N_("CALUri"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_FBURL, "fburl", N_("Free-busy URL"), N_("FBUrl"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_ICSCALENDAR, "icscalendar", N_("Default server calendar"), N_("icsCalendar"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_ANNIVERSARY, "anniversary", N_("Anniversary"), N_("Anniv"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE },
- { E_CARD_SIMPLE_FIELD_BIRTH_DATE, "birth_date", N_("Birth Date"), "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE },
- { E_CARD_SIMPLE_FIELD_MAILER, "mailer", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_NAME_OR_ORG, "nameororg", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL },
- { E_CARD_SIMPLE_FIELD_CATEGORIES, "categories", N_("Categories"), N_("Categories"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
- { E_CARD_SIMPLE_FIELD_FAMILY_NAME, "family_name", N_("Family Name"), N_("Family Name"), 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL },
- { E_CARD_SIMPLE_FIELD_GIVEN_NAME, "given_name", "Given Name", "Given Name", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL },
- { E_CARD_SIMPLE_FIELD_ADDITIONAL_NAME, "additional_name", "Additional Name", "Additional Name", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL },
- { E_CARD_SIMPLE_FIELD_NAME_SUFFIX, "name_suffix", "Name Suffix", "Name Suffix", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL },
- { E_CARD_SIMPLE_FIELD_WANTS_HTML, "wants_html", "Wants HTML", "Wants HTML", 0, E_CARD_SIMPLE_INTERNAL_TYPE_BOOL },
- { E_CARD_SIMPLE_FIELD_IS_LIST, "list", "Is List", "Is List", 0, E_CARD_SIMPLE_INTERNAL_TYPE_BOOL },
-};
-static int field_data_count = sizeof (field_data) / sizeof (field_data[0]);
-
-static void e_card_simple_init (ECardSimple *simple);
-static void e_card_simple_class_init (ECardSimpleClass *klass);
-
-static void e_card_simple_dispose (GObject *object);
-static void e_card_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_card_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-static void fill_in_info(ECardSimple *simple);
-
-ECardPhoneFlags phone_correspondences[] = {
- E_CARD_PHONE_ASSISTANT, /* E_CARD_SIMPLE_PHONE_ID_ASSISTANT, */
- E_CARD_PHONE_WORK | E_CARD_PHONE_VOICE, /* E_CARD_SIMPLE_PHONE_ID_BUSINESS, */
- E_CARD_PHONE_WORK | E_CARD_PHONE_VOICE, /* E_CARD_SIMPLE_PHONE_ID_BUSINESS_2, */
- E_CARD_PHONE_WORK | E_CARD_PHONE_FAX, /* E_CARD_SIMPLE_PHONE_ID_BUSINESS_FAX, */
- E_CARD_PHONE_CALLBACK, /* E_CARD_SIMPLE_PHONE_ID_CALLBACK, */
- E_CARD_PHONE_CAR, /* E_CARD_SIMPLE_PHONE_ID_CAR, */
- E_CARD_PHONE_WORK, /* E_CARD_SIMPLE_PHONE_ID_COMPANY, */
- E_CARD_PHONE_HOME, /* E_CARD_SIMPLE_PHONE_ID_HOME, */
- E_CARD_PHONE_HOME, /* E_CARD_SIMPLE_PHONE_ID_HOME_2, */
- E_CARD_PHONE_HOME | E_CARD_PHONE_FAX, /* E_CARD_SIMPLE_PHONE_ID_HOME_FAX, */
- E_CARD_PHONE_ISDN, /* E_CARD_SIMPLE_PHONE_ID_ISDN, */
- E_CARD_PHONE_CELL, /* E_CARD_SIMPLE_PHONE_ID_MOBILE, */
- E_CARD_PHONE_VOICE, /* E_CARD_SIMPLE_PHONE_ID_OTHER, */
- E_CARD_PHONE_FAX, /* E_CARD_SIMPLE_PHONE_ID_OTHER_FAX, */
- E_CARD_PHONE_PAGER, /* E_CARD_SIMPLE_PHONE_ID_PAGER, */
- E_CARD_PHONE_PREF, /* E_CARD_SIMPLE_PHONE_ID_PRIMARY, */
- E_CARD_PHONE_RADIO, /* E_CARD_SIMPLE_PHONE_ID_RADIO, */
- E_CARD_PHONE_TELEX, /* E_CARD_SIMPLE_PHONE_ID_TELEX, */
- E_CARD_PHONE_TTYTDD, /* E_CARD_SIMPLE_PHONE_ID_TTYTDD, */
-};
-
-char *phone_names[] = {
- NULL, /* E_CARD_SIMPLE_PHONE_ID_ASSISTANT, */
- "Business",
- "Business 2",
- "Business Fax",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_CALLBACK, */
- "Car",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_COMPANY, */
- "Home",
- "Home 2",
- "Home Fax",
- "ISDN",
- "Mobile",
- "Other",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_OTHER_FAX, */
- "Pager",
- "Primary",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_RADIO, */
- NULL, /* E_CARD_SIMPLE_PHONE_ID_TELEX, */
- NULL, /* E_CARD_SIMPLE_PHONE_ID_TTYTDD, */
-};
-
-char *phone_short_names[] = {
- NULL, /* E_CARD_SIMPLE_PHONE_ID_ASSISTANT, */
- "Bus",
- "Bus 2",
- "Bus Fax",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_CALLBACK, */
- "Car",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_COMPANY, */
- "Home",
- "Home 2",
- "Home Fax",
- "ISDN",
- "Mob",
- "Other",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_OTHER_FAX, */
- "Pag",
- "Prim",
- NULL, /* E_CARD_SIMPLE_PHONE_ID_RADIO, */
- NULL, /* E_CARD_SIMPLE_PHONE_ID_TELEX, */
- NULL, /* E_CARD_SIMPLE_PHONE_ID_TTYTDD, */
-};
-
-ECardAddressFlags addr_correspondences[] = {
- E_CARD_ADDR_WORK, /* E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, */
- E_CARD_ADDR_HOME, /* E_CARD_SIMPLE_ADDRESS_ID_HOME, */
- E_CARD_ADDR_POSTAL, /* E_CARD_SIMPLE_ADDRESS_ID_OTHER, */
-};
-
-char *address_names[] = {
- "Business",
- "Home",
- "Other",
-};
-
-/**
- * e_card_simple_get_type:
- * @void:
- *
- * Registers the &ECardSimple class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ECardSimple class.
- **/
-GType
-e_card_simple_get_type (void)
-{
- static GType simple_type = 0;
-
- if (!simple_type) {
- static const GTypeInfo simple_info = {
- sizeof (ECardSimpleClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_card_simple_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECardSimple),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_card_simple_init,
- };
-
- simple_type = g_type_register_static (G_TYPE_OBJECT, "ECardSimple", &simple_info, 0);
- }
-
- return simple_type;
-}
-
-/**
- * e_card_simple_new:
- * @VCard: a string in vCard format
- *
- * Returns: a new #ECardSimple that wraps the @VCard.
- */
-ECardSimple *
-e_card_simple_new (ECard *card)
-{
- ECardSimple *simple = g_object_new (E_TYPE_CARD_SIMPLE, NULL);
- g_object_set(simple,
- "card", card,
- NULL);
- return simple;
-}
-
-ECardSimple *
-e_card_simple_duplicate(ECardSimple *simple)
-{
- ECard *card = simple->card ? e_card_duplicate (simple->card) : e_card_new ("");
- ECardSimple *new_simple = e_card_simple_new(card);
- return new_simple;
-}
-
-/**
- * e_card_simple_get_id:
- * @simple: an #ECardSimple
- *
- * Returns: a string representing the id of the simple, which is unique
- * within its book.
- */
-const char *
-e_card_simple_get_id (ECardSimple *simple)
-{
- if (simple->card)
- return e_card_get_id(simple->card);
- else
- return "";
-}
-
-/**
- * e_card_simple_get_id:
- * @simple: an #ECardSimple
- * @id: a id in string format
- *
- * Sets the identifier of a simple, which should be unique within its
- * book.
- */
-void
-e_card_simple_set_id (ECardSimple *simple, const char *id)
-{
- if ( simple->card )
- e_card_set_id(simple->card, id);
-}
-
-/**
- * e_card_simple_get_vcard:
- * @simple: an #ECardSimple
- *
- * Returns: a string in vcard format, which is wrapped by the @simple.
- */
-char *
-e_card_simple_get_vcard (ECardSimple *simple)
-{
- if (simple->card)
- return e_card_get_vcard(simple->card);
- else
- return g_strdup("");
-}
-
-/**
- * e_card_simple_get_vcard_assume_utf8:
- * @simple: an #ECardSimple
- *
- * Returns: a string in vcard format, which is wrapped by the @simple.
- */
-char *
-e_card_simple_get_vcard_assume_utf8 (ECardSimple *simple)
-{
- if (simple->card)
- return e_card_get_vcard_assume_utf8(simple->card);
- else
- return g_strdup("");
-}
-
-static void
-e_card_simple_class_init (ECardSimpleClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- object_class->dispose = e_card_simple_dispose;
- object_class->get_property = e_card_simple_get_property;
- object_class->set_property = e_card_simple_set_property;
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("ECard"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
-}
-
-/*
- * ECardSimple lifecycle management and vcard loading/saving.
- */
-
-static void
-e_card_simple_dispose (GObject *object)
-{
- ECardSimple *simple;
- int i;
-
- simple = E_CARD_SIMPLE (object);
-
- if (simple->card) {
- g_object_unref(simple->card);
- simple->card = NULL;
- }
- if (simple->temp_fields) {
- g_list_foreach(simple->temp_fields, (GFunc) g_free, NULL);
- g_list_free(simple->temp_fields);
- simple->temp_fields = NULL;
- }
-
- for(i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++) {
- if (simple->phone[i]) {
- e_card_phone_unref (simple->phone[i]);
- simple->phone[i] = NULL;
- }
- }
- for(i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++) {
- if (simple->email[i]) {
- g_free(simple->email[i]);
- simple->email[i] = NULL;
- }
- }
- for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- if (simple->address[i]) {
- e_card_address_label_unref(simple->address[i]);
- simple->address[i] = NULL;
- }
- }
- for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- if (simple->delivery[i]) {
- e_card_delivery_address_unref(simple->delivery[i]);
- simple->delivery[i] = NULL;
- }
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-/* Set_arg handler for the simple */
-static void
-e_card_simple_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- ECardSimple *simple;
-
- simple = E_CARD_SIMPLE (object);
-
- switch (prop_id) {
- case PROP_CARD:
- if (simple->card)
- g_object_unref(simple->card);
- g_list_foreach(simple->temp_fields, (GFunc) g_free, NULL);
- g_list_free(simple->temp_fields);
- simple->temp_fields = NULL;
- if (g_value_get_object (value))
- simple->card = E_CARD(g_value_get_object (value));
- else
- simple->card = NULL;
- if(simple->card)
- g_object_ref(simple->card);
- fill_in_info(simple);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Get_arg handler for the simple */
-static void
-e_card_simple_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ECardSimple *simple;
-
- simple = E_CARD_SIMPLE (object);
-
- switch (prop_id) {
- case PROP_CARD:
- e_card_simple_sync_card(simple);
- g_value_set_object (value, simple->card);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-/**
- * e_card_simple_init:
- */
-static void
-e_card_simple_init (ECardSimple *simple)
-{
- int i;
- simple->card = NULL;
- for(i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++)
- simple->phone[i] = NULL;
- for(i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++)
- simple->email[i] = NULL;
- for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++)
- simple->address[i] = NULL;
- simple->temp_fields = NULL;
-
- simple->changed = TRUE;
-}
-
-static void
-fill_in_info(ECardSimple *simple)
-{
- ECard *card = simple->card;
- if (card) {
- EList *address_list;
- EList *phone_list;
- EList *email_list;
- EList *delivery_list;
- const ECardPhone *phone;
- const char *email;
- const ECardAddrLabel *address;
- const ECardDeliveryAddress *delivery;
- int i;
-
- EIterator *iterator;
-
- g_object_get(card,
- "address_label", &address_list,
- "address", &delivery_list,
- "phone", &phone_list,
- "email", &email_list,
- NULL);
- for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++) {
- e_card_phone_unref(simple->phone[i]);
- simple->phone[i] = NULL;
- }
- for (iterator = e_list_get_iterator(phone_list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- gboolean found = FALSE;
- phone = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
- if ((phone->flags == phone_correspondences[i]) && (simple->phone[i] == NULL)) {
- simple->phone[i] = e_card_phone_ref(phone);
- found = TRUE;
- break;
- }
- }
- if (found)
- continue;
- for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
- if (((phone->flags & phone_correspondences[i]) == phone_correspondences[i]) && (simple->phone[i] == NULL)) {
- simple->phone[i] = e_card_phone_ref(phone);
- break;
- }
- }
- }
- g_object_unref(iterator);
-
- for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++) {
- g_free(simple->email[i]);
- simple->email[i] = NULL;
- }
- for (iterator = e_list_get_iterator(email_list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- email = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++) {
- if ((simple->email[i] == NULL)) {
- simple->email[i] = g_strdup(email);
- break;
- }
- }
- }
- g_object_unref(iterator);
-
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- e_card_address_label_unref(simple->address[i]);
- simple->address[i] = NULL;
- }
- for (iterator = e_list_get_iterator(address_list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- address = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if (((address->flags & addr_correspondences[i]) == addr_correspondences[i]) && (simple->address[i] == NULL)) {
- simple->address[i] = e_card_address_label_ref(address);
- break;
- }
- }
- }
- g_object_unref(iterator);
-
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- e_card_delivery_address_unref(simple->delivery[i]);
- simple->delivery[i] = NULL;
- }
- for (iterator = e_list_get_iterator(delivery_list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- delivery = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if (((delivery->flags & addr_correspondences[i]) == addr_correspondences[i]) && (simple->delivery[i] == NULL)) {
- simple->delivery[i] = e_card_delivery_address_ref(delivery);
- break;
- }
- }
- }
- g_object_unref(iterator);
-
- g_object_unref(phone_list);
- g_object_unref(email_list);
- g_object_unref(address_list);
- g_object_unref(delivery_list);
- e_card_free_empty_lists (card);
- }
-}
-
-void
-e_card_simple_sync_card(ECardSimple *simple)
-{
- ECard *card = simple->card;
- if (card && simple->changed) {
- EList *address_list;
- EList *phone_list;
- EList *email_list;
- EList *delivery_list;
- const ECardPhone *phone;
- const ECardAddrLabel *address;
- const ECardDeliveryAddress *delivery;
- const char *email;
- int i;
-
- EIterator *iterator;
-
- g_object_get(card,
- "address_label", &address_list,
- "address", &delivery_list,
- "phone", &phone_list,
- "email", &email_list,
- NULL);
-
- for (iterator = e_list_get_iterator(phone_list); e_iterator_is_valid(iterator); e_iterator_next(iterator) ) {
- int i;
- gboolean found = FALSE;
- phone = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
- if (phone->flags == phone_correspondences[i]) {
- if (simple->phone[i]) {
- simple->phone[i]->flags = phone_correspondences[i];
- if (simple->phone[i]->number && *simple->phone[i]->number) {
- e_iterator_set(iterator, simple->phone[i]);
- } else {
- e_iterator_delete(iterator);
- }
- e_card_phone_unref(simple->phone[i]);
- simple->phone[i] = NULL;
- found = TRUE;
- break;
- }
- }
- }
- if (found)
- continue;
- for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
- if ((phone->flags & phone_correspondences[i]) == phone_correspondences[i]) {
- if (simple->phone[i]) {
- simple->phone[i]->flags = phone_correspondences[i];
- if (simple->phone[i]->number && *simple->phone[i]->number) {
- e_iterator_set(iterator, simple->phone[i]);
- } else {
- e_iterator_delete(iterator);
- }
- e_card_phone_unref(simple->phone[i]);
- simple->phone[i] = NULL;
- break;
- }
- }
- }
- }
- g_object_unref(iterator);
- for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
- if (simple->phone[i]) {
- simple->phone[i]->flags = phone_correspondences[i];
- e_list_append(phone_list, simple->phone[i]);
- e_card_phone_unref(simple->phone[i]);
- simple->phone[i] = NULL;
- }
- }
-
- for (iterator = e_list_get_iterator(email_list); e_iterator_is_valid(iterator); e_iterator_next(iterator) ) {
- int i;
- email = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++) {
- if (simple->email[i]) {
- if (*simple->email[i]) {
- e_iterator_set(iterator, simple->email[i]);
- } else {
- e_iterator_delete(iterator);
- }
- g_free(simple->email[i]);
- simple->email[i] = NULL;
- break;
- }
- }
- }
- g_object_unref(iterator);
- for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++) {
- if (simple->email[i]) {
- e_list_append(email_list, simple->email[i]);
- g_free(simple->email[i]);
- simple->email[i] = NULL;
- }
- }
-
- for (iterator = e_list_get_iterator(address_list); e_iterator_is_valid(iterator); e_iterator_next(iterator) ) {
- int i;
- address = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if ((address->flags & addr_correspondences[i]) == addr_correspondences[i]) {
- if (simple->address[i]) {
- simple->address[i]->flags &= ~E_CARD_ADDR_MASK;
- simple->address[i]->flags |= addr_correspondences[i];
- if (simple->address[i]->data && *simple->address[i]->data) {
- e_iterator_set(iterator, simple->address[i]);
- } else {
- e_iterator_delete(iterator);
- }
- e_card_address_label_unref(simple->address[i]);
- simple->address[i] = NULL;
- break;
- }
- }
- }
- }
- g_object_unref(iterator);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if (simple->address[i]) {
- simple->address[i]->flags &= ~E_CARD_ADDR_MASK;
- simple->address[i]->flags |= addr_correspondences[i];
- e_list_append(address_list, simple->address[i]);
- e_card_address_label_unref(simple->address[i]);
- simple->address[i] = NULL;
- }
- }
-
- for (iterator = e_list_get_iterator(delivery_list); e_iterator_is_valid(iterator); e_iterator_next(iterator) ) {
- int i;
- delivery = e_iterator_get(iterator);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if ((delivery->flags & addr_correspondences[i]) == addr_correspondences[i]) {
- if (simple->delivery[i]) {
- simple->delivery[i]->flags &= ~E_CARD_ADDR_MASK;
- simple->delivery[i]->flags |= addr_correspondences[i];
- if (!e_card_delivery_address_is_empty(simple->delivery[i])) {
- e_iterator_set(iterator, simple->delivery[i]);
- } else {
- e_iterator_delete(iterator);
- }
- e_card_delivery_address_unref(simple->delivery[i]);
- simple->delivery[i] = NULL;
- break;
- }
- }
- }
- }
- g_object_unref(iterator);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if (simple->delivery[i]) {
- simple->delivery[i]->flags &= ~E_CARD_ADDR_MASK;
- simple->delivery[i]->flags |= addr_correspondences[i];
- e_list_append(delivery_list, simple->delivery[i]);
- e_card_delivery_address_unref(simple->delivery[i]);
- simple->delivery[i] = NULL;
- }
- }
- fill_in_info(simple);
-
- g_object_unref(phone_list);
- g_object_unref(email_list);
- g_object_unref(address_list);
- g_object_unref(delivery_list);
- e_card_free_empty_lists (card);
- }
-
- simple->changed = FALSE;
-}
-
-const ECardPhone *e_card_simple_get_phone (ECardSimple *simple,
- ECardSimplePhoneId id)
-{
- return simple->phone[id];
-}
-
-const char *e_card_simple_get_email (ECardSimple *simple,
- ECardSimpleEmailId id)
-{
- return simple->email[id];
-}
-
-const ECardAddrLabel *e_card_simple_get_address (ECardSimple *simple,
- ECardSimpleAddressId id)
-{
- return simple->address[id];
-}
-
-const ECardDeliveryAddress *e_card_simple_get_delivery_address (ECardSimple *simple,
- ECardSimpleAddressId id)
-{
- return simple->delivery[id];
-}
-
-void e_card_simple_set_phone (ECardSimple *simple,
- ECardSimplePhoneId id,
- const ECardPhone *phone)
-{
- e_card_phone_unref(simple->phone[id]);
- simple->phone[id] = e_card_phone_ref(phone);
- simple->changed = TRUE;
-}
-
-void e_card_simple_set_email (ECardSimple *simple,
- ECardSimpleEmailId id,
- const char *email)
-{
- g_free(simple->email[id]);
- simple->email[id] = g_strdup(email);
- simple->changed = TRUE;
-}
-
-void
-e_card_simple_set_address (ECardSimple *simple, ECardSimpleAddressId id, const ECardAddrLabel *address)
-{
- e_card_address_label_unref(simple->address[id]);
- simple->address[id] = e_card_address_label_ref(address);
- e_card_delivery_address_unref(simple->delivery[id]);
- simple->delivery[id] = e_card_delivery_address_from_label(simple->address[id]);
- simple->changed = TRUE;
-}
-
-void e_card_simple_set_delivery_address (ECardSimple *simple,
- ECardSimpleAddressId id,
- const ECardDeliveryAddress *delivery)
-{
- e_card_delivery_address_unref(simple->delivery[id]);
- simple->delivery[id] = e_card_delivery_address_ref(delivery);
- e_card_address_label_unref(simple->address[id]);
- simple->address[id] = e_card_delivery_address_to_label(simple->delivery[id]);
- simple->changed = TRUE;
-}
-
-const char *e_card_simple_get_const (ECardSimple *simple,
- ECardSimpleField field)
-{
- char *ret_val = e_card_simple_get(simple, field);
- if (ret_val)
- simple->temp_fields = g_list_prepend(simple->temp_fields, ret_val);
- return ret_val;
-}
-
-char *e_card_simple_get (ECardSimple *simple,
- ECardSimpleField field)
-{
- ECardSimpleInternalType type = field_data[field].type;
- const ECardAddrLabel *addr;
- const ECardPhone *phone;
- char *string;
- ECardDate *date;
- ECardName *name;
- switch(type) {
- case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
- if (simple->card) {
- g_object_get(simple->card,
- field_data[field].ecard_field, &string,
- NULL);
- return string;
- } else
- return NULL;
- case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
- if (simple->card) {
- g_object_get(simple->card,
- field_data[field].ecard_field, &date,
- NULL);
- if (date != NULL) {
- char buf[26];
- struct tm then;
- then.tm_year = date->year;
- then.tm_mon = date->month - 1;
- then.tm_mday = date->day;
- then.tm_hour = 12;
- then.tm_min = 0;
- then.tm_sec = 0;
- e_strftime_fix_am_pm (buf, 26, _("%x"), &then);
- return g_strdup (buf);
- } else {
- return NULL;
- }
- } else
- return NULL;
- case E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS:
- addr = e_card_simple_get_address(simple,
- field_data[field].list_type_index);
- if (addr)
- return g_strdup(addr->data);
- else
- return NULL;
- case E_CARD_SIMPLE_INTERNAL_TYPE_PHONE:
- phone = e_card_simple_get_phone(simple,
- field_data[field].list_type_index);
- if (phone)
- return g_strdup(phone->number);
- else
- return NULL;
- case E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL:
- string = e_card_simple_get_email(simple,
- field_data[field].list_type_index);
- return g_strdup(string);
- case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
- if (simple->card) {
- gboolean boole;
- g_object_get (simple->card,
- field_data[field].ecard_field, &boole,
- NULL);
- if (boole)
- return g_strdup("true");
- else
- return NULL;
- } else {
- return NULL;
- }
- case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
- switch (field) {
- case E_CARD_SIMPLE_FIELD_NAME_OR_ORG:
- if (simple->card) {
- gboolean is_list;
-
- g_object_get(simple->card,
- "file_as", &string,
- NULL);
- if (string && *string)
- return string
-; else
- g_free (string);
-
- g_object_get(simple->card,
- "full_name", &string,
- NULL);
- if (string && *string)
- return g_strdup(string);
- else
- g_free (string);
-
- g_object_get(simple->card,
- "org", &string,
- NULL);
- if (string && *string)
- return g_strdup(string);
- else
- g_free (string);
-
- is_list = e_card_evolution_list (simple->card);
- if (is_list)
- string = _("Unnamed List");
- else
- string = e_card_simple_get_email(simple,
- E_CARD_SIMPLE_EMAIL_ID_EMAIL);
- return g_strdup(string);
- } else
- return NULL;
- case E_CARD_SIMPLE_FIELD_FAMILY_NAME:
- if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
- return g_strdup (name->family);
- } else
- return NULL;
- case E_CARD_SIMPLE_FIELD_GIVEN_NAME:
- if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
- return g_strdup (name->given);
- } else
- return NULL;
- case E_CARD_SIMPLE_FIELD_ADDITIONAL_NAME:
- if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
- return g_strdup (name->additional);
- } else
- return NULL;
- case E_CARD_SIMPLE_FIELD_NAME_SUFFIX:
- if (simple->card) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
- return g_strdup (name->suffix);
- } else
- return NULL;
- default:
- return NULL;
- }
- default:
- return NULL;
- }
-}
-
-static char *
-name_to_style(const ECardName *name, char *company, int style)
-{
- char *string;
- char *strings[4], **stringptr;
- char *substring;
- switch (style) {
- case 0:
- stringptr = strings;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- *stringptr = NULL;
- string = g_strjoinv(", ", strings);
- break;
- case 1:
- stringptr = strings;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- *stringptr = NULL;
- string = g_strjoinv(" ", strings);
- break;
- case 2:
- string = g_strdup(company);
- break;
- case 3: /* Fall Through */
- case 4:
- stringptr = strings;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- *stringptr = NULL;
- substring = g_strjoinv(", ", strings);
- if (!(company && *company))
- company = "";
- if (style == 3)
- string = g_strdup_printf("%s (%s)", substring, company);
- else
- string = g_strdup_printf("%s (%s)", company, substring);
- g_free(substring);
- break;
- default:
- string = g_strdup("");
- }
- return string;
-}
-
-static int
-file_as_get_style (ECardSimple *simple)
-{
- char *filestring = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_FILE_AS);
- char *trystring;
- char *company = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_ORG);
- ECardName *name = NULL;
- int i;
- int style;
- style = 0;
- if (!company)
- company = g_strdup("");
- if (filestring) {
- g_object_get (simple->card,
- "name", &name,
- NULL);
-
- if (!name) {
- goto end;
- }
-
- style = -1;
-
- for (i = 0; i < 5; i++) {
- trystring = name_to_style(name, company, i);
- if (!strcmp(trystring, filestring)) {
- g_free(trystring);
- style = i;
- goto end;
- }
- g_free(trystring);
- }
- }
- end:
-
- g_free(filestring);
- g_free(company);
-
- return style;
-}
-
-static void
-file_as_set_style(ECardSimple *simple, int style)
-{
- if (style != -1) {
- char *string;
- char *company = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_ORG);
- ECardName *name;
-
- if (!company)
- company = g_strdup("");
- g_object_get (simple->card,
- "name", &name,
- NULL);
- if (name) {
- string = name_to_style(name, company, style);
- e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_FILE_AS, string);
- g_free(string);
- }
- g_free(company);
- }
-}
-
-void e_card_simple_set (ECardSimple *simple,
- ECardSimpleField field,
- const char *data)
-{
- ECardSimpleInternalType type = field_data[field].type;
- ECardAddrLabel *address;
- ECardPhone *phone;
- int style;
- simple->changed = TRUE;
- switch (field) {
- case E_CARD_SIMPLE_FIELD_FULL_NAME:
- case E_CARD_SIMPLE_FIELD_ORG:
- style = file_as_get_style(simple);
- g_object_set(simple->card,
- field_data[field].ecard_field, data,
- NULL);
- file_as_set_style(simple, style);
- break;
- default:
- switch(type) {
- case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
- g_object_set(simple->card,
- field_data[field].ecard_field, data,
- NULL);
- break;
- case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
- break; /* FIXME!!!! */
- case E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS:
- address = e_card_address_label_new();
- address->data = g_strdup (data);
- e_card_simple_set_address(simple,
- field_data[field].list_type_index,
- address);
- e_card_address_label_unref(address);
- break;
- case E_CARD_SIMPLE_INTERNAL_TYPE_PHONE:
- phone = e_card_phone_new();
- phone->number = g_strdup (data);
- e_card_simple_set_phone(simple,
- field_data[field].list_type_index,
- phone);
- e_card_phone_unref(phone);
- break;
- case E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL:
- e_card_simple_set_email(simple,
- field_data[field].list_type_index,
- data);
- break;
- case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
- break;
- case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
- if (simple->card) {
- gboolean boole = TRUE;
- if (data == NULL)
- boole = FALSE;
- else if (!strcasecmp (data, "false"))
- boole = FALSE;
- g_object_set (simple->card,
- field_data[field].ecard_field, boole,
- NULL);
- }
- break;
- }
- break;
- }
-}
-
-ECardSimpleType e_card_simple_type (ECardSimple *simple,
- ECardSimpleField field)
-{
- ECardSimpleInternalType type = field_data[field].type;
- switch(type) {
- case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
- case E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS:
- case E_CARD_SIMPLE_INTERNAL_TYPE_PHONE:
- case E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL:
- default:
- return E_CARD_SIMPLE_TYPE_STRING;
-
- case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
- return E_CARD_SIMPLE_TYPE_BOOL;
-
- case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
- return E_CARD_SIMPLE_TYPE_DATE;
-
- case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
- return E_CARD_SIMPLE_TYPE_STRING;
- }
-}
-
-const char *e_card_simple_get_ecard_field (ECardSimple *simple,
- ECardSimpleField field)
-{
- return field_data[field].ecard_field;
-}
-
-const char *e_card_simple_get_name (ECardSimple *simple,
- ECardSimpleField field)
-{
- return _(field_data[field].name);
-}
-
-gboolean
-e_card_simple_get_allow_newlines (ECardSimple *simple,
- ECardSimpleField field)
-{
- ECardSimpleInternalType type = field_data[field].type;
- switch(type) {
- case E_CARD_SIMPLE_INTERNAL_TYPE_STRING:
- case E_CARD_SIMPLE_INTERNAL_TYPE_PHONE:
- case E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL:
- case E_CARD_SIMPLE_INTERNAL_TYPE_BOOL:
- case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
- case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
- default:
- switch (field) {
- case E_CARD_SIMPLE_FIELD_NOTE:
- return TRUE;
- default:
- return FALSE;
- }
-
- case E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS:
- return TRUE;
- }
-}
-
-const char *e_card_simple_get_short_name (ECardSimple *simple,
- ECardSimpleField field)
-{
- return _(field_data[field].short_name);
-}
-
-void e_card_simple_arbitrary_foreach (ECardSimple *simple,
- ECardSimpleArbitraryCallback *callback,
- gpointer closure)
-{
- if (simple->card) {
- EList *list;
- EIterator *iterator;
- g_object_get(simple->card,
- "arbitrary", &list,
- NULL);
- for (iterator = e_list_get_iterator(list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- const ECardArbitrary *arbitrary = e_iterator_get(iterator);
- if (callback)
- (*callback) (arbitrary, closure);
- }
-
- g_object_unref (list);
- e_card_free_empty_lists (simple->card);
- }
-}
-
-const ECardArbitrary *e_card_simple_get_arbitrary (ECardSimple *simple,
- const char *key)
-{
- if (simple->card) {
- EList *list;
- EIterator *iterator;
- g_object_get(simple->card,
- "arbitrary", &list,
- NULL);
- for (iterator = e_list_get_iterator(list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- const ECardArbitrary *arbitrary = e_iterator_get(iterator);
- if (!strcasecmp(arbitrary->key, key))
- return arbitrary;
- }
-
- g_object_unref (list);
- e_card_free_empty_lists (simple->card);
- }
- return NULL;
-}
-
-/* Any of these except key can be NULL */
-void e_card_simple_set_arbitrary (ECardSimple *simple,
- const char *key,
- const char *type,
- const char *value)
-{
- if (simple->card) {
- ECardArbitrary *new_arb;
- EList *list;
- EIterator *iterator;
-
- simple->changed = TRUE;
- g_object_get(simple->card,
- "arbitrary", &list,
- NULL);
- for (iterator = e_list_get_iterator(list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- const ECardArbitrary *arbitrary = e_iterator_get(iterator);
- if (!strcasecmp(arbitrary->key, key)) {
- new_arb = e_card_arbitrary_new();
- new_arb->key = g_strdup(key);
- new_arb->type = g_strdup(type);
- new_arb->value = g_strdup(value);
- e_iterator_set(iterator, new_arb);
- e_card_arbitrary_unref(new_arb);
- return;
- }
- }
- new_arb = e_card_arbitrary_new();
- new_arb->key = g_strdup(key);
- new_arb->type = g_strdup(type);
- new_arb->value = g_strdup(value);
- e_list_append(list, new_arb);
- g_object_unref(list);
- e_card_arbitrary_unref(new_arb);
- }
-}
-
-void
-e_card_simple_set_name (ECardSimple *simple, ECardName *name)
-{
- int style;
- style = file_as_get_style(simple);
- g_object_set (simple->card,
- "name", name,
- NULL);
- file_as_set_style(simple, style);
-}
-
-/* These map between the individual list types and ECardSimpleField */
-ECardSimpleField
-e_card_simple_map_phone_to_field (ECardSimplePhoneId phone_id)
-{
- int i;
-
- g_return_val_if_fail (phone_id < E_CARD_SIMPLE_PHONE_ID_LAST, 0);
-
- for (i = 0; i < field_data_count; i ++)
- if (field_data[i].list_type_index == phone_id
- && field_data[i].type == E_CARD_SIMPLE_INTERNAL_TYPE_PHONE)
- return i;
-
- g_warning ("couldn't find phone id %d, returning 0 (which is almost assuredly incorrect)\n", phone_id);
-
- return 0;
-}
-
-ECardSimpleField
-e_card_simple_map_email_to_field (ECardSimpleEmailId email_id)
-{
- int i;
-
- g_return_val_if_fail (email_id < E_CARD_SIMPLE_EMAIL_ID_LAST, 0);
-
- for (i = 0; i < field_data_count; i ++)
- if (field_data[i].list_type_index == email_id
- && field_data[i].type == E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL)
- return i;
-
- g_warning ("couldn't find email id %d, returning 0 (which is almost assuredly incorrect)\n", email_id);
- return 0;
-}
-
-ECardSimpleField
-e_card_simple_map_address_to_field (ECardSimpleAddressId address_id)
-{
- int i;
-
- g_return_val_if_fail (address_id < E_CARD_SIMPLE_ADDRESS_ID_LAST, 0);
-
- for (i = 0; i < field_data_count; i ++)
- if (field_data[i].list_type_index == address_id
- && field_data[i].type == E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS)
- return i;
-
- g_warning ("couldn't find address id %d, returning 0 (which is almost assuredly incorrect)\n", address_id);
- return 0;
-}
diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h
deleted file mode 100644
index 868d4e1573..0000000000
--- a/addressbook/backend/ebook/e-card-simple.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Arturo Espinosa
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 1999 The Free Software Foundation
- */
-
-#ifndef __E_CARD_SIMPLE_H__
-#define __E_CARD_SIMPLE_H__
-
-#include <time.h>
-#include <glib-object.h>
-#include <stdio.h>
-#include <ebook/e-card.h>
-#include <ebook/e-card-types.h>
-#include <e-util/e-list.h>
-
-#define E_TYPE_CARD_SIMPLE (e_card_simple_get_type ())
-#define E_CARD_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CARD_SIMPLE, ECardSimple))
-#define E_CARD_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
-#define E_IS_CARD_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CARD_SIMPLE))
-#define E_IS_CARD_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD_SIMPLE))
-#define E_CARD_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD_SIMPLE, ECardSimpleClass))
-
-typedef enum _ECardSimplePhoneId ECardSimplePhoneId;
-typedef enum _ECardSimpleEmailId ECardSimpleEmailId;
-typedef enum _ECardSimpleAddressId ECardSimpleAddressId;
-typedef enum _ECardSimpleType ECardSimpleType;
-typedef enum _ECardSimpleField ECardSimpleField;
-
-enum _ECardSimplePhoneId {
- E_CARD_SIMPLE_PHONE_ID_ASSISTANT,
- E_CARD_SIMPLE_PHONE_ID_BUSINESS,
- E_CARD_SIMPLE_PHONE_ID_BUSINESS_2,
- E_CARD_SIMPLE_PHONE_ID_BUSINESS_FAX,
- E_CARD_SIMPLE_PHONE_ID_CALLBACK,
- E_CARD_SIMPLE_PHONE_ID_CAR,
- E_CARD_SIMPLE_PHONE_ID_COMPANY,
- E_CARD_SIMPLE_PHONE_ID_HOME,
- E_CARD_SIMPLE_PHONE_ID_HOME_2,
- E_CARD_SIMPLE_PHONE_ID_HOME_FAX,
- E_CARD_SIMPLE_PHONE_ID_ISDN,
- E_CARD_SIMPLE_PHONE_ID_MOBILE,
- E_CARD_SIMPLE_PHONE_ID_OTHER,
- E_CARD_SIMPLE_PHONE_ID_OTHER_FAX,
- E_CARD_SIMPLE_PHONE_ID_PAGER,
- E_CARD_SIMPLE_PHONE_ID_PRIMARY,
- E_CARD_SIMPLE_PHONE_ID_RADIO,
- E_CARD_SIMPLE_PHONE_ID_TELEX,
- E_CARD_SIMPLE_PHONE_ID_TTYTDD,
- E_CARD_SIMPLE_PHONE_ID_LAST
-};
-
-/* We need HOME and WORK email addresses here. */
-enum _ECardSimpleEmailId {
- E_CARD_SIMPLE_EMAIL_ID_EMAIL,
- E_CARD_SIMPLE_EMAIL_ID_EMAIL_2,
- E_CARD_SIMPLE_EMAIL_ID_EMAIL_3,
- E_CARD_SIMPLE_EMAIL_ID_LAST
-};
-
-/* Should this include (BILLING/SHIPPING)? */
-enum _ECardSimpleAddressId {
- E_CARD_SIMPLE_ADDRESS_ID_BUSINESS,
- E_CARD_SIMPLE_ADDRESS_ID_HOME,
- E_CARD_SIMPLE_ADDRESS_ID_OTHER,
- E_CARD_SIMPLE_ADDRESS_ID_LAST
-};
-
-enum _ECardSimpleType {
- E_CARD_SIMPLE_TYPE_STRING,
- E_CARD_SIMPLE_TYPE_DATE,
- E_CARD_SIMPLE_TYPE_BOOL,
-};
-
-enum _ECardSimpleField {
- E_CARD_SIMPLE_FIELD_FILE_AS,
- E_CARD_SIMPLE_FIELD_FULL_NAME,
- E_CARD_SIMPLE_FIELD_EMAIL,
- E_CARD_SIMPLE_FIELD_PHONE_PRIMARY,
- E_CARD_SIMPLE_FIELD_PHONE_ASSISTANT,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS,
- E_CARD_SIMPLE_FIELD_PHONE_CALLBACK,
- E_CARD_SIMPLE_FIELD_PHONE_COMPANY,
- E_CARD_SIMPLE_FIELD_PHONE_HOME,
- E_CARD_SIMPLE_FIELD_ORG,
- E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS,
- E_CARD_SIMPLE_FIELD_ADDRESS_HOME,
- E_CARD_SIMPLE_FIELD_PHONE_MOBILE,
- E_CARD_SIMPLE_FIELD_PHONE_CAR,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2,
- E_CARD_SIMPLE_FIELD_PHONE_HOME_2,
- E_CARD_SIMPLE_FIELD_PHONE_ISDN,
- E_CARD_SIMPLE_FIELD_PHONE_OTHER,
- E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_PAGER,
- E_CARD_SIMPLE_FIELD_PHONE_RADIO,
- E_CARD_SIMPLE_FIELD_PHONE_TELEX,
- E_CARD_SIMPLE_FIELD_PHONE_TTYTDD,
- E_CARD_SIMPLE_FIELD_ADDRESS_OTHER,
- E_CARD_SIMPLE_FIELD_EMAIL_2,
- E_CARD_SIMPLE_FIELD_EMAIL_3,
- E_CARD_SIMPLE_FIELD_URL,
- E_CARD_SIMPLE_FIELD_ORG_UNIT,
- E_CARD_SIMPLE_FIELD_OFFICE,
- E_CARD_SIMPLE_FIELD_TITLE,
- E_CARD_SIMPLE_FIELD_ROLE,
- E_CARD_SIMPLE_FIELD_MANAGER,
- E_CARD_SIMPLE_FIELD_ASSISTANT,
- E_CARD_SIMPLE_FIELD_NICKNAME,
- E_CARD_SIMPLE_FIELD_SPOUSE,
- E_CARD_SIMPLE_FIELD_NOTE,
- E_CARD_SIMPLE_FIELD_CALURI,
- E_CARD_SIMPLE_FIELD_FBURL,
- E_CARD_SIMPLE_FIELD_ICSCALENDAR,
- /* If you add after icscalendar, make sure to move LAST_SIMPLE_STRING */
- E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING = E_CARD_SIMPLE_FIELD_ICSCALENDAR,
- E_CARD_SIMPLE_FIELD_ANNIVERSARY,
- E_CARD_SIMPLE_FIELD_BIRTH_DATE,
- E_CARD_SIMPLE_FIELD_MAILER,
- E_CARD_SIMPLE_FIELD_NAME_OR_ORG,
- E_CARD_SIMPLE_FIELD_CATEGORIES,
- E_CARD_SIMPLE_FIELD_FAMILY_NAME,
- E_CARD_SIMPLE_FIELD_GIVEN_NAME,
- E_CARD_SIMPLE_FIELD_ADDITIONAL_NAME,
- E_CARD_SIMPLE_FIELD_NAME_SUFFIX,
- E_CARD_SIMPLE_FIELD_WANTS_HTML,
- E_CARD_SIMPLE_FIELD_IS_LIST,
- E_CARD_SIMPLE_FIELD_LAST
-};
-
-typedef struct _ECardSimple ECardSimple;
-typedef struct _ECardSimpleClass ECardSimpleClass;
-
-struct _ECardSimple {
- GObject object;
- ECard *card;
-
- GList *temp_fields;
-
- ECardPhone *phone[E_CARD_SIMPLE_PHONE_ID_LAST];
- char *email[E_CARD_SIMPLE_EMAIL_ID_LAST];
- ECardAddrLabel *address[E_CARD_SIMPLE_ADDRESS_ID_LAST];
- ECardDeliveryAddress *delivery[E_CARD_SIMPLE_ADDRESS_ID_LAST];
-
- gboolean changed;
-};
-
-struct _ECardSimpleClass {
- GObjectClass parent_class;
-};
-
-typedef void (*ECardSimpleArbitraryCallback) (const ECardArbitrary *arbitrary, gpointer closure);
-ECardSimple *e_card_simple_new (ECard *card);
-const char *e_card_simple_get_id (ECardSimple *simple);
-void e_card_simple_set_id (ECardSimple *simple,
- const gchar *character);
-char *e_card_simple_get_vcard (ECardSimple *simple);
-char *e_card_simple_get_vcard_assume_utf8 (ECardSimple *simple);
-ECardSimple *e_card_simple_duplicate (ECardSimple *simple);
-char *e_card_simple_get (ECardSimple *simple,
- ECardSimpleField field);
-const char *e_card_simple_get_const (ECardSimple *simple,
- ECardSimpleField field);
-void e_card_simple_set (ECardSimple *simple,
- ECardSimpleField field,
- const char *data);
-ECardSimpleType e_card_simple_type (ECardSimple *simple,
- ECardSimpleField field);
-
-const char *e_card_simple_get_ecard_field (ECardSimple *simple,
- ECardSimpleField field);
-const char *e_card_simple_get_name (ECardSimple *simple,
- ECardSimpleField field);
-const char *e_card_simple_get_short_name (ECardSimple *simple,
- ECardSimpleField field);
-gboolean e_card_simple_get_allow_newlines (ECardSimple *simple,
- ECardSimpleField field);
-
-
-/* Use these only if building lists of specific types. It should be
- * easier to use the above if you consider a phone field to be the
- * same as any other field.
- */
-const ECardPhone *e_card_simple_get_phone (ECardSimple *simple,
- ECardSimplePhoneId id);
-const char *e_card_simple_get_email (ECardSimple *simple,
- ECardSimpleEmailId id);
-const ECardAddrLabel *e_card_simple_get_address (ECardSimple *simple,
- ECardSimpleAddressId id);
-const ECardDeliveryAddress *e_card_simple_get_delivery_address (ECardSimple *simple,
- ECardSimpleAddressId id);
-void e_card_simple_set_phone (ECardSimple *simple,
- ECardSimplePhoneId id,
- const ECardPhone *phone);
-void e_card_simple_set_email (ECardSimple *simple,
- ECardSimpleEmailId id,
- const char *email);
-void e_card_simple_set_address (ECardSimple *simple,
- ECardSimpleAddressId id,
- const ECardAddrLabel *address);
-void e_card_simple_set_delivery_address (ECardSimple *simple,
- ECardSimpleAddressId id,
- const ECardDeliveryAddress *delivery);
-void e_card_simple_arbitrary_foreach (ECardSimple *simple,
- ECardSimpleArbitraryCallback *callback,
- gpointer closure);
-const ECardArbitrary *e_card_simple_get_arbitrary (ECardSimple *simple,
- const char *key);
-/* Any of these except key can be NULL */
-void e_card_simple_set_arbitrary (ECardSimple *simple,
- const char *key,
- const char *type,
- const char *value);
-void e_card_simple_set_name (ECardSimple *simple,
- ECardName *name);
-void e_card_simple_sync_card (ECardSimple *simple);
-
-/* These map between the individual list types and ECardSimpleField */
-ECardSimpleField e_card_simple_map_phone_to_field (ECardSimplePhoneId phone_id);
-ECardSimpleField e_card_simple_map_email_to_field (ECardSimpleEmailId email_id);
-ECardSimpleField e_card_simple_map_address_to_field (ECardSimpleAddressId address_id);
-
-GType e_card_simple_get_type (void);
-
-#endif /* ! __E_CARD_SIMPLE_H__ */
-
-
diff --git a/addressbook/backend/ebook/e-card-types.h b/addressbook/backend/ebook/e-card-types.h
deleted file mode 100644
index 8d35c54924..0000000000
--- a/addressbook/backend/ebook/e-card-types.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Arturo Espinosa
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 1999 The Free Software Foundation
- */
-
-#ifndef __E_CARD_TYPES_H__
-#define __E_CARD_TYPES_H__
-
-/* IDENTIFICATION PROPERTIES */
-
-typedef struct {
- gint ref_count;
- char *prefix; /* Mr. */
- char *given; /* John */
- char *additional; /* Quinlan */
- char *family; /* Public */
- char *suffix; /* Esq. */
-} ECardName;
-
-typedef struct {
- int year;
- int month;
- int day;
-} ECardDate;
-
-/* TELECOMMUNICATIONS ADDRESSING PROPERTIES */
-
-typedef enum {
- E_CARD_PHONE_PREF = 1 << 0,
- E_CARD_PHONE_WORK = 1 << 1,
- E_CARD_PHONE_HOME = 1 << 2,
- E_CARD_PHONE_VOICE = 1 << 3,
- E_CARD_PHONE_FAX = 1 << 4,
- E_CARD_PHONE_MSG = 1 << 5,
- E_CARD_PHONE_CELL = 1 << 6,
- E_CARD_PHONE_PAGER = 1 << 7,
- E_CARD_PHONE_BBS = 1 << 8,
- E_CARD_PHONE_MODEM = 1 << 9,
- E_CARD_PHONE_CAR = 1 << 10,
- E_CARD_PHONE_ISDN = 1 << 11,
- E_CARD_PHONE_VIDEO = 1 << 12,
- E_CARD_PHONE_ASSISTANT = 1 << 13,
- E_CARD_PHONE_CALLBACK = 1 << 14,
- E_CARD_PHONE_RADIO = 1 << 15,
- E_CARD_PHONE_TELEX = 1 << 16,
- E_CARD_PHONE_TTYTDD = 1 << 17,
-} ECardPhoneFlags;
-
-typedef struct {
- gint ref_count;
- ECardPhoneFlags flags;
- char *number;
-} ECardPhone;
-
-/* DELIVERY ADDRESSING PROPERTIES */
-
-typedef enum {
- E_CARD_ADDR_HOME = 1 << 0,
- E_CARD_ADDR_WORK = 1 << 1,
- E_CARD_ADDR_POSTAL = 1 << 2,
- E_CARD_ADDR_MASK = 7,
- E_CARD_ADDR_PARCEL = 1 << 3,
- E_CARD_ADDR_DOM = 1 << 4,
- E_CARD_ADDR_INTL = 1 << 5,
- E_CARD_ADDR_DEFAULT = 1 << 6
-} ECardAddressFlags;
-
-typedef struct {
- gint ref_count;
- ECardAddressFlags flags;
-
- char *po;
- char *ext;
- char *street;
- char *city;
- char *region;
- char *code;
- char *country;
-} ECardDeliveryAddress;
-
-typedef struct {
- gint ref_count;
- ECardAddressFlags flags;
- char *data;
-} ECardAddrLabel;
-
-/* ARBITRARY PROPERTIES */
-
-typedef struct {
- gint ref_count;
- char *key;
- char *type;
- char *value;
-} ECardArbitrary;
-
-#endif /* __E_CARD_TYPES_H__ */
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
deleted file mode 100644
index ff2ecc9287..0000000000
--- a/addressbook/backend/ebook/e-card.c
+++ /dev/null
@@ -1,2807 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Arturo Espinosa (arturo@nuclecu.unam.mx)
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 1999 The Free Software Foundation
- */
-
-#include <config.h>
-
-#include "e-card.h"
-
-#include <gal/widgets/e-unicode.h>
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <math.h>
-
-#include <bonobo/bonobo-i18n.h>
-#include <gal/util/e-util.h>
-
-#include <libversit/vcc.h>
-#include "e-util/ename/e-name-western.h"
-#include "e-util/ename/e-address-western.h"
-#include "e-book.h"
-
-#define is_a_prop_of(obj,prop) (isAPropertyOf ((obj),(prop)))
-#define str_val(obj) (the_str = (vObjectValueType (obj))? fakeCString (vObjectUStringZValue (obj)) : calloc (1, 1))
-#define has(obj,prop) (vo = isAPropertyOf ((obj), (prop)))
-
-#define XEV_WANTS_HTML "X-MOZILLA-HTML"
-#define XEV_ARBITRARY "X-EVOLUTION-ARBITRARY"
-#define XEV_LIST "X-EVOLUTION-LIST"
-#define XEV_LIST_SHOW_ADDRESSES "X-EVOLUTION-LIST-SHOW_ADDRESSES"
-#define XEV_RELATED_CONTACTS "X-EVOLUTION-RELATED_CONTACTS"
-
-/* Object property IDs */
-enum {
- PROP_0,
- PROP_FILE_AS,
- PROP_FULL_NAME,
- PROP_NAME,
- PROP_ADDRESS,
- PROP_ADDRESS_LABEL,
- PROP_PHONE,
- PROP_EMAIL,
- PROP_BIRTH_DATE,
- PROP_URL,
- PROP_ORG,
- PROP_ORG_UNIT,
- PROP_OFFICE,
- PROP_TITLE,
- PROP_ROLE,
- PROP_MANAGER,
- PROP_ASSISTANT,
- PROP_NICKNAME,
- PROP_SPOUSE,
- PROP_ANNIVERSARY,
- PROP_MAILER,
- PROP_CALURI,
- PROP_FBURL,
- PROP_ICSCALENDAR,
- PROP_NOTE,
- PROP_RELATED_CONTACTS,
- PROP_CATEGORIES,
- PROP_CATEGORY_LIST,
- PROP_WANTS_HTML,
- PROP_WANTS_HTML_SET,
- PROP_EVOLUTION_LIST,
- PROP_EVOLUTION_LIST_SHOW_ADDRESSES,
- PROP_ARBITRARY,
- PROP_ID,
- PROP_LAST_USE,
- PROP_USE_SCORE,
-};
-
-static GObjectClass *parent_class;
-
-static void parse(ECard *card, VObject *vobj, char *default_charset);
-static void e_card_init (ECard *card);
-static void e_card_class_init (ECardClass *klass);
-
-static void e_card_dispose (GObject *object);
-static void e_card_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_card_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-static void assign_string(VObject *vobj, char *default_charset, char **string);
-
-char *e_v_object_get_child_value(VObject *vobj, char *name, char *default_charset);
-
-static void parse_bday(ECard *card, VObject *object, char *default_charset);
-static void parse_full_name(ECard *card, VObject *object, char *default_charset);
-static void parse_file_as(ECard *card, VObject *object, char *default_charset);
-static void parse_name(ECard *card, VObject *object, char *default_charset);
-static void parse_email(ECard *card, VObject *object, char *default_charset);
-static void parse_phone(ECard *card, VObject *object, char *default_charset);
-static void parse_address(ECard *card, VObject *object, char *default_charset);
-static void parse_address_label(ECard *card, VObject *object, char *default_charset);
-static void parse_url(ECard *card, VObject *object, char *default_charset);
-static void parse_org(ECard *card, VObject *object, char *default_charset);
-static void parse_office(ECard *card, VObject *object, char *default_charset);
-static void parse_title(ECard *card, VObject *object, char *default_charset);
-static void parse_role(ECard *card, VObject *object, char *default_charset);
-static void parse_manager(ECard *card, VObject *object, char *default_charset);
-static void parse_assistant(ECard *card, VObject *object, char *default_charset);
-static void parse_nickname(ECard *card, VObject *object, char *default_charset);
-static void parse_spouse(ECard *card, VObject *object, char *default_charset);
-static void parse_anniversary(ECard *card, VObject *object, char *default_charset);
-static void parse_mailer(ECard *card, VObject *object, char *default_charset);
-static void parse_caluri(ECard *card, VObject *object, char *default_charset);
-static void parse_fburl(ECard *card, VObject *object, char *default_charset);
-static void parse_icscalendar(ECard *card, VObject *object, char *default_charset);
-static void parse_note(ECard *card, VObject *object, char *default_charset);
-static void parse_related_contacts(ECard *card, VObject *object, char *default_charset);
-static void parse_categories(ECard *card, VObject *object, char *default_charset);
-static void parse_wants_html(ECard *card, VObject *object, char *default_charset);
-static void parse_list(ECard *card, VObject *object, char *default_charset);
-static void parse_list_show_addresses(ECard *card, VObject *object, char *default_charset);
-static void parse_arbitrary(ECard *card, VObject *object, char *default_charset);
-static void parse_id(ECard *card, VObject *object, char *default_charset);
-static void parse_last_use(ECard *card, VObject *object, char *default_charset);
-static void parse_use_score(ECard *card, VObject *object, char *default_charset);
-
-static ECardPhoneFlags get_phone_flags (VObject *vobj);
-static void set_phone_flags (VObject *vobj, ECardPhoneFlags flags);
-static ECardAddressFlags get_address_flags (VObject *vobj);
-static void set_address_flags (VObject *vobj, ECardAddressFlags flags);
-
-typedef void (* ParsePropertyFunc) (ECard *card, VObject *object, char *default_charset);
-
-struct {
- char *key;
- ParsePropertyFunc function;
-} attribute_jump_array[] =
-{
- { VCFullNameProp, parse_full_name },
- { "X-EVOLUTION-FILE-AS", parse_file_as },
- { VCNameProp, parse_name },
- { VCBirthDateProp, parse_bday },
- { VCEmailAddressProp, parse_email },
- { VCTelephoneProp, parse_phone },
- { VCAdrProp, parse_address },
- { VCDeliveryLabelProp, parse_address_label },
- { VCURLProp, parse_url },
- { VCOrgProp, parse_org },
- { "X-EVOLUTION-OFFICE", parse_office },
- { VCTitleProp, parse_title },
- { VCBusinessRoleProp, parse_role },
- { "X-EVOLUTION-MANAGER", parse_manager },
- { "X-EVOLUTION-ASSISTANT", parse_assistant },
- { "NICKNAME", parse_nickname },
- { "X-EVOLUTION-SPOUSE", parse_spouse },
- { "X-EVOLUTION-ANNIVERSARY", parse_anniversary },
- { VCMailerProp, parse_mailer },
- { "CALURI", parse_caluri },
- { "FBURL", parse_fburl },
- { "ICSCALENDAR", parse_icscalendar },
- { VCNoteProp, parse_note },
- { XEV_RELATED_CONTACTS, parse_related_contacts },
- { "CATEGORIES", parse_categories },
- { XEV_WANTS_HTML, parse_wants_html },
- { XEV_ARBITRARY, parse_arbitrary },
- { VCUniqueStringProp, parse_id },
- { "X-EVOLUTION-LAST-USE", parse_last_use },
- { "X-EVOLUTION-USE-SCORE", parse_use_score },
- { XEV_LIST, parse_list },
- { XEV_LIST_SHOW_ADDRESSES, parse_list_show_addresses },
- { VCUniqueStringProp, parse_id }
-};
-
-/**
- * e_card_get_type:
- * @void:
- *
- * Registers the &ECard class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ECard class.
- **/
-GType
-e_card_get_type (void)
-{
- static GType card_type = 0;
-
- if (!card_type) {
- static const GTypeInfo card_info = {
- sizeof (ECardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_card_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_card_init,
- };
-
- card_type = g_type_register_static (G_TYPE_OBJECT, "ECard", &card_info, 0);
- }
-
- return card_type;
-}
-
-ECard *
-e_card_new_with_default_charset (char *vcard, char *default_charset)
-{
- ECard *card = g_object_new (E_TYPE_CARD, NULL);
- VObject *vobj = Parse_MIME(vcard, strlen(vcard));
- while(vobj) {
- VObject *next;
- parse(card, vobj, default_charset);
- next = nextVObjectInList(vobj);
- cleanVObject(vobj);
- vobj = next;
- }
- if (card->name == NULL)
- card->name = e_card_name_new();
- if (card->file_as == NULL)
- card->file_as = g_strdup("");
- if (card->fname == NULL)
- card->fname = g_strdup("");
- return card;
-}
-
-/**
- * e_card_new:
- * @vcard: a string in vCard format
- *
- * Returns: a new #ECard that wraps the @vcard.
- */
-ECard *
-e_card_new (char *vcard)
-{
- return e_card_new_with_default_charset (vcard, "UTF-8");
-}
-
-ECard *
-e_card_duplicate(ECard *card)
-{
- char *vcard = e_card_get_vcard_assume_utf8(card);
- ECard *new_card = e_card_new(vcard);
- g_free (vcard);
-
- if (card->book) {
- new_card->book = card->book;
- g_object_ref (new_card->book);
- }
-
- return new_card;
-}
-
-static void
-e_card_get_today (GDate *dt)
-{
- time_t now;
- struct tm *now_tm;
- if (dt == NULL)
- return;
-
- time (&now);
- now_tm = localtime (&now);
-
- g_date_set_dmy (dt, now_tm->tm_mday, now_tm->tm_mon + 1, now_tm->tm_year + 1900);
-}
-
-float
-e_card_get_use_score(ECard *card)
-{
- GDate today, last_use;
- gint days_since_last_use;
-
- g_return_val_if_fail (card != NULL && E_IS_CARD (card), 0);
-
- if (card->last_use == NULL)
- return 0.0;
-
- e_card_get_today (&today);
- g_date_set_dmy (&last_use, card->last_use->day, card->last_use->month, card->last_use->year);
-
- days_since_last_use = g_date_get_julian (&today) - g_date_get_julian (&last_use);
-
- /* Apply a seven-day "grace period" to the use score decay. */
- days_since_last_use -= 7;
- if (days_since_last_use < 0)
- days_since_last_use = 0;
-
- return MAX (card->raw_use_score, 0) * exp (- days_since_last_use / 30.0);
-}
-
-void
-e_card_touch(ECard *card)
-{
- GDate today;
- double use_score;
-
- g_return_if_fail (card != NULL && E_IS_CARD (card));
-
- e_card_get_today (&today);
- use_score = e_card_get_use_score (card);
-
- if (card->last_use == NULL)
- card->last_use = g_new (ECardDate, 1);
-
- card->last_use->day = g_date_get_day (&today);
- card->last_use->month = g_date_get_month (&today);
- card->last_use->year = g_date_get_year (&today);
-
- card->raw_use_score = use_score + 1.0;
-}
-
-/**
- * e_card_get_id:
- * @card: an #ECard
- *
- * Returns: a string representing the id of the card, which is unique
- * within its book.
- */
-const char *
-e_card_get_id (ECard *card)
-{
- g_return_val_if_fail (card && E_IS_CARD (card), NULL);
-
- return card->id ? card->id : "";
-}
-
-/**
- * e_card_get_id:
- * @card: an #ECard
- * @id: a id in string format
- *
- * Sets the identifier of a card, which should be unique within its
- * book.
- */
-void
-e_card_set_id (ECard *card, const char *id)
-{
- g_return_if_fail (card && E_IS_CARD (card));
-
- if ( card->id )
- g_free(card->id);
- card->id = g_strdup(id ? id : "");
-}
-
-EBook *
-e_card_get_book (ECard *card)
-{
- g_return_val_if_fail (card && E_IS_CARD (card), NULL);
-
- return card->book;
-}
-
-void
-e_card_set_book (ECard *card, EBook *book)
-{
- g_return_if_fail (card && E_IS_CARD (card));
-
- if (card->book)
- g_object_unref (card->book);
- card->book = book;
- if (card->book)
- g_object_ref (card->book);
-}
-
-gchar *
-e_card_date_to_string (ECardDate *dt)
-{
- if (dt)
- return g_strdup_printf ("%04d-%02d-%02d",
- CLAMP(dt->year, 1000, 9999),
- CLAMP(dt->month, 1, 12),
- CLAMP(dt->day, 1, 31));
- else
- return NULL;
-}
-
-static VObject *
-addPropValueUTF8(VObject *o, const char *p, const char *v)
-{
- VObject *prop = addPropValue (o, p, v);
- for (; *v; v++) {
- if ((*v) & 0x80) {
- addPropValue (prop, "CHARSET", "UTF-8");
- addProp(prop, VCQuotedPrintableProp);
-
- return prop;
- }
- if (*v == '\n') {
- addProp(prop, VCQuotedPrintableProp);
- for (; *v; v++) {
- if ((*v) & 0x80) {
- addPropValue (prop, "CHARSET", "UTF-8");
- return prop;
- }
- }
- return prop;
- }
- }
- return prop;
-}
-
-static VObject *
-addPropValueQP(VObject *o, const char *p, const char *v)
-{
- VObject *prop = addPropValue (o, p, v);
- for (; *v; v++) {
- if (*v == '\n') {
- addProp(prop, VCQuotedPrintableProp);
- break;
- }
- }
- return prop;
-}
-
-static void
-addPropValueSets (VObject *o, const char *p, const char *v, gboolean assumeUTF8, gboolean *is_ascii, gboolean *has_return)
-{
- addPropValue (o, p, v);
- if (*has_return && (assumeUTF8 || !*is_ascii))
- return;
- if (*has_return) {
- for (; *v; v++) {
- if (*v & 0x80) {
- *is_ascii = FALSE;
- return;
- }
- }
- return;
- }
- if (assumeUTF8 || !*is_ascii) {
- for (; *v; v++) {
- if (*v == '\n') {
- *has_return = TRUE;
- return;
- }
- }
- return;
- }
- for (; *v; v++) {
- if (*v & 0x80) {
- *is_ascii = FALSE;
- for (; *v; v++) {
- if (*v == '\n') {
- *has_return = TRUE;
- return;
- }
- }
- return;
- }
- if (*v == '\n') {
- *has_return = TRUE;
- for (; *v; v++) {
- if (*v & 0x80) {
- *is_ascii = FALSE;
- return;
- }
- }
- return;
- }
- }
- return;
-}
-
-#define ADD_PROP_VALUE(o, p, v) (assumeUTF8 ? (addPropValueQP ((o), (p), (v))) : addPropValueUTF8 ((o), (p), (v)))
-#define ADD_PROP_VALUE_SET_IS_ASCII(o, p, v) (addPropValueSets ((o), (p), (v), assumeUTF8, &is_ascii, &has_return))
-
-
-static VObject *
-e_card_get_vobject (const ECard *card, gboolean assumeUTF8)
-{
- VObject *vobj;
-
- vobj = newVObject (VCCardProp);
-
- ADD_PROP_VALUE(vobj, VCVersionProp, "2.1");
-
- if (card->file_as && *card->file_as)
- ADD_PROP_VALUE(vobj, "X-EVOLUTION-FILE-AS", card->file_as);
- else if (card->file_as)
- addProp(vobj, "X-EVOLUTION-FILE_AS");
-
- if (card->fname && *card->fname)
- ADD_PROP_VALUE(vobj, VCFullNameProp, card->fname);
- else if (card->fname)
- addProp(vobj, VCFullNameProp);
-
- if ( card->name && (card->name->prefix || card->name->given || card->name->additional || card->name->family || card->name->suffix) ) {
- VObject *nameprop;
- gboolean is_ascii = TRUE;
- gboolean has_return = FALSE;
- nameprop = addProp(vobj, VCNameProp);
- if ( card->name->prefix )
- ADD_PROP_VALUE_SET_IS_ASCII(nameprop, VCNamePrefixesProp, card->name->prefix);
- if ( card->name->given )
- ADD_PROP_VALUE_SET_IS_ASCII(nameprop, VCGivenNameProp, card->name->given);
- if ( card->name->additional )
- ADD_PROP_VALUE_SET_IS_ASCII(nameprop, VCAdditionalNamesProp, card->name->additional);
- if ( card->name->family )
- ADD_PROP_VALUE_SET_IS_ASCII(nameprop, VCFamilyNameProp, card->name->family);
- if ( card->name->suffix )
- ADD_PROP_VALUE_SET_IS_ASCII(nameprop, VCNameSuffixesProp, card->name->suffix);
- if (has_return)
- addProp(nameprop, VCQuotedPrintableProp);
- if (!(is_ascii || assumeUTF8))
- addPropValue (nameprop, "CHARSET", "UTF-8");
- }
- else if (card->name)
- addProp(vobj, VCNameProp);
-
-
- if ( card->address ) {
- EIterator *iterator = e_list_get_iterator(card->address);
- for ( ; e_iterator_is_valid(iterator) ;e_iterator_next(iterator) ) {
- VObject *addressprop;
- ECardDeliveryAddress *address = (ECardDeliveryAddress *) e_iterator_get(iterator);
- gboolean is_ascii = TRUE;
- gboolean has_return = FALSE;
-
- addressprop = addProp(vobj, VCAdrProp);
-
- set_address_flags (addressprop, address->flags);
- if (address->po)
- ADD_PROP_VALUE_SET_IS_ASCII(addressprop, VCPostalBoxProp, address->po);
- if (address->ext)
- ADD_PROP_VALUE_SET_IS_ASCII(addressprop, VCExtAddressProp, address->ext);
- if (address->street)
- ADD_PROP_VALUE_SET_IS_ASCII(addressprop, VCStreetAddressProp, address->street);
- if (address->city)
- ADD_PROP_VALUE_SET_IS_ASCII(addressprop, VCCityProp, address->city);
- if (address->region)
- ADD_PROP_VALUE_SET_IS_ASCII(addressprop, VCRegionProp, address->region);
- if (address->code)
- ADD_PROP_VALUE_SET_IS_ASCII(addressprop, VCPostalCodeProp, address->code);
- if (address->country)
- ADD_PROP_VALUE_SET_IS_ASCII(addressprop, VCCountryNameProp, address->country);
-
- if (has_return)
- addProp(addressprop, VCQuotedPrintableProp);
- if (!(is_ascii || assumeUTF8))
- addPropValue (addressprop, "CHARSET", "UTF-8");
- }
- g_object_unref(iterator);
- }
-
- if ( card->address_label ) {
- EIterator *iterator = e_list_get_iterator(card->address_label);
- for ( ; e_iterator_is_valid(iterator) ;e_iterator_next(iterator) ) {
- VObject *labelprop;
- ECardAddrLabel *address_label = (ECardAddrLabel *) e_iterator_get(iterator);
- if (address_label->data)
- labelprop = ADD_PROP_VALUE(vobj, VCDeliveryLabelProp, address_label->data);
- else
- labelprop = addProp(vobj, VCDeliveryLabelProp);
-
- set_address_flags (labelprop, address_label->flags);
- }
- g_object_unref(iterator);
- }
-
- if ( card->phone ) {
- EIterator *iterator = e_list_get_iterator(card->phone);
- for ( ; e_iterator_is_valid(iterator) ;e_iterator_next(iterator) ) {
- VObject *phoneprop;
- ECardPhone *phone = (ECardPhone *) e_iterator_get(iterator);
- phoneprop = ADD_PROP_VALUE(vobj, VCTelephoneProp, phone->number);
-
- set_phone_flags (phoneprop, phone->flags);
- }
- g_object_unref(iterator);
- }
-
- if ( card->email ) {
- EIterator *iterator = e_list_get_iterator(card->email);
- for ( ; e_iterator_is_valid(iterator) ;e_iterator_next(iterator) ) {
- VObject *emailprop;
- emailprop = ADD_PROP_VALUE(vobj, VCEmailAddressProp, (char *) e_iterator_get(iterator));
- addProp (emailprop, VCInternetProp);
- }
- g_object_unref(iterator);
- }
-
- if ( card->bday ) {
- char *value;
- value = e_card_date_to_string (card->bday);
- ADD_PROP_VALUE(vobj, VCBirthDateProp, value);
- g_free(value);
- }
-
- if (card->url)
- ADD_PROP_VALUE(vobj, VCURLProp, card->url);
-
- if (card->org || card->org_unit) {
- VObject *orgprop;
- gboolean is_ascii = TRUE;
- gboolean has_return = FALSE;
- orgprop = addProp(vobj, VCOrgProp);
-
- if (card->org)
- ADD_PROP_VALUE_SET_IS_ASCII(orgprop, VCOrgNameProp, card->org);
- if (card->org_unit)
- ADD_PROP_VALUE_SET_IS_ASCII(orgprop, VCOrgUnitProp, card->org_unit);
-
- if (has_return)
- addProp(orgprop, VCQuotedPrintableProp);
- if (!(is_ascii || assumeUTF8))
- addPropValue (orgprop, "CHARSET", "UTF-8");
- }
-
- if (card->office)
- ADD_PROP_VALUE(vobj, "X-EVOLUTION-OFFICE", card->office);
-
- if (card->title)
- ADD_PROP_VALUE(vobj, VCTitleProp, card->title);
-
- if (card->role)
- ADD_PROP_VALUE(vobj, VCBusinessRoleProp, card->role);
-
- if (card->manager)
- ADD_PROP_VALUE(vobj, "X-EVOLUTION-MANAGER", card->manager);
-
- if (card->assistant)
- ADD_PROP_VALUE(vobj, "X-EVOLUTION-ASSISTANT", card->assistant);
-
- if (card->nickname)
- ADD_PROP_VALUE(vobj, "NICKNAME", card->nickname);
-
- if (card->spouse)
- ADD_PROP_VALUE(vobj, "X-EVOLUTION-SPOUSE", card->spouse);
-
- if ( card->anniversary ) {
- char *value;
- value = e_card_date_to_string (card->anniversary);
- ADD_PROP_VALUE(vobj, "X-EVOLUTION-ANNIVERSARY", value);
- g_free(value);
- }
-
- if (card->mailer) {
- ADD_PROP_VALUE(vobj, VCMailerProp, card->mailer);
- }
-
- if (card->caluri)
- addPropValueQP(vobj, "CALURI", card->caluri);
-
- if (card->fburl)
- ADD_PROP_VALUE(vobj, "FBURL", card->fburl);
-
- if (card->icscalendar)
- ADD_PROP_VALUE(vobj, "ICSCALENDAR", card->icscalendar);
-
- if (card->note) {
- VObject *noteprop;
-
- noteprop = ADD_PROP_VALUE(vobj, VCNoteProp, card->note);
- }
-
- if (card->last_use) {
- char *value;
- value = e_card_date_to_string (card->last_use);
- ADD_PROP_VALUE (vobj, "X-EVOLUTION-LAST-USE", value);
- g_free (value);
- }
-
- if (card->raw_use_score > 0) {
- char *value;
- value = g_strdup_printf ("%f", card->raw_use_score);
- ADD_PROP_VALUE (vobj, "X-EVOLUTION-USE-SCORE", value);
- g_free (value);
- }
-
- if (card->related_contacts && *card->related_contacts) {
- ADD_PROP_VALUE(vobj, XEV_RELATED_CONTACTS, card->related_contacts);
- }
-
- if (card->categories) {
- EIterator *iterator;
- int length = 0;
- char *string;
- char *stringptr;
- for (iterator = e_list_get_iterator(card->categories); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- length += strlen(e_iterator_get(iterator)) + 1;
- }
- string = g_new(char, length + 1);
- stringptr = string;
- *stringptr = 0;
- for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- strcpy(stringptr, e_iterator_get(iterator));
- stringptr += strlen(stringptr);
- *stringptr = ',';
- stringptr++;
- *stringptr = 0;
- }
- if (stringptr > string) {
- stringptr --;
- *stringptr = 0;
- }
- ADD_PROP_VALUE (vobj, "CATEGORIES", string);
- g_free(string);
- }
-
- if (card->wants_html_set) {
- ADD_PROP_VALUE (vobj, XEV_WANTS_HTML, card->wants_html ? "TRUE" : "FALSE");
- }
-
- if (card->list) {
- ADD_PROP_VALUE (vobj, XEV_LIST, "TRUE");
- ADD_PROP_VALUE (vobj, XEV_LIST_SHOW_ADDRESSES, card->list_show_addresses ? "TRUE" : "FALSE");
- }
-
- if (card->arbitrary) {
- EIterator *iterator;
- for (iterator = e_list_get_iterator(card->arbitrary); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- const ECardArbitrary *arbitrary = e_iterator_get(iterator);
- VObject *arb_object;
- if (arbitrary->value) {
- arb_object = ADD_PROP_VALUE (vobj, XEV_ARBITRARY, arbitrary->value);
- } else {
- arb_object = addProp (vobj, XEV_ARBITRARY);
- }
- if (arbitrary->type) {
- ADD_PROP_VALUE (arb_object, "TYPE", arbitrary->type);
- }
- if (arbitrary->key) {
- addProp (arb_object, arbitrary->key);
- }
- }
- }
-
- addPropValueQP (vobj, VCUniqueStringProp, (card->id ? card->id : ""));
-
- return vobj;
-}
-
-/**
- * e_card_get_vcard:
- * @card: an #ECard
- *
- * Returns: a string in vCard format, which is wrapped by the @card.
- */
-char *
-e_card_get_vcard (ECard *card)
-{
- VObject *vobj;
- char *temp, *ret_val;
-
- vobj = e_card_get_vobject (card, FALSE);
- temp = writeMemVObject(NULL, NULL, vobj);
- ret_val = g_strdup(temp);
- free(temp);
- cleanVObject(vobj);
- return ret_val;
-}
-
-char *
-e_card_get_vcard_assume_utf8 (ECard *card)
-{
- VObject *vobj;
- char *temp, *ret_val;
-
- vobj = e_card_get_vobject (card, TRUE);
- temp = writeMemVObject(NULL, NULL, vobj);
- ret_val = g_strdup(temp);
- free(temp);
- cleanVObject(vobj);
- return ret_val;
-}
-
-/**
- * e_card_list_get_vcard:
- * @list: a list of #ECards
- *
- * Returns: a string in vCard format.
- */
-char *
-e_card_list_get_vcard (const GList *list)
-{
- VObject *vobj;
-
- char *temp, *ret_val;
-
- vobj = NULL;
-
- for (; list; list = list->next) {
- VObject *tempvobj;
- ECard *card = list->data;
-
- tempvobj = e_card_get_vobject (card, FALSE);
- addList (&vobj, tempvobj);
- }
- temp = writeMemVObjects(NULL, NULL, vobj);
- ret_val = g_strdup(temp);
- free(temp);
- cleanVObjects(vobj);
- return ret_val;
-}
-
-static void
-parse_file_as(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->file_as )
- g_free(card->file_as);
- assign_string(vobj, default_charset, &(card->file_as));
-}
-
-static void
-parse_name(ECard *card, VObject *vobj, char *default_charset)
-{
- e_card_name_unref(card->name);
-
- card->name = e_card_name_new();
-
- card->name->family = e_v_object_get_child_value (vobj, VCFamilyNameProp, default_charset);
- card->name->given = e_v_object_get_child_value (vobj, VCGivenNameProp, default_charset);
- card->name->additional = e_v_object_get_child_value (vobj, VCAdditionalNamesProp, default_charset);
- card->name->prefix = e_v_object_get_child_value (vobj, VCNamePrefixesProp, default_charset);
- card->name->suffix = e_v_object_get_child_value (vobj, VCNameSuffixesProp, default_charset);
-}
-
-static void
-parse_full_name(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->fname )
- g_free(card->fname);
- assign_string(vobj, default_charset, &(card->fname));
-}
-
-static void
-parse_email(ECard *card, VObject *vobj, char *default_charset)
-{
- char *next_email;
- EList *list;
-
- assign_string(vobj, default_charset, &next_email);
- g_object_get(card,
- "email", &list,
- NULL);
- e_list_append(list, next_email);
- g_free (next_email);
- g_object_unref(list);
-}
-
-/* Deal with charset */
-static void
-parse_bday(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- if ( card->bday )
- g_free(card->bday);
- card->bday = g_new(ECardDate, 1);
- *(card->bday) = e_card_date_from_string(str);
- free(str);
- }
-}
-
-static void
-parse_phone(ECard *card, VObject *vobj, char *default_charset)
-{
- ECardPhone *next_phone = e_card_phone_new ();
- EList *list;
-
- assign_string(vobj, default_charset, &(next_phone->number));
- next_phone->flags = get_phone_flags(vobj);
-
- g_object_get(card,
- "phone", &list,
- NULL);
- e_list_append(list, next_phone);
- e_card_phone_unref (next_phone);
- g_object_unref(list);
-}
-
-static void
-parse_address(ECard *card, VObject *vobj, char *default_charset)
-{
- ECardDeliveryAddress *next_addr = e_card_delivery_address_new ();
- EList *list;
-
- next_addr->flags = get_address_flags (vobj);
- next_addr->po = e_v_object_get_child_value (vobj, VCPostalBoxProp, default_charset);
- next_addr->ext = e_v_object_get_child_value (vobj, VCExtAddressProp, default_charset);
- next_addr->street = e_v_object_get_child_value (vobj, VCStreetAddressProp, default_charset);
- next_addr->city = e_v_object_get_child_value (vobj, VCCityProp, default_charset);
- next_addr->region = e_v_object_get_child_value (vobj, VCRegionProp, default_charset);
- next_addr->code = e_v_object_get_child_value (vobj, VCPostalCodeProp, default_charset);
- next_addr->country = e_v_object_get_child_value (vobj, VCCountryNameProp, default_charset);
-
- g_object_get(card,
- "address", &list,
- NULL);
- e_list_append(list, next_addr);
- e_card_delivery_address_unref (next_addr);
- g_object_unref(list);
-}
-
-static void
-parse_address_label(ECard *card, VObject *vobj, char *default_charset)
-{
- ECardAddrLabel *next_addr = e_card_address_label_new ();
- EList *list;
-
- next_addr->flags = get_address_flags (vobj);
- assign_string(vobj, default_charset, &next_addr->data);
-
- g_object_get(card,
- "address_label", &list,
- NULL);
- e_list_append(list, next_addr);
- e_card_address_label_unref (next_addr);
- g_object_unref(list);
-}
-
-static void
-parse_url(ECard *card, VObject *vobj, char *default_charset)
-{
- if (card->url)
- g_free(card->url);
- assign_string(vobj, default_charset, &(card->url));
-}
-
-static void
-parse_org(ECard *card, VObject *vobj, char *default_charset)
-{
- char *temp;
-
- temp = e_v_object_get_child_value(vobj, VCOrgNameProp, default_charset);
- g_free(card->org);
- card->org = temp;
-
- temp = e_v_object_get_child_value(vobj, VCOrgUnitProp, default_charset);
- g_free(card->org_unit);
- card->org_unit = temp;
-}
-
-static void
-parse_office(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->office )
- g_free(card->office);
- assign_string(vobj, default_charset, &(card->office));
-}
-
-static void
-parse_title(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->title )
- g_free(card->title);
- assign_string(vobj, default_charset, &(card->title));
-}
-
-static void
-parse_role(ECard *card, VObject *vobj, char *default_charset)
-{
- if (card->role)
- g_free(card->role);
- assign_string(vobj, default_charset, &(card->role));
-}
-
-static void
-parse_manager(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->manager )
- g_free(card->manager);
- assign_string(vobj, default_charset, &(card->manager));
-}
-
-static void
-parse_assistant(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->assistant )
- g_free(card->assistant);
- assign_string(vobj, default_charset, &(card->assistant));
-}
-
-static void
-parse_nickname(ECard *card, VObject *vobj, char *default_charset)
-{
- if (card->nickname)
- g_free(card->nickname);
- assign_string(vobj, default_charset, &(card->nickname));
-}
-
-static void
-parse_spouse(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->spouse )
- g_free(card->spouse);
- assign_string(vobj, default_charset, &(card->spouse));
-}
-
-/* Deal with charset */
-static void
-parse_anniversary(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- if (card->anniversary)
- g_free(card->anniversary);
- card->anniversary = g_new(ECardDate, 1);
- *(card->anniversary) = e_card_date_from_string(str);
- free(str);
- }
-}
-
-static void
-parse_mailer(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( card->mailer )
- g_free(card->mailer);
- assign_string(vobj, default_charset, &(card->mailer));
-}
-
-static void
-parse_caluri(ECard *card, VObject *vobj, char *default_charset)
-{
- g_free(card->caluri);
- assign_string(vobj, default_charset, &(card->caluri));
-}
-
-static void
-parse_fburl(ECard *card, VObject *vobj, char *default_charset)
-{
- g_free(card->fburl);
- assign_string(vobj, default_charset, &(card->fburl));
-}
-
-static void
-parse_icscalendar(ECard *card, VObject *vobj, char *default_charset)
-{
- g_free(card->icscalendar);
- assign_string(vobj, default_charset, &(card->icscalendar));
-}
-
-static void
-parse_note(ECard *card, VObject *vobj, char *default_charset)
-{
- g_free(card->note);
- assign_string(vobj, default_charset, &(card->note));
-}
-
-static void
-parse_related_contacts(ECard *card, VObject *vobj, char *default_charset)
-{
- g_free(card->related_contacts);
- assign_string(vobj, default_charset, &(card->related_contacts));
-}
-
-static void
-add_list_unique(ECard *card, EList *list, char *string)
-{
- char *temp = e_strdup_strip(string);
- EIterator *iterator;
-
- if (!*temp) {
- g_free(temp);
- return;
- }
- for ( iterator = e_list_get_iterator(list); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- if (!strcmp(e_iterator_get(iterator), temp)) {
- break;
- }
- }
- if (!e_iterator_is_valid(iterator)) {
- e_list_append(list, temp);
- }
- g_free(temp);
- g_object_unref(iterator);
-}
-
-static void
-do_parse_categories(ECard *card, char *str)
-{
- int length = strlen(str);
- char *copy = g_new(char, length + 1);
- int i, j;
- EList *list;
- g_object_get(card,
- "category_list", &list,
- NULL);
- for (i = 0, j = 0; str[i]; i++, j++) {
- switch (str[i]) {
- case '\\':
- i++;
- if (str[i]) {
- copy[j] = str[i];
- } else
- i--;
- break;
- case ',':
- copy[j] = 0;
- add_list_unique(card, list, copy);
- j = -1;
- break;
- default:
- copy[j] = str[i];
- break;
- }
- }
- copy[j] = 0;
- add_list_unique(card, list, copy);
- g_object_unref(list);
- g_free(copy);
-}
-
-/* Deal with charset */
-static void
-parse_categories(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- do_parse_categories(card, str);
- free(str);
- }
-}
-
-/* Deal with charset */
-static void
-parse_wants_html(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- if (!strcasecmp(str, "true")) {
- card->wants_html = TRUE;
- card->wants_html_set = TRUE;
- }
- if (!strcasecmp(str, "false")) {
- card->wants_html = FALSE;
- card->wants_html_set = TRUE;
- }
- free(str);
- }
-}
-
-/* Deal with charset */
-static void
-parse_list(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- if (!strcasecmp(str, "true")) {
- card->list = TRUE;
- }
- if (!strcasecmp(str, "false")) {
- card->list = FALSE;
- }
- free(str);
- }
-}
-
-/* Deal with charset */
-static void
-parse_list_show_addresses(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- if (!strcasecmp(str, "true")) {
- card->list_show_addresses = TRUE;
- }
- if (!strcasecmp(str, "false")) {
- card->list_show_addresses = FALSE;
- }
- free(str);
- }
-}
-
-typedef union ValueItem {
- const char *strs;
- const wchar_t *ustrs;
- unsigned int i;
- unsigned long l;
- void *any;
- VObject *vobj;
-} ValueItem;
-
-struct VObject {
- VObject *next;
- const char *id;
- VObject *prop;
- unsigned short valType;
- ValueItem val;
-};
-
-static void
-parse_arbitrary(ECard *card, VObject *vobj, char *default_charset)
-{
- ECardArbitrary *arbitrary = e_card_arbitrary_new();
- VObjectIterator iterator;
- EList *list;
- for ( initPropIterator (&iterator, vobj); moreIteration(&iterator); ) {
- VObject *temp = nextVObject(&iterator);
- const char *name = vObjectName(temp);
- if (name && !strcmp(name, "TYPE")) {
- g_free(arbitrary->type);
- assign_string(temp, default_charset, &(arbitrary->type));
- } else {
- g_free(arbitrary->key);
- arbitrary->key = g_strdup(name);
- }
- }
-
- assign_string(vobj, default_charset, &(arbitrary->value));
-
- g_object_get(card,
- "arbitrary", &list,
- NULL);
- e_list_append(list, arbitrary);
- e_card_arbitrary_unref(arbitrary);
- g_object_unref(list);
-}
-
-static void
-parse_id(ECard *card, VObject *vobj, char *default_charset)
-{
- g_free(card->id);
- assign_string(vobj, default_charset, &(card->id));
-}
-
-/* Deal with charset */
-static void
-parse_last_use(ECard *card, VObject *vobj, char *default_charset)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- g_free(card->last_use);
- card->last_use = g_new(ECardDate, 1);
- *(card->last_use) = e_card_date_from_string(str);
- free(str);
- }
-}
-
-/* Deal with charset */
-static void
-parse_use_score(ECard *card, VObject *vobj, char *default_charset)
-{
- card->raw_use_score = 0;
-
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- card->raw_use_score = MAX(0, atof (str));
- free (str);
- }
-}
-
-static void
-parse_attribute(ECard *card, VObject *vobj, char *default_charset)
-{
- ParsePropertyFunc function = g_hash_table_lookup(E_CARD_GET_CLASS(card)->attribute_jump_table, vObjectName(vobj));
- if ( function )
- function(card, vobj, default_charset);
-}
-
-static void
-parse(ECard *card, VObject *vobj, char *default_charset)
-{
- VObjectIterator iterator;
- initPropIterator(&iterator, vobj);
- while(moreIteration (&iterator)) {
- parse_attribute(card, nextVObject(&iterator), default_charset);
- }
- if (!card->fname) {
- card->fname = g_strdup("");
- }
- if (!card->name) {
- card->name = e_card_name_from_string(card->fname);
- }
- if (!card->file_as) {
- ECardName *name = card->name;
- char *strings[3], **stringptr;
- char *string;
- stringptr = strings;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- *stringptr = NULL;
- string = g_strjoinv(", ", strings);
- card->file_as = string;
- }
-}
-
-static void
-e_card_class_init (ECardClass *klass)
-{
- int i;
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- klass->attribute_jump_table = g_hash_table_new(g_str_hash, g_str_equal);
-
- for ( i = 0; i < sizeof(attribute_jump_array) / sizeof(attribute_jump_array[0]); i++ ) {
- g_hash_table_insert(klass->attribute_jump_table, attribute_jump_array[i].key, attribute_jump_array[i].function);
- }
-
- object_class->dispose = e_card_dispose;
- object_class->get_property = e_card_get_property;
- object_class->set_property = e_card_set_property;
-
- g_object_class_install_property (object_class, PROP_FILE_AS,
- g_param_spec_string ("file_as",
- _("File As"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_NAME,
- g_param_spec_string ("full_name",
- _("Full Name"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_pointer ("name",
- _("Name"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ADDRESS,
- g_param_spec_object ("address",
- _("Address"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_ADDRESS_LABEL,
- g_param_spec_object ("address_label",
- _("Address Label"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_PHONE,
- g_param_spec_object ("phone",
- _("Phone"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_EMAIL,
- g_param_spec_object ("email",
- _("Email"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_BIRTH_DATE,
- g_param_spec_pointer ("birth_date",
- _("Birth date"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_URL,
- g_param_spec_string ("url",
- _("URL"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ORG,
- g_param_spec_string ("org",
- _("Organization"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ORG_UNIT,
- g_param_spec_string ("org_unit",
- _("Organizational Unit"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_OFFICE,
- g_param_spec_string ("office",
- _("Office"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TITLE,
- g_param_spec_string ("title",
- _("Title"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ROLE,
- g_param_spec_string ("role",
- _("Role"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MANAGER,
- g_param_spec_string ("manager",
- _("Manager"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ASSISTANT,
- g_param_spec_string ("assistant",
- _("Assistant"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_NICKNAME,
- g_param_spec_string ("nickname",
- _("Nickname"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_SPOUSE,
- g_param_spec_string ("spouse",
- _("Spouse"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ANNIVERSARY,
- g_param_spec_pointer ("anniversary",
- _("Anniversary"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MAILER,
- g_param_spec_string ("mailer",
- _("Mailer"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CALURI,
- g_param_spec_string ("caluri",
- _("Calendar URI"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FBURL,
- g_param_spec_string ("fburl",
- _("Free/Busy URL"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ICSCALENDAR,
- g_param_spec_string ("icscalendar",
- _("ICS Calendar"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_NOTE,
- g_param_spec_string ("note",
- _("Note"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_RELATED_CONTACTS,
- g_param_spec_string ("related_contacts",
- _("Related Contacts"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CATEGORIES,
- g_param_spec_string ("categories",
- _("Categories"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CATEGORY_LIST,
- g_param_spec_object ("category list",
- _("Category List"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WANTS_HTML,
- g_param_spec_boolean ("wants_html",
- _("Wants HTML"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WANTS_HTML_SET,
- g_param_spec_boolean ("wants_html_set",
- _("Wants HTML set"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_EVOLUTION_LIST,
- g_param_spec_boolean ("list",
- _("List"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EVOLUTION_LIST_SHOW_ADDRESSES,
- g_param_spec_boolean ("list_show_addresses",
- _("List Show Addresses"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ARBITRARY,
- g_param_spec_object ("arbitrary",
- _("Arbitrary"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ID,
- g_param_spec_string ("id",
- _("ID"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_LAST_USE,
- g_param_spec_pointer ("last_use",
- _("Last Use"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_USE_SCORE,
- /* XXX at some point we
- should remove
- LAX_VALIDATION and figure
- out some hard min & max
- scores. */
- g_param_spec_float ("use_score",
- _("Use Score"),
- /*_( */"XXX blurb" /*)*/,
- 0.0,
- 0.0,
- 0.0,
- G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION));
-}
-
-ECardPhone *
-e_card_phone_new (void)
-{
- ECardPhone *newphone = g_new(ECardPhone, 1);
-
- newphone->ref_count = 1;
- newphone->number = NULL;
- newphone->flags = 0;
-
- return newphone;
-}
-
-void
-e_card_phone_unref (ECardPhone *phone)
-{
- if (phone) {
- phone->ref_count --;
- if (phone->ref_count == 0) {
- g_free(phone->number);
- g_free(phone);
- }
- }
-}
-
-ECardPhone *
-e_card_phone_ref (const ECardPhone *phone)
-{
- ECardPhone *phone_mutable = (ECardPhone *) phone;
- if (phone_mutable)
- phone_mutable->ref_count ++;
- return phone_mutable;
-}
-
-ECardPhone *
-e_card_phone_copy (const ECardPhone *phone)
-{
- if ( phone ) {
- ECardPhone *phone_copy = e_card_phone_new();
- phone_copy->number = g_strdup(phone->number);
- phone_copy->flags = phone->flags;
- return phone_copy;
- } else
- return NULL;
-}
-
-ECardDeliveryAddress *
-e_card_delivery_address_new (void)
-{
- ECardDeliveryAddress *newaddr = g_new(ECardDeliveryAddress, 1);
-
- newaddr->ref_count = 1;
- newaddr->po = NULL;
- newaddr->ext = NULL;
- newaddr->street = NULL;
- newaddr->city = NULL;
- newaddr->region = NULL;
- newaddr->code = NULL;
- newaddr->country = NULL;
- newaddr->flags = 0;
-
- return newaddr;
-}
-
-void
-e_card_delivery_address_unref (ECardDeliveryAddress *addr)
-{
- if ( addr ) {
- addr->ref_count --;
- if (addr->ref_count == 0) {
- g_free(addr->po);
- g_free(addr->ext);
- g_free(addr->street);
- g_free(addr->city);
- g_free(addr->region);
- g_free(addr->code);
- g_free(addr->country);
- g_free(addr);
- }
- }
-}
-
-ECardDeliveryAddress *
-e_card_delivery_address_ref (const ECardDeliveryAddress *addr)
-{
- ECardDeliveryAddress *addr_mutable = (ECardDeliveryAddress *) addr;
- if (addr_mutable)
- addr_mutable->ref_count ++;
- return addr_mutable;
-}
-
-ECardDeliveryAddress *
-e_card_delivery_address_copy (const ECardDeliveryAddress *addr)
-{
- if ( addr ) {
- ECardDeliveryAddress *addr_copy = e_card_delivery_address_new ();
- addr_copy->po = g_strdup(addr->po );
- addr_copy->ext = g_strdup(addr->ext );
- addr_copy->street = g_strdup(addr->street );
- addr_copy->city = g_strdup(addr->city );
- addr_copy->region = g_strdup(addr->region );
- addr_copy->code = g_strdup(addr->code );
- addr_copy->country = g_strdup(addr->country);
- addr_copy->flags = addr->flags;
- return addr_copy;
- } else
- return NULL;
-}
-
-gboolean
-e_card_delivery_address_is_empty (const ECardDeliveryAddress *addr)
-{
- return (((addr->po == NULL) || (*addr->po == 0)) &&
- ((addr->ext == NULL) || (*addr->ext == 0)) &&
- ((addr->street == NULL) || (*addr->street == 0)) &&
- ((addr->city == NULL) || (*addr->city == 0)) &&
- ((addr->region == NULL) || (*addr->region == 0)) &&
- ((addr->code == NULL) || (*addr->code == 0)) &&
- ((addr->country == NULL) || (*addr->country == 0)));
-}
-
-ECardDeliveryAddress *
-e_card_delivery_address_from_label(const ECardAddrLabel *label)
-{
- ECardDeliveryAddress *addr = e_card_delivery_address_new ();
- EAddressWestern *western = e_address_western_parse (label->data);
-
- addr->po = g_strdup (western->po_box );
- addr->ext = g_strdup (western->extended );
- addr->street = g_strdup (western->street );
- addr->city = g_strdup (western->locality );
- addr->region = g_strdup (western->region );
- addr->code = g_strdup (western->postal_code);
- addr->country = g_strdup (western->country );
- addr->flags = label->flags;
-
- e_address_western_free(western);
-
- return addr;
-}
-
-char *
-e_card_delivery_address_to_string(const ECardDeliveryAddress *addr)
-{
- char *strings[5], **stringptr = strings;
- char *line1, *line22, *line2;
- char *final;
- if (addr->po && *addr->po)
- *(stringptr++) = addr->po;
- if (addr->street && *addr->street)
- *(stringptr++) = addr->street;
- *stringptr = NULL;
- line1 = g_strjoinv(" ", strings);
- stringptr = strings;
- if (addr->region && *addr->region)
- *(stringptr++) = addr->region;
- if (addr->code && *addr->code)
- *(stringptr++) = addr->code;
- *stringptr = NULL;
- line22 = g_strjoinv(" ", strings);
- stringptr = strings;
- if (addr->city && *addr->city)
- *(stringptr++) = addr->city;
- if (line22 && *line22)
- *(stringptr++) = line22;
- *stringptr = NULL;
- line2 = g_strjoinv(", ", strings);
- stringptr = strings;
- if (line1 && *line1)
- *(stringptr++) = line1;
- if (addr->ext && *addr->ext)
- *(stringptr++) = addr->ext;
- if (line2 && *line2)
- *(stringptr++) = line2;
- if (addr->country && *addr->country)
- *(stringptr++) = addr->country;
- *stringptr = NULL;
- final = g_strjoinv("\n", strings);
- g_free(line1);
- g_free(line22);
- g_free(line2);
- return final;
-}
-
-ECardAddrLabel *
-e_card_delivery_address_to_label (const ECardDeliveryAddress *addr)
-{
- ECardAddrLabel *label;
- label = e_card_address_label_new();
- label->flags = addr->flags;
- label->data = e_card_delivery_address_to_string(addr);
-
- return label;
-}
-
-ECardAddrLabel *
-e_card_address_label_new (void)
-{
- ECardAddrLabel *newaddr = g_new(ECardAddrLabel, 1);
-
- newaddr->ref_count = 1;
- newaddr->data = NULL;
- newaddr->flags = 0;
-
- return newaddr;
-}
-
-void
-e_card_address_label_unref (ECardAddrLabel *addr)
-{
- if (addr) {
- addr->ref_count --;
- if (addr->ref_count == 0) {
- g_free(addr->data);
- g_free(addr);
- }
- }
-}
-
-ECardAddrLabel *
-e_card_address_label_ref (const ECardAddrLabel *addr)
-{
- ECardAddrLabel *addr_mutable = (ECardAddrLabel *) addr;
- if (addr_mutable)
- addr_mutable->ref_count ++;
- return addr_mutable;
-}
-
-ECardAddrLabel *
-e_card_address_label_copy (const ECardAddrLabel *addr)
-{
- if ( addr ) {
- ECardAddrLabel *addr_copy = e_card_address_label_new ();
- addr_copy->data = g_strdup(addr->data);
- addr_copy->flags = addr->flags;
- return addr_copy;
- } else
- return NULL;
-}
-
-ECardName *e_card_name_new(void)
-{
- ECardName *newname = g_new(ECardName, 1);
-
- newname->ref_count = 1;
- newname->prefix = NULL;
- newname->given = NULL;
- newname->additional = NULL;
- newname->family = NULL;
- newname->suffix = NULL;
-
- return newname;
-}
-
-void
-e_card_name_unref(ECardName *name)
-{
- if (name) {
- name->ref_count --;
- if (name->ref_count == 0) {
- g_free (name->prefix);
- g_free (name->given);
- g_free (name->additional);
- g_free (name->family);
- g_free (name->suffix);
- g_free (name);
- }
- }
-}
-
-ECardName *
-e_card_name_ref(const ECardName *name)
-{
- ECardName *name_mutable = (ECardName *) name;
- if (name_mutable)
- name_mutable->ref_count ++;
- return name_mutable;
-}
-
-ECardName *
-e_card_name_copy(const ECardName *name)
-{
- if (name) {
- ECardName *newname = e_card_name_new ();
-
- newname->prefix = g_strdup(name->prefix);
- newname->given = g_strdup(name->given);
- newname->additional = g_strdup(name->additional);
- newname->family = g_strdup(name->family);
- newname->suffix = g_strdup(name->suffix);
-
- return newname;
- } else
- return NULL;
-}
-
-
-char *
-e_card_name_to_string(const ECardName *name)
-{
- char *strings[6], **stringptr = strings;
-
- g_return_val_if_fail (name != NULL, NULL);
-
- if (name->prefix && *name->prefix)
- *(stringptr++) = name->prefix;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- if (name->additional && *name->additional)
- *(stringptr++) = name->additional;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->suffix && *name->suffix)
- *(stringptr++) = name->suffix;
- *stringptr = NULL;
- return g_strjoinv(" ", strings);
-}
-
-ECardName *
-e_card_name_from_string(const char *full_name)
-{
- ECardName *name = e_card_name_new ();
- ENameWestern *western = e_name_western_parse (full_name);
-
- name->prefix = g_strdup (western->prefix);
- name->given = g_strdup (western->first );
- name->additional = g_strdup (western->middle);
- name->family = g_strdup (western->last );
- name->suffix = g_strdup (western->suffix);
-
- e_name_western_free(western);
-
- return name;
-}
-
-ECardArbitrary *
-e_card_arbitrary_new(void)
-{
- ECardArbitrary *arbitrary = g_new(ECardArbitrary, 1);
- arbitrary->ref_count = 1;
- arbitrary->key = NULL;
- arbitrary->type = NULL;
- arbitrary->value = NULL;
- return arbitrary;
-}
-
-void
-e_card_arbitrary_unref(ECardArbitrary *arbitrary)
-{
- if (arbitrary) {
- arbitrary->ref_count --;
- if (arbitrary->ref_count == 0) {
- g_free(arbitrary->key);
- g_free(arbitrary->type);
- g_free(arbitrary->value);
- g_free(arbitrary);
- }
- }
-}
-
-ECardArbitrary *
-e_card_arbitrary_copy(const ECardArbitrary *arbitrary)
-{
- if (arbitrary) {
- ECardArbitrary *arb_copy = e_card_arbitrary_new ();
- arb_copy->key = g_strdup(arbitrary->key);
- arb_copy->type = g_strdup(arbitrary->type);
- arb_copy->value = g_strdup(arbitrary->value);
- return arb_copy;
- } else
- return NULL;
-}
-
-ECardArbitrary *
-e_card_arbitrary_ref(const ECardArbitrary *arbitrary)
-{
- ECardArbitrary *arbitrary_mutable = (ECardArbitrary *) arbitrary;
- if (arbitrary_mutable)
- arbitrary_mutable->ref_count ++;
- return arbitrary_mutable;
-}
-
-/* EMail matching */
-static gboolean
-e_card_email_match_single_string (const gchar *a, const gchar *b)
-{
- const gchar *xa = NULL, *xb = NULL;
- gboolean match = TRUE;
-
- for (xa=a; *xa && *xa != '@'; ++xa);
- for (xb=b; *xb && *xb != '@'; ++xb);
-
- if (xa-a != xb-b || *xa != *xb || g_ascii_strncasecmp (a, b, xa-a))
- return FALSE;
-
- if (*xa == '\0')
- return TRUE;
-
- /* Find the end of the string, then walk through backwards comparing.
- This is so that we'll match joe@foobar.com and joe@mail.foobar.com.
- */
- while (*xa)
- ++xa;
- while (*xb)
- ++xb;
-
- while (match && *xa != '@' && *xb != '@') {
- match = (tolower (*xa) == tolower (*xb));
- --xa;
- --xb;
- }
-
- match = match && ((tolower (*xa) == tolower (*xb)) || (*xa == '.') || (*xb == '.'));
-
- return match;
-}
-
-gboolean
-e_card_email_match_string (const ECard *card, const gchar *str)
-{
- EIterator *iter;
-
- g_return_val_if_fail (card && E_IS_CARD (card), FALSE);
- g_return_val_if_fail (str != NULL, FALSE);
-
- if (!card->email)
- return FALSE;
-
- iter = e_list_get_iterator (card->email);
- for (e_iterator_reset (iter); e_iterator_is_valid (iter); e_iterator_next (iter)) {
- if (e_card_email_match_single_string (e_iterator_get (iter), str))
- return TRUE;
- }
- g_object_unref (iter);
-
- return FALSE;
-}
-
-gint
-e_card_email_find_number (const ECard *card, const gchar *email)
-{
- EIterator *iter;
- gint count = 0;
-
- g_return_val_if_fail (E_IS_CARD (card), -1);
- g_return_val_if_fail (email != NULL, -1);
-
- if (!card->email)
- return -1;
-
- iter = e_list_get_iterator (card->email);
- for (e_iterator_reset (iter); e_iterator_is_valid (iter); e_iterator_next (iter)) {
- if (!g_ascii_strcasecmp (e_iterator_get (iter), email))
- goto finished;
- ++count;
- }
- count = -1;
-
- finished:
- g_object_unref (iter);
-
- return count;
-}
-
-/*
- * ECard lifecycle management and vCard loading/saving.
- */
-
-static void
-e_card_dispose (GObject *object)
-{
- ECard *card = E_CARD(object);
-
-#define FREE_IF(x) do { if ((x)) { g_free (x); x = NULL; } } while (0)
-#define UNREF_IF(x) do { if ((x)) { g_object_unref (x); x = NULL; } } while (0)
-
- FREE_IF (card->id);
- UNREF_IF (card->book);
- FREE_IF(card->file_as);
- FREE_IF(card->fname);
- if (card->name) {
- e_card_name_unref(card->name);
- card->name = NULL;
- }
- FREE_IF(card->bday);
-
- FREE_IF(card->url);
- FREE_IF(card->org);
- FREE_IF(card->org_unit);
- FREE_IF(card->office);
- FREE_IF(card->title);
- FREE_IF(card->role);
- FREE_IF(card->manager);
- FREE_IF(card->assistant);
- FREE_IF(card->nickname);
- FREE_IF(card->spouse);
- FREE_IF(card->anniversary);
- FREE_IF(card->caluri);
- FREE_IF(card->fburl);
- FREE_IF(card->icscalendar);
- FREE_IF(card->last_use);
- FREE_IF(card->note);
- FREE_IF(card->related_contacts);
-
- UNREF_IF (card->categories);
- UNREF_IF (card->email);
- UNREF_IF (card->phone);
- UNREF_IF (card->address);
- UNREF_IF (card->address_label);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-/* Set_arg handler for the card */
-static void
-e_card_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- ECard *card;
-
- card = E_CARD (object);
-
- switch (prop_id) {
- case PROP_FILE_AS:
- g_free(card->file_as);
- card->file_as = g_strdup(g_value_get_string (value));
- if (card->file_as == NULL)
- card->file_as = g_strdup("");
- break;
-
- case PROP_FULL_NAME:
- g_free(card->fname);
- card->fname = g_strdup(g_value_get_string (value));
- if (card->fname == NULL)
- card->fname = g_strdup("");
-
- e_card_name_unref (card->name);
- card->name = e_card_name_from_string (card->fname);
- break;
- case PROP_NAME:
- e_card_name_unref (card->name);
- card->name = e_card_name_ref(g_value_get_pointer (value));
- if (card->name == NULL)
- card->name = e_card_name_new();
- if (card->fname == NULL) {
- card->fname = e_card_name_to_string(card->name);
- }
- if (card->file_as == NULL) {
- ECardName *name = card->name;
- char *strings[3], **stringptr;
- char *string;
- stringptr = strings;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- *stringptr = NULL;
- string = g_strjoinv(", ", strings);
- card->file_as = string;
- }
- break;
- case PROP_CATEGORIES:
- if (card->categories)
- g_object_unref(card->categories);
- card->categories = NULL;
- if (g_value_get_string (value))
- do_parse_categories(card, (char*)g_value_get_string (value));
- break;
- case PROP_CATEGORY_LIST:
- if (card->categories)
- g_object_unref(card->categories);
- card->categories = E_LIST(g_value_get_object(value));
- if (card->categories)
- g_object_ref(card->categories);
- break;
- case PROP_BIRTH_DATE:
- g_free(card->bday);
- if (g_value_get_pointer (value)) {
- card->bday = g_new (ECardDate, 1);
- memcpy (card->bday, g_value_get_pointer (value), sizeof (ECardDate));
- } else {
- card->bday = NULL;
- }
- break;
- case PROP_URL:
- g_free(card->url);
- card->url = g_strdup(g_value_get_string(value));
- break;
- case PROP_ORG:
- g_free(card->org);
- card->org = g_strdup(g_value_get_string(value));
- break;
- case PROP_ORG_UNIT:
- g_free(card->org_unit);
- card->org_unit = g_strdup(g_value_get_string(value));
- break;
- case PROP_OFFICE:
- g_free(card->office);
- card->office = g_strdup(g_value_get_string(value));
- break;
- case PROP_TITLE:
- g_free(card->title);
- card->title = g_strdup(g_value_get_string(value));
- break;
- case PROP_ROLE:
- g_free(card->role);
- card->role = g_strdup(g_value_get_string(value));
- break;
- case PROP_MANAGER:
- g_free(card->manager);
- card->manager = g_strdup(g_value_get_string(value));
- break;
- case PROP_ASSISTANT:
- g_free(card->assistant);
- card->assistant = g_strdup(g_value_get_string(value));
- break;
- case PROP_NICKNAME:
- g_free(card->nickname);
- card->nickname = g_strdup(g_value_get_string(value));
- break;
- case PROP_SPOUSE:
- g_free(card->spouse);
- card->spouse = g_strdup(g_value_get_string(value));
- break;
- case PROP_ANNIVERSARY:
- g_free(card->anniversary);
- if (g_value_get_pointer (value)) {
- card->anniversary = g_new (ECardDate, 1);
- memcpy (card->anniversary, g_value_get_pointer (value), sizeof (ECardDate));
- } else {
- card->anniversary = NULL;
- }
- break;
- case PROP_MAILER:
- g_free(card->mailer);
- card->mailer = g_strdup(g_value_get_string(value));
- break;
- case PROP_CALURI:
- g_free(card->caluri);
- card->caluri = g_strdup(g_value_get_string(value));
- break;
- case PROP_FBURL:
- g_free(card->fburl);
- card->fburl = g_strdup(g_value_get_string(value));
- break;
- case PROP_ICSCALENDAR:
- g_free(card->icscalendar);
- card->icscalendar = g_strdup(g_value_get_string(value));
- break;
- case PROP_NOTE:
- g_free (card->note);
- card->note = g_strdup(g_value_get_string(value));
- break;
- case PROP_RELATED_CONTACTS:
- g_free (card->related_contacts);
- card->related_contacts = g_strdup(g_value_get_string(value));
- break;
- case PROP_WANTS_HTML:
- card->wants_html = g_value_get_boolean (value);
- card->wants_html_set = TRUE;
- break;
- case PROP_ARBITRARY:
- if (card->arbitrary)
- g_object_unref(card->arbitrary);
- card->arbitrary = E_LIST(g_value_get_pointer(value));
- if (card->arbitrary)
- g_object_ref(card->arbitrary);
- break;
- case PROP_ID:
- g_free(card->id);
- card->id = g_strdup(g_value_get_string(value));
- if (card->id == NULL)
- card->id = g_strdup ("");
- break;
- case PROP_LAST_USE:
- g_free(card->last_use);
- if (g_value_get_pointer (value)) {
- card->last_use = g_new (ECardDate, 1);
- memcpy (card->last_use, g_value_get_pointer (value), sizeof (ECardDate));
- } else {
- card->last_use = NULL;
- }
- break;
- case PROP_USE_SCORE:
- card->raw_use_score = g_value_get_float (value);
- break;
- case PROP_EVOLUTION_LIST:
- card->list = g_value_get_boolean (value);
- break;
- case PROP_EVOLUTION_LIST_SHOW_ADDRESSES:
- card->list_show_addresses = g_value_get_boolean (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Get_arg handler for the card */
-static void
-e_card_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- ECard *card;
-
- card = E_CARD (object);
-
- switch (prop_id) {
- case PROP_FILE_AS:
- g_value_set_string (value, card->file_as);
- break;
- case PROP_FULL_NAME:
- g_value_set_string (value, card->fname);
- break;
- case PROP_NAME:
- g_value_set_pointer (value, card->name);
- break;
- case PROP_ADDRESS:
- if (!card->address)
- card->address = e_list_new((EListCopyFunc) e_card_delivery_address_ref,
- (EListFreeFunc) e_card_delivery_address_unref,
- NULL);
- g_value_set_object (value, card->address);
- break;
- case PROP_ADDRESS_LABEL:
- if (!card->address_label)
- card->address_label = e_list_new((EListCopyFunc) e_card_address_label_ref,
- (EListFreeFunc) e_card_address_label_unref,
- NULL);
- g_value_set_object (value, card->address_label);
- break;
- case PROP_PHONE:
- if (!card->phone)
- card->phone = e_list_new((EListCopyFunc) e_card_phone_ref,
- (EListFreeFunc) e_card_phone_unref,
- NULL);
- g_value_set_object (value, card->phone);
- break;
- case PROP_EMAIL:
- if (!card->email)
- card->email = e_list_new((EListCopyFunc) g_strdup,
- (EListFreeFunc) g_free,
- NULL);
- g_value_set_object (value, card->email);
- break;
- case PROP_CATEGORIES:
- {
- int i;
- char ** strs;
- int length;
- EIterator *iterator;
- if (!card->categories)
- card->categories = e_list_new((EListCopyFunc) g_strdup,
- (EListFreeFunc) g_free,
- NULL);
- length = e_list_length(card->categories);
- strs = g_new(char *, length + 1);
- for (iterator = e_list_get_iterator(card->categories), i = 0; e_iterator_is_valid(iterator); e_iterator_next(iterator), i++) {
- strs[i] = (char *)e_iterator_get(iterator);
- }
- strs[i] = 0;
- g_value_set_string_take_ownership(value, g_strjoinv(", ", strs));
- g_free(strs);
- }
- break;
- case PROP_CATEGORY_LIST:
- if (!card->categories)
- card->categories = e_list_new((EListCopyFunc) g_strdup,
- (EListFreeFunc) g_free,
- NULL);
- g_value_set_object (value, card->categories);
- break;
- case PROP_BIRTH_DATE:
- g_value_set_pointer (value, card->bday);
- break;
- case PROP_URL:
- g_value_set_string (value, card->url);
- break;
- case PROP_ORG:
- g_value_set_string (value, card->org);
- break;
- case PROP_ORG_UNIT:
- g_value_set_string (value, card->org_unit);
- break;
- case PROP_OFFICE:
- g_value_set_string (value, card->office);
- break;
- case PROP_TITLE:
- g_value_set_string (value, card->title);
- break;
- case PROP_ROLE:
- g_value_set_string (value, card->role);
- break;
- case PROP_MANAGER:
- g_value_set_string (value, card->manager);
- break;
- case PROP_ASSISTANT:
- g_value_set_string (value, card->assistant);
- break;
- case PROP_NICKNAME:
- g_value_set_string (value, card->nickname);
- break;
- case PROP_SPOUSE:
- g_value_set_string (value, card->spouse);
- break;
- case PROP_ANNIVERSARY:
- g_value_set_pointer (value, card->anniversary);
- break;
- case PROP_MAILER:
- g_value_set_string (value, card->mailer);
- break;
- case PROP_CALURI:
- g_value_set_string (value, card->caluri);
- break;
- case PROP_FBURL:
- g_value_set_string (value, card->fburl);
- break;
- case PROP_ICSCALENDAR:
- g_value_set_string (value, card->icscalendar);
- break;
- case PROP_NOTE:
- g_value_set_string (value, card->note);
- break;
- case PROP_RELATED_CONTACTS:
- g_value_set_string (value, card->related_contacts);
- break;
- case PROP_WANTS_HTML:
- g_value_set_boolean (value, card->wants_html);
- break;
- case PROP_WANTS_HTML_SET:
- g_value_set_boolean (value, card->wants_html_set);
- break;
- case PROP_ARBITRARY:
- if (!card->arbitrary)
- card->arbitrary = e_list_new((EListCopyFunc) e_card_arbitrary_ref,
- (EListFreeFunc) e_card_arbitrary_unref,
- NULL);
-
- g_value_set_object (value, card->arbitrary);
- break;
- case PROP_ID:
- g_value_set_string (value, card->id);
- break;
- case PROP_LAST_USE:
- g_value_set_pointer (value, card->last_use);
- break;
- case PROP_USE_SCORE:
- g_value_set_float (value, e_card_get_use_score (card));
- break;
- case PROP_EVOLUTION_LIST:
- g_value_set_boolean (value, card->list);
- break;
- case PROP_EVOLUTION_LIST_SHOW_ADDRESSES:
- g_value_set_boolean (value, card->list_show_addresses);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-/**
- * e_card_init:
- */
-static void
-e_card_init (ECard *card)
-{
- card->id = g_strdup("");
-
- card->file_as = NULL;
- card->fname = NULL;
- card->name = NULL;
- card->bday = NULL;
- card->email = NULL;
- card->phone = NULL;
- card->address = NULL;
- card->address_label = NULL;
- card->url = NULL;
- card->org = NULL;
- card->org_unit = NULL;
- card->office = NULL;
- card->title = NULL;
- card->role = NULL;
- card->manager = NULL;
- card->assistant = NULL;
- card->nickname = NULL;
- card->spouse = NULL;
- card->anniversary = NULL;
- card->mailer = NULL;
- card->caluri = NULL;
- card->fburl = NULL;
- card->icscalendar = NULL;
- card->note = NULL;
- card->related_contacts = NULL;
- card->categories = NULL;
- card->wants_html = FALSE;
- card->wants_html_set = FALSE;
- card->list = FALSE;
- card->list_show_addresses = FALSE;
- card->arbitrary = NULL;
- card->last_use = NULL;
- card->raw_use_score = 0;
-}
-
-GList *
-e_card_load_cards_from_file_with_default_charset(const char *filename, char *default_charset)
-{
- VObject *vobj = Parse_MIME_FromFileName((char *) filename);
- GList *list = NULL;
- while(vobj) {
- VObject *next;
- ECard *card = g_object_new (E_TYPE_CARD, NULL);
- parse(card, vobj, default_charset);
- next = nextVObjectInList(vobj);
- cleanVObject(vobj);
- vobj = next;
- list = g_list_prepend(list, card);
- }
- list = g_list_reverse(list);
- return list;
-}
-
-GList *
-e_card_load_cards_from_file(const char *filename)
-{
- return e_card_load_cards_from_file_with_default_charset (filename, "UTF-8");
-}
-
-GList *
-e_card_load_cards_from_string_with_default_charset(const char *str, char *default_charset)
-{
- VObject *vobj = Parse_MIME(str, strlen (str));
- GList *list = NULL;
- while(vobj) {
- VObject *next;
- ECard *card = g_object_new (E_TYPE_CARD, NULL);
- parse(card, vobj, default_charset);
- next = nextVObjectInList(vobj);
- cleanVObject(vobj);
- vobj = next;
- list = g_list_prepend(list, card);
- }
- list = g_list_reverse(list);
- return list;
-}
-
-GList *
-e_card_load_cards_from_string(const char *str)
-{
- return e_card_load_cards_from_string_with_default_charset (str, "UTF-8");
-}
-
-void
-e_card_free_empty_lists (ECard *card)
-{
- if (card->address && e_list_length (card->address) == 0) {
- g_object_unref (card->address);
- card->address = NULL;
- }
-
- if (card->address_label && e_list_length (card->address_label) == 0) {
- g_object_unref (card->address_label);
- card->address_label = NULL;
- }
-
- if (card->phone && e_list_length (card->phone) == 0) {
- g_object_unref (card->phone);
- card->phone = NULL;
- }
-
- if (card->email && e_list_length (card->email) == 0) {
- g_object_unref (card->email);
- card->email = NULL;
- }
-
- if (card->categories && e_list_length (card->categories) == 0) {
- g_object_unref (card->categories);
- card->categories = NULL;
- }
-
- if (card->arbitrary && e_list_length (card->arbitrary) == 0) {
- g_object_unref (card->arbitrary);
- card->arbitrary = NULL;
- }
-}
-
-static void
-assign_string(VObject *vobj, char *default_charset, char **string)
-{
- int type = vObjectValueType(vobj);
- char *str;
- char *charset = default_charset;
- gboolean free_charset = FALSE;
- VObject *charset_obj;
-
- if ((charset_obj = isAPropertyOf (vobj, "CHARSET"))) {
- switch (vObjectValueType (charset_obj)) {
- case VCVT_STRINGZ:
- charset = (char *) vObjectStringZValue(charset_obj);
- break;
- case VCVT_USTRINGZ:
- charset = fakeCString (vObjectUStringZValue (charset_obj));
- free_charset = TRUE;
- break;
- }
- }
-
- switch(type) {
- case VCVT_STRINGZ:
- if (strcmp (charset, "UTF-8"))
- *string = e_utf8_from_charset_string (charset, vObjectStringZValue(vobj));
- else
- *string = g_strdup(vObjectStringZValue(vobj));
- break;
- case VCVT_USTRINGZ:
- str = fakeCString (vObjectUStringZValue (vobj));
- if (strcmp (charset, "UTF-8"))
- *string = e_utf8_from_charset_string (charset, str);
- else
- *string = g_strdup(str);
- free(str);
- break;
- default:
- *string = g_strdup("");
- break;
- }
-
- if (free_charset) {
- free (charset);
- }
-}
-
-
-ECardDate
-e_card_date_from_string (const char *str)
-{
- ECardDate date;
- int length;
-
- date.year = 0;
- date.month = 0;
- date.day = 0;
-
- length = strlen(str);
-
- if (length == 10 ) {
- date.year = str[0] * 1000 + str[1] * 100 + str[2] * 10 + str[3] - '0' * 1111;
- date.month = str[5] * 10 + str[6] - '0' * 11;
- date.day = str[8] * 10 + str[9] - '0' * 11;
- } else if ( length == 8 ) {
- date.year = str[0] * 1000 + str[1] * 100 + str[2] * 10 + str[3] - '0' * 1111;
- date.month = str[4] * 10 + str[5] - '0' * 11;
- date.day = str[6] * 10 + str[7] - '0' * 11;
- }
-
- return date;
-}
-
-char *
-e_v_object_get_child_value(VObject *vobj, char *name, char *default_charset)
-{
- char *ret_val;
- VObjectIterator iterator;
- gboolean free_charset = FALSE;
- VObject *charset_obj;
-
- if ((charset_obj = isAPropertyOf (vobj, "CHARSET"))) {
- switch (vObjectValueType (charset_obj)) {
- case VCVT_STRINGZ:
- default_charset = (char *) vObjectStringZValue(charset_obj);
- break;
- case VCVT_USTRINGZ:
- default_charset = fakeCString (vObjectUStringZValue (charset_obj));
- free_charset = TRUE;
- break;
- }
- }
-
- initPropIterator(&iterator, vobj);
- while(moreIteration (&iterator)) {
- VObject *attribute = nextVObject(&iterator);
- const char *id = vObjectName(attribute);
- if ( ! strcmp(id, name) ) {
- assign_string(attribute, default_charset, &ret_val);
- return ret_val;
- }
- }
- if (free_charset)
- free (default_charset);
-
- return NULL;
-}
-
-static struct {
- char *id;
- ECardPhoneFlags flag;
-} phone_pairs[] = {
- { VCPreferredProp, E_CARD_PHONE_PREF },
- { VCWorkProp, E_CARD_PHONE_WORK },
- { VCHomeProp, E_CARD_PHONE_HOME },
- { VCVoiceProp, E_CARD_PHONE_VOICE },
- { VCFaxProp, E_CARD_PHONE_FAX },
- { VCMessageProp, E_CARD_PHONE_MSG },
- { VCCellularProp, E_CARD_PHONE_CELL },
- { VCPagerProp, E_CARD_PHONE_PAGER },
- { VCBBSProp, E_CARD_PHONE_BBS },
- { VCModemProp, E_CARD_PHONE_MODEM },
- { VCCarProp, E_CARD_PHONE_CAR },
- { VCISDNProp, E_CARD_PHONE_ISDN },
- { VCVideoProp, E_CARD_PHONE_VIDEO },
- { "X-EVOLUTION-ASSISTANT", E_CARD_PHONE_ASSISTANT },
- { "X-EVOLUTION-CALLBACK", E_CARD_PHONE_CALLBACK },
- { "X-EVOLUTION-RADIO", E_CARD_PHONE_RADIO },
- { "X-EVOLUTION-TELEX", E_CARD_PHONE_TELEX },
- { "X-EVOLUTION-TTYTDD", E_CARD_PHONE_TTYTDD },
-};
-
-static ECardPhoneFlags
-get_phone_flags (VObject *vobj)
-{
- ECardPhoneFlags ret = 0;
- int i;
-
- for (i = 0; i < sizeof(phone_pairs) / sizeof(phone_pairs[0]); i++) {
- if (isAPropertyOf (vobj, phone_pairs[i].id)) {
- ret |= phone_pairs[i].flag;
- }
- }
-
- return ret;
-}
-
-static void
-set_phone_flags (VObject *vobj, ECardPhoneFlags flags)
-{
- int i;
-
- for (i = 0; i < sizeof(phone_pairs) / sizeof(phone_pairs[0]); i++) {
- if (flags & phone_pairs[i].flag) {
- addProp (vobj, phone_pairs[i].id);
- }
- }
-}
-
-static struct {
- char *id;
- ECardAddressFlags flag;
-} addr_pairs[] = {
- { VCDomesticProp, E_CARD_ADDR_DOM },
- { VCInternationalProp, E_CARD_ADDR_INTL },
- { VCPostalProp, E_CARD_ADDR_POSTAL },
- { VCParcelProp, E_CARD_ADDR_PARCEL },
- { VCHomeProp, E_CARD_ADDR_HOME },
- { VCWorkProp, E_CARD_ADDR_WORK },
- { "PREF", E_CARD_ADDR_DEFAULT },
-};
-
-static ECardAddressFlags
-get_address_flags (VObject *vobj)
-{
- ECardAddressFlags ret = 0;
- int i;
-
- for (i = 0; i < sizeof(addr_pairs) / sizeof(addr_pairs[0]); i++) {
- if (isAPropertyOf (vobj, addr_pairs[i].id)) {
- ret |= addr_pairs[i].flag;
- }
- }
-
- return ret;
-}
-
-static void
-set_address_flags (VObject *vobj, ECardAddressFlags flags)
-{
- int i;
-
- for (i = 0; i < sizeof(addr_pairs) / sizeof(addr_pairs[0]); i++) {
- if (flags & addr_pairs[i].flag) {
- addProp (vobj, addr_pairs[i].id);
- }
- }
-}
-
-gboolean
-e_card_evolution_list (ECard *card)
-{
- g_return_val_if_fail (card && E_IS_CARD (card), FALSE);
- return card->list;
-}
-
-gboolean
-e_card_evolution_list_show_addresses (ECard *card)
-{
- g_return_val_if_fail (card && E_IS_CARD (card), FALSE);
- return card->list_show_addresses;
-}
-
-typedef struct _CardLoadData CardLoadData;
-struct _CardLoadData {
- gchar *card_id;
- ECardCallback cb;
- gpointer closure;
-};
-
-static void
-get_card_cb (EBook *book, EBookStatus status, ECard *card, gpointer closure)
-{
- CardLoadData *data = (CardLoadData *) closure;
-
- if (data->cb != NULL) {
- if (status == E_BOOK_STATUS_SUCCESS)
- data->cb (card, data->closure);
- else
- data->cb (NULL, data->closure);
- }
-
- g_free (data->card_id);
- g_free (data);
-}
-
-static void
-card_load_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- CardLoadData *data = (CardLoadData *) closure;
-
- if (status == E_BOOK_STATUS_SUCCESS)
- e_book_get_card (book, data->card_id, get_card_cb, closure);
- else {
- data->cb (NULL, data->closure);
- g_free (data->card_id);
- g_free (data);
- }
-}
-
-void
-e_card_load_uri (const gchar *book_uri, const gchar *uid, ECardCallback cb, gpointer closure)
-{
- CardLoadData *data;
- EBook *book;
-
- data = g_new (CardLoadData, 1);
- data->card_id = g_strdup (uid);
- data->cb = cb;
- data->closure = closure;
-
- book = e_book_new ();
- e_book_load_uri (book, book_uri, card_load_cb, data);
-}
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
deleted file mode 100644
index d82d5f4cb6..0000000000
--- a/addressbook/backend/ebook/e-card.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Arturo Espinosa
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 1999 The Free Software Foundation
- */
-
-#ifndef __E_CARD_H__
-#define __E_CARD_H__
-
-#include <time.h>
-#include <glib-object.h>
-#include <stdio.h>
-#include <ebook/e-card-types.h>
-#include <e-util/e-list.h>
-
-#define E_TYPE_CARD (e_card_get_type ())
-#define E_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CARD, ECard))
-#define E_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CARD, ECardClass))
-#define E_IS_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CARD))
-#define E_IS_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CARD))
-#define E_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_CARD, ECardClass))
-
-typedef struct _ECard ECard;
-typedef struct _ECardClass ECardClass;
-
-struct _EBook; /* Forward reference */
-
-struct _ECard {
- GObject object;
- char *id;
-
- struct _EBook *book; /* The EBook this card is from. */
-
- char *file_as; /* The File As field. */
- char *fname; /* The full name. */
- ECardName *name; /* The structured name. */
- EList *address; /* Delivery addresses (ECardDeliveryAddress *) */
- EList *address_label; /* Delivery address labels
- * (ECardAddrLabel *) */
-
- EList *phone; /* Phone numbers (ECardPhone *) */
- EList *email; /* Email addresses (char *) */
- char *url; /* The person's web page. */
-
- ECardDate *bday; /* The person's birthday. */
-
- char *note;
-
-
- char *org; /* The person's organization. */
- char *org_unit; /* The person's organization unit. */
- char *office; /* The person's office. */
- char *role; /* The person's role w/in his org */
- char *title; /* The person's title w/in his org */
-
- char *manager;
- char *assistant;
-
- char *nickname; /* The person's nickname */
-
- char *spouse; /* The person's spouse. */
- ECardDate *anniversary; /* The person's anniversary. */
-
- char *mailer; /* Mailer */
-
- char *caluri; /* Calendar URI */
- char *fburl; /* Free Busy URL */
- char *icscalendar; /* Default server calendar */
-
- gint timezone; /* number of minutes from UTC as an int */
-
- ECardDate *last_use;
- float raw_use_score;
-
- char *related_contacts; /* EDestinationV (serialized) of related contacts. */
-
- EList *categories; /* Categories. */
-
- EList *arbitrary; /* Arbitrary fields. */
-
-
-
- guint32 wants_html : 1; /* Wants html mail. */
- guint32 wants_html_set : 1; /* Wants html mail. */
- guint32 list : 1; /* If the card corresponds to a contact list */
- guint32 list_show_addresses : 1; /* Whether to show the addresses
- in the To: or Bcc: field */
-
-#if 0
- ECardPhoto *logo; /* This person's org's logo. */
-
- ECardPhoto *photo; /* A photo of the person. */
-
- ECard *agent; /* A person who sereves as this
- guy's agent/secretary/etc. */
-
- ECardSound *sound;
-
- ECardKey *key; /* The person's public key. */
- ECardTimeZone *timezn; /* The person's time zone. */
- ECardGeoPos *geopos; /* The person's long/lat. */
-
- ECardRev *rev; /* The time this card was last
- modified. */
-
- EList xtension;
-#endif
-};
-
-struct _ECardClass {
- GObjectClass parent_class;
- GHashTable *attribute_jump_table;
-};
-
-
-/* Simple functions */
-ECard *e_card_new (char *vcard); /* Assumes utf8 */
-ECard *e_card_new_with_default_charset (char *vcard,
- char *default_charset);
-const char *e_card_get_id (ECard *card);
-void e_card_set_id (ECard *card,
- const char *character);
-
-struct _EBook *e_card_get_book (ECard *card);
-void e_card_set_book (ECard *card,
- struct _EBook *book);
-char *e_card_get_vcard (ECard *card);
-char *e_card_get_vcard_assume_utf8 (ECard *card);
-char *e_card_list_get_vcard (const GList *list);
-ECard *e_card_duplicate (ECard *card);
-float e_card_get_use_score (ECard *card);
-void e_card_touch (ECard *card);
-
-/* Evolution List convenience functions */
-/* used for encoding uids in email addresses */
-gboolean e_card_evolution_list (ECard *card);
-gboolean e_card_evolution_list_show_addresses (ECard *card);
-
-/* ECardPhone manipulation */
-ECardPhone *e_card_phone_new (void);
-ECardPhone *e_card_phone_copy (const ECardPhone *phone);
-ECardPhone *e_card_phone_ref (const ECardPhone *phone);
-void e_card_phone_unref (ECardPhone *phone);
-
-/* ECardDeliveryAddress manipulation */
-ECardDeliveryAddress *e_card_delivery_address_new (void);
-ECardDeliveryAddress *e_card_delivery_address_copy (const ECardDeliveryAddress *addr);
-ECardDeliveryAddress *e_card_delivery_address_ref (const ECardDeliveryAddress *addr);
-void e_card_delivery_address_unref (ECardDeliveryAddress *addr);
-gboolean e_card_delivery_address_is_empty (const ECardDeliveryAddress *addr);
-char *e_card_delivery_address_to_string (const ECardDeliveryAddress *addr);
-ECardDeliveryAddress *e_card_delivery_address_from_label (const ECardAddrLabel *label);
-ECardAddrLabel *e_card_delivery_address_to_label (const ECardDeliveryAddress *addr);
-
-/* ECardAddrLabel manipulation */
-ECardAddrLabel *e_card_address_label_new (void);
-ECardAddrLabel *e_card_address_label_copy (const ECardAddrLabel *addr);
-ECardAddrLabel *e_card_address_label_ref (const ECardAddrLabel *addr);
-void e_card_address_label_unref (ECardAddrLabel *addr);
-
-/* ECardName manipulation */
-ECardName *e_card_name_new (void);
-ECardName *e_card_name_copy (const ECardName *name);
-ECardName *e_card_name_ref (const ECardName *name);
-void e_card_name_unref (ECardName *name);
-char *e_card_name_to_string (const ECardName *name);
-ECardName *e_card_name_from_string (const char *full_name);
-
-/* ECardDate */
-ECardDate e_card_date_from_string (const gchar *str);
-gchar *e_card_date_to_string (ECardDate *dt);
-
-/* ECardArbitrary manipulation */
-ECardArbitrary *e_card_arbitrary_new (void);
-ECardArbitrary *e_card_arbitrary_copy (const ECardArbitrary *arbitrary);
-ECardArbitrary *e_card_arbitrary_ref (const ECardArbitrary *arbitrary);
-void e_card_arbitrary_unref (ECardArbitrary *arbitrary);
-
-/* ECard email manipulation */
-gboolean e_card_email_match_string (const ECard *card,
- const gchar *str);
-gint e_card_email_find_number (const ECard *card,
- const gchar *email);
-
-/* Specialized functionality */
-GList *e_card_load_cards_from_file (const char *filename);
-GList *e_card_load_cards_from_file_with_default_charset (const char *filename,
- char *default_charset);
-GList *e_card_load_cards_from_string (const char *str);
-GList *e_card_load_cards_from_string_with_default_charset (const char *str,
- char *default_charset);
-void e_card_free_empty_lists (ECard *card);
-
-/* Getting ECards via their URIs */
-typedef void (*ECardCallback) (ECard *card, gpointer closure);
-void e_card_load_uri (const gchar *book_uri,
- const gchar *uid,
- ECardCallback cb,
- gpointer closure);
-
-
-GType e_card_get_type (void);
-
-#endif /* ! __E_CARD_H__ */
diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c
deleted file mode 100644
index 7ddae75b48..0000000000
--- a/addressbook/backend/ebook/e-destination.c
+++ /dev/null
@@ -1,1695 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-destination.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include "e-destination.h"
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include "e-book.h"
-#include "e-book-marshal.h"
-#include "e-book-util.h"
-#include <gal/widgets/e-unicode.h>
-
-#include <glib.h>
-#include <libxml/xmlmemory.h>
-#include <camel/camel-internet-address.h>
-
-#define d(x)
-
-enum {
- CHANGED,
- CARDIFIED,
- LAST_SIGNAL
-};
-
-guint e_destination_signals[LAST_SIGNAL] = { 0 };
-
-struct _EDestinationPrivate {
- gchar *raw;
-
- gchar *book_uri;
- gchar *card_uid;
- ECard *card;
- gint card_email_num;
-
- ECard *old_card;
- gint old_card_email_num;
- gchar *old_textrep;
-
- gchar *name;
- gchar *email;
- gchar *addr;
- gchar *textrep;
-
- GList *list_dests;
-
- guint html_mail_override : 1;
- guint wants_html_mail : 1;
-
- guint show_addresses : 1;
-
- guint has_been_cardified : 1;
- guint allow_cardify : 1;
- guint cannot_cardify : 1;
- guint auto_recipient : 1;
- guint pending_cardification;
-
- guint pending_change : 1;
-
- EBook *cardify_book;
-
- gint freeze_count;
-};
-
-static void e_destination_clear_card (EDestination *);
-static void e_destination_clear_strings (EDestination *);
-
-static GObjectClass *parent_class;
-
-static void
-e_destination_dispose (GObject *obj)
-{
- EDestination *dest = E_DESTINATION (obj);
-
- if (dest->priv) {
- e_destination_clear (dest);
-
- if (dest->priv->old_card)
- g_object_unref (dest->priv->old_card);
-
- if (dest->priv->cardify_book)
- g_object_unref (dest->priv->cardify_book);
-
- g_free (dest->priv->old_textrep);
-
- g_free (dest->priv);
- dest->priv = NULL;
- }
-}
-
-static void
-e_destination_class_init (EDestinationClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- object_class->dispose = e_destination_dispose;
-
- e_destination_signals[CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EDestinationClass, changed),
- NULL, NULL,
- e_book_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_destination_signals[CARDIFIED] =
- g_signal_new ("cardified",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EDestinationClass, cardified),
- NULL, NULL,
- e_book_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-e_destination_init (EDestination *dest)
-{
- dest->priv = g_new0 (struct _EDestinationPrivate, 1);
-
- dest->priv->allow_cardify = TRUE;
- dest->priv->cannot_cardify = FALSE;
- dest->priv->auto_recipient = FALSE;
- dest->priv->pending_cardification = 0;
-}
-
-GType
-e_destination_get_type (void)
-{
- static GType dest_type = 0;
-
- if (!dest_type) {
- GTypeInfo dest_info = {
- sizeof (EDestinationClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) e_destination_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EDestination),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_destination_init
- };
-
- dest_type = g_type_register_static (G_TYPE_OBJECT, "EDestination", &dest_info, 0);
- }
-
- return dest_type;
-}
-
-EDestination *
-e_destination_new (void)
-{
- return g_object_new (E_TYPE_DESTINATION, NULL);
-}
-
-static void
-e_destination_freeze (EDestination *dest)
-{
- g_return_if_fail (E_IS_DESTINATION (dest));
- g_return_if_fail (dest->priv->freeze_count >= 0);
-
- dest->priv->freeze_count++;
-}
-
-static void
-e_destination_thaw (EDestination *dest)
-{
- g_return_if_fail (E_IS_DESTINATION (dest));
- g_return_if_fail (dest->priv->freeze_count > 0);
-
- dest->priv->freeze_count--;
- if (dest->priv->freeze_count == 0 && dest->priv->pending_change)
- e_destination_changed (dest);
-}
-
-void
-e_destination_changed (EDestination *dest)
-{
- if (dest->priv->freeze_count == 0) {
- g_signal_emit (dest, e_destination_signals[CHANGED], 0);
- dest->priv->pending_change = FALSE;
- dest->priv->cannot_cardify = FALSE;
-
- } else {
- dest->priv->pending_change = TRUE;
- }
-}
-
-EDestination *
-e_destination_copy (const EDestination *dest)
-{
- EDestination *new_dest;
- GList *iter;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- new_dest = e_destination_new ();
-
- new_dest->priv->book_uri = g_strdup (dest->priv->book_uri);
- new_dest->priv->card_uid = g_strdup (dest->priv->card_uid);
- new_dest->priv->name = g_strdup (dest->priv->name);
- new_dest->priv->email = g_strdup (dest->priv->email);
- new_dest->priv->addr = g_strdup (dest->priv->addr);
- new_dest->priv->card_email_num = dest->priv->card_email_num;
- new_dest->priv->old_card_email_num = dest->priv->old_card_email_num;
- new_dest->priv->old_textrep = g_strdup (dest->priv->old_textrep);
-
- new_dest->priv->card = dest->priv->card;
- if (new_dest->priv->card)
- g_object_ref (new_dest->priv->card);
-
- new_dest->priv->old_card = dest->priv->old_card;
- if (new_dest->priv->old_card)
- g_object_ref (new_dest->priv->old_card);
-
- new_dest->priv->html_mail_override = dest->priv->html_mail_override;
- new_dest->priv->wants_html_mail = dest->priv->wants_html_mail;
-
- for (iter = dest->priv->list_dests; iter != NULL; iter = g_list_next (iter)) {
- new_dest->priv->list_dests = g_list_append (new_dest->priv->list_dests,
- e_destination_copy (E_DESTINATION (iter->data)));
- }
-
- return new_dest;
-}
-
-static void
-e_destination_clear_card (EDestination *dest)
-{
- if (dest->priv->card) {
- if (dest->priv->old_card)
- g_object_unref (dest->priv->old_card);
-
- dest->priv->old_card = dest->priv->card;
- dest->priv->old_card_email_num = dest->priv->card_email_num;
-
- g_free (dest->priv->old_textrep);
- dest->priv->old_textrep = g_strdup (e_destination_get_textrep (dest, FALSE));
- }
-
- g_free (dest->priv->book_uri);
- dest->priv->book_uri = NULL;
- g_free (dest->priv->card_uid);
- dest->priv->card_uid = NULL;
-
- dest->priv->card = NULL;
- dest->priv->card_email_num = -1;
-
- g_list_foreach (dest->priv->list_dests, (GFunc) g_object_unref, NULL);
- g_list_free (dest->priv->list_dests);
- dest->priv->list_dests = NULL;
-
- dest->priv->allow_cardify = TRUE;
- dest->priv->cannot_cardify = FALSE;
-
- e_destination_cancel_cardify (dest);
-
- e_destination_changed (dest);
-}
-
-static void
-e_destination_clear_strings (EDestination *dest)
-{
- g_free (dest->priv->raw);
- dest->priv->raw = NULL;
-
- g_free (dest->priv->name);
- dest->priv->name = NULL;
-
- g_free (dest->priv->email);
- dest->priv->email = NULL;
-
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
-
- g_free (dest->priv->textrep);
- dest->priv->textrep = NULL;
-
- e_destination_changed (dest);
-}
-
-void
-e_destination_clear (EDestination *dest)
-{
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- e_destination_freeze (dest);
-
- e_destination_clear_card (dest);
- e_destination_clear_strings (dest);
-
- e_destination_thaw (dest);
-}
-
-static gboolean
-nonempty (const gchar *s)
-{
- gunichar c;
- while (*s) {
- c = g_utf8_get_char (s);
- if (!g_unichar_isspace (c))
- return TRUE;
- s = g_utf8_next_char (s);
- }
- return FALSE;
-}
-
-gboolean
-e_destination_is_empty (const EDestination *dest)
-
-{
- struct _EDestinationPrivate *p;
-
- g_return_val_if_fail (E_IS_DESTINATION (dest), TRUE);
-
- p = dest->priv;
-
- return !(p->card != NULL
- || (p->book_uri && *p->book_uri)
- || (p->card_uid && *p->card_uid)
- || (p->raw && nonempty (p->raw))
- || (p->name && nonempty (p->name))
- || (p->email && nonempty (p->email))
- || (p->addr && nonempty (p->addr))
- || (p->list_dests != NULL));
-}
-
-gboolean
-e_destination_is_valid (const EDestination *dest)
-{
- const char *email;
-
- g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
-
- if (e_destination_from_card (dest))
- return TRUE;
-
- email = e_destination_get_email (dest);
-
- /* FIXME: if we really wanted to get fancy here, we could
- check to make sure that the address was valid according to
- rfc822's addr-spec grammar. */
-
- return email && *email && strchr (email, '@');
-}
-
-gboolean
-e_destination_equal (const EDestination *a, const EDestination *b)
-{
- const struct _EDestinationPrivate *pa, *pb;
- const char *na, *nb;
-
- g_return_val_if_fail (E_IS_DESTINATION (a), FALSE);
- g_return_val_if_fail (E_IS_DESTINATION (b), FALSE);
-
- if (a == b)
- return TRUE;
-
- pa = a->priv;
- pb = b->priv;
-
- /* Check equality of cards. */
- if (pa->card || pb->card) {
- if (! (pa->card && pb->card))
- return FALSE;
-
- if (pa->card == pb->card || !strcmp (e_card_get_id (pa->card), e_card_get_id (pb->card)))
- return TRUE;
-
- return FALSE;
- }
-
- /* Just in case name returns NULL */
- na = e_destination_get_name (a);
- nb = e_destination_get_name (b);
- if ((na || nb) && !(na && nb && ! e_utf8_casefold_collate (na, nb)))
- return FALSE;
-
- if (!g_ascii_strcasecmp (e_destination_get_email (a), e_destination_get_email (b)))
- return TRUE;
- else
- return FALSE;
-}
-
-void
-e_destination_set_card (EDestination *dest, ECard *card, gint email_num)
-{
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
- g_return_if_fail (card && E_IS_CARD (card));
-
- if (dest->priv->card != card || dest->priv->card_email_num != email_num) {
- /* We have to freeze/thaw around these operations so that the 'changed'
- signals don't cause the EDestination's internal state to be altered
- before we can finish setting ->card && ->card_email_num. */
- e_destination_freeze (dest);
- e_destination_clear (dest);
-
- dest->priv->card = card;
- g_object_ref (dest->priv->card);
-
- dest->priv->card_email_num = email_num;
-
- e_destination_changed (dest);
- e_destination_thaw (dest);
- }
-}
-
-void
-e_destination_set_book_uri (EDestination *dest, const gchar *uri)
-{
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
- g_return_if_fail (uri != NULL);
-
- if (dest->priv->book_uri == NULL || strcmp (dest->priv->book_uri, uri)) {
- g_free (dest->priv->book_uri);
- dest->priv->book_uri = g_strdup (uri);
-
- /* If we already have a card, remove it unless it's uri matches the one
- we just set. */
- if (dest->priv->card) {
- EBook *book = e_card_get_book (dest->priv->card);
- if ((!book) || strcmp (uri, e_book_get_uri (book))) {
- g_object_unref (dest->priv->card);
- dest->priv->card = NULL;
- }
- }
-
- e_destination_changed (dest);
- }
-}
-
-void
-e_destination_set_card_uid (EDestination *dest, const gchar *uid, gint email_num)
-{
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
- g_return_if_fail (uid != NULL);
-
- if (dest->priv->card_uid == NULL
- || strcmp (dest->priv->card_uid, uid)
- || dest->priv->card_email_num != email_num) {
-
- g_free (dest->priv->card_uid);
- dest->priv->card_uid = g_strdup (uid);
- dest->priv->card_email_num = email_num;
-
- /* If we already have a card, remove it unless it's uri matches the one
- we just set. */
- if (dest->priv->card && strcmp (uid, e_card_get_id (dest->priv->card))) {
- g_object_unref (dest->priv->card);
- dest->priv->card = NULL;
- }
-
- e_destination_changed (dest);
- }
-}
-
-void
-e_destination_set_name (EDestination *dest, const gchar *name)
-{
- gboolean changed = FALSE;
-
- g_return_if_fail (E_IS_DESTINATION (dest));
-
- if (name == NULL) {
- if (dest->priv->name != NULL) {
- g_free (dest->priv->name);
- dest->priv->name = NULL;
- changed = TRUE;
- }
- } else if (dest->priv->name == NULL || strcmp (dest->priv->name, name)) {
- g_free (dest->priv->name);
- dest->priv->name = g_strdup (name);
- changed = TRUE;
- }
-
- if (changed) {
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
- g_free (dest->priv->textrep);
- dest->priv->textrep = NULL;
- e_destination_changed (dest);
- }
-}
-
-void
-e_destination_set_email (EDestination *dest, const gchar *email)
-{
- gboolean changed = FALSE;
-
- g_return_if_fail (E_IS_DESTINATION (dest));
-
- if (email == NULL) {
- if (dest->priv->email != NULL) {
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
- changed = TRUE;
- }
- } else if (dest->priv->email == NULL || strcmp (dest->priv->email, email)) {
- g_free (dest->priv->email);
- dest->priv->email = g_strdup (email);
- changed = TRUE;
- }
-
- if (changed) {
- g_free (dest->priv->addr);
- dest->priv->addr = NULL;
- g_free (dest->priv->textrep);
- dest->priv->textrep = NULL;
- e_destination_changed (dest);
- }
-}
-
-void
-e_destination_set_html_mail_pref (EDestination *dest, gboolean x)
-{
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- dest->priv->html_mail_override = TRUE;
- if (dest->priv->wants_html_mail != x) {
- dest->priv->wants_html_mail = x;
- e_destination_changed (dest);
- }
-}
-
-gboolean
-e_destination_contains_card (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
- return dest->priv->card != NULL;
-}
-
-gboolean
-e_destination_from_card (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
- return dest->priv->card != NULL || dest->priv->book_uri != NULL || dest->priv->card_uid != NULL;
-}
-
-gboolean
-e_destination_is_auto_recipient (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
-
- return dest->priv->auto_recipient;
-}
-
-void
-e_destination_set_auto_recipient (EDestination *dest, gboolean value)
-{
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- dest->priv->auto_recipient = value;
-}
-
-typedef struct _UseCard UseCard;
-struct _UseCard {
- EDestination *dest;
- EDestinationCardCallback cb;
- gpointer closure;
-};
-
-static void
-use_card_cb (ECard *card, gpointer closure)
-{
- UseCard *uc = (UseCard *) closure;
-
- if (card != NULL && uc->dest->priv->card == NULL) {
- uc->dest->priv->card = card;
- g_object_ref (uc->dest->priv->card);
- e_destination_changed (uc->dest);
- }
-
- if (uc->cb) {
- uc->cb (uc->dest, uc->dest->priv->card, uc->closure);
- }
-
- /* We held a copy of the destination during the callback. */
- g_object_unref (uc->dest);
- g_free (uc);
-}
-
-void
-e_destination_use_card (EDestination *dest, EDestinationCardCallback cb, gpointer closure)
-{
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- if (dest->priv->card != NULL) {
- if (cb)
- cb (dest, dest->priv->card, closure);
- } else if (dest->priv->book_uri != NULL && dest->priv->card_uid != NULL) {
- UseCard *uc = g_new (UseCard, 1);
-
- uc->dest = dest;
- /* Hold a reference to the destination during the callback. */
- g_object_ref (uc->dest);
- uc->cb = cb;
- uc->closure = closure;
- e_card_load_uri (dest->priv->book_uri, dest->priv->card_uid, use_card_cb, uc);
- } else {
- if (cb)
- cb (dest, NULL, closure);
- }
-}
-
-ECard *
-e_destination_get_card (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- return dest->priv->card;
-}
-
-const gchar *
-e_destination_get_card_uid (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- if (dest->priv->card_uid)
- return dest->priv->card_uid;
-
- if (dest->priv->card)
- return e_card_get_id (dest->priv->card);
-
- return NULL;
-}
-
-const gchar *
-e_destination_get_book_uri (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- if (dest->priv->book_uri)
- return dest->priv->book_uri;
-
- if (dest->priv->card) {
- EBook *book = e_card_get_book (dest->priv->card);
-
- if (book) {
- return e_book_get_uri (book);
- }
- }
-
- return NULL;
-}
-
-gint
-e_destination_get_email_num (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), -1);
-
- if (dest->priv->card == NULL && (dest->priv->book_uri == NULL || dest->priv->card_uid == NULL))
- return -1;
-
- return dest->priv->card_email_num;
-}
-
-const gchar *
-e_destination_get_name (const EDestination *dest)
-{
- struct _EDestinationPrivate *priv;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
-
- if (priv->name == NULL) {
- if (priv->card != NULL) {
- priv->name = e_card_name_to_string (priv->card->name);
-
- if (priv->name == NULL || *priv->name == '\0') {
- g_free (priv->name);
- priv->name = g_strdup (priv->card->file_as);
- }
-
- if (priv->name == NULL || *priv->name == '\0') {
- g_free (priv->name);
- if (e_card_evolution_list (priv->card))
- priv->name = g_strdup (_("Unnamed List"));
- else
- priv->name = g_strdup (e_destination_get_email (dest));
- }
- } else if (priv->raw != NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
- const char *camel_name = NULL;
-
- camel_internet_address_get (addr, 0, &camel_name, NULL);
- priv->name = g_strdup (camel_name);
- }
-
- camel_object_unref (CAMEL_OBJECT (addr));
- }
- }
-
- return priv->name;
-}
-
-const gchar *
-e_destination_get_email (const EDestination *dest)
-{
- struct _EDestinationPrivate *priv;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
-
- if (priv->email == NULL) {
- if (priv->card != NULL) {
- /* Pull the address out of the card. */
- if (priv->card->email) {
- EIterator *iter = e_list_get_iterator (priv->card->email);
- int n = priv->card_email_num;
-
- if (n >= 0) {
- while (n > 0) {
- e_iterator_next (iter);
- n--;
- }
-
- if (e_iterator_is_valid (iter)) {
- gconstpointer ptr = e_iterator_get (iter);
- priv->email = g_strdup ((char *) ptr);
- }
- }
- }
- } else if (priv->raw != NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
- const gchar *camel_email = NULL;
- camel_internet_address_get (addr, 0, NULL, &camel_email);
- priv->email = g_strdup (camel_email);
- }
-
- camel_object_unref (CAMEL_OBJECT (addr));
- }
-
- /* Force e-mail to be non-null... */
- if (priv->email == NULL) {
- priv->email = g_strdup ("");
- }
- }
-
- return priv->email;
-}
-
-const gchar *
-e_destination_get_address (const EDestination *dest)
-{
- struct _EDestinationPrivate *priv;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
-
- if (priv->addr == NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- if (e_destination_is_evolution_list (dest)) {
- GList *iter = dest->priv->list_dests;
-
- while (iter) {
- EDestination *list_dest = E_DESTINATION (iter->data);
-
- if (!e_destination_is_empty (list_dest)) {
- camel_internet_address_add (addr,
- e_destination_get_name (list_dest),
- e_destination_get_email (list_dest));
- }
- iter = g_list_next (iter);
- }
-
- priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
- } else if (priv->raw) {
-
- if (camel_address_unformat (CAMEL_ADDRESS (addr), priv->raw)) {
- priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
- }
- } else {
- camel_internet_address_add (addr,
- e_destination_get_name (dest),
- e_destination_get_email (dest));
-
- priv->addr = camel_address_encode (CAMEL_ADDRESS (addr));
- }
-
- camel_object_unref (CAMEL_OBJECT (addr));
- }
-
- return priv->addr;
-}
-
-void
-e_destination_set_raw (EDestination *dest, const gchar *raw)
-{
- g_return_if_fail (E_IS_DESTINATION (dest));
- g_return_if_fail (raw != NULL);
-
- if (dest->priv->raw == NULL || strcmp (dest->priv->raw, raw)) {
- e_destination_freeze (dest);
-
- e_destination_clear (dest);
- dest->priv->raw = g_strdup (raw);
- e_destination_changed (dest);
-
- e_destination_thaw (dest);
- }
-}
-
-const gchar *
-e_destination_get_textrep (const EDestination *dest, gboolean include_email)
-{
- const char *name, *email;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- if (dest->priv->raw)
- return dest->priv->raw;
-
- name = e_destination_get_name (dest);
- email = e_destination_get_email (dest);
-
- if (e_destination_from_card (dest) && name != NULL && (!include_email || !email || !*email))
- return name;
-
- /* Make sure that our address gets quoted properly */
- if (name && email && dest->priv->textrep == NULL) {
- CamelInternetAddress *addr = camel_internet_address_new ();
-
- camel_internet_address_add (addr, name, email);
- g_free (dest->priv->textrep);
- dest->priv->textrep = camel_address_format (CAMEL_ADDRESS (addr));
- camel_object_unref (CAMEL_OBJECT (addr));
- }
-
- if (dest->priv->textrep != NULL)
- return dest->priv->textrep;
-
- if (email)
- return email;
-
- return "";
-}
-
-gboolean
-e_destination_is_evolution_list (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
-
- if (dest->priv->list_dests == NULL
- && dest->priv->card != NULL
- && dest->priv->card->email != NULL
- && e_card_evolution_list (dest->priv->card)) {
-
- EIterator *iter = e_list_get_iterator (dest->priv->card->email);
-
- e_iterator_reset (iter);
- while (e_iterator_is_valid (iter)) {
- const char *dest_xml = (const char *) e_iterator_get (iter);
- EDestination *list_dest = e_destination_import (dest_xml);
-
- if (list_dest)
- dest->priv->list_dests = g_list_append (dest->priv->list_dests, list_dest);
- e_iterator_next (iter);
- }
- }
-
- return dest->priv->list_dests != NULL;
-}
-
-gboolean
-e_destination_list_show_addresses (const EDestination *dest)
-{
- g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
-
- if (dest->priv->card != NULL)
- return e_card_evolution_list_show_addresses (dest->priv->card);
-
- return dest->priv->show_addresses;
-}
-
-gboolean
-e_destination_get_html_mail_pref (const EDestination *dest)
-{
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
-
- if (dest->priv->html_mail_override || dest->priv->card == NULL)
- return dest->priv->wants_html_mail;
-
- return dest->priv->card->wants_html;
-}
-
-gboolean
-e_destination_allow_cardification (const EDestination *dest)
-{
- g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
-
- return dest->priv->allow_cardify;
-}
-
-void
-e_destination_set_allow_cardification (EDestination *dest, gboolean x)
-{
- g_return_if_fail (E_IS_DESTINATION (dest));
-
- dest->priv->allow_cardify = x;
-}
-
-static void
-set_cardify_book (EDestination *dest, EBook *book)
-{
- if (dest->priv->cardify_book && dest->priv->cardify_book != book) {
- g_object_unref (dest->priv->cardify_book);
- }
-
- dest->priv->cardify_book = book;
-
- if (book)
- g_object_ref (book);
-}
-
-static void
-name_and_email_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- EDestination *dest = E_DESTINATION (closure);
-
- if (status == E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS && g_list_length ((GList *) cards) == 1) {
- ECard *card = E_CARD (cards->data);
- const char *email = e_destination_get_email (dest);
- int email_num = 0;
-
- if (e_destination_is_valid (dest) && email && *email) {
- email_num = e_card_email_find_number (card, e_destination_get_email (dest));
- }
-
- if (email_num >= 0) {
- const char *book_uri;
-
- book_uri = e_book_get_uri (book);
-
- dest->priv->has_been_cardified = TRUE;
- e_destination_set_card (dest, card, email_num);
- e_destination_set_book_uri (dest, book_uri);
- g_signal_emit (dest, e_destination_signals[CARDIFIED], 0);
- }
- }
-
- if (!dest->priv->has_been_cardified) {
- dest->priv->cannot_cardify = TRUE;
- }
-
- g_object_unref (dest); /* drop the reference held by the query */
-}
-
-
-static void
-nickname_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- EDestination *dest = E_DESTINATION (closure);
-
- if (status == E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS) {
- if (g_list_length ((GList *) cards) == 1) {
- const char *book_uri;
-
- book_uri = e_book_get_uri (book);
-
- dest->priv->has_been_cardified = TRUE;
- e_destination_set_card (dest, E_CARD (cards->data), 0); /* Uses primary e-mail by default. */
- e_destination_set_book_uri (dest, book_uri);
- g_signal_emit (dest, e_destination_signals[CARDIFIED], 0);
-
- g_object_unref (dest); /* drop the reference held by the query */
-
- } else {
- /* We can only end up here if we don't look at all like an e-mail address, so
- we do a name-only query on the textrep */
-
- e_book_name_and_email_query (book,
- e_destination_get_textrep (dest, FALSE),
- NULL,
- name_and_email_simple_query_cb,
- dest);
- }
- } else {
- /* Something went wrong with the query: drop our ref to the destination and return. */
- g_object_unref (dest);
- }
-}
-
-static void
-launch_cardify_query (EDestination *dest)
-{
- if (! e_destination_is_valid (dest)) {
- /* If it doesn't look like an e-mail address, see if it is a nickname. */
- e_book_nickname_query (dest->priv->cardify_book,
- e_destination_get_textrep (dest, FALSE),
- nickname_simple_query_cb,
- dest);
-
- } else {
- e_book_name_and_email_query (dest->priv->cardify_book,
- e_destination_get_name (dest),
- e_destination_get_email (dest),
- name_and_email_simple_query_cb,
- dest);
- }
-}
-
-static void
-use_default_book_cb (EBook *book, gpointer closure)
-{
- EDestination *dest = E_DESTINATION (closure);
- if (book != NULL && dest->priv->cardify_book == NULL) {
- dest->priv->cardify_book = book;
- g_object_ref (book);
- }
-
- if (dest->priv->cardify_book)
- launch_cardify_query (dest);
- else
- g_object_unref (dest);
-}
-
-
-static gboolean
-e_destination_reverting_is_a_good_idea (EDestination *dest)
-{
- const char *textrep;
- int len, old_len;
-
- g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
- if (dest->priv->old_textrep == NULL)
- return FALSE;
-
- textrep = e_destination_get_textrep (dest, FALSE);
-
- len = g_utf8_strlen (textrep, -1);
- old_len = g_utf8_strlen (dest->priv->old_textrep, -1);
-
- if (len <= old_len/2)
- return FALSE;
-
- return TRUE;
-}
-
-void
-e_destination_cardify (EDestination *dest, EBook *book)
-{
- g_return_if_fail (E_IS_DESTINATION (dest));
- g_return_if_fail (book == NULL || E_IS_BOOK (book));
-
- if (e_destination_is_evolution_list (dest))
- return;
-
- if (e_destination_contains_card (dest))
- return;
-
- if (!dest->priv->allow_cardify)
- return;
-
- if (dest->priv->cannot_cardify)
- return;
-
- e_destination_cancel_cardify (dest);
-
- /* In some cases, we can revert to the previous card. */
- if (!e_destination_is_valid (dest)
- && e_destination_reverting_is_a_good_idea (dest)
- && e_destination_revert (dest)) {
- return;
- }
-
- set_cardify_book (dest, book);
-
- /* Handle the case of an EDestination containing a card URL */
- if (e_destination_contains_card (dest)) {
- e_destination_use_card (dest, NULL, NULL);
- return;
- }
-
- /* If we have a book ready, proceed. We hold a reference to ourselves
- until our query is complete. */
- g_object_ref (dest);
- if (dest->priv->cardify_book != NULL) {
- launch_cardify_query (dest);
- } else {
- e_book_use_default_book (use_default_book_cb, dest);
- }
-}
-
-static int
-do_cardify_delayed (gpointer ptr)
-{
- EDestination *dest = E_DESTINATION (ptr);
-
- e_destination_cardify (dest, dest->priv->cardify_book);
- return FALSE;
-}
-
-void
-e_destination_cardify_delayed (EDestination *dest, EBook *book, gint delay)
-{
- g_return_if_fail (E_IS_DESTINATION (dest));
- g_return_if_fail (book == NULL || E_IS_BOOK (book));
-
- if (delay < 0)
- delay = 500;
-
- e_destination_cancel_cardify (dest);
-
- set_cardify_book (dest, book);
-
- dest->priv->pending_cardification = g_timeout_add (delay, do_cardify_delayed, dest);
-}
-
-void
-e_destination_cancel_cardify (EDestination *dest)
-{
- g_return_if_fail (E_IS_DESTINATION (dest));
-
- if (dest->priv->pending_cardification) {
- g_source_remove (dest->priv->pending_cardification);
- dest->priv->pending_cardification = 0;
- }
-}
-
-gboolean
-e_destination_uncardify (EDestination *dest)
-{
- char *email;
-
- g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
-
- if (!e_destination_contains_card (dest))
- return FALSE;
-
- email = g_strdup (e_destination_get_email (dest));
-
- if (email == NULL)
- return FALSE;
-
- e_destination_freeze (dest);
- e_destination_clear (dest);
- e_destination_set_raw (dest, email);
- g_free (email);
- e_destination_thaw (dest);
-
- return TRUE;
-}
-
-gboolean
-e_destination_revert (EDestination *dest)
-{
- g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
-
- if (dest->priv->old_card) {
- ECard *card;
- int card_email_num;
-
- card = dest->priv->old_card;
- card_email_num = dest->priv->old_card_email_num;
-
- dest->priv->old_card = NULL;
- g_free (dest->priv->old_textrep);
- dest->priv->old_textrep = NULL;
-
- e_destination_freeze (dest);
- e_destination_clear (dest);
- e_destination_set_card (dest, card, card_email_num);
- e_destination_thaw (dest);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*
- * Destination import/export
- */
-
-gchar *
-e_destination_get_address_textv (EDestination **destv)
-{
- int i, j, len = 0;
- char **strv;
- char *str;
-
- g_return_val_if_fail (destv, NULL);
-
- /* Q: Please tell me this is only for assertion
- reasons. If this is considered to be ok behavior then you
- shouldn't use g_return's. Just a reminder ;-)
-
- A: Yes, this is just an assertion. (Though it does find the
- length of the vector in the process...)
- */
- while (destv[len]) {
- g_return_val_if_fail (E_IS_DESTINATION (destv[len]), NULL);
- len++;
- }
-
- strv = g_new0 (char *, len + 1);
- for (i = 0, j = 0; destv[i]; i++) {
- if (!e_destination_is_empty (destv[i])) {
- const char *addr = e_destination_get_address (destv[i]);
- strv[j++] = addr ? (char *) addr : "";
- }
- }
-
- str = g_strjoinv (", ", strv);
-
- g_free (strv);
-
- return str;
-}
-
-xmlNodePtr
-e_destination_xml_encode (const EDestination *dest)
-{
- xmlNodePtr dest_node;
- const char *str;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- dest_node = xmlNewNode (NULL, "destination");
-
- str = e_destination_get_name (dest);
- if (str)
- xmlNewTextChild (dest_node, NULL, "name", str);
-
- if (!e_destination_is_evolution_list (dest)) {
- str = e_destination_get_email (dest);
- if (str)
- xmlNewTextChild (dest_node, NULL, "email", str);
- } else {
- GList *iter = dest->priv->list_dests;
-
- while (iter) {
- EDestination *list_dest = E_DESTINATION (iter->data);
- xmlNodePtr list_node = xmlNewNode (NULL, "list_entry");
-
- str = e_destination_get_name (list_dest);
- if (str)
- xmlNewTextChild (list_node, NULL, "name", str);
-
- str = e_destination_get_email (list_dest);
- if (str)
- xmlNewTextChild (list_node, NULL, "email", str);
-
- xmlAddChild (dest_node, list_node);
-
- iter = g_list_next (iter);
- }
-
- xmlNewProp (dest_node, "is_list", "yes");
- xmlNewProp (dest_node, "show_addresses",
- e_destination_list_show_addresses (dest) ? "yes" : "no");
- }
-
- str = e_destination_get_book_uri (dest);
- if (str) {
- xmlNewTextChild (dest_node, NULL, "book_uri", str);
- }
-
- str = e_destination_get_card_uid (dest);
- if (str) {
- char buf[16];
-
- xmlNodePtr uri_node = xmlNewTextChild (dest_node, NULL, "card_uid", str);
- g_snprintf (buf, 16, "%d", e_destination_get_email_num (dest));
- xmlNewProp (uri_node, "email_num", buf);
- }
-
- xmlNewProp (dest_node, "html_mail", e_destination_get_html_mail_pref (dest) ? "yes" : "no");
-
- xmlNewProp (dest_node, "auto_recipient",
- e_destination_is_auto_recipient (dest) ? "yes" : "no");
-
- return dest_node;
-}
-
-gboolean
-e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
-{
- char *name = NULL, *email = NULL, *book_uri = NULL, *card_uid = NULL;
- gboolean is_list = FALSE, show_addr = FALSE, auto_recip = FALSE;
- gboolean html_mail = FALSE;
- GList *list_dests = NULL;
- int email_num = -1;
- char *tmp;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), FALSE);
- g_return_val_if_fail (node != NULL, FALSE);
-
- if (strcmp (node->name, "destination"))
- return FALSE;
-
- tmp = xmlGetProp (node, "html_mail");
- if (tmp) {
- html_mail = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- tmp = xmlGetProp (node, "is_list");
- if (tmp) {
- is_list = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- tmp = xmlGetProp (node, "show_addresses");
- if (tmp) {
- show_addr = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- tmp = xmlGetProp (node, "auto_recipient");
- if (tmp) {
- auto_recip = !strcmp (tmp, "yes");
- xmlFree (tmp);
- }
-
- node = node->xmlChildrenNode;
- while (node) {
- if (!strcmp (node->name, "name")) {
- tmp = xmlNodeGetContent (node);
- g_free (name);
- name = g_strdup (tmp);
- xmlFree (tmp);
- } else if (!is_list && !strcmp (node->name, "email")) {
- tmp = xmlNodeGetContent (node);
- g_free (email);
- email = g_strdup (tmp);
- xmlFree (tmp);
- } else if (is_list && !strcmp (node->name, "list_entry")) {
- xmlNodePtr subnode = node->xmlChildrenNode;
- char *list_name = NULL, *list_email = NULL;
-
- while (subnode) {
- if (!strcmp (subnode->name, "name")) {
- tmp = xmlNodeGetContent (subnode);
- g_free (list_name);
- list_name = g_strdup (tmp);
- xmlFree (tmp);
- } else if (!strcmp (subnode->name, "email")) {
- tmp = xmlNodeGetContent (subnode);
- g_free (list_email);
- list_email = g_strdup (tmp);
- xmlFree (tmp);
- }
-
- subnode = subnode->next;
- }
-
- if (list_name || list_email) {
- EDestination *list_dest = e_destination_new ();
-
- if (list_name)
- e_destination_set_name (list_dest, list_name);
- if (list_email)
- e_destination_set_email (list_dest, list_email);
-
- g_free (list_name);
- g_free (list_email);
-
- list_dests = g_list_append (list_dests, list_dest);
- }
- } else if (!strcmp (node->name, "book_uri")) {
- tmp = xmlNodeGetContent (node);
- g_free (book_uri);
- book_uri = g_strdup (tmp);
- xmlFree (tmp);
- } else if (!strcmp (node->name, "card_uid")) {
- tmp = xmlNodeGetContent (node);
- g_free (card_uid);
- card_uid = g_strdup (tmp);
- xmlFree (tmp);
-
- tmp = xmlGetProp (node, "email_num");
- email_num = atoi (tmp);
- xmlFree (tmp);
- }
-
- node = node->next;
- }
-
- e_destination_freeze (dest);
-
- e_destination_clear (dest);
-
- if (name) {
- e_destination_set_name (dest, name);
- g_free (name);
- }
- if (email) {
- e_destination_set_email (dest, email);
- g_free (email);
- }
- if (book_uri) {
- e_destination_set_book_uri (dest, book_uri);
- g_free (book_uri);
- }
- if (card_uid) {
- e_destination_set_card_uid (dest, card_uid, email_num);
- g_free (card_uid);
- }
- if (list_dests)
- dest->priv->list_dests = list_dests;
-
- dest->priv->html_mail_override = TRUE;
- dest->priv->wants_html_mail = html_mail;
-
- dest->priv->show_addresses = show_addr;
-
- dest->priv->auto_recipient = auto_recip;
-
- e_destination_thaw (dest);
-
- return TRUE;
-}
-
-/* FIXME: Make utf-8 safe */
-static gchar *
-null_terminate_and_remove_extra_whitespace (xmlChar *xml_in, gint size)
-{
- gboolean skip_white = FALSE;
- char *xml, *r, *w;
-
- if (xml_in == NULL || size <= 0)
- return NULL;
-
- xml = g_strndup (xml_in, size);
- r = w = xml;
-
- while (*r) {
- if (*r == '\n' || *r == '\r') {
- skip_white = TRUE;
- } else {
- gboolean is_space = isspace (*r);
-
- *w = *r;
-
- if (!(skip_white && is_space))
- w++;
- if (!is_space)
- skip_white = FALSE;
- }
- r++;
- }
-
- *w = '\0';
-
- return xml;
-}
-
-gchar *
-e_destination_export (const EDestination *dest)
-{
- xmlNodePtr dest_node;
- xmlDocPtr dest_doc;
- xmlChar *buffer = NULL;
- int size = -1;
- char *str;
-
- g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
-
- dest_node = e_destination_xml_encode (dest);
- if (dest_node == NULL)
- return NULL;
-
- dest_doc = xmlNewDoc (XML_DEFAULT_VERSION);
- xmlDocSetRootElement (dest_doc, dest_node);
-
- xmlDocDumpMemory (dest_doc, &buffer, &size);
- xmlFreeDoc (dest_doc);
-
- str = null_terminate_and_remove_extra_whitespace (buffer, size);
- xmlFree (buffer);
-
- return str;
-}
-
-EDestination *
-e_destination_import (const gchar *str)
-{
- EDestination *dest = NULL;
- xmlDocPtr dest_doc;
-
- if (!(str && *str))
- return NULL;
-
- dest_doc = xmlParseMemory ((char *) str, strlen (str));
- if (dest_doc && dest_doc->xmlRootNode) {
- dest = e_destination_new ();
- if (! e_destination_xml_decode (dest, dest_doc->xmlRootNode)) {
- g_object_unref (dest);
- dest = NULL;
- }
- }
- xmlFreeDoc (dest_doc);
-
- return dest;
-}
-
-gchar *
-e_destination_exportv (EDestination **destv)
-{
- xmlDocPtr destv_doc;
- xmlNodePtr destv_node;
- xmlChar *buffer = NULL;
- int i, size = -1;
- char *str;
-
- if (destv == NULL || *destv == NULL)
- return NULL;
-
- destv_doc = xmlNewDoc (XML_DEFAULT_VERSION);
- destv_node = xmlNewNode (NULL, "destinations");
- xmlDocSetRootElement (destv_doc, destv_node);
-
- for (i = 0; destv[i]; i++) {
- if (! e_destination_is_empty (destv[i])) {
- xmlNodePtr dest_node = e_destination_xml_encode (destv[i]);
- if (dest_node)
- xmlAddChild (destv_node, dest_node);
- }
- }
-
- xmlDocDumpMemory (destv_doc, &buffer, &size);
- xmlFreeDoc (destv_doc);
-
- str = null_terminate_and_remove_extra_whitespace (buffer, size);
- xmlFree (buffer);
-
- return str;
-}
-
-EDestination **
-e_destination_importv (const gchar *str)
-{
- GPtrArray *dest_array = NULL;
- xmlDocPtr destv_doc;
- xmlNodePtr node;
- EDestination **destv = NULL;
-
- if (!(str && *str))
- return NULL;
-
- destv_doc = xmlParseMemory ((char *)str, strlen (str));
- if (destv_doc == NULL)
- return NULL;
-
- node = destv_doc->xmlRootNode;
-
- if (strcmp (node->name, "destinations"))
- goto finished;
-
- node = node->xmlChildrenNode;
-
- dest_array = g_ptr_array_new ();
-
- while (node) {
- EDestination *dest;
-
- dest = e_destination_new ();
- if (e_destination_xml_decode (dest, node) && !e_destination_is_empty (dest)) {
- g_ptr_array_add (dest_array, dest);
- } else {
- g_object_unref (dest);
- }
-
- node = node->next;
- }
-
- /* we need destv to be NULL terminated */
- g_ptr_array_add (dest_array, NULL);
-
- destv = (EDestination **) dest_array->pdata;
- g_ptr_array_free (dest_array, FALSE);
-
- finished:
- xmlFreeDoc (destv_doc);
-
- return destv;
-}
-
-EDestination **
-e_destination_list_to_vector_sized (GList *list, int n)
-{
- EDestination **destv;
- int i = 0;
-
- if (n == -1)
- n = g_list_length (list);
-
- if (n == 0)
- return NULL;
-
- destv = g_new (EDestination *, n + 1);
- while (list != NULL && i < n) {
- destv[i] = E_DESTINATION (list->data);
- list->data = NULL;
- i++;
- list = g_list_next (list);
- }
- destv[i] = NULL;
-
- return destv;
-}
-
-EDestination **
-e_destination_list_to_vector (GList *list)
-{
- return e_destination_list_to_vector_sized (list, -1);
-}
-
-void
-e_destination_freev (EDestination **destv)
-{
- int i;
-
- if (destv) {
- for (i = 0; destv[i] != NULL; ++i) {
- g_object_unref (destv[i]);
- }
- g_free (destv);
- }
-
-}
-
-static void
-touch_cb (EBook *book, const gchar *addr, ECard *card, gpointer closure)
-{
- if (book != NULL && card != NULL) {
- e_card_touch (card);
- d(g_message ("Use score for \"%s\" is now %f", addr, e_card_get_use_score (card)));
- e_book_commit_card (book, card, NULL, NULL);
- }
-}
-
-void
-e_destination_touch (EDestination *dest)
-{
- const char *email;
-
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- if (!e_destination_is_auto_recipient (dest)) {
- email = e_destination_get_email (dest);
-
- if (email)
- e_book_query_address_default (email, touch_cb, NULL);
- }
-}
-
-void
-e_destination_touchv (EDestination **destv)
-{
- int i;
-
- g_return_if_fail (destv != NULL);
-
- for (i = 0; destv[i] != NULL; ++i) {
- e_destination_touch (destv[i]);
- }
-}
diff --git a/addressbook/backend/ebook/e-destination.h b/addressbook/backend/ebook/e-destination.h
deleted file mode 100644
index acd6af1bc4..0000000000
--- a/addressbook/backend/ebook/e-destination.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-destination.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_DESTINATION_H__
-#define __E_DESTINATION_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <ebook/e-card.h>
-#include <ebook/e-book.h>
-#include <libxml/tree.h>
-
-#define E_TYPE_DESTINATION (e_destination_get_type ())
-#define E_DESTINATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_DESTINATION, EDestination))
-#define E_DESTINATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_DESTINATION, EDestinationClass))
-#define E_IS_DESTINATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_DESTINATION))
-#define E_IS_DESTINATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_DESTINATION))
-#define E_DESTINATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_DESTINATION, EDestinationClass))
-
-typedef struct _EDestination EDestination;
-typedef struct _EDestinationClass EDestinationClass;
-
-typedef void (*EDestinationCardCallback) (EDestination *dest, ECard *card, gpointer closure);
-
-struct _EDestinationPrivate;
-
-struct _EDestination {
- GObject object;
-
- struct _EDestinationPrivate *priv;
-};
-
-struct _EDestinationClass {
- GObjectClass parent_class;
-
- void (*changed) (EDestination *dest);
- void (*cardified) (EDestination *dest);
-};
-
-GType e_destination_get_type (void);
-
-
-EDestination *e_destination_new (void);
-void e_destination_changed (EDestination *);
-EDestination *e_destination_copy (const EDestination *);
-void e_destination_clear (EDestination *);
-
-gboolean e_destination_is_empty (const EDestination *);
-gboolean e_destination_is_valid (const EDestination *);
-gboolean e_destination_equal (const EDestination *a, const EDestination *b);
-
-void e_destination_set_card (EDestination *, ECard *card, gint email_num);
-void e_destination_set_book_uri (EDestination *, const gchar *uri);
-void e_destination_set_card_uid (EDestination *, const gchar *uid, gint email_num);
-
-void e_destination_set_name (EDestination *, const gchar *name);
-void e_destination_set_email (EDestination *, const gchar *email);
-
-void e_destination_set_html_mail_pref (EDestination *, gboolean);
-
-gboolean e_destination_contains_card (const EDestination *);
-gboolean e_destination_from_card (const EDestination *);
-
-gboolean e_destination_is_auto_recipient (const EDestination *);
-void e_destination_set_auto_recipient (EDestination *, gboolean value);
-
-void e_destination_use_card (EDestination *, EDestinationCardCallback cb, gpointer closure);
-
-ECard *e_destination_get_card (const EDestination *);
-const gchar *e_destination_get_book_uri (const EDestination *);
-const gchar *e_destination_get_card_uid (const EDestination *);
-gint e_destination_get_email_num (const EDestination *);
-
-const gchar *e_destination_get_name (const EDestination *); /* "Jane Smith" */
-const gchar *e_destination_get_email (const EDestination *); /* "jane@assbarn.com" */
-const gchar *e_destination_get_address (const EDestination *);; /* "Jane Smith <jane@assbarn.com>" (or a comma-sep set of such for a list) */
-
-void e_destination_set_raw (EDestination *, const gchar *free_form_string);
-const gchar *e_destination_get_textrep (const EDestination *, gboolean include_email); /* "Jane Smith" or "jane@assbarn.com" */
-
-gboolean e_destination_is_evolution_list (const EDestination *);
-gboolean e_destination_list_show_addresses (const EDestination *);
-
-/* If true, they want HTML mail. */
-gboolean e_destination_get_html_mail_pref (const EDestination *);
-
-gboolean e_destination_allow_cardification (const EDestination *);
-void e_destination_set_allow_cardification (EDestination *, gboolean);
-void e_destination_cardify (EDestination *, EBook *);
-void e_destination_cardify_delayed (EDestination *, EBook *, gint delay); /* delay < 0: "default" */
-void e_destination_cancel_cardify (EDestination *);
-gboolean e_destination_uncardify (EDestination *);
-
-gboolean e_destination_revert (EDestination *);
-
-gchar *e_destination_get_address_textv (EDestination **);
-
-xmlNodePtr e_destination_xml_encode (const EDestination *dest);
-gboolean e_destination_xml_decode (EDestination *dest, xmlNodePtr node);
-
-gchar *e_destination_export (const EDestination *);
-EDestination *e_destination_import (const gchar *str);
-
-gchar *e_destination_exportv (EDestination **);
-EDestination **e_destination_importv (const gchar *str);
-
-EDestination **e_destination_list_to_vector_sized (GList *, int n);
-EDestination **e_destination_list_to_vector (GList *);
-
-void e_destination_freev (EDestination **);
-
-void e_destination_touch (EDestination *);
-void e_destination_touchv (EDestination **);
-
-
-#endif /* __E_DESTINATION_H__ */
-
diff --git a/addressbook/backend/ebook/e-vcard.c b/addressbook/backend/ebook/e-vcard.c
deleted file mode 100644
index 62ebda9349..0000000000
--- a/addressbook/backend/ebook/e-vcard.c
+++ /dev/null
@@ -1,925 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* evcard.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Toshok (toshok@ximian.com)
- */
-
-#include <glib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "e-vcard.h"
-
-#define CRLF "\r\n"
-
-struct _EVCardPrivate {
- GList *attributes;
-};
-
-struct _EVCardAttribute {
- char *group;
- char *name;
- GList *params; /* EVCardParam */
- GList *values;
-};
-
-struct _EVCardAttributeParam {
- char *name;
- GList *values; /* GList of char*'s*/
-};
-
-static GObjectClass *parent_class;
-
-static void
-e_vcard_dispose (GObject *object)
-{
- EVCard *evc = E_VCARD (object);
-
- if (!evc->priv)
- return;
-
- g_list_foreach (evc->priv->attributes, (GFunc)e_vcard_attribute_free, NULL);
- g_list_free (evc->priv->attributes);
-
- g_free (evc->priv);
- evc->priv = NULL;
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_vcard_class_init (EVCardClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
-
- parent_class = g_type_class_ref (G_TYPE_OBJECT);
-
- object_class->dispose = e_vcard_dispose;
-}
-
-static void
-e_vcard_init (EVCard *evc)
-{
- evc->priv = g_new0 (EVCardPrivate, 1);
-}
-
-GType
-e_vcard_get_type (void)
-{
- static GType vcard_type = 0;
-
- if (!vcard_type) {
- static const GTypeInfo vcard_info = {
- sizeof (EVCardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_vcard_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EVCard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_vcard_init,
- };
-
- vcard_type = g_type_register_static (G_TYPE_OBJECT, "EVCard", &vcard_info, 0);
- }
-
- return vcard_type;
-}
-
-
-
-static char*
-fold_lines (char *buf)
-{
- GString *str = g_string_new ("");
- char *p = buf;
- char *next, *next2;
-
- /* we're pretty liberal with line folding here. We handle
- lines folded with \r\n<WS>... and \n\r<WS>... and
- \n<WS>... We also turn single \r's and \n's not followed by
- WS into \r\n's. */
- while (*p) {
- if (*p == '\r' || *p == '\n') {
- next = g_utf8_next_char (p);
- if (*next == '\n' || *next == '\r') {
- next2 = g_utf8_next_char (next);
- if (*next2 == ' ' || *next2 == '\t') {
- p = g_utf8_next_char (next2);
- }
- else {
- str = g_string_append (str, CRLF);
- p = g_utf8_next_char (next);
- }
- }
- else if (*next == ' ' || *next == '\t') {
- p = g_utf8_next_char (next);
- }
- else {
- str = g_string_append (str, CRLF);
- p = g_utf8_next_char (p);
- }
- }
- else {
- str = g_string_append_unichar (str, g_utf8_get_char (p));
- p = g_utf8_next_char (p);
- }
- }
-
- g_free (buf);
-
- return g_string_free (str, FALSE);
-}
-
-/* skip forward until we hit the CRLF, or \0 */
-static void
-skip_to_next_line (char **p)
-{
- char *lp;
- lp = *p;
-
- while (*lp != '\r' && *lp != '\0')
- lp = g_utf8_next_char (lp);
-
- if (*lp == '\r') {
- lp = g_utf8_next_char (lp); /* \n */
- lp = g_utf8_next_char (lp); /* start of the next line */
- }
-
- *p = lp;
-}
-
-/* skip forward until we hit a character in @s, CRLF, or \0 */
-static void
-skip_until (char **p, char *s)
-{
- /* XXX write me plz k thx */
- g_assert_not_reached();
-}
-
-static void
-read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable)
-{
- char *lp = *p;
- GString *str;
-
- /* read in the value */
- str = g_string_new ("");
- while (*lp != '\r' && *lp != '\0') {
- if (*lp == '=' && quoted_printable) {
- char a, b;
- if ((a = *(++lp)) == '\0') break;
- if ((b = *(++lp)) == '\0') break;
- if (a == '\r' && b == '\n') {
- /* it was a = at the end of the line,
- * just ignore this and continue
- * parsing on the next line. yay for
- * 2 kinds of line folding
- */
- }
- else if (isalnum(a) && isalnum (b)) {
- char c;
-
- a = tolower (a);
- b = tolower (b);
-
- c = (((a>='a'?a-'a'+10:a-'0')&0x0f) << 4)
- | ((b>='a'?b-'a'+10:b-'0')&0x0f);
-
- str = g_string_append_c (str, c);
- }
- /* silently consume malformed input, and
- continue parsing */
- lp++;
- }
- else if (*lp == '\\') {
- /* convert back to the non-escaped version of
- the characters */
- lp = g_utf8_next_char(lp);
- if (*lp == '\0') {
- str = g_string_append_c (str, '\\');
- break;
- }
- switch (*lp) {
- case 'n': str = g_string_append_c (str, '\n'); break;
- case 'r': str = g_string_append_c (str, '\r'); break;
- case ';': str = g_string_append_c (str, ';'); break;
- case ',': str = g_string_append_c (str, ','); break;
- case '\\': str = g_string_append_c (str, '\\'); break;
- default:
- g_warning ("invalid escape, passing it through");
- str = g_string_append_c (str, '\\');
- str = g_string_append_unichar (str, g_utf8_get_char(lp));
- lp = g_utf8_next_char(lp);
- break;
- }
- }
- else if (*lp == ';') {
- e_vcard_attribute_add_value (attr, g_string_free (str, FALSE));
- str = g_string_new ("");
- lp = g_utf8_next_char(lp);
- }
- else {
- str = g_string_append_unichar (str, g_utf8_get_char (lp));
- lp = g_utf8_next_char(lp);
- }
- }
- if (str)
- e_vcard_attribute_add_value (attr, g_string_free (str, FALSE));
-
- if (*lp == '\r') {
- lp = g_utf8_next_char (lp); /* \n */
- lp = g_utf8_next_char (lp); /* start of the next line */
- }
-
- *p = lp;
-}
-
-static void
-read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printable)
-{
- char *lp = *p;
- GString *str;
- EVCardAttributeParam *param = NULL;
-
- str = g_string_new ("");
- while (*lp != '\0') {
- /* accumulate until we hit the '=' or ';'. If we hit
- * a '=' the string contains the parameter name. if
- * we hit a ';' the string contains the parameter
- * value and the name is either ENCODING (if value ==
- * QUOTED-PRINTABLE) or TYPE (in any other case.)
- */
- if (*lp == '=') {
- if (str->len > 0) {
- param = e_vcard_attribute_param_new (str->str);
- str = g_string_assign (str, "");
- lp = g_utf8_next_char (lp);
- }
- else {
- skip_until (&lp, ":;");
- if (*lp == '\r') {
- lp = g_utf8_next_char (lp); /* \n */
- lp = g_utf8_next_char (lp); /* start of the next line */
- break;
- }
- else if (*lp == ';')
- lp = g_utf8_next_char (lp);
- }
- }
- else if (*lp == ';' || *lp == ':' || *lp == ',') {
- gboolean colon = (*lp == ':');
- gboolean comma = (*lp == ',');
-
- if (param) {
- if (str->len > 0) {
- e_vcard_attribute_param_add_value (param, str->str);
- str = g_string_assign (str, "");
- if (!colon)
- lp = g_utf8_next_char (lp);
- }
- else {
- /* we've got a parameter of the form:
- * PARAM=(.*,)?[:;]
- * so what we do depends on if there are already values
- * for the parameter. If there are, we just finish
- * this parameter and skip past the offending character
- * (unless it's the ':'). If there aren't values, we free
- * the parameter then skip past the character.
- */
- if (!param->values) {
- e_vcard_attribute_param_free (param);
- param = NULL;
- }
- }
-
- if (param
- && !g_ascii_strcasecmp (param->name, "encoding")
- && !g_ascii_strcasecmp (param->values->data, "quoted-printable")) {
- *quoted_printable = TRUE;
- e_vcard_attribute_param_free (param);
- param = NULL;
- }
- }
- else {
- if (str->len > 0) {
- char *param_name;
- if (!g_ascii_strcasecmp (str->str,
- "quoted-printable")) {
- param_name = NULL;
- *quoted_printable = TRUE;
- }
- else {
- param_name = "TYPE";
- }
-
- if (param_name) {
- param = e_vcard_attribute_param_new (param_name);
- e_vcard_attribute_param_add_value (param, str->str);
- }
- str = g_string_assign (str, "");
- if (!colon)
- lp = g_utf8_next_char (lp);
- }
- else {
- /* XXX more here */
- g_assert_not_reached ();
- }
- }
- if (param && !comma) {
- e_vcard_attribute_add_param (attr, param);
- param = NULL;
- }
- if (colon)
- break;
- }
- else if (g_unichar_isalnum (g_utf8_get_char (lp)) || *lp == '-' || *lp == '_') {
- str = g_string_append_unichar (str, g_utf8_get_char (lp));
- lp = g_utf8_next_char (lp);
- }
- else {
- g_warning ("invalid character found in parameter spec");
- str = g_string_assign (str, "");
- skip_until (&lp, ":;");
- }
- }
-
- if (str)
- g_string_free (str, TRUE);
-
- *p = lp;
-}
-
-/* reads an entire attribute from the input buffer, leaving p pointing
- at the start of the next line (past the \r\n) */
-static EVCardAttribute*
-read_attribute (char **p)
-{
- char *attr_group = NULL;
- char *attr_name = NULL;
- EVCardAttribute *attr = NULL;
- GString *str;
- char *lp = *p;
- gboolean is_qp = FALSE;
-
- /* first read in the group/name */
- str = g_string_new ("");
- while (*lp != '\r' && *lp != '\0') {
- if (*lp == ':' || *lp == ';') {
- if (str->len != 0) {
- /* we've got a name, break out to the value/attribute parsing */
- attr_name = g_string_free (str, FALSE);
- break;
- }
- else {
- /* a line of the form:
- * (group.)?[:;]
- *
- * since we don't have an attribute
- * name, skip to the end of the line
- * and try again.
- */
- g_string_free (str, TRUE);
- *p = lp;
- skip_to_next_line(p);
- goto lose;
- }
- }
- else if (*lp == '.') {
- if (attr_group) {
- g_warning ("extra `.' in attribute specification. ignoring extra group `%s'",
- str->str);
- g_string_free (str, TRUE);
- str = g_string_new ("");
- }
- if (str->len != 0) {
- attr_group = g_string_free (str, FALSE);
- str = g_string_new ("");
- }
- }
- else if (g_unichar_isalnum (g_utf8_get_char (lp)) || *lp == '-' || *lp == '_') {
- str = g_string_append_unichar (str, g_utf8_get_char (lp));
- }
- else {
- g_warning ("invalid character found in attribute group/name");
- g_string_free (str, TRUE);
- *p = lp;
- skip_to_next_line(p);
- goto lose;
- }
-
- lp = g_utf8_next_char(lp);
- }
-
- if (!attr_name) {
- skip_to_next_line (p);
- goto lose;
- }
-
- attr = e_vcard_attribute_new (attr_group, attr_name);
- g_free (attr_group);
- g_free (attr_name);
-
- if (*lp == ';') {
- /* skip past the ';' */
- lp = g_utf8_next_char(lp);
- read_attribute_params (attr, &lp, &is_qp);
- }
- if (*lp == ':') {
- /* skip past the ':' */
- lp = g_utf8_next_char(lp);
- read_attribute_value (attr, &lp, is_qp);
- }
-
- *p = lp;
-
- if (!attr->values)
- goto lose;
-
- return attr;
- lose:
- if (attr)
- e_vcard_attribute_free (attr);
- return NULL;
-}
-
-/* we try to be as forgiving as we possibly can here - this isn't a
- * validator. Almost nothing is considered a fatal error. We always
- * try to return *something*.
- */
-static void
-parse (EVCard *evc, const char *str)
-{
- char *buf = g_strdup (str);
- char *p, *end;
- EVCardAttribute *attr;
-
- /* first validate the string is valid utf8 */
- if (!g_utf8_validate (buf, -1, (const char **)&end)) {
- /* if the string isn't valid, we parse as much as we can from it */
- g_warning ("invalid utf8 passed to EVCard. Limping along.");
- *end = '\0';
- }
-
- printf ("BEFORE FOLDING:\n");
- printf (str);
-
- buf = fold_lines (buf);
-
- printf ("\n\nAFTER FOLDING:\n");
- printf (buf);
-
- p = buf;
-
- attr = read_attribute (&p);
- if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "begin")) {
- g_warning ("vcard began without a BEGIN:VCARD\n");
- }
-
- while (*p) {
- EVCardAttribute *next_attr = read_attribute (&p);
-
- if (next_attr) {
- if (g_ascii_strcasecmp (next_attr->name, "end"))
- e_vcard_add_attribute (evc, next_attr);
- attr = next_attr;
- }
- }
-
- if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "end")) {
- g_warning ("vcard ended without END:VCARD\n");
- }
-}
-
-static char*
-escape_string (const char *s)
-{
- GString *str = g_string_new ("");
- const char *p;
-
- /* Escape a string as described in RFC2426, section 5 */
- for (p = s; *p; p++) {
- switch (*p) {
- case '\n':
- str = g_string_append (str, "\\n");
- break;
- case '\r':
- if (*(p+1) == '\n')
- p++;
- str = g_string_append (str, "\\n");
- break;
- case ';':
- str = g_string_append (str, "\\;");
- break;
- case ',':
- str = g_string_append (str, "\\,");
- break;
- case '\\':
- str = g_string_append (str, "\\\\");
- break;
- default:
- str = g_string_append_c (str, *p);
- break;
- }
- }
-
- return g_string_free (str, FALSE);
-}
-
-#if notyet
-static char*
-unescape_string (const char *s)
-{
- GString *str = g_string_new ("");
- const char *p;
-
- /* Unescape a string as described in RFC2426, section 5 */
- for (p = s; *p; p++) {
- if (*p == '\\') {
- p++;
- if (*p == '\0') {
- str = g_string_append_c (str, '\\');
- break;
- }
- switch (*p) {
- case 'n': str = g_string_append_c (str, '\n'); break;
- case 'r': str = g_string_append_c (str, '\r'); break;
- case ';': str = g_string_append_c (str, ';'); break;
- case ',': str = g_string_append_c (str, ','); break;
- case '\\': str = g_string_append_c (str, '\\'); break;
- default:
- g_warning ("invalid escape, passing it through");
- str = g_string_append_c (str, '\\');
- str = g_string_append_unichar (str, g_utf8_get_char(p));
- break;
- }
- }
- }
-
- return g_string_free (str, FALSE);
-}
-#endif
-
-EVCard *
-e_vcard_new ()
-{
- return g_object_new (E_TYPE_VCARD, NULL);
-}
-
-EVCard *
-e_vcard_new_from_string (const char *str)
-{
- EVCard *evc = e_vcard_new ();
-
- parse (evc, str);
-
- return evc;
-}
-
-char*
-e_vcard_to_string (EVCard *evc)
-{
- GList *l;
- GList *v;
-
- GString *str = g_string_new ("");
-
- str = g_string_append (str, "BEGIN:vCard" CRLF);
-
- for (l = evc->priv->attributes; l; l = l->next) {
- GList *p;
- EVCardAttribute *attr = l->data;
- GString *attr_str = g_string_new ("");
- int l;
-
- /* From rfc2425, 5.8.2
- *
- * contentline = [group "."] name *(";" param) ":" value CRLF
- */
-
- if (attr->group) {
- attr_str = g_string_append (attr_str, attr->group);
- attr_str = g_string_append_c (attr_str, '.');
- }
- attr_str = g_string_append (attr_str, attr->name);
-
- /* handle the parameters */
- for (p = attr->params; p; p = p->next) {
- EVCardAttributeParam *param = p->data;
- /* 5.8.2:
- * param = param-name "=" param-value *("," param-value)
- */
- attr_str = g_string_append_c (attr_str, ';');
- attr_str = g_string_append (attr_str, param->name);
- if (param->values) {
- attr_str = g_string_append_c (attr_str, '=');
- for (v = param->values; v; v = v->next) {
- char *value = v->data;
- attr_str = g_string_append (attr_str, value);
- if (v->next)
- attr_str = g_string_append_c (attr_str, ',');
- }
- }
- }
-
- attr_str = g_string_append_c (attr_str, ':');
-
- for (v = attr->values; v; v = v->next) {
- char *value = v->data;
- char *escaped_value = NULL;
-
- escaped_value = escape_string (value);
-
- attr_str = g_string_append (attr_str, escaped_value);
- if (v->next)
- attr_str = g_string_append_c (attr_str, ';');
-
- g_free (escaped_value);
- }
-
- /* 5.8.2:
- * When generating a content line, lines longer than 75
- * characters SHOULD be folded
- */
- l = 0;
- do {
- if (attr_str->len - l > 75) {
- l += 75;
- attr_str = g_string_insert_len (attr_str, l, CRLF " ", sizeof (CRLF " ") - 1);
- }
- else
- break;
- } while (l < attr_str->len);
-
- attr_str = g_string_append (attr_str, CRLF);
-
- str = g_string_append (str, g_string_free (attr_str, FALSE));
- }
-
- str = g_string_append (str, "END:vCard");
-
- return g_string_free (str, FALSE);
-}
-
-void
-e_vcard_dump_structure (EVCard *evc)
-{
- GList *a;
- GList *v;
- int i;
-
- printf ("vCard\n");
- for (a = evc->priv->attributes; a; a = a->next) {
- GList *p;
- EVCardAttribute *attr = a->data;
- printf ("+-- %s\n", attr->name);
- if (attr->params) {
- printf (" +- params=\n");
-
- for (p = attr->params, i = 0; p; p = p->next, i++) {
- EVCardAttributeParam *param = p->data;
- printf (" | [%d] = %s", i,param->name);
- printf ("(");
- for (v = param->values; v; v = v->next) {
- char *value = escape_string ((char*)v->data);
- printf ("%s", value);
- if (v->next)
- printf (",");
- g_free (value);
- }
-
- printf (")\n");
- }
- }
- printf (" +- values=\n");
- for (v = attr->values, i = 0; v; v = v->next, i++) {
- printf (" [%d] = `%s'\n", i, (char*)v->data);
- }
- }
-}
-
-
-EVCardAttribute*
-e_vcard_attribute_new (const char *attr_group, const char *attr_name)
-{
- EVCardAttribute *attr = g_new0 (EVCardAttribute, 1);
-
- attr->group = g_strdup (attr_group);
- attr->name = g_strdup (attr_name);
-
- return attr;
-}
-
-void
-e_vcard_attribute_free (EVCardAttribute *attr)
-{
- GList *p;
-
- g_free (attr->group);
- g_free (attr->name);
-
- g_list_foreach (attr->values, (GFunc)g_free, NULL);
- g_list_free (attr->values);
-
- for (p = attr->params; p; p = p->next) {
- EVCardAttributeParam *param = p->data;
-
- g_free (param->name);
- g_list_foreach (param->values, (GFunc)g_free, NULL);
- g_list_free (param->values);
- g_free (param);
- }
-
- g_free (attr);
-}
-
-void
-e_vcard_add_attribute (EVCard *evc, EVCardAttribute *attr)
-{
- evc->priv->attributes = g_list_append (evc->priv->attributes, attr);
-}
-
-void
-e_vcard_add_attribute_with_value (EVCard *evcard,
- EVCardAttribute *attr, const char *value)
-{
- e_vcard_attribute_add_value (attr, value);
-
- e_vcard_add_attribute (evcard, attr);
-}
-
-void
-e_vcard_add_attribute_with_values (EVCard *evcard, EVCardAttribute *attr, ...)
-{
- va_list ap;
- char *v;
-
- va_start (ap, attr);
-
- while ((v = va_arg (ap, char*))) {
- e_vcard_attribute_add_value (attr, v);
- }
-
- va_end (ap);
-
- e_vcard_add_attribute (evcard, attr);
-}
-
-void
-e_vcard_attribute_add_value (EVCardAttribute *attr, const char *value)
-{
- attr->values = g_list_append (attr->values, g_strdup (value));
-}
-
-void
-e_vcard_attribute_add_values (EVCardAttribute *attr,
- ...)
-{
- va_list ap;
- char *v;
-
- va_start (ap, attr);
-
- while ((v = va_arg (ap, char*))) {
- e_vcard_attribute_add_value (attr, v);
- }
-
- va_end (ap);
-}
-
-
-EVCardAttributeParam*
-e_vcard_attribute_param_new (const char *name)
-{
- EVCardAttributeParam *param = g_new0 (EVCardAttributeParam, 1);
- param->name = g_strdup (name);
-
- return param;
-}
-
-void
-e_vcard_attribute_param_free (EVCardAttributeParam *param)
-{
- g_free (param->name);
- g_list_foreach (param->values, (GFunc)g_free, NULL);
- g_list_free (param->values);
- g_free (param);
-}
-
-void
-e_vcard_attribute_add_param (EVCardAttribute *attr,
- EVCardAttributeParam *param)
-{
- attr->params = g_list_append (attr->params, param);
-}
-
-void
-e_vcard_attribute_param_add_value (EVCardAttributeParam *param,
- const char *value)
-{
- param->values = g_list_append (param->values, g_strdup (value));
-}
-
-void
-e_vcard_attribute_param_add_values (EVCardAttributeParam *param,
- ...)
-{
- va_list ap;
- char *v;
-
- va_start (ap, param);
-
- while ((v = va_arg (ap, char*))) {
- e_vcard_attribute_param_add_value (param, v);
- }
-
- va_end (ap);
-}
-
-void
-e_vcard_attribute_add_param_with_value (EVCardAttribute *attr,
- EVCardAttributeParam *param, const char *value)
-{
- e_vcard_attribute_param_add_value (param, value);
-
- e_vcard_attribute_add_param (attr, param);
-}
-
-void
-e_vcard_attribute_add_param_with_values (EVCardAttribute *attr,
- EVCardAttributeParam *param, ...)
-{
- va_list ap;
- char *v;
-
- va_start (ap, param);
-
- while ((v = va_arg (ap, char*))) {
- e_vcard_attribute_param_add_value (param, v);
- }
-
- va_end (ap);
-
- e_vcard_attribute_add_param (attr, param);
-}
-
-GList*
-e_vcard_get_attributes (EVCard *evcard)
-{
- return evcard->priv->attributes;
-}
-
-const char*
-e_vcard_attribute_get_group (EVCardAttribute *attr)
-{
- return attr->group;
-}
-
-const char*
-e_vcard_attribute_get_name (EVCardAttribute *attr)
-{
- return attr->name;
-}
-
-GList*
-e_vcard_attribute_get_values (EVCardAttribute *attr)
-{
- return attr->values;
-}
-
-GList*
-e_vcard_attribute_get_params (EVCardAttribute *attr)
-{
- return attr->params;
-}
-
-const char*
-e_vcard_attribute_param_get_name (EVCardAttributeParam *param)
-{
- return param->name;
-}
-
-GList*
-e_vcard_attribute_param_get_values (EVCardAttributeParam *param)
-{
- return param->values;
-}
diff --git a/addressbook/backend/ebook/e-vcard.h b/addressbook/backend/ebook/e-vcard.h
deleted file mode 100644
index 69e0a3e10b..0000000000
--- a/addressbook/backend/ebook/e-vcard.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-vcard.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Toshok (toshok@ximian.com)
- */
-
-#ifndef _EVCARD_H
-#define _EVCARD_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#define EVC_FN "FN"
-#define EVC_ORG "ORG"
-#define EVC_URL "URL"
-#define EVC_VERSION "VERSION"
-#define EVC_REV "REV"
-#define EVC_PRODID "PRODID"
-#define EVC_TYPE "TYPE"
-#define EVC_ADR "ADR"
-#define EVC_TEL "TEL"
-
-#define EVC_ENCODING "ENCODING"
-#define EVC_QUOTEDPRINTABLE "QUOTED-PRINTABLE"
-
-#define E_TYPE_VCARD (e_vcard_get_type ())
-#define E_VCARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_VCARD, EVCard))
-#define E_VCARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_VCARD, EVCardClass))
-#define E_IS_VCARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_VCARD))
-#define E_IS_VCARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_VCARD))
-#define E_VCARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_VCARD, EVCardClass))
-
-typedef struct _EVCard EVCard;
-typedef struct _EVCardClass EVCardClass;
-typedef struct _EVCardPrivate EVCardPrivate;
-typedef struct _EVCardAttribute EVCardAttribute;
-typedef struct _EVCardAttributeParam EVCardAttributeParam;
-
-struct _EVCard {
- GObject parent;
-
- EVCardPrivate *priv;
-};
-
-struct _EVCardClass {
- GObjectClass parent_class;
-};
-
-GType e_vcard_get_type (void);
-EVCard* e_vcard_new (void);
-EVCard* e_vcard_new_from_string (const char *str);
-char* e_vcard_to_string (EVCard *evcard);
-/* mostly for debugging */
-void e_vcard_dump_structure (EVCard *evc);
-
-
-/* attributes */
-EVCardAttribute *e_vcard_attribute_new (const char *attr_group, const char *attr_name);
-void e_vcard_attribute_free (EVCardAttribute *attr);
-void e_vcard_add_attribute (EVCard *evcard, EVCardAttribute *attr);
-void e_vcard_add_attribute_with_value (EVCard *evcard, EVCardAttribute *attr, const char *value);
-void e_vcard_add_attribute_with_values (EVCard *evcard, EVCardAttribute *attr, ...);
-void e_vcard_attribute_add_value (EVCardAttribute *attr, const char *value);
-void e_vcard_attribute_add_values (EVCardAttribute *attr, ...);
-
-/* attribute parameters */
-EVCardAttributeParam* e_vcard_attribute_param_new (const char *param_name);
-void e_vcard_attribute_param_free (EVCardAttributeParam *param);
-void e_vcard_attribute_add_param (EVCardAttribute *attr, EVCardAttributeParam *param);
-void e_vcard_attribute_add_param_with_value (EVCardAttribute *attr,
- EVCardAttributeParam *param, const char *value);
-void e_vcard_attribute_add_param_with_values (EVCardAttribute *attr,
- EVCardAttributeParam *param, ...);
-
-void e_vcard_attribute_param_add_value (EVCardAttributeParam *param,
- const char *value);
-void e_vcard_attribute_param_add_values (EVCardAttributeParam *param,
- ...);
-
-/* EVCard* accessors. nothing returned from these functions should be
- freed by the caller. */
-GList* e_vcard_get_attributes (EVCard *evcard);
-const char* e_vcard_attribute_get_group (EVCardAttribute *attr);
-const char* e_vcard_attribute_get_name (EVCardAttribute *attr);
-GList* e_vcard_attribute_get_values (EVCardAttribute *attr);
-
-GList* e_vcard_attribute_get_params (EVCardAttribute *attr);
-const char* e_vcard_attribute_param_get_name (EVCardAttributeParam *param);
-GList* e_vcard_attribute_param_get_values (EVCardAttributeParam *param);
-
-
-#endif /* _EVCARD_H */
diff --git a/addressbook/backend/ebook/evolution-ldif-importer.c b/addressbook/backend/ebook/evolution-ldif-importer.c
deleted file mode 100644
index 559e591fdb..0000000000
--- a/addressbook/backend/ebook/evolution-ldif-importer.c
+++ /dev/null
@@ -1,592 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * LDIF importer. LDIF is the file format of an exported Netscape
- * addressbook.
- *
- * Framework copied from evolution-gnomecard-importer.c
- *
- * Michael M. Morrison (mmorrison@kqcorp.com)
- *
- * Multi-line value support, mailing list support, base64 support, and
- * various fixups: Chris Toshok (toshok@ximian.com)
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <e-book.h>
-#include <e-book-util.h>
-#include <e-card-simple.h>
-#include <e-destination.h>
-
-#include <libgnome/gnome-init.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-main.h>
-
-#include <importer/evolution-importer.h>
-#include <importer/GNOME_Evolution_Importer.h>
-
-#define COMPONENT_FACTORY_IID "OAFIID:GNOME_Evolution_Addressbook_LDIF_ImporterFactory"
-#define COMPONENT_IID "OAFIID:GNOME_Evolution_Addressbook_LDIF_Importer"
-
-static GHashTable *dn_card_hash;
-
-typedef struct {
- char *filename;
- GList *cardlist;
- GList *iterator;
- EBook *book;
- gboolean ready;
-} LDIFImporter;
-
-static struct {
- char *ldif_attribute;
- ECardSimpleField simple_field;
-#define FLAG_ADDRESS 0x01
- int flags;
-}
-ldif_fields[] = {
- { "cn", E_CARD_SIMPLE_FIELD_FULL_NAME },
- { "mail", E_CARD_SIMPLE_FIELD_EMAIL },
-#if 0
- { "givenname", E_CARD_SIMPLE_FIELD_GIVEN_NAME },
-#endif
- { "sn", E_CARD_SIMPLE_FIELD_FAMILY_NAME },
- { "xmozillanickname", E_CARD_SIMPLE_FIELD_NICKNAME },
- { "o", E_CARD_SIMPLE_FIELD_ORG },
- { "locality", 0, FLAG_ADDRESS},
- { "st", 0, FLAG_ADDRESS },
- { "streetaddress", 0, FLAG_ADDRESS },
- { "title", E_CARD_SIMPLE_FIELD_TITLE },
- { "postalcode", 0, FLAG_ADDRESS },
- { "countryname", 0, FLAG_ADDRESS },
- { "telephonenumber", E_CARD_SIMPLE_FIELD_PHONE_BUSINESS},
- { "homephone", E_CARD_SIMPLE_FIELD_PHONE_HOME },
- { "facsimiletelephonenumber", E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX },
- { "ou", E_CARD_SIMPLE_FIELD_ORG_UNIT },
- { "pagerphone", E_CARD_SIMPLE_FIELD_PHONE_PAGER },
- { "cellphone", E_CARD_SIMPLE_FIELD_PHONE_MOBILE },
- { "homeurl", E_CARD_SIMPLE_FIELD_URL },
- { "description", E_CARD_SIMPLE_FIELD_NOTE },
- { "xmozillausehtmlmail", E_CARD_SIMPLE_FIELD_WANTS_HTML }
-};
-static int num_ldif_fields = sizeof(ldif_fields) / sizeof (ldif_fields[0]);
-
-static unsigned char base64_rank[256] = {
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255, 62,255,255,255, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255, 0,255,255,
- 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255,
- 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
- 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-};
-
-/**
- * base64_decode_step: decode a chunk of base64 encoded data
- * @in: input stream
- * @len: max length of data to decode
- * @out: output stream
- * @state: holds the number of bits that are stored in @save
- * @save: leftover bits that have not yet been decoded
- *
- * Decodes a chunk of base64 encoded data
- **/
-static int
-base64_decode_step(unsigned char *in, int len, unsigned char *out, int *state, unsigned int *save)
-{
- register unsigned char *inptr, *outptr;
- unsigned char *inend, c;
- register unsigned int v;
- int i;
-
- inend = in+len;
- outptr = out;
-
- /* convert 4 base64 bytes to 3 normal bytes */
- v=*save;
- i=*state;
- inptr = in;
- while (inptr<inend) {
- c = base64_rank[*inptr++];
- if (c != 0xff) {
- v = (v<<6) | c;
- i++;
- if (i==4) {
- *outptr++ = v>>16;
- *outptr++ = v>>8;
- *outptr++ = v;
- i=0;
- }
- }
- }
-
- *save = v;
- *state = i;
-
- /* quick scan back for '=' on the end somewhere */
- /* fortunately we can drop 1 output char for each trailing = (upto 2) */
- i=2;
- while (inptr>in && i) {
- inptr--;
- if (base64_rank[*inptr] != 0xff) {
- if (*inptr == '=')
- outptr--;
- i--;
- }
- }
-
- /* if i!= 0 then there is a truncation error! */
- return outptr-out;
-}
-
-static int
-base64_decode_simple (char *data, int len)
-{
- int state = 0;
- unsigned int save = 0;
-
- return base64_decode_step ((unsigned char *)data, len,
- (unsigned char *)data, &state, &save);
-}
-
-static GString *
-getValue( char **src )
-{
- GString *dest = g_string_new("");
- char *s = *src;
- gboolean need_base64 = (*s == ':');
-
- copy_line:
- while( *s != 0 && *s != '\n' && *s != '\r' )
- dest = g_string_append_c (dest, *s++);
-
- if (*s == '\r') s++;
- if (*s == '\n') s++;
-
- /* check for continuation here */
- if (*s == ' ') {
- s++;
- goto copy_line;
- }
-
- if (need_base64) {
- int new_len;
- /* it's base64 encoded */
- dest = g_string_erase (dest, 0, 2);
- new_len = base64_decode_simple (dest->str, strlen (dest->str));
- dest = g_string_truncate (dest, new_len);
- }
-
- *src = s;
-
- return dest;
-}
-
-static gboolean
-parseLine( ECardSimple *simple, ECardDeliveryAddress *address, char **buf )
-{
- char *ptr;
- char *colon, *value;
- gboolean field_handled;
- GString *ldif_value;
-
- ptr = *buf;
-
- /* if the string is empty, return */
- if (*ptr == '\0') {
- *buf = NULL;
- return TRUE;
- }
-
- /* skip comment lines */
- if (*ptr == '#') {
- ptr = strchr (ptr, '\n');
- if (!ptr)
- *buf = NULL;
- else
- *buf = ptr + 1;
- return TRUE;
- }
-
- /* first, check for a 'continuation' line */
- if( ptr[0] == ' ' && ptr[1] != '\n' ) {
- g_warning ("unexpected continuation line");
- return FALSE;
- }
-
- colon = (char *)strchr( ptr, ':' );
- if (colon) {
- int i;
-
- *colon = 0;
- value = colon + 1;
- while ( isspace(*value) )
- value++;
-
- ldif_value = getValue(&value );
-
- field_handled = FALSE;
- for (i = 0; i < num_ldif_fields; i ++) {
- if (!g_ascii_strcasecmp (ptr, ldif_fields[i].ldif_attribute)) {
- if (ldif_fields[i].flags & FLAG_ADDRESS) {
- if (!g_ascii_strcasecmp (ptr, "locality"))
- address->city = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "countryname"))
- address->country = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "postalcode"))
- address->code = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "st"))
- address->region = g_strdup (ldif_value->str);
- else if (!g_ascii_strcasecmp (ptr, "streetaddress"))
- address->street = g_strdup (ldif_value->str);
- }
- else {
- e_card_simple_set (simple, ldif_fields[i].simple_field, ldif_value->str);
- printf ("set %s to %s\n", ptr, ldif_value->str);
- }
- field_handled = TRUE;
- break;
- }
- }
-
- /* handle objectclass/dn/member out here */
- if (!field_handled) {
- if (!g_ascii_strcasecmp (ptr, "dn"))
- g_hash_table_insert (dn_card_hash, g_strdup(ldif_value->str), simple->card);
- else if (!g_ascii_strcasecmp (ptr, "objectclass") && !g_ascii_strcasecmp (ldif_value->str, "groupofnames")) {
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_IS_LIST, "true");
- }
- else if (!g_ascii_strcasecmp (ptr, "member")) {
- EList *email;
- g_object_get (simple->card,
- "email", &email,
- NULL);
- e_list_append (email, ldif_value->str);
- g_object_unref (email);
- }
- }
-
- /* put the colon back the way it was, just for kicks */
- *colon = ':';
-
- g_string_free (ldif_value, TRUE);
- }
- else {
- g_warning ("unrecognized entry %s", ptr);
- return FALSE;
- }
-
- *buf = value;
-
- return TRUE;
-}
-
-static ECard *
-getNextLDIFEntry( FILE *f )
-{
- ECard *card;
- ECardAddrLabel *label;
- ECardSimple *simple;
- ECardDeliveryAddress *address;
- GString *str;
- char line[1024];
- char *buf;
-
- str = g_string_new ("");
- /* read from the file until we get to a blank line (or eof) */
- while (!feof (f)) {
- if (!fgets (line, sizeof(line), f))
- break;
- if (line[0] == '\n' || (line[0] == '\r' && line[1] == '\n'))
- break;
- str = g_string_append (str, line);
- }
-
- if (strlen (str->str) == 0) {
- g_string_free (str, TRUE);
- return NULL;
- }
-
- /* now parse that entry */
- card = e_card_new ("");
- simple = e_card_simple_new (card);
- address = e_card_delivery_address_new ();
-
- buf = str->str;
- while (buf) {
- if (!parseLine (simple, address, &buf)) {
- /* parsing error */
- g_object_unref (simple);
- e_card_delivery_address_unref (address);
- return NULL;
- }
- }
-
-
- /* fill in the address */
- address->flags = E_CARD_ADDR_HOME;
-
- label = e_card_delivery_address_to_label (address);
- e_card_delivery_address_unref (address);
-
- e_card_simple_set_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME, label);
-
- e_card_address_label_unref (label);
-
- e_card_simple_sync_card (simple);
-
- g_string_free (str, TRUE);
-
- return card;
-}
-
-static void
-add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
-{
- ECard *card = E_CARD(closure);
- char *vcard;
-
- e_card_set_id (card, id);
-
- vcard = e_card_get_vcard(card);
-
- g_print ("Saved card: %s\n", vcard);
- g_free(vcard);
-}
-
-static void
-resolve_list_card (LDIFImporter *gci, ECard *card)
-{
- EList *email;
- EIterator *email_iter;
- char *full_name;
-
- if (!e_card_evolution_list (card))
- return;
-
- g_object_get (card,
- "email", &email,
- "full_name", &full_name,
- NULL);
-
- /* set file_as to full_name so we don't later try and figure
- out a first/last name for the list. */
- if (full_name) {
- g_object_set (card,
- "file_as", full_name,
- NULL);
- g_free (full_name);
- }
-
- email_iter = e_list_get_iterator (email);
- while (e_iterator_is_valid (email_iter)) {
- const char *dn = e_iterator_get (email_iter);
- ECard *dn_card = g_hash_table_lookup (dn_card_hash, dn);
-
- /* break list chains here, since we don't support them just yet */
- if (dn_card && !e_card_evolution_list (dn_card)) {
- EDestination *dest = e_destination_new ();
- gchar *dest_xml;
- e_destination_set_card (dest, dn_card, 0); /* Hard-wired for default e-mail, since netscape only exports 1 email address */
- dest_xml = e_destination_export (dest);
- g_object_unref (dest);
- if (dest_xml) {
- e_iterator_set (email_iter, dest_xml);
- g_free (dest_xml);
- e_iterator_next (email_iter);
- }
- else {
- e_iterator_delete (email_iter);
- }
- }
- else {
- e_iterator_delete (email_iter);
- }
- }
- g_object_unref(email);
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- LDIFImporter *gci = (LDIFImporter *) closure;
- GList * list = NULL;
- GList * list_list = NULL;
- FILE * file;
- ECard *card;
-
- if(!( file = fopen( gci->filename, "r" ) )) {
- g_warning("!!!Can't open .ldif file");
- return;
- }
-
- dn_card_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- while ((card = getNextLDIFEntry (file))) {
-
- if (e_card_evolution_list (card))
- list_list = g_list_append (list_list, card);
- else
- list = g_list_append (list, card);
- }
-
- fclose( file );
-
- list = g_list_reverse( list );
- list_list = g_list_reverse (list_list);
- list = g_list_concat (list, list_list);
-
- gci->cardlist = list;
- gci->ready = TRUE;
-}
-
-static void
-ebook_open (LDIFImporter *gci, const char *uri)
-{
- gci->book = e_book_new ();
-
- if (!gci->book) {
- printf ("%s: %s(): Couldn't create EBook, bailing.\n",
- __FILE__,
- G_GNUC_FUNCTION);
- return;
- }
-
- e_book_load_address_book_by_uri (gci->book, uri, book_open_cb, gci);
-}
-
-/* EvolutionImporter methods */
-static void
-process_item_fn (EvolutionImporter *importer,
- CORBA_Object listener,
- void *closure,
- CORBA_Environment *ev)
-{
- LDIFImporter *gci = (LDIFImporter *) closure;
- ECard *card;
-
- if (gci->iterator == NULL)
- gci->iterator = gci->cardlist;
-
- if (gci->ready == FALSE) {
- GNOME_Evolution_ImporterListener_notifyResult (listener,
- GNOME_Evolution_ImporterListener_NOT_READY,
- gci->iterator ? TRUE : FALSE,
- ev);
- return;
- }
-
- if (gci->iterator == NULL) {
- GNOME_Evolution_ImporterListener_notifyResult (listener,
- GNOME_Evolution_ImporterListener_UNSUPPORTED_OPERATION,
- FALSE, ev);
- return;
- }
-
- card = gci->iterator->data;
- if (e_card_evolution_list (card))
- resolve_list_card (gci, card);
- e_book_add_card (gci->book, card, add_card_cb, card);
-
- gci->iterator = gci->iterator->next;
-
- GNOME_Evolution_ImporterListener_notifyResult (listener,
- GNOME_Evolution_ImporterListener_OK,
- gci->iterator ? TRUE : FALSE,
- ev);
- if (ev->_major != CORBA_NO_EXCEPTION) {
- g_warning ("Error notifying listeners.");
- }
-
- return;
-}
-
-static char *supported_extensions[2] = {
- ".ldif", NULL
-};
-
-static gboolean
-support_format_fn (EvolutionImporter *importer,
- const char *filename,
- void *closure)
-{
- char *ext;
- int i;
-
- ext = strrchr (filename, '.');
- if (ext == NULL) {
- return FALSE;
- }
-
- for (i = 0; supported_extensions[i] != NULL; i++) {
- if (strcmp (supported_extensions[i], ext) == 0)
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-importer_destroy_cb (gpointer data,
- GObject *where_object_was)
-{
- bonobo_main_quit ();
-}
-
-static gboolean
-load_file_fn (EvolutionImporter *importer,
- const char *filename,
- const char *uri,
- const char *folder_type,
- void *closure)
-{
- LDIFImporter *gci;
-
- gci = (LDIFImporter *) closure;
- gci->filename = g_strdup (filename);
- gci->cardlist = NULL;
- gci->iterator = NULL;
- gci->ready = FALSE;
- ebook_open (gci, uri);
-
- return TRUE;
-}
-
-static BonoboObject *
-factory_fn (BonoboGenericFactory *_factory,
- const char *component_id,
- void *closure)
-{
- EvolutionImporter *importer;
- LDIFImporter *gci;
-
- if (!strcmp (component_id, COMPONENT_IID)) {
- gci = g_new (LDIFImporter, 1);
- importer = evolution_importer_new (support_format_fn, load_file_fn,
- process_item_fn, NULL, gci);
-
- g_object_weak_ref (G_OBJECT (importer),
- importer_destroy_cb, gci);
-
- return BONOBO_OBJECT (importer);
- }
- else {
- g_warning (COMPONENT_FACTORY_IID ": Don't know what to do with %s", component_id);
- return NULL;
- }
-}
-
-BONOBO_ACTIVATION_FACTORY (COMPONENT_FACTORY_IID, "Evolution LDIF Importer Factory", VERSION, factory_fn, NULL);
diff --git a/addressbook/backend/ebook/evolution-vcard-importer.c b/addressbook/backend/ebook/evolution-vcard-importer.c
deleted file mode 100644
index c01c118cae..0000000000
--- a/addressbook/backend/ebook/evolution-vcard-importer.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#include <config.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <bonobo/bonobo-context.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-main.h>
-
-#include <e-book.h>
-#include <e-book-util.h>
-
-#include <importer/evolution-importer.h>
-#include <importer/GNOME_Evolution_Importer.h>
-
-#include <e-util/e-path.h>
-
-#define COMPONENT_FACTORY_IID "OAFIID:GNOME_Evolution_Addressbook_VCard_ImporterFactory"
-#define COMPONENT_IID "OAFIID:GNOME_Evolution_Addressbook_VCard_Importer"
-
-typedef struct {
- char *filename;
- GList *cardlist;
- GList *iterator;
- EBook *book;
- gboolean ready;
-} VCardImporter;
-
-static void
-add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
-{
- ECard *card = E_CARD(closure);
- g_object_unref(card);
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- VCardImporter *gci = (VCardImporter *) closure;
-
- gci->cardlist = e_card_load_cards_from_file_with_default_charset(gci->filename, "ISO-8859-1");
- gci->ready = TRUE;
-}
-
-static void
-ebook_open (VCardImporter *gci, const char *uri)
-{
- gci->book = e_book_new ();
-
- if (!gci->book) {
- printf ("%s: %s(): Couldn't create EBook, bailing.\n",
- __FILE__,
- G_GNUC_FUNCTION);
- return;
- }
-
- e_book_load_address_book_by_uri (gci->book, uri, book_open_cb, gci);
-}
-
-/* EvolutionImporter methods */
-static void
-process_item_fn (EvolutionImporter *importer,
- CORBA_Object listener,
- void *closure,
- CORBA_Environment *ev)
-{
- VCardImporter *gci = (VCardImporter *) closure;
- ECard *card;
-
- if (gci->iterator == NULL)
- gci->iterator = gci->cardlist;
-
- if (gci->ready == FALSE) {
- GNOME_Evolution_ImporterListener_notifyResult (listener,
- GNOME_Evolution_ImporterListener_NOT_READY,
- gci->iterator ? TRUE : FALSE,
- ev);
- return;
- }
-
- if (gci->iterator == NULL) {
- GNOME_Evolution_ImporterListener_notifyResult (listener,
- GNOME_Evolution_ImporterListener_UNSUPPORTED_OPERATION,
- FALSE, ev);
- return;
- }
-
- card = gci->iterator->data;
- e_book_add_card (gci->book, card, add_card_cb, card);
-
- gci->iterator = gci->iterator->next;
-
- GNOME_Evolution_ImporterListener_notifyResult (listener,
- GNOME_Evolution_ImporterListener_OK,
- gci->iterator ? TRUE : FALSE,
- ev);
- if (ev->_major != CORBA_NO_EXCEPTION) {
- g_warning ("Error notifying listeners.");
- }
-
- return;
-}
-
-static char *supported_extensions[3] = {
- ".vcf",
- ".gcrd",
- NULL
-};
-
-/* Actually check the contents of this file */
-static gboolean
-check_file_is_vcard (const char *filename)
-{
- FILE *handle;
- char line[4096];
- gboolean result;
-
- handle = fopen (filename, "r");
- if (handle == NULL) {
- g_print ("\n");
- return FALSE;
- }
-
- fgets (line, 4096, handle);
- if (line == NULL) {
- fclose (handle);
- g_print ("\n");
- return FALSE;
- }
-
- if (g_ascii_strncasecmp (line, "BEGIN:VCARD", 11) == 0) {
- result = TRUE;
- } else {
- result = FALSE;
- }
-
- fclose (handle);
- return result;
-}
-
-static gboolean
-support_format_fn (EvolutionImporter *importer,
- const char *filename,
- void *closure)
-{
- char *ext;
- int i;
-
- ext = strrchr (filename, '.');
- if (ext == NULL) {
- return check_file_is_vcard (filename);
- }
- for (i = 0; supported_extensions[i] != NULL; i++) {
- if (g_ascii_strcasecmp (supported_extensions[i], ext) == 0)
- return check_file_is_vcard (filename);
- }
-
- return FALSE;
-}
-
-static void
-importer_destroy_cb (gpointer data,
- GObject *where_object_was)
-{
- bonobo_main_quit ();
-}
-
-static gboolean
-load_file_fn (EvolutionImporter *importer,
- const char *filename,
- const char *uri,
- const char *folder_type,
- void *closure)
-{
- VCardImporter *gci;
-
- if (check_file_is_vcard (filename) == FALSE) {
- return FALSE;
- }
-
- gci = (VCardImporter *) closure;
- gci->filename = g_strdup (filename);
- gci->cardlist = NULL;
- gci->iterator = NULL;
- gci->ready = FALSE;
- ebook_open (gci, uri);
-
- return TRUE;
-}
-
-static BonoboObject *
-factory_fn (BonoboGenericFactory *_factory,
- const char *component_id,
- void *closure)
-{
- EvolutionImporter *importer;
- VCardImporter *gci;
-
- if (!strcmp (component_id, COMPONENT_IID)) {
- gci = g_new (VCardImporter, 1);
- importer = evolution_importer_new (support_format_fn, load_file_fn,
- process_item_fn, NULL, gci);
-
- g_object_weak_ref (G_OBJECT (importer),
- importer_destroy_cb, gci);
- return BONOBO_OBJECT (importer);
- }
- else {
- g_warning (COMPONENT_FACTORY_IID ": Don't know what to do with %s", component_id);
- return NULL;
- }
-}
-
-BONOBO_ACTIVATION_FACTORY (COMPONENT_FACTORY_IID, "Evolution VCard Importer Factory", VERSION, factory_fn, NULL);
diff --git a/addressbook/backend/ebook/load-gnomecard-addressbook.c b/addressbook/backend/ebook/load-gnomecard-addressbook.c
deleted file mode 100644
index f6fde225e0..0000000000
--- a/addressbook/backend/ebook/load-gnomecard-addressbook.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#include <config.h>
-#include <stdio.h>
-#include <glib.h>
-
-#include <bonobo/bonobo-i18n.h>
-#include <bonobo/bonobo-main.h>
-#include <libgnome/gnome-init.h>
-
-#include "e-book.h"
-
-static void
-add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
-{
- ECard *card = E_CARD(closure);
- char *vcard = e_card_get_vcard_assume_utf8(card);
- g_print ("Saved card: %s\n", vcard);
- g_free(vcard);
- g_object_unref(card);
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- GList *list = e_card_load_cards_from_file_with_default_charset("gnomecard.vcf", "ISO-8859-1");
- GList *iterator;
- for (iterator = list; iterator; iterator = g_list_next(iterator)) {
- ECard *card = iterator->data;
- e_book_add_card(book, card, add_card_cb, card);
- }
- g_list_free(list);
-}
-
-static gboolean
-ebook_create (gpointer data)
-{
- EBook *book;
- gchar *path, *uri;
-
- book = e_book_new ();
-
- if (!book) {
- printf ("%s: %s(): Couldn't create EBook, bailing.\n",
- __FILE__,
- G_GNUC_FUNCTION);
- return FALSE;
- }
-
-
- path = g_build_filename (g_get_home_dir (),
- "evolution/local/Contacts/addressbook.db",
- NULL);
- uri = g_strdup_printf ("file://%s", path);
- g_free (path);
-
- e_book_load_uri (book, uri, book_open_cb, NULL);
- g_free(uri);
-
-
- return FALSE;
-}
-
-int
-main (int argc, char **argv)
-{
- GnomeProgram *program;
-
- program = gnome_program_init ("load-gnomecard-addressbook", VERSION, LIBGNOME_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- NULL);
-
- g_idle_add (ebook_create, NULL);
-
- bonobo_main ();
-
- return 0;
-}
diff --git a/addressbook/backend/ebook/load-pine-addressbook.c b/addressbook/backend/ebook/load-pine-addressbook.c
deleted file mode 100644
index ece04bbdef..0000000000
--- a/addressbook/backend/ebook/load-pine-addressbook.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#include <config.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <glib.h>
-#include <bonobo/bonobo-i18n.h>
-#include <bonobo/bonobo-main.h>
-#include <libgnome/gnome-init.h>
-
-#include "e-book.h"
-
-static void
-add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
-{
- ECard *card = E_CARD(closure);
- char *vcard = e_card_get_vcard_assume_utf8(card);
- g_print ("Saved card: %s\n", vcard);
- g_free(vcard);
- g_object_unref(card);
-}
-
-static void
-parse_line (EBook *book, char *line)
-{
- char **strings;
- ECardName *name;
- ECard *card;
- EList *list;
-
- card = e_card_new("");
- strings = g_strsplit(line, "\t", 3);
- if (strings[0] && strings[1] && strings[2]) {
- name = e_card_name_from_string(strings[1]);
- g_object_set(card,
- "nickname", strings[0],
- "full_name", strings[1],
- "name", name,
- NULL);
- g_object_get(card,
- "email", &list,
- NULL);
- e_list_append(list, strings[2]);
- e_book_add_card(book, card, add_card_cb, card);
- g_object_unref(list);
- }
- g_strfreev(strings);
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- FILE *fp = fopen (".addressbook", "r");
- char line[2 * 1024];
- int which = 0;
- char *lastline = NULL;
-
- if (!fp) {
- g_warning ("Can't find .addressbook");
- return;
- }
-
- while(fgets(line + which * 1024, 1024, fp)) {
- int length;
- char *thisline = line + which * 1024;
- length = strlen(thisline);
- if (thisline[length - 1] == '\n')
- line[--length] = 0;
- if (lastline && *thisline && isspace(*thisline)) {
- char *temp;
- while(*thisline && isspace(*thisline))
- thisline ++;
- temp = lastline;
- lastline = g_strdup_printf("%s%s", lastline, thisline);
- g_free(temp);
- continue;
- }
- if (lastline) {
- parse_line (book, lastline);
- g_free(lastline);
- }
- lastline = g_strdup(thisline);
- }
-
- if (lastline) {
- parse_line (book, lastline);
- g_free(lastline);
- }
-}
-
-static gboolean
-ebook_create (gpointer data)
-{
- EBook *book;
- gchar *path, *uri;
-
- book = e_book_new ();
-
- if (!book) {
- printf ("%s: %s(): Couldn't create EBook, bailing.\n",
- __FILE__, G_GNUC_FUNCTION);
- return FALSE;
- }
-
-
- path = g_build_filename (g_get_home_dir (),
- "evolution/local/Contacts/addressbook.db",
- NULL);
-
- uri = g_strdup_printf ("file://%s", path);
- g_free (path);
-
- e_book_load_uri (book, uri, book_open_cb, NULL);
- g_free(uri);
-
-
- return FALSE;
-}
-
-#if 0
-static char *
-read_file (char *name)
-{
- int len;
- char buff[65536];
- char line[1024];
- FILE *f;
-
- f = fopen (name, "r");
- if (f == NULL)
- g_error ("Unable to open %s!\n", name);
-
- len = 0;
- while (fgets (line, sizeof (line), f) != NULL) {
- strcpy (buff + len, line);
- len += strlen (line);
- }
-
- fclose (f);
-
- return g_strdup (buff);
-}
-#endif
-
-int
-main (int argc, char **argv)
-{
- GnomeProgram *program;
-
- program = gnome_program_init ("load-pine-addressbook", VERSION, LIBGNOME_MODULE, argc, argv,
- GNOME_PROGRAM_STANDARD_PROPERTIES,
- NULL);
-
- g_idle_add (ebook_create, NULL);
-
- bonobo_main ();
-
- return 0;
-}
diff --git a/addressbook/backend/ebook/test-card.c b/addressbook/backend/ebook/test-card.c
deleted file mode 100644
index 21806b0313..0000000000
--- a/addressbook/backend/ebook/test-card.c
+++ /dev/null
@@ -1,193 +0,0 @@
-#include <string.h>
-#include "e-card.h"
-#include <libgnome/gnome-init.h>
-
-#define TEST_VCARD \
-"BEGIN:VCARD\r\n" \
-"FN:Nat\r\n" \
-"N:Friedman;Nat;D;Mr.\r\n" \
-"ORG:Ximian, Inc.\r\n" \
-"TITLE:Head Geek\r\n" \
-"ROLE:Programmer/Executive\r\n" \
-"BDAY:1977-08-06\r\n" \
-"TEL;WORK:617 679 1984\r\n" \
-"TEL;CELL:123 456 7890\r\n" \
-"EMAIL;INTERNET:nat@nat.org\r\n" \
-"EMAIL;INTERNET:nat@ximian.com\r\n" \
-"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;\r\n" \
-"ADR;HOME;POSTAL;INTL:P.O. Box 202;;;Any Town 2;MI;12344-4321;USA\r\n" \
-"END:VCARD\r\n" \
-"\r\n"
-
-static char *
-read_file (char *name)
-{
- int len;
- char buff[65536];
- char line[1024];
- FILE *f;
-
- f = fopen (name, "r");
- if (f == NULL)
- g_error ("Unable to open %s!\n", name);
-
- len = 0;
- while (fgets (line, sizeof (line), f) != NULL) {
- strcpy (buff + len, line);
- len += strlen (line);
- }
-
- fclose (f);
-
- return g_strdup (buff);
-}
-
-
-
-int
-main (int argc, char **argv)
-{
- char *cardstr;
- ECard *card;
-
- /* Fields */
- char *fname;
- char *org;
- char *org_unit;
- char *title;
- char *role;
- char *nickname;
- char *fburl;
- ECardName *name;
- EList *address;
- EList *phone;
- EList *email;
- EList *arbitrary;
- EIterator *iterator;
- ECardDate *bday;
-
- gnome_program_init("test-card", "0.0", LIBGNOME_MODULE, argc, argv, NULL);
-
- cardstr = NULL;
- if (argc == 2)
- cardstr = read_file (argv [1]);
-
- if (cardstr == NULL)
- cardstr = TEST_VCARD;
-#if 0
- {
- int i;
- for ( i = 0; i < 100000; i++ ) {
- card = e_card_new (cardstr);
-
- g_object_unref (card);
- }
- }
-#endif
- card = e_card_new_with_default_charset (cardstr, "ISO-8859-1");
- g_object_get(card,
- "full_name", &fname,
- "name", &name,
- "address", &address,
- "phone", &phone,
- "email", &email,
- "org", &org,
- "org_unit", &org_unit,
- "title", &title,
- "role", &role,
- "nickname", &nickname,
- "fburl", &fburl,
- "arbitrary", &arbitrary,
- "birth_date", &bday,
- NULL);
- if ( fname ) {
- printf("Name : %s\n", fname);
- g_free(fname);
- }
- if ( name ) {
- printf("Full Name:\n");
- if ( name->prefix )
- printf(" prefix : %s\n", name->prefix);
- if ( name->given )
- printf(" given : %s\n", name->given);
- if ( name->additional )
- printf(" additional : %s\n", name->additional);
- if ( name->family )
- printf(" family : %s\n", name->family);
- if ( name->suffix )
- printf(" suffix : %s\n", name->suffix);
- }
- if ( org ) {
- printf("Company : %s\n", org);
- }
- if ( org_unit ) {
- printf("Department : %s\n", org_unit);
- }
- if ( title ) {
- printf("Title : %s\n", title);
- }
- if ( role ) {
- printf("Profession : %s\n", role);
- }
- if ( nickname ) {
- printf("Nickname : %s\n", nickname);
- }
- if ( fburl ) {
- printf("Free Busy URL : %s\n", fburl);
- }
- if ( arbitrary ) {
- iterator = e_list_get_iterator(arbitrary);
- for (; e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- ECardArbitrary *arbitrary = (ECardArbitrary *) e_iterator_get(iterator);
- printf("Arbitrary : %s, %s\n", arbitrary->key, arbitrary->value);
- }
- g_object_unref(iterator);
- }
- if ( bday ) {
- printf("BDay : %4d-%02d-%02d\n", bday->year, bday->month, bday->day);
- }
- if ( email ) {
- iterator = e_list_get_iterator(address);
- for (; e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- printf("Email : %s\n", (char *) e_iterator_get(iterator));
- }
- g_object_unref(iterator);
- g_object_unref(email);
- }
- if ( phone ) {
- iterator = e_list_get_iterator(address);
- for (; e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- ECardPhone *e_card_phone = (ECardPhone *) e_iterator_get(iterator);
- printf("Phone ; %d : %s\n", e_card_phone->flags, e_card_phone->number);
- }
- g_object_unref(iterator);
- g_object_unref(phone);
- }
- if ( address ) {
- iterator = e_list_get_iterator(address);
- for (; e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- ECardDeliveryAddress *del_address = (ECardDeliveryAddress *) e_iterator_get(iterator);
- printf("Address ; %d:\n", del_address->flags);
- if ( del_address->po )
- printf(" Po : %s\n", del_address->po);
- if ( del_address->ext )
- printf(" Ext : %s\n", del_address->ext);
- if ( del_address->street )
- printf(" Street : %s\n", del_address->street);
- if ( del_address->city )
- printf(" City : %s\n", del_address->city);
- if ( del_address->region )
- printf(" Region : %s\n", del_address->region);
- if ( del_address->code )
- printf(" Code : %s\n", del_address->code);
- if ( del_address->country )
- printf(" Country : %s\n", del_address->country);
- }
- g_object_unref(iterator);
- g_object_unref(address);
- }
- printf("%s", e_card_get_vcard_assume_utf8(card));
- g_object_unref (card);
-
- return 0;
-}
diff --git a/addressbook/backend/ebook/test-client-list.c b/addressbook/backend/ebook/test-client-list.c
deleted file mode 100644
index 6fa3d6b094..0000000000
--- a/addressbook/backend/ebook/test-client-list.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#include <config.h>
-
-#include <glib.h>
-#include <bonobo/bonobo-i18n.h>
-#include <bonobo/bonobo-main.h>
-#include <libgnome/gnome-init.h>
-
-#include "e-book.h"
-
-static void
-init_bonobo (int *argc, char **argv)
-{
- if (bonobo_init (argc, argv) == FALSE)
- g_error (_("Could not initialize Bonobo"));
-}
-
-static void
-get_cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer closure)
-{
- long length = e_card_cursor_get_length(cursor);
- long i;
-
- printf ("Length: %d\n", (int) length);
- for ( i = 0; i < length; i++ ) {
- ECard *card = e_card_cursor_get_nth(cursor, i);
- char *vcard = e_card_get_vcard_assume_utf8(card);
- printf("[%s]\n", vcard);
- g_free(vcard);
- g_object_unref(card);
- }
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- printf ("Book opened.\n");
- e_book_get_cursor(book, "", get_cursor_cb, NULL);
-}
-
-static gboolean
-ebook_create (gpointer data)
-{
- EBook *book;
-
- book = e_book_new ();
-
- e_book_load_uri (book, "file:/tmp/test.db", book_open_cb, NULL);
-
- return FALSE;
-}
-
-int
-main (int argc, char **argv)
-{
- gnome_program_init("test-client-list", "0.0", LIBGNOME_MODULE, argc, argv, NULL);
-
- init_bonobo (&argc, argv);
-
- g_idle_add (ebook_create, NULL);
-
- bonobo_main ();
-
- return 0;
-}
diff --git a/addressbook/backend/ebook/test-client.c b/addressbook/backend/ebook/test-client.c
deleted file mode 100644
index 63461fb671..0000000000
--- a/addressbook/backend/ebook/test-client.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#include <config.h>
-#include <glib.h>
-#include <bonobo/bonobo-i18n.h>
-#include <bonobo/bonobo-main.h>
-#include <libgnome/gnome-init.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "e-book.h"
-#include "e-book-util.h"
-
-#define TEST_VCARD \
-"BEGIN:VCARD\r\n" \
-"FN:Nat\r\n" \
-"N:Friedman;Nat;D;Mr.\r\n" \
-"BDAY:1977-08-06\r\n" \
-"TEL;WORK:617 679 1984\r\n" \
-"TEL;CELL:123 456 7890\r\n" \
-"EMAIL;INTERNET:nat@nat.org\r\n" \
-"EMAIL;INTERNET:nat@ximian.com\r\n" \
-"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;\r\n" \
-"END:VCARD\r\n" \
-"\r\n"
-
-static CORBA_Environment ev;
-static char *cardstr;
-
-static void
-init_bonobo (int *argc, char **argv)
-{
- if (bonobo_init (argc, argv) == FALSE)
- g_error (_("Could not initialize Bonobo"));
-}
-
-static void
-get_cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer closure)
-{
- long length = e_card_cursor_get_length(cursor);
- long i;
-
- /* we just added a card, so the length should be >1 */
- printf ("\n%s: %s(): Number of cards is %ld\n",
- __FILE__, G_GNUC_FUNCTION, length);
- if (length < 1)
- printf ("*** Why isn't this above zero?? ***\n\n");
-
- for ( i = 0; i < length; i++ ) {
- ECard *card = e_card_cursor_get_nth(cursor, i);
- char *vcard = e_card_get_vcard_assume_utf8(card);
- printf("Get all cards callback: [%s]\n", vcard);
- g_free(vcard);
- g_object_unref(card);
- }
-
- g_object_unref (book);
- exit(0);
-}
-
-static void
-get_card_cb (EBook *book, EBookStatus status, ECard *card, gpointer closure)
-{
- char *vcard;
-
- vcard = e_card_get_vcard_assume_utf8(card);
- printf ("Card added: [%s]\n", vcard);
- g_free(vcard);
-
- printf ("Getting cards..\n");
- e_book_get_cursor(book, "(contains \"x-evolution-any-field\" \"\")", get_cursor_cb, NULL);
- printf ("Done getting all cards.\n");
-}
-
-static void
-add_card_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure)
-{
- GTimer *timer;
-
- printf ("Status: %d\n", status);
-
- printf ("Id: %s\n", id);
-
- timer = g_timer_new ();
- g_timer_start (timer);
- e_book_get_card (book, id, get_card_cb, closure);
- g_timer_stop (timer);
- printf ("%g\n", g_timer_elapsed (timer, NULL));
-}
-
-static void
-get_fields_cb (EBook *book, EBookStatus status, EList *fields, gpointer closure)
-{
- if (fields) {
- EIterator *iter = e_list_get_iterator (fields);
-
- printf ("Supported fields:\n");
-
- for (; e_iterator_is_valid (iter); e_iterator_next (iter)) {
- printf (" %s\n", (char*)e_iterator_get (iter));
- }
-
- g_object_unref(fields);
- }
- else {
- printf ("No supported fields?\n");
- }
-
- e_book_add_vcard(book, cardstr, add_card_cb, NULL);
-}
-
-
-static void
-auth_user_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- printf ("user authenticated\n");
- e_book_get_supported_fields (book, get_fields_cb, closure);
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- e_book_authenticate_user (book, "username", "password", "auth_method", auth_user_cb, NULL);
-}
-
-static gboolean
-ebook_create (gpointer data)
-{
- EBook *book;
-
- book = e_book_new ();
-
- if (!book) {
- printf ("%s: %s(): Couldn't create EBook, bailing.\n",
- __FILE__,
- G_GNUC_FUNCTION);
- return FALSE;
- }
-
-
- e_book_load_default_book (book, book_open_cb, NULL);
-
- return FALSE;
-}
-
-static char *
-read_file (char *name)
-{
- int len;
- char buff[65536];
- char line[1024];
- FILE *f;
-
- f = fopen (name, "r");
- if (f == NULL)
- g_error ("Unable to open %s!\n", name);
-
- len = 0;
- while (fgets (line, sizeof (line), f) != NULL) {
- strcpy (buff + len, line);
- len += strlen (line);
- }
-
- fclose (f);
-
- return g_strdup (buff);
-}
-
-
-int
-main (int argc, char **argv)
-{
-
- CORBA_exception_init (&ev);
-
- gnome_program_init("test-client", "0.0", LIBGNOME_MODULE, argc, argv, NULL);
-
- init_bonobo (&argc, argv);
-
- cardstr = NULL;
- if (argc == 2)
- cardstr = read_file (argv [1]);
-
- if (cardstr == NULL)
- cardstr = TEST_VCARD;
-
- g_idle_add (ebook_create, NULL);
-
- bonobo_main ();
-
- return 0;
-}
diff --git a/addressbook/backend/ebook/tests/.cvsignore b/addressbook/backend/ebook/tests/.cvsignore
deleted file mode 100644
index 282522db03..0000000000
--- a/addressbook/backend/ebook/tests/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/addressbook/backend/ebook/tests/Makefile.am b/addressbook/backend/ebook/tests/Makefile.am
deleted file mode 100644
index f17f979485..0000000000
--- a/addressbook/backend/ebook/tests/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS=vcard \ No newline at end of file
diff --git a/addressbook/backend/ebook/tests/vcard/.cvsignore b/addressbook/backend/ebook/tests/vcard/.cvsignore
deleted file mode 100644
index 41d78c77a2..0000000000
--- a/addressbook/backend/ebook/tests/vcard/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-dump-vcard
diff --git a/addressbook/backend/ebook/tests/vcard/1.vcf b/addressbook/backend/ebook/tests/vcard/1.vcf
deleted file mode 100644
index 308144c5f1..0000000000
--- a/addressbook/backend/ebook/tests/vcard/1.vcf
+++ /dev/null
@@ -1,12 +0,0 @@
-BEGIN:vCard
-VERSION:3.0
-FN:Frank Dawson
-ORG:Lotus Development Corporation
-ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive
- ;Raleigh;NC;27613-3502;U.S.A.
-TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
-TEL;TYPE=FAX,WORK:+1-919-676-9564
-EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
-EMAIL;TYPE=INTERNET:fdawson@earthlink.net
-URL:http://home.earthlink.net/~fdawson
-END:vCard
diff --git a/addressbook/backend/ebook/tests/vcard/10.vcf b/addressbook/backend/ebook/tests/vcard/10.vcf
deleted file mode 100644
index 4bccbe9ffb..0000000000
--- a/addressbook/backend/ebook/tests/vcard/10.vcf
+++ /dev/null
@@ -1,12 +0,0 @@
-BEGIN:vCard
-vCard.vCard.VERSION:3.0
-vCard.FN:Frank Dawson
-vCard.ORG:Lotus Development Corporation
-vCard.ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive
- ;Raleigh;NC;27613-3502;U.S.A.
-vCard.TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
-vCard.TEL;TYPE=FAX,WORK:+1-919-676-9564
-vCard.EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
-vCard.EMAIL;TYPE=INTERNET:fdawson@earthlink.net
-vCard.URL:http://home.earthlink.net/~fdawson
-END:vCard
diff --git a/addressbook/backend/ebook/tests/vcard/2.vcf b/addressbook/backend/ebook/tests/vcard/2.vcf
deleted file mode 100644
index bdf14ea1b7..0000000000
--- a/addressbook/backend/ebook/tests/vcard/2.vcf
+++ /dev/null
@@ -1,10 +0,0 @@
-BEGIN:vCard
-VERSION:3.0
-FN:Tim Howes
-ORG:Netscape Communications Corp.
-ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View;
- CA; 94043;U.S.A.
-TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419
-TEL;TYPE=FAX,WORK:+1-415-528-4164
-EMAIL;TYPE=INTERNET:howes@netscape.com
-END:vCard
diff --git a/addressbook/backend/ebook/tests/vcard/3.vcf b/addressbook/backend/ebook/tests/vcard/3.vcf
deleted file mode 100644
index 3058716959..0000000000
--- a/addressbook/backend/ebook/tests/vcard/3.vcf
+++ /dev/null
@@ -1,13 +0,0 @@
-BEGIN:VCARD
-VERSION:2.1
-X-EVOLUTION-FILE-AS:Friedman, Nat
-FN:Nat
-N:Friedman;Nat;D;Mr.
-ADR;POSTAL;WORK:P.O. Box 101;;;Any Town;CA;91921-1234
-TEL;WORK:617 679 1984
-TEL;CELL:123 456 7890
-EMAIL;INTERNET:nat@nat.org
-EMAIL;INTERNET:nat@ximian.com
-BDAY:1977-08-06
-UID:pas-id-3E65886900000002
-END:VCARD
diff --git a/addressbook/backend/ebook/tests/vcard/4.vcf b/addressbook/backend/ebook/tests/vcard/4.vcf
deleted file mode 100644
index 46878f753b..0000000000
--- a/addressbook/backend/ebook/tests/vcard/4.vcf
+++ /dev/null
@@ -1,11 +0,0 @@
-BEGIN:VCARD
-VERSION:2.1
-X-EVOLUTION-FILE-AS:address, canada
-FN:canada address
-N:address;canada
-ADR;WORK:;;92 Main St. N.;Newmarket;ON;L3Y 4A1;Canada
-ADR;HOME;PREF:;;92 Main St. N.;Newmarket;ON;L3Y 4A1;Canada
-LABEL;QUOTED-PRINTABLE;WORK:92 Main St. N.=0ANewmarket, ON L3Y 4A1=0ACanada
-LABEL;QUOTED-PRINTABLE;HOME;PREF:92 Main St. N.=0ANewmarket, ON L3Y 4A1=0ACanada
-UID:pas-id-3E84C16E00000001
-END:VCARD
diff --git a/addressbook/backend/ebook/tests/vcard/5.vcf b/addressbook/backend/ebook/tests/vcard/5.vcf
deleted file mode 100644
index 51bbe207a6..0000000000
--- a/addressbook/backend/ebook/tests/vcard/5.vcf
+++ /dev/null
@@ -1,32 +0,0 @@
-BEGIN:VCARD
-VERSION:2.1
-X-EVOLUTION-FILE-AS;CHARSET=UTF-8;QUOTED-PRINTABLE:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-FN;CHARSET=UTF-8;QUOTED-PRINTABLE:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-N;CHARSET=UTF-8:;å城目管ç†å¤§åž‹çŸ¥åº§
-ADR;WORK;PREF;QUOTED-PRINTABLE;CHARSET=UTF-8:;=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7=0A=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=
-=9F=A5=E5=BA=A7=0A=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=
-=9E=8B=E7=9F=A5=E5=BA=A7;=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-LABEL;CHARSET=UTF-8;QUOTED-PRINTABLE;WORK;PREF:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7=0A=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=
-=9F=A5=E5=BA=A7=0A=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=
-=9E=8B=E7=9F=A5=E5=BA=A7=0A=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=
-=A4=A7=E5=9E=8B=E7=9F=A5=E5=BA=A7
-TEL;CHARSET=UTF-8;QUOTED-PRINTABLE;WORK;VOICE:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-TEL;CHARSET=UTF-8;QUOTED-PRINTABLE;WORK;FAX:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-TEL;CHARSET=UTF-8;QUOTED-PRINTABLE;HOME:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-TEL;CHARSET=UTF-8;QUOTED-PRINTABLE;CELL:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-EMAIL;INTERNET:weird@weird.com
-ORG;CHARSET=UTF-8:å城目管ç†å¤§åž‹çŸ¥åº§
-TITLE;CHARSET=UTF-8;QUOTED-PRINTABLE:=E5=8D=81=E5=9F=8E=E7=9B=AE=E7=AE=A1=E7=90=86=E5=A4=A7=E5=9E=8B=E7=9F=A5=E5=
-=BA=A7
-UID:pas-id-3E52FE2E00000000
-END:VCARD
-
diff --git a/addressbook/backend/ebook/tests/vcard/6.vcf b/addressbook/backend/ebook/tests/vcard/6.vcf
deleted file mode 100644
index e5e8310eb3..0000000000
--- a/addressbook/backend/ebook/tests/vcard/6.vcf
+++ /dev/null
@@ -1,12 +0,0 @@
-BEGIN:vCard
-VERSION:3.0
-FN:Frank Dawson
-ORG:Lotus Development Corporation
-ADR;TYPE=WORK,:;;6544 Battleford Drive
- ;Raleigh;NC;27613-3502;U.S.A.
-TEL;TYPE=VOICE;MSG,WORK:+1-919-676-9515
-TEL;FAX,WORK:+1-919-676-9564
-EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
-EMAIL;TYPE=INTERNET:fdawson@earthlink.net
-URL:http://home.earthlink.net/~fdawson
-END:vCard
diff --git a/addressbook/backend/ebook/tests/vcard/7.vcf b/addressbook/backend/ebook/tests/vcard/7.vcf
deleted file mode 100644
index fb88173032..0000000000
--- a/addressbook/backend/ebook/tests/vcard/7.vcf
+++ /dev/null
@@ -1,11 +0,0 @@
-VERSION:3.0
-FN:Frank Dawson
-ORG:Lotus Development Corporation
-ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive
- ;Raleigh;NC;27613-3502;U.S.A.
-TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
-TEL;TYPE=FAX,WORK:+1-919-676-9564
-EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
-EMAIL;TYPE=INTERNET:fdawson@earthlink.net
-URL:http://home.earthlink.net/~fdawson
-END:vCard
diff --git a/addressbook/backend/ebook/tests/vcard/8.vcf b/addressbook/backend/ebook/tests/vcard/8.vcf
deleted file mode 100644
index 172d1d2c68..0000000000
--- a/addressbook/backend/ebook/tests/vcard/8.vcf
+++ /dev/null
@@ -1,11 +0,0 @@
-BEGIN:vCard
-VERSION:3.0
-FN:Frank Dawson
-ORG:Lotus Development Corporation
-ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive
- ;Raleigh;NC;27613-3502;U.S.A.
-TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
-TEL;TYPE=FAX,WORK:+1-919-676-9564
-EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
-EMAIL;TYPE=INTERNET:fdawson@earthlink.net
-URL:http://home.earthlink.net/~fdawson
diff --git a/addressbook/backend/ebook/tests/vcard/9.vcf b/addressbook/backend/ebook/tests/vcard/9.vcf
deleted file mode 100644
index 7043ab8c13..0000000000
--- a/addressbook/backend/ebook/tests/vcard/9.vcf
+++ /dev/null
@@ -1,9 +0,0 @@
-BEGIN:vCard
-VERSION:3.0
-FN:Frank Dawson
-ORG:Lotus Development Corporation
-ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive
- ;Raleigh;NC;27613-3502;U.S.A.
-TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
-TEL;TYPE=FAX,WORK:+1-919-676-9564
-E
diff --git a/addressbook/backend/ebook/tests/vcard/Makefile.am b/addressbook/backend/ebook/tests/vcard/Makefile.am
deleted file mode 100644
index ae16780095..0000000000
--- a/addressbook/backend/ebook/tests/vcard/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-
-CFLAGS=-I$(srcdir)/../.. `pkg-config --cflags gobject-2.0`
-
-noinst_PROGRAMS=dump-vcard
-
-dump_vcard_LDFLAGS=$(top_builddir)/addressbook/backend/ebook/libevcard.la `pkg-config --libs gobject-2.0`
diff --git a/addressbook/backend/ebook/tests/vcard/README b/addressbook/backend/ebook/tests/vcard/README
deleted file mode 100644
index 06ae719c5e..0000000000
--- a/addressbook/backend/ebook/tests/vcard/README
+++ /dev/null
@@ -1,41 +0,0 @@
-This is the list of tests I've been using while writing e-vcard.c.
-The parser is all handcrafted, and it's not a validating parser by any
-stretch of the imagination. It tries very hard to deal with any
-possible input (it'll even parse rfc822 mail headers and spit out
-vCard-ish results.)
-
-Test : Description
-----------------------
-
-1.vcf : Frank Dawson's vCard from RFC 2426 (missing the required N
- attribute.)
-
-2.vcf : Tim Howes's vCard from from RFC 2426 (missing the required N
- attribute.)
-
-3.vcf : Nat's old vCard.
-
-4.vcf : A vCard containing a canadian address (quoted-printable
- encoded attribute values.)
-
-5.vcf : A vCard containing utf8 characters quoted-printable encoded.
-
-6.vcf : A vCard with several errors in attribute parameters:
- line 5: an missing parameter value (a , with nothing after it).
- line 6: a missing parameter name when using multiple
- values. (this may not be in violation of the rfc.)
- line 7: a missing parameter name when using multiple
- values. (this may not be in violation of the rfc.)
-
-7.vcf : A vCard missing its begin:vcard attribute, as well as missing
- the required N attribute.
-
-8.vcf : A vCard missing its end: vcard attribute, as well as missing
- the required N attribute.
-
-9.vcf : A vCard that ends (\0) in the middle of an attribute
- name/group.
-
-10.vcf : A vCard with an attribute with more than 1 group specified.
-
-----------------------
diff --git a/addressbook/backend/ebook/tests/vcard/dump-vcard.c b/addressbook/backend/ebook/tests/vcard/dump-vcard.c
deleted file mode 100644
index 52dbf8a957..0000000000
--- a/addressbook/backend/ebook/tests/vcard/dump-vcard.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <stdio.h>
-#include "e-vcard.h"
-
-FILE *fp;
-
-int
-main(int argc, char **argv)
-{
- EVCard *vcard;
- GString *str = g_string_new ("");
-
- if (argc < 2)
- return 0;
-
- g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS);
-
- fp = fopen (argv[1], "r");
-
- while (!feof (fp)) {
- char buf[1024];
- if (fgets (buf, sizeof(buf), fp))
- str = g_string_append (str, buf);
- }
-
- vcard = e_vcard_new_from_string (str->str);
-
- e_vcard_dump_structure (vcard);
-
- return 0;
-}
diff --git a/addressbook/backend/idl/.cvsignore b/addressbook/backend/idl/.cvsignore
deleted file mode 100644
index 09980ae6ba..0000000000
--- a/addressbook/backend/idl/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/backend/idl/Makefile.am b/addressbook/backend/idl/Makefile.am
deleted file mode 100644
index e9f011975b..0000000000
--- a/addressbook/backend/idl/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-idl_DATA = \
- addressbook.idl
-
-EXTRA_DIST = $(idl_DATA)
diff --git a/addressbook/backend/idl/addressbook.idl b/addressbook/backend/idl/addressbook.idl
deleted file mode 100644
index c9ce728a15..0000000000
--- a/addressbook/backend/idl/addressbook.idl
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <Bonobo.idl>
-
-module GNOME {
-module Evolution {
-module Addressbook {
- typedef string CardId;
- typedef string VCard;
- typedef sequence<VCard> VCardList;
- typedef sequence<CardId> CardIdList;
- typedef sequence<string> stringlist;
-
- interface CardCursor : Bonobo::Unknown {
- long count ();
- string getNth (in long n);
- };
-
- /*
- * A book view is a live view of a book. It's either a view
- * of all the cards in the book or a view of a query. When
- * created, it will get a series of signal_card_added calls
- * for all objects in the initial set. After that, it will
- * get added, removed, or changed signals whenever the book
- * changes (if it affects the set of viewed cards.)
- */
- interface BookViewListener : Bonobo::Unknown {
- enum CallStatus {
- Success,
- /* These are still successful searches, but
- the result set was truncated */
- SearchSizeLimitExceeded,
- SearchTimeLimitExceeded,
-
- /* These are failures */
- InvalidQuery,
- QueryRefused,
- OtherError
- };
- void notifyCardAdded (in VCardList cards);
- void notifyCardsRemoved (in CardIdList ids);
- void notifyCardChanged (in VCardList cards);
- void notifySequenceComplete (in CallStatus status);
- void notifyStatusMessage (in string message);
- };
-
- interface BookView : Bonobo::Unknown {
- };
-
- interface Book : Bonobo::Unknown {
-
- /*
- * Fetching cards in the addresbook.
- */
- void getVCard (in CardId id);
-
- void authenticateUser (in string user, in string passwd,
- in string authMethod);
-
- /*
- * Adding and deleting cards in the book.
- */
- void addCard (in VCard vcard);
- void removeCards (in CardIdList Id);
-
- /*
- * Modifying cards in the addressbook.
- */
- void modifyCard (in VCard vcard);
-
- /*
- * This function returns a cursor to the book
- * listener. This is for people who want a snapshot
- * of the addressbook.
- */
- void getCursor (in string query);
-
- /*
- * These two functions return a book view to the book
- * listener. This is for people who want a live view
- * of the addressbook.
- */
- void getBookView (in BookViewListener listener, in string query);
-
- void getChanges (in BookViewListener listener, in string change_id);
-
- /*
- * This function returns a book view that is identical
- * to a normal book view, except in one way - The only
- * values reflected in the cards that are transfered
- * back are: File As, family name, given name, email
- * addresses, and nickname. It is intended for use in
- * completion searches.
- */
- void getCompletionView (in BookViewListener listener, in string query);
-
- void checkConnection ();
-
- void getSupportedFields ();
-
- /*
- * This function returns a list of strings
- * representing the auth methods (e.g. SASL mechs)
- * that a backend/server supports.
- *
- * Some examples are:
- *
- * "ldap/simple-email|By email Address"
- * "sasl/CRAM-MD5|CRAM-MD5(SASL)"
- *
- * The format should be:
- *
- * <class>/<type>|<i18nized string>
- *
- * "i18nized string" is shown in the UI, and should be
- * a user friendly representation of the auth method.
- *
- * in the case of SASL auth mechs, the text trailing
- * the '/' should be the proper name of the mechanism,
- * as it will be passed unchanged to the backend auth
- * function (eg. ldap_sasl_bind)
- */
- void getSupportedAuthMethods ();
-
- string getStaticCapabilities ();
-
- string getName ();
- };
-
- interface BookListener : Bonobo::Unknown {
-
- enum CallStatus {
- Success,
- RepositoryOffline,
- PermissionDenied,
- CardNotFound,
- CardIdAlreadyExists,
- ProtocolNotSupported,
- AuthenticationFailed,
- AuthenticationRequired,
- UnsupportedField,
- UnsupportedAuthenticationMethod,
- TLSNotAvailable,
- NoSuchBook,
-
- OtherError
- };
-
- void notifyCardCreated (in CallStatus status, in CardId Id);
-
- void notifyCardsRemoved (in CallStatus status);
-
- void notifyCardModified (in CallStatus status);
-
- void notifyOpenBookProgress (in string status_message, in short percent);
-
- void notifyBookOpened (in CallStatus status, in Book book);
-
- void notifyCardRequested (in CallStatus status, in VCard card);
-
- void notifyCursorRequested (in CallStatus status, in CardCursor cursor);
-
- void notifyViewRequested (in CallStatus status, in BookView view);
-
- void notifyChangesRequested (in CallStatus status, in BookView view);
-
- void notifyAuthenticationResult (in CallStatus status);
-
- void notifySupportedFields (in CallStatus status, in stringlist fields);
-
- void notifySupportedAuthMethods (in CallStatus status, in stringlist fields);
-
- /**
- * notifyConnectionStatus:
- *
- * Used to report changes in the connection to the
- * contact repository. This is often a response to a
- * call to check_connection() on the Book, but wombat
- * is free to report the connection status without
- * being asked.
- */
- void notifyConnectionStatus (in boolean connected);
-
- /**
- * notifyWritable:
- *
- * Used to report whether or not a backend can write
- * to a given addressbook. All books default to
- * read-only, so unless you receive a notification
- * saying otherwise, treat the book as read-only. It
- * is presumed that this notification will be sent
- * early (just after a connection is opened, usually),
- * but it may also be sent later, if/when the backend
- * notices a change.
- */
- void notifyWritable (in boolean writable);
- };
-
- interface BookFactory : Bonobo::Unknown {
- exception ProtocolNotSupported {};
-
- void openBook (in string uri, in BookListener listener)
- raises (ProtocolNotSupported);
- };
-};
-};
-};
diff --git a/addressbook/backend/pas/.cvsignore b/addressbook/backend/pas/.cvsignore
deleted file mode 100644
index 6eb58802ec..0000000000
--- a/addressbook/backend/pas/.cvsignore
+++ /dev/null
@@ -1,13 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-addressbook-stubs.c
-addressbook-skels.c
-addressbook-common.c
-addressbook.h
-*.lo
-*.la
-pas-marshal.c
-pas-marshal.h \ No newline at end of file
diff --git a/addressbook/backend/pas/Makefile.am b/addressbook/backend/pas/Makefile.am
deleted file mode 100644
index 92115eae19..0000000000
--- a/addressbook/backend/pas/Makefile.am
+++ /dev/null
@@ -1,101 +0,0 @@
-CORBA_SOURCE_H = addressbook.h
-
-CORBA_SOURCE_C = \
- addressbook-common.c \
- addressbook-stubs.c \
- addressbook-skels.c
-
-CORBA_SOURCE = $(CORBA_SOURCE_H) $(CORBA_SOURCE_C)
-
-idls = \
- $(srcdir)/../idl/addressbook.idl
-
-$(CORBA_SOURCE_H): $(idls)
- $(ORBIT_IDL) $(IDL_INCLUDES) -I $(srcdir) $(srcdir)/../idl/addressbook.idl
-
-$(CORBA_SOURCE_C): $(CORBA_SOURCE_H)
-
-
-INCLUDES = \
- $(DB3_CFLAGS) \
- $(LDAP_CFLAGS) \
- -DG_LOG_DOMAIN=\"wombat-pas\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -DG_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-LDAP_SCHEMA = \
- evolutionperson.schema
-
-LDAP_BACKEND_FILES = \
- pas-backend-ldap.c \
- pas-backend-ldap.h
-
-if ENABLE_LDAP
-LDAP_BACKEND = libpasldap.a
-endif
-
-ldapschemadir = $(privdatadir)
-ldapschema_DATA= $(LDAP_SCHEMA)
-
-privlib_LIBRARIES = libpas.a
-noinst_LIBRARIES = libpasfile.a $(LDAP_BACKEND)
-
-pasincludedir = $(privincludedir)/pas
-
-pasinclude_HEADERS = \
- $(CORBA_SOURCE_H) \
- pas-book-factory.h \
- pas-book-view.h \
- pas-book.h \
- pas-backend-card-sexp.h \
- pas-backend.h \
- pas-backend-summary.h \
- pas-card-cursor.h
-
-libpas_a_SOURCES = \
- $(pasinclude_HEADERS) \
- $(CORBA_SOURCE_C) \
- pas-book-factory.c \
- pas-book-view.c \
- pas-book.c \
- pas-backend-card-sexp.c \
- pas-backend-file.c \
- pas-backend.c \
- pas-backend-summary.c \
- pas-card-cursor.c \
- pas-marshal.c
-
-libpasfile_a_SOURCES = \
- pas-backend-file.c \
- pas-backend-file.h
-
-if ENABLE_LDAP
-libpasldap_a_SOURCES = \
- $(LDAP_BACKEND_FILES)
-endif
-
-# GLib marshalling cruft
-
-pas-marshal.h: pas-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=pas_marshal pas-marshal.list --header > pas-marshal.tmp \
- && mv pas-marshal.tmp pas-marshal.h ) \
- || ( rm -f pas-marshal.tmp && exit 1 )
-
-pas-marshal.c: pas-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=pas_marshal pas-marshal.list --body > pas-marshal.tmp \
- && mv pas-marshal.tmp pas-marshal.c ) \
- || ( rm -f pas-marshal.tmp && exit 1 )
-
-MARSHAL_GENERATED = pas-marshal.c pas-marshal.h
-
-BUILT_SOURCES = $(CORBA_SOURCE) $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
-EXTRA_DIST = $(LDAP_BACKEND_FILES) $(LDAP_SCHEMA) pas-marshal.list
diff --git a/addressbook/backend/pas/TODO b/addressbook/backend/pas/TODO
deleted file mode 100644
index 0c77c1b200..0000000000
--- a/addressbook/backend/pas/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-* Implement pas_book_factory_activate
-* Authentication \ No newline at end of file
diff --git a/addressbook/backend/pas/evolutionperson.schema b/addressbook/backend/pas/evolutionperson.schema
deleted file mode 100644
index cc32a96262..0000000000
--- a/addressbook/backend/pas/evolutionperson.schema
+++ /dev/null
@@ -1,212 +0,0 @@
-#
-# Depends upon
-# Definition of an X.500 Attribute Type and an Object Class to Hold
-# Uniform Resource Identifiers (URIs) [RFC2079]
-# (core.schema)
-#
-# A Summary of the X.500(96) User Schema for use with LDAPv3 [RFC2256]
-# (core.schema)
-#
-# The COSINE and Internet X.500 Schema [RFC1274] (cosine.schema)
-#
-# The Internet Organizational Person Schema (inetorgperson)
-#
-# OIDs are broken up into the following:
-# 1.3.6.1.4.1.8506.1.?
-# .1 Syntaxes
-# .2 Attributes
-# .3 Objectclasses
-
-# primaryPhone
-attributetype ( 1.3.6.1.4.1.8506.1.2.1
- NAME 'primaryPhone'
- DESC 'preferred phone number used to contact a person'
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
- SINGLE-VALUE )
-
-# carPhone
-attributetype ( 1.3.6.1.4.1.8506.1.2.2
- NAME 'carPhone'
- DESC 'car phone telephone number of the person'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50
- SINGLE-VALUE )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.3
- NAME ( 'homeFacsimileTelephoneNumber' 'homeFax' )
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.22 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.4
- NAME 'otherPhone'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.5
- NAME 'businessRole'
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.6
- NAME 'managerName'
- SUP name )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.7
- NAME 'assistantName'
- SUP name )
-
-# spouseName
-# single valued (/me smirks)
-attributetype ( 1.3.6.1.4.1.8506.1.2.8
- NAME 'spouseName'
- SUP name
- SINGLE-VALUE )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.9
- NAME 'otherPostalAddress'
- EQUALITY caseIgnoreListMatch
- SUBSTR caseIgnoreListSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.10
- NAME ( 'mailer' 'mua' )
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32} )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.11
- NAME ( 'birthDate' 'dob' )
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.12
- NAME 'anniversary'
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.13
- NAME 'note'
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.14
- NAME 'evolutionArbitrary'
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{4096} )
- )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.15
- NAME 'fileAs'
- SUP name )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.16
- NAME 'assistantPhone'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.17
- NAME 'companyPhone'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.18
- NAME 'callbackPhone'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.19
- NAME ( 'otherFacsimileTelephoneNumber' 'otherFax' )
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.22 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.20
- NAME 'radio'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.21
- NAME 'telex'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.22
- NAME 'tty'
- EQUALITY telephoneNumberMatch
- SUBSTR telephoneNumberSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )
-
-# deprecated - use the multivalued category
-attributetype ( 1.3.6.1.4.1.8506.1.2.23
- NAME 'categories'
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{4096} )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.24
- NAME 'contact'
- EQUALITY distinguishedNameMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.25
- NAME 'listName'
- SUP name
- SINGLE-VALUE )
-
-# deprecated - use calEntry and its attributes from RFC 2739
-attributetype ( 1.3.6.1.4.1.8506.1.2.26
- NAME 'calendarURI'
- EQUALITY caseExactIA5Match
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
- SINGLE-VALUE )
-
-# deprecated - use calEntry and its attributes from RFC 2739
-attributetype ( 1.3.6.1.4.1.8506.1.2.27
- NAME 'freeBusyURI'
- EQUALITY caseExactIA5Match
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
- SINGLE-VALUE )
-
-attributetype ( 1.3.6.1.4.1.8506.1.2.28
- NAME 'category'
- EQUALITY caseIgnoreMatch
- SUBSTR caseIgnoreSubstringsMatch
- SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{4096} )
-
-
-# evolutionPerson
-objectclass ( 1.3.6.1.4.1.8506.1.3.1
- NAME 'evolutionPerson'
- DESC 'Objectclass geared to Evolution Usage'
- SUP inetOrgPerson
- STRUCTURAL
- MAY (
- fileAs $ primaryPhone $ carPhone $ homeFacsimileTelephoneNumber $
- otherPhone $ businessRole $ managerName $ assistantName $ assistantPhone $
- otherPostalAddress $ mailer $ birthDate $ anniversary $ spouseName $
- note $ companyPhone $ callbackPhone $ otherFacsimileTelephoneNumber $
- radio $ telex $ tty $ categories $ category $ calendarURI $ freeBusyURI )
- )
-
-# evolutionPersonList
-objectclass ( 1.3.6.1.4.1.8506.1.3.2
- NAME 'evolutionPersonList'
- DESC 'Objectclass geared to Evolution Contact Lists'
- SUP top
- STRUCTURAL
- MUST (
- listName )
- MAY (
- mail $ contact )
- )
diff --git a/addressbook/backend/pas/pas-backend-card-sexp.c b/addressbook/backend/pas/pas-backend-card-sexp.c
deleted file mode 100644
index e7b5d8a87d..0000000000
--- a/addressbook/backend/pas/pas-backend-card-sexp.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * pas-backend-card-sexp.c
- * Copyright 1999, 2000, 2001, Ximian, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include "pas-backend-card-sexp.h"
-
-#include <string.h>
-#include <e-util/e-sexp.h>
-#include <ebook/e-card-simple.h>
-#include <gal/widgets/e-unicode.h>
-
-static GObjectClass *parent_class;
-
-typedef struct _SearchContext SearchContext;
-
-struct _PASBackendCardSExpPrivate {
- ESExp *search_sexp;
- SearchContext *search_context;
-};
-
-struct _SearchContext {
- ECardSimple *card;
-};
-
-static gboolean
-compare_email (ECardSimple *card, const char *str,
- char *(*compare)(const char*, const char*))
-{
- int i;
-
- for (i = E_CARD_SIMPLE_EMAIL_ID_EMAIL; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++) {
- const char *email = e_card_simple_get_email (card, i);
-
- if (email && compare(email, str))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-compare_phone (ECardSimple *card, const char *str,
- char *(*compare)(const char*, const char*))
-{
- int i;
-
- for (i = E_CARD_SIMPLE_PHONE_ID_ASSISTANT; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++) {
- const ECardPhone *phone = e_card_simple_get_phone (card, i);
-
- if (phone && compare(phone->number, str))
- return TRUE;
- }
-
- return FALSE;
-}
-
-static gboolean
-compare_name (ECardSimple *card, const char *str,
- char *(*compare)(const char*, const char*))
-{
- const char *name;
-
- name = e_card_simple_get_const (card, E_CARD_SIMPLE_FIELD_FULL_NAME);
- if (name && compare (name, str))
- return TRUE;
-
- name = e_card_simple_get_const (card, E_CARD_SIMPLE_FIELD_FAMILY_NAME);
- if (name && compare (name, str))
- return TRUE;
-
- return FALSE;
-}
-
-static gboolean
-compare_address (ECardSimple *card, const char *str,
- char *(*compare)(const char*, const char*))
-{
- g_warning("address searching not implemented\n");
- return FALSE;
-}
-
-static gboolean
-compare_category (ECardSimple *card, const char *str,
- char *(*compare)(const char*, const char*))
-{
- EList *categories;
- EIterator *iterator;
- ECard *ecard;
- gboolean ret_val = FALSE;
-
- g_object_get (card,
- "card", &ecard,
- NULL);
- g_object_get (ecard,
- "category_list", &categories,
- NULL);
-
- for (iterator = e_list_get_iterator(categories); e_iterator_is_valid (iterator); e_iterator_next (iterator)) {
- const char *category = e_iterator_get (iterator);
-
- if (compare(category, str)) {
- ret_val = TRUE;
- break;
- }
- }
-
- g_object_unref (iterator);
- e_card_free_empty_lists (ecard);
- g_object_unref (categories);
- g_object_unref (ecard);
- return ret_val;
-}
-
-static gboolean
-compare_arbitrary (ECardSimple *card, const char *str,
- char *(*compare)(const char*, const char*))
-{
- EList *list;
- EIterator *iterator;
- ECard *ecard;
- gboolean ret_val = FALSE;
-
- g_object_get (card,
- "card", &ecard,
- NULL);
- g_object_get (ecard,
- "arbitrary", &list,
- NULL);
-
- for (iterator = e_list_get_iterator(list); e_iterator_is_valid (iterator); e_iterator_next (iterator)) {
- const ECardArbitrary *arbitrary = e_iterator_get (iterator);
-
- if (compare(arbitrary->key, str)) {
- ret_val = TRUE;
- break;
- }
- }
-
- g_object_unref (iterator);
- e_card_free_empty_lists (ecard);
- g_object_unref (list);
- g_object_unref (ecard);
- return ret_val;
-}
-
-static struct prop_info {
- ECardSimpleField field_id;
- const char *query_prop;
- const char *ecard_prop;
-#define PROP_TYPE_NORMAL 0x01
-#define PROP_TYPE_LIST 0x02
-#define PROP_TYPE_LISTITEM 0x03
-#define PROP_TYPE_ID 0x04
- int prop_type;
- gboolean (*list_compare)(ECardSimple *ecard, const char *str,
- char *(*compare)(const char*, const char*));
-
-} prop_info_table[] = {
-#define NORMAL_PROP(f,q,e) {f, q, e, PROP_TYPE_NORMAL, NULL}
-#define ID_PROP {0, "id", NULL, PROP_TYPE_ID, NULL}
-#define LIST_PROP(q,e,c) {0, q, e, PROP_TYPE_LIST, c}
-
- /* query prop, ecard prop, type, list compare function */
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_FILE_AS, "file_as", "file_as" ),
- LIST_PROP ( "full_name", "full_name", compare_name), /* not really a list, but we need to compare both full and surname */
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_URL, "url", "url" ),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_MAILER, "mailer", "mailer"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_ORG, "org", "org"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_ORG_UNIT, "org_unit", "org_unit"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_OFFICE, "office", "office"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_TITLE, "title", "title"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_ROLE, "role", "role"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_MANAGER, "manager", "manager"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_ASSISTANT, "assistant", "assistant"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_NICKNAME, "nickname", "nickname"),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_SPOUSE, "spouse", "spouse" ),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_NOTE, "note", "note"),
- ID_PROP,
- LIST_PROP ( "email", "email", compare_email ),
- LIST_PROP ( "phone", "phone", compare_phone ),
- LIST_PROP ( "address", "address", compare_address ),
- LIST_PROP ( "category", "category", compare_category ),
- LIST_PROP ( "arbitrary", "arbitrary", compare_arbitrary )
-};
-static int num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]);
-
-static ESExpResult *
-entry_compare(SearchContext *ctx, struct _ESExp *f,
- int argc, struct _ESExpResult **argv,
- char *(*compare)(const char*, const char*))
-{
- ESExpResult *r;
- int truth = FALSE;
-
- if (argc == 2
- && argv[0]->type == ESEXP_RES_STRING
- && argv[1]->type == ESEXP_RES_STRING) {
- char *propname;
- struct prop_info *info = NULL;
- int i;
- gboolean any_field;
-
- propname = argv[0]->value.string;
-
- any_field = !strcmp(propname, "x-evolution-any-field");
- for (i = 0; i < num_prop_infos; i ++) {
- if (any_field
- || !strcmp (prop_info_table[i].query_prop, propname)) {
- info = &prop_info_table[i];
-
- if (info->prop_type == PROP_TYPE_NORMAL) {
- char *prop = NULL;
- /* searches where the query's property
- maps directly to an ecard property */
-
- prop = e_card_simple_get (ctx->card, info->field_id);
-
- if (prop && compare(prop, argv[1]->value.string)) {
- truth = TRUE;
- }
- if ((!prop) && compare("", argv[1]->value.string)) {
- truth = TRUE;
- }
- g_free (prop);
- } else if (info->prop_type == PROP_TYPE_LIST) {
- /* the special searches that match any of the list elements */
- truth = info->list_compare (ctx->card, argv[1]->value.string, compare);
- } else if (info->prop_type == PROP_TYPE_ID) {
- const char *prop = NULL;
- /* searches where the query's property
- maps directly to an ecard property */
-
- prop = e_card_get_id (ctx->card->card);
-
- if (prop && compare(prop, argv[1]->value.string)) {
- truth = TRUE;
- }
- if ((!prop) && compare("", argv[1]->value.string)) {
- truth = TRUE;
- }
- }
-
- /* if we're looking at all fields and find a match,
- or if we're just looking at this one field,
- break. */
- if ((any_field && truth)
- || !any_field)
- break;
- }
- }
-
- }
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
-
- return r;
-}
-
-static ESExpResult *
-func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- SearchContext *ctx = data;
-
- return entry_compare (ctx, f, argc, argv, (char *(*)(const char*, const char*)) e_utf8_strstrcase);
-}
-
-static char *
-is_helper (const char *s1, const char *s2)
-{
- if (!strcasecmp(s1, s2))
- return (char*)s1;
- else
- return NULL;
-}
-
-static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- SearchContext *ctx = data;
-
- return entry_compare (ctx, f, argc, argv, is_helper);
-}
-
-static char *
-endswith_helper (const char *s1, const char *s2)
-{
- char *p;
- if ((p = (char*)e_utf8_strstrcase(s1, s2))
- && (strlen(p) == strlen(s2)))
- return p;
- else
- return NULL;
-}
-
-static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- SearchContext *ctx = data;
-
- return entry_compare (ctx, f, argc, argv, endswith_helper);
-}
-
-static char *
-beginswith_helper (const char *s1, const char *s2)
-{
- char *p;
- if ((p = (char*)e_utf8_strstrcase(s1, s2))
- && (p == s1))
- return p;
- else
- return NULL;
-}
-
-static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- SearchContext *ctx = data;
-
- return entry_compare (ctx, f, argc, argv, beginswith_helper);
-}
-
-/* 'builtin' functions */
-static struct {
- char *name;
- ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
- doesn't execute everything, 0 otherwise */
-} symbols[] = {
- { "contains", func_contains, 0 },
- { "is", func_is, 0 },
- { "beginswith", func_beginswith, 0 },
- { "endswith", func_endswith, 0 },
-};
-
-gboolean
-pas_backend_card_sexp_match_ecard (PASBackendCardSExp *sexp, ECard *ecard)
-{
- ESExpResult *r;
- gboolean retval;
-
- sexp->priv->search_context->card = e_card_simple_new (ecard);
-
- /* if it's not a valid vcard why is it in our db? :) */
- if (!sexp->priv->search_context->card)
- return FALSE;
-
- r = e_sexp_eval(sexp->priv->search_sexp);
-
- retval = (r && r->type == ESEXP_RES_BOOL && r->value.bool);
-
- g_object_unref(sexp->priv->search_context->card);
-
- e_sexp_result_free(sexp->priv->search_sexp, r);
-
- return retval;
-}
-
-gboolean
-pas_backend_card_sexp_match_vcard (PASBackendCardSExp *sexp, const char *vcard)
-{
- ECard *card;
- gboolean retval;
-
- card = e_card_new ((char*)vcard);
-
- retval = pas_backend_card_sexp_match_ecard (sexp, card);
-
- g_object_unref(card);
-
- return retval;
-}
-
-
-
-/**
- * pas_backend_card_sexp_new:
- */
-PASBackendCardSExp *
-pas_backend_card_sexp_new (const char *text)
-{
- PASBackendCardSExp *sexp = g_object_new (PAS_TYPE_BACKEND_CARD_SEXP, NULL);
- int esexp_error;
- int i;
-
- sexp->priv->search_sexp = e_sexp_new();
-
- for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
- if (symbols[i].type == 1) {
- e_sexp_add_ifunction(sexp->priv->search_sexp, 0, symbols[i].name,
- (ESExpIFunc *)symbols[i].func, sexp->priv->search_context);
- } else {
- e_sexp_add_function(sexp->priv->search_sexp, 0, symbols[i].name,
- symbols[i].func, sexp->priv->search_context);
- }
- }
-
- e_sexp_input_text(sexp->priv->search_sexp, text, strlen(text));
- esexp_error = e_sexp_parse(sexp->priv->search_sexp);
-
- if (esexp_error == -1) {
- g_object_unref (sexp);
- sexp = NULL;
- }
-
- return sexp;
-}
-
-static void
-pas_backend_card_sexp_dispose (GObject *object)
-{
- PASBackendCardSExp *sexp = PAS_BACKEND_CARD_SEXP (object);
-
- if (sexp->priv) {
- e_sexp_unref(sexp->priv->search_sexp);
-
- g_free (sexp->priv->search_context);
- g_free (sexp->priv);
- sexp->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-pas_backend_card_sexp_class_init (PASBackendCardSExpClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Set the virtual methods. */
-
- object_class->dispose = pas_backend_card_sexp_dispose;
-}
-
-static void
-pas_backend_card_sexp_init (PASBackendCardSExp *sexp)
-{
- PASBackendCardSExpPrivate *priv;
-
- priv = g_new0 (PASBackendCardSExpPrivate, 1);
-
- sexp->priv = priv;
- priv->search_context = g_new (SearchContext, 1);
-}
-
-/**
- * pas_backend_card_sexp_get_type:
- */
-GType
-pas_backend_card_sexp_get_type (void)
-{
- static GType type = 0;
-
- if (! type) {
- GTypeInfo info = {
- sizeof (PASBackendCardSExpClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) pas_backend_card_sexp_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PASBackendCardSExp),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pas_backend_card_sexp_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "PASBackendCardSExp", &info, 0);
- }
-
- return type;
-}
diff --git a/addressbook/backend/pas/pas-backend-card-sexp.h b/addressbook/backend/pas/pas-backend-card-sexp.h
deleted file mode 100644
index eb7c7c6641..0000000000
--- a/addressbook/backend/pas/pas-backend-card-sexp.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * pas-backend-card-sexp.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef __PAS_BACKEND_CARD_SEXP_H__
-#define __PAS_BACKEND_CARD_SEXP_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <ebook/e-card.h>
-
-#define PAS_TYPE_BACKEND_CARD_SEXP (pas_backend_card_sexp_get_type ())
-#define PAS_BACKEND_CARD_SEXP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BACKEND_CARD_SEXP, PASBackendCardSExp))
-#define PAS_BACKEND_CARD_SEXP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_BACKEND_TYPE, PASBackendCardSExpClass))
-#define PAS_IS_BACKEND_CARD_SEXP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BACKEND_CARD_SEXP))
-#define PAS_IS_BACKEND_CARD_SEXP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BACKEND_CARD_SEXP))
-#define PAS_BACKEND_CARD_SEXP_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BACKEND_CARD_SEXP, PASBackendCardSExpClass))
-
-typedef struct _PASBackendCardSExpPrivate PASBackendCardSExpPrivate;
-
-typedef struct {
- GObject parent_object;
- PASBackendCardSExpPrivate *priv;
-} PASBackendCardSExp;
-
-typedef struct {
- GObjectClass parent_class;
-} PASBackendCardSExpClass;
-
-PASBackendCardSExp *pas_backend_card_sexp_new (const char *text);
-GType pas_backend_card_sexp_get_type (void);
-
-gboolean pas_backend_card_sexp_match_vcard (PASBackendCardSExp *sexp, const char *vcard);
-gboolean pas_backend_card_sexp_match_ecard (PASBackendCardSExp *sexp, ECard *ecard);
-
-#endif /* __PAS_BACKEND_CARD_SEXP_H__ */
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
deleted file mode 100644
index b11c62cb86..0000000000
--- a/addressbook/backend/pas/pas-backend-file.c
+++ /dev/null
@@ -1,1617 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include "config.h"
-#include "pas-backend-file.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <db.h>
-#include <sys/stat.h>
-
-#include <e-util/e-db3-utils.h>
-
-#if DB_VERSION_MAJOR != 3 || \
- DB_VERSION_MINOR != 1 || \
- DB_VERSION_PATCH != 17
-#error Including wrong DB3. Need libdb 3.1.17.
-#endif
-
-#include <gal/util/e-util.h>
-#include <gal/widgets/e-unicode.h>
-
-#include <ebook/e-card-simple.h>
-#include <e-util/e-dbhash.h>
-#include <e-util/e-db3-utils.h>
-#include <libgnome/gnome-i18n.h>
-
-#include "pas-book.h"
-#include "pas-card-cursor.h"
-#include "pas-backend-card-sexp.h"
-#include "pas-backend-summary.h"
-
-#define PAS_BACKEND_FILE_VERSION_NAME "PAS-DB-VERSION"
-#define PAS_BACKEND_FILE_VERSION "0.2"
-
-#define PAS_ID_PREFIX "pas-id-"
-#define SUMMARY_FLUSH_TIMEOUT 5000
-
-static PASBackendClass *pas_backend_file_parent_class;
-typedef struct _PASBackendFileCursorPrivate PASBackendFileCursorPrivate;
-typedef struct _PASBackendFileBookView PASBackendFileBookView;
-typedef struct _PASBackendFileSearchContext PASBackendFileSearchContext;
-typedef struct _PasBackendFileChangeContext PASBackendFileChangeContext;
-
-struct _PASBackendFilePrivate {
- char *uri;
- char *filename;
- DB *file_db;
- EList *book_views;
- GHashTable *address_lists;
- PASBackendSummary *summary;
-};
-
-struct _PASBackendFileCursorPrivate {
- PASBackend *backend;
- PASBook *book;
-
- GList *elements;
- guint32 num_elements;
-};
-
-struct _PASBackendFileBookView {
- PASBookView *book_view;
- gchar *search;
- PASBackendCardSExp *card_sexp;
- gchar *change_id;
- PASBackendFileChangeContext *change_context;
-};
-
-struct _PasBackendFileChangeContext {
- DB *db;
-
- GList *add_cards;
- GList *add_ids;
- GList *mod_cards;
- GList *mod_ids;
- GList *del_ids;
-};
-
-static void
-string_to_dbt(const char *str, DBT *dbt)
-{
- memset (dbt, 0, sizeof (*dbt));
- dbt->data = (void*)str;
- dbt->size = strlen (str) + 1;
-}
-
-static void
-build_summary (PASBackendFilePrivate *bfpriv)
-{
- DB *db = bfpriv->file_db;
- DBC *dbc;
- int db_error;
- DBT id_dbt, vcard_dbt;
-
- db_error = db->cursor (db, NULL, &dbc, 0);
-
- if (db_error != 0) {
- g_warning ("pas_backend_file_build_all_cards_list: error building list\n");
- }
-
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
- memset (&id_dbt, 0, sizeof (id_dbt));
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_FIRST);
-
- while (db_error == 0) {
-
- /* don't include the version in the list of cards */
- if (id_dbt.size != strlen(PAS_BACKEND_FILE_VERSION_NAME) + 1
- || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
-
- pas_backend_summary_add_card (bfpriv->summary, vcard_dbt.data);
- }
-
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
-
- }
-}
-
-static void
-do_summary_query (PASBackendFile *bf,
- PASBackendFileBookView *view,
- gboolean completion_search)
-{
- GPtrArray *ids = pas_backend_summary_search (bf->priv->summary, view->search);
- int db_error = 0;
- GList *cards = NULL;
- gint card_count = 0, card_threshold = 20, card_threshold_max = 3000;
- DB *db = bf->priv->file_db;
- DBT id_dbt, vcard_dbt;
- int i;
-
- for (i = 0; i < ids->len; i ++) {
- char *id = g_ptr_array_index (ids, i);
- char *vcard = NULL;
-
-#if SUMMARY_STORES_ENOUGH_INFO
- /* this is disabled for the time being because lists
- can have more than 3 email addresses and the
- summary only stores 3. */
-
- if (completion_search) {
- vcard = pas_backend_summary_get_summary_vcard (bf->priv->summary,
- id);
- }
- else {
-#endif
- string_to_dbt (id, &id_dbt);
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
-
- if (db_error == 0)
- vcard = g_strdup (vcard_dbt.data);
-#if SUMMARY_STORES_ENOUGH_INFO
- }
-#endif
-
- if (vcard) {
- cards = g_list_prepend (cards, vcard);
- card_count ++;
-
- /* If we've accumulated a number of checks, pass them off to the client. */
- if (card_count >= card_threshold) {
- pas_book_view_notify_add (view->book_view, cards);
- /* Clean up the handed-off data. */
- g_list_foreach (cards, (GFunc)g_free, NULL);
- g_list_free (cards);
- cards = NULL;
- card_count = 0;
-
- /* Yeah, this scheme is overly complicated. But I like it. */
- if (card_threshold < card_threshold_max) {
- card_threshold = MIN (2*card_threshold, card_threshold_max);
- }
- }
- }
- else
- continue; /* XXX */
- }
-
- g_ptr_array_free (ids, TRUE);
-
- if (card_count)
- pas_book_view_notify_add (view->book_view, cards);
-
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-
- g_list_foreach (cards, (GFunc)g_free, NULL);
- g_list_free (cards);
-}
-
-static PASBackendFileBookView *
-pas_backend_file_book_view_copy(const PASBackendFileBookView *book_view, void *closure)
-{
- PASBackendFileBookView *new_book_view;
- new_book_view = g_new (PASBackendFileBookView, 1);
- new_book_view->book_view = book_view->book_view;
-
- new_book_view->search = g_strdup(book_view->search);
- new_book_view->card_sexp = book_view->card_sexp;
- if (new_book_view->card_sexp)
- g_object_ref(new_book_view->card_sexp);
-
- new_book_view->change_id = g_strdup(book_view->change_id);
- if (book_view->change_context) {
- new_book_view->change_context = g_new(PASBackendFileChangeContext, 1);
- new_book_view->change_context->db = book_view->change_context->db;
- new_book_view->change_context->add_cards = book_view->change_context->add_cards;
- new_book_view->change_context->add_ids = book_view->change_context->add_ids;
- new_book_view->change_context->mod_cards = book_view->change_context->mod_cards;
- new_book_view->change_context->mod_ids = book_view->change_context->mod_ids;
- new_book_view->change_context->del_ids = book_view->change_context->del_ids;
- } else
- new_book_view->change_context = NULL;
-
- return new_book_view;
-}
-
-static void
-pas_backend_file_book_view_free(PASBackendFileBookView *book_view, void *closure)
-{
- g_free(book_view->search);
- if (book_view->card_sexp)
- g_object_unref (book_view->card_sexp);
-
- g_free(book_view->change_id);
- if (book_view->change_context) {
- g_list_foreach (book_view->change_context->add_cards, (GFunc)g_free, NULL);
- g_list_foreach (book_view->change_context->add_ids, (GFunc)g_free, NULL);
- g_list_foreach (book_view->change_context->mod_cards, (GFunc)g_free, NULL);
- g_list_foreach (book_view->change_context->mod_ids, (GFunc)g_free, NULL);
- g_list_foreach (book_view->change_context->del_ids, (GFunc)g_free, NULL);
- g_list_free (book_view->change_context->add_cards);
- g_list_free (book_view->change_context->add_ids);
- g_list_free (book_view->change_context->mod_cards);
- g_list_free (book_view->change_context->mod_ids);
- g_list_free (book_view->change_context->del_ids);
- }
- g_free(book_view->change_context);
-
- g_free(book_view);
-}
-
-static long
-get_length(PASCardCursor *cursor, gpointer data)
-{
- PASBackendFileCursorPrivate *cursor_data = (PASBackendFileCursorPrivate *) data;
-
- return cursor_data->num_elements;
-}
-
-static char *
-get_nth(PASCardCursor *cursor, long n, gpointer data)
-{
- PASBackendFileCursorPrivate *cursor_data = (PASBackendFileCursorPrivate *) data;
- GList *nth_item = g_list_nth(cursor_data->elements, n);
-
- return g_strdup((char*)nth_item->data);
-}
-
-static void
-cursor_destroy(gpointer data, GObject *where_object_was)
-{
- CORBA_Environment ev;
- GNOME_Evolution_Addressbook_Book corba_book;
- PASBackendFileCursorPrivate *cursor_data = (PASBackendFileCursorPrivate *) data;
-
- corba_book = bonobo_object_corba_objref(BONOBO_OBJECT(cursor_data->book));
-
- CORBA_exception_init(&ev);
-
- GNOME_Evolution_Addressbook_Book_unref(corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("cursor_destroy: Exception unreffing "
- "corba book.\n");
- }
-
- CORBA_exception_free(&ev);
-
- g_list_foreach(cursor_data->elements, (GFunc)g_free, NULL);
- g_list_free (cursor_data->elements);
-
- g_free(cursor_data);
-}
-
-static void
-view_destroy(gpointer data, GObject *where_object_was)
-{
- PASBook *book = (PASBook *)data;
- PASBackendFile *bf;
- EIterator *iterator;
- gboolean success = FALSE;
-
- bf = PAS_BACKEND_FILE(pas_book_get_backend(book));
- for (iterator = e_list_get_iterator(bf->priv->book_views); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- const PASBackendFileBookView *view = e_iterator_get(iterator);
- if (view->book_view == (PASBookView*)where_object_was) {
- e_iterator_delete(iterator);
- success = TRUE;
- break;
- }
- }
- if (!success)
- g_warning ("Failed to remove from book_views list");
- g_object_unref(iterator);
-
- bonobo_object_unref(BONOBO_OBJECT(book));
-}
-
-static char *
-pas_backend_file_create_unique_id (char *vcard)
-{
- /* use a 32 counter and the 32 bit timestamp to make an id.
- it's doubtful 2^32 id's will be created in a second, so we
- should be okay. */
- static guint c = 0;
- return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time(NULL), c++);
-}
-
-static gboolean
-vcard_matches_search (const PASBackendFileBookView *view, char *vcard_string)
-{
- /* If this is not a search context view, it doesn't match be default */
- if (view->card_sexp == NULL)
- return FALSE;
-
- return pas_backend_card_sexp_match_vcard (view->card_sexp, vcard_string);
-}
-
-static gboolean
-ecard_matches_search (const PASBackendFileBookView *view, ECard *card)
-{
- /* If this is not a search context view, it doesn't match be default */
- if (view->card_sexp == NULL)
- return FALSE;
-
- return pas_backend_card_sexp_match_ecard (view->card_sexp, card);
-}
-
-typedef struct {
- PASBackendFile *bf;
- PASBook *book;
- const PASBackendFileBookView *view;
- DBC *dbc;
-
- int card_count;
- int card_threshold;
- int card_threshold_max;
- GList *cards;
-
- gboolean done_first;
- gboolean search_needed;
-} FileBackendSearchClosure;
-
-static void
-free_search_closure (FileBackendSearchClosure *closure)
-{
- g_list_foreach (closure->cards, (GFunc)g_free, NULL);
- g_list_free (closure->cards);
- g_free (closure);
-}
-
-static gboolean
-pas_backend_file_search_timeout (gpointer data)
-{
- FileBackendSearchClosure *closure = data;
- int db_error = 0;
- DBT id_dbt, vcard_dbt;
- int file_version_name_len;
- DBC *dbc = closure->dbc;
-
- file_version_name_len = strlen (PAS_BACKEND_FILE_VERSION_NAME);
-
- memset (&id_dbt, 0, sizeof (id_dbt));
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- if (closure->done_first) {
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
- }
- else {
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_FIRST);
- closure->done_first = TRUE;
- }
-
- while (db_error == 0) {
-
- /* don't include the version in the list of cards */
- if (strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
- char *vcard_string = vcard_dbt.data;
-
- /* check if the vcard matches the search sexp */
- if ((!closure->search_needed) || vcard_matches_search (closure->view, vcard_string)) {
- closure->cards = g_list_prepend (closure->cards, g_strdup (vcard_string));
- closure->card_count ++;
- }
-
- /* If we've accumulated a number of checks, pass them off to the client. */
- if (closure->card_count >= closure->card_threshold) {
- pas_book_view_notify_add (closure->view->book_view, closure->cards);
- /* Clean up the handed-off data. */
- g_list_foreach (closure->cards, (GFunc)g_free, NULL);
- g_list_free (closure->cards);
- closure->cards = NULL;
- closure->card_count = 0;
-
- /* Yeah, this scheme is overly complicated. But I like it. */
- if (closure->card_threshold < closure->card_threshold_max) {
- closure->card_threshold = MIN (2*closure->card_threshold, closure->card_threshold_max);
- }
-
- /* return here, we'll do the next lump in the next callback */
- g_timeout_add (200, pas_backend_file_search_timeout, closure);
-
- return FALSE;
- }
- }
-
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
- }
-
- dbc->c_close (dbc);
-
- if (db_error != DB_NOTFOUND) {
- g_warning ("pas_backend_file_search: error building list\n");
- free_search_closure (closure);
- }
-
- if (closure->card_count)
- pas_book_view_notify_add (closure->view->book_view, closure->cards);
-
- pas_book_view_notify_complete (closure->view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-
- free_search_closure (closure);
-
- return FALSE;
-}
-
-
-static void
-pas_backend_file_search (PASBackendFile *bf,
- PASBook *book,
- const PASBackendFileBookView *cnstview,
- gboolean completion_search)
-{
- PASBackendFileBookView *view = (PASBackendFileBookView *)cnstview;
- gboolean search_needed;
-
- search_needed = TRUE;
-
- if ( ! strcmp (view->search, "(contains \"x-evolution-any-field\" \"\")"))
- search_needed = FALSE;
-
- if (search_needed)
- pas_book_view_notify_status_message (view->book_view, _("Searching..."));
- else
- pas_book_view_notify_status_message (view->book_view, _("Loading..."));
-
- if (view->card_sexp) {
- g_object_unref (view->card_sexp);
- view->card_sexp = NULL;
- }
-
- view->card_sexp = pas_backend_card_sexp_new (view->search);
-
- if (!view->card_sexp) {
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_InvalidQuery);
- return;
- }
-
- if (pas_backend_summary_is_summary_query (bf->priv->summary, view->search)) {
- do_summary_query (bf, view, completion_search);
- }
- else {
- FileBackendSearchClosure *closure = g_new0 (FileBackendSearchClosure, 1);
- DB *db = bf->priv->file_db;
- int db_error;
-
- closure->card_threshold = 20;
- closure->card_threshold_max = 3000;
- closure->search_needed = search_needed;
- closure->view = view;
- closure->bf = bf;
- closure->book = book;
-
- db_error = db->cursor (db, NULL, &closure->dbc, 0);
-
- if (db_error != 0) {
- g_warning ("pas_backend_file_search: error building list\n");
- } else {
- g_idle_add (pas_backend_file_search_timeout, closure);
- }
- }
-}
-
-static void
-pas_backend_file_changes_foreach_key (const char *key, gpointer user_data)
-{
- PASBackendFileChangeContext *ctx = user_data;
- DB *db = ctx->db;
- DBT id_dbt, vcard_dbt;
- int db_error = 0;
-
- string_to_dbt (key, &id_dbt);
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
- db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
-
- if (db_error != 0) {
- char *id = id_dbt.data;
-
- ctx->del_ids = g_list_append (ctx->del_ids, g_strdup (id));
- }
-}
-
-static void
-pas_backend_file_changes (PASBackendFile *bf,
- PASBook *book,
- const PASBackendFileBookView *cnstview)
-{
- int db_error = 0;
- DBT id_dbt, vcard_dbt;
- char *filename;
- EDbHash *ehash;
- GList *i, *v;
- DB *db = bf->priv->file_db;
- DBC *dbc;
- PASBackendFileBookView *view = (PASBackendFileBookView *)cnstview;
- PASBackendFileChangeContext *ctx = cnstview->change_context;
- char *dirname, *slash;
-
- memset (&id_dbt, 0, sizeof (id_dbt));
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- /* Find the changed ids */
- dirname = g_strdup (bf->priv->filename);
- slash = strrchr (dirname, '/');
- *slash = '\0';
-
- filename = g_strdup_printf ("%s/%s.db", dirname, view->change_id);
- ehash = e_dbhash_new (filename);
- g_free (filename);
- g_free (dirname);
-
- db_error = db->cursor (db, NULL, &dbc, 0);
-
- if (db_error != 0) {
- g_warning ("pas_backend_file_changes: error building list\n");
- } else {
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_FIRST);
-
- while (db_error == 0) {
-
- /* don't include the version in the list of cards */
- if (id_dbt.size != strlen(PAS_BACKEND_FILE_VERSION_NAME) + 1
- || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
- ECard *card;
- char *id = id_dbt.data;
- char *vcard_string;
-
- /* Remove fields the user can't change
- * and can change without the rest of the
- * card changing
- */
- card = e_card_new (vcard_dbt.data);
- g_object_set (card, "last_use", NULL, "use_score", 0.0, NULL);
- vcard_string = e_card_get_vcard_assume_utf8 (card);
- g_object_unref (card);
-
- /* check what type of change has occurred, if any */
- switch (e_dbhash_compare (ehash, id, vcard_string)) {
- case E_DBHASH_STATUS_SAME:
- break;
- case E_DBHASH_STATUS_NOT_FOUND:
- ctx->add_cards = g_list_append (ctx->add_cards,
- vcard_string);
- ctx->add_ids = g_list_append (ctx->add_ids, g_strdup(id));
- break;
- case E_DBHASH_STATUS_DIFFERENT:
- ctx->mod_cards = g_list_append (ctx->mod_cards,
- vcard_string);
- ctx->mod_ids = g_list_append (ctx->mod_ids, g_strdup(id));
- break;
- }
- }
-
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
- }
- dbc->c_close (dbc);
- }
-
- e_dbhash_foreach_key (ehash, (EDbHashFunc)pas_backend_file_changes_foreach_key, view->change_context);
-
- /* Send the changes */
- if (db_error != DB_NOTFOUND) {
- g_warning ("pas_backend_file_changes: error building list\n");
- } else {
- if (ctx->add_cards != NULL)
- pas_book_view_notify_add (view->book_view, ctx->add_cards);
-
- if (ctx->mod_cards != NULL)
- pas_book_view_notify_change (view->book_view, ctx->mod_cards);
-
- for (v = ctx->del_ids; v != NULL; v = v->next){
- char *id = v->data;
- pas_book_view_notify_remove_1 (view->book_view, id);
- }
-
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
- }
-
- /* Update the hash */
- for (i = ctx->add_ids, v = ctx->add_cards; i != NULL; i = i->next, v = v->next){
- char *id = i->data;
- char *vcard = v->data;
-
- e_dbhash_add (ehash, id, vcard);
- g_free (i->data);
- g_free (v->data);
- }
- for (i = ctx->mod_ids, v = ctx->mod_cards; i != NULL; i = i->next, v = v->next){
- char *id = i->data;
- char *vcard = v->data;
-
- e_dbhash_add (ehash, id, vcard);
- g_free (i->data);
- g_free (v->data);
- }
- for (i = ctx->del_ids; i != NULL; i = i->next){
- char *id = i->data;
-
- e_dbhash_remove (ehash, id);
- g_free (i->data);
- }
-
- e_dbhash_write (ehash);
- e_dbhash_destroy (ehash);
-}
-
-static char *
-do_create(PASBackend *backend,
- char *vcard_req,
- char **vcard_ptr)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- DB *db = bf->priv->file_db;
- DBT id_dbt, vcard_dbt;
- int db_error;
- char *id;
- ECard *card;
- char *vcard;
- char *ret_val;
-
- id = pas_backend_file_create_unique_id (vcard_req);
-
- string_to_dbt (id, &id_dbt);
-
- card = e_card_new(vcard_req);
- e_card_set_id(card, id);
- vcard = e_card_get_vcard_assume_utf8(card);
-
- string_to_dbt (vcard, &vcard_dbt);
-
- db_error = db->put (db, NULL, &id_dbt, &vcard_dbt, 0);
-
- if (0 == db_error) {
- db_error = db->sync (db, 0);
- if (db_error != 0)
- g_warning ("db->sync failed.\n");
- ret_val = id;
-
- }
- else {
- g_free (id);
- ret_val = NULL;
- }
-
- g_object_unref(card);
- card = NULL;
-
- if (vcard_ptr && ret_val)
- *vcard_ptr = vcard;
- else
- g_free (vcard);
-
- return ret_val;
-}
-
-static void
-pas_backend_file_process_create_card (PASBackend *backend,
- PASBook *book,
- PASCreateCardRequest *req)
-{
- char *id;
- char *vcard;
- EIterator *iterator;
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
-
- id = do_create(backend, req->vcard, &vcard);
- if (id) {
- for (iterator = e_list_get_iterator(bf->priv->book_views); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- const PASBackendFileBookView *view = e_iterator_get(iterator);
- if (vcard_matches_search (view, vcard)) {
- bonobo_object_ref (BONOBO_OBJECT (view->book_view));
- pas_book_view_notify_add_1 (view->book_view, vcard);
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
- bonobo_object_unref (BONOBO_OBJECT (view->book_view));
- }
- }
- g_object_unref(iterator);
-
- pas_book_respond_create (
- book,
- GNOME_Evolution_Addressbook_BookListener_Success,
- id);
-
- pas_backend_summary_add_card (bf->priv->summary, vcard);
-
- g_free(vcard);
- g_free(id);
- }
- else {
- /* XXX need a different call status for this case, i
- think */
- pas_book_respond_create (
- book,
- GNOME_Evolution_Addressbook_BookListener_CardNotFound,
- "");
- }
-}
-
-static void
-pas_backend_file_process_remove_cards (PASBackend *backend,
- PASBook *book,
- PASRemoveCardsRequest *req)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- DB *db = bf->priv->file_db;
- DBT id_dbt, vcard_dbt;
- int db_error;
- EIterator *iterator;
- const char *id;
- GList *l;
- GList *removed_cards = NULL;
- GNOME_Evolution_Addressbook_BookListener_CallStatus rv = GNOME_Evolution_Addressbook_BookListener_Success;
-
- for (l = req->ids; l; l = l->next) {
- id = l->data;
-
- string_to_dbt (id, &id_dbt);
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
- if (0 != db_error) {
- rv = GNOME_Evolution_Addressbook_BookListener_CardNotFound;
- continue;
- }
-
- db_error = db->del (db, NULL, &id_dbt, 0);
- if (0 != db_error) {
- rv = GNOME_Evolution_Addressbook_BookListener_CardNotFound;
- continue;
- }
-
- removed_cards = g_list_prepend (removed_cards, e_card_new (vcard_dbt.data));
- }
-
- /* if we actually removed some, try to sync */
- if (removed_cards) {
- db_error = db->sync (db, 0);
- if (db_error != 0)
- g_warning ("db->sync failed.\n");
- }
-
- for (iterator = e_list_get_iterator (bf->priv->book_views); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- const PASBackendFileBookView *view = e_iterator_get(iterator);
- GList *view_removed = NULL;
- for (l = removed_cards; l; l = l->next) {
- ECard *removed_card = l->data;
- if (ecard_matches_search (view, removed_card)) {
- view_removed = g_list_prepend (view_removed, (char*)e_card_get_id (removed_card));
- }
- }
- if (view_removed) {
- bonobo_object_ref (BONOBO_OBJECT (view->book_view));
- pas_book_view_notify_remove (view->book_view, view_removed);
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
- bonobo_object_unref (BONOBO_OBJECT (view->book_view));
- g_list_free (view_removed);
- }
- }
- g_object_unref(iterator);
-
- pas_book_respond_remove (book, rv);
-
- for (l = removed_cards; l; l = l->next) {
- ECard *c = l->data;
- pas_backend_summary_remove_card (bf->priv->summary, e_card_get_id (c));
- g_object_unref (c);
- }
-
- g_list_free (removed_cards);
-}
-
-static void
-pas_backend_file_process_modify_card (PASBackend *backend,
- PASBook *book,
- PASModifyCardRequest *req)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- DB *db = bf->priv->file_db;
- DBT id_dbt, vcard_dbt;
- int db_error;
- EIterator *iterator;
- ECard *card;
- const char *id, *lookup_id;
- char *old_vcard_string;
-
- /* create a new ecard from the request data */
- card = e_card_new(req->vcard);
- id = e_card_get_id(card);
-
- /* This is disgusting, but for a time cards were added with
- ID's that are no longer used (they contained both the uri
- and the id.) If we recognize it as a uri (file:///...) trim
- off everything before the last '/', and use that as the
- id.*/
- if (!strncmp (id, "file:///", strlen ("file:///"))) {
- lookup_id = strrchr (id, '/') + 1;
- }
- else
- lookup_id = id;
-
- string_to_dbt (lookup_id, &id_dbt);
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- /* get the old ecard - the one that's presently in the db */
- db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
- if (0 != db_error) {
- pas_book_respond_modify (
- book,
- GNOME_Evolution_Addressbook_BookListener_CardNotFound);
- return;
- }
- old_vcard_string = g_strdup(vcard_dbt.data);
-
- string_to_dbt (req->vcard, &vcard_dbt);
-
- db_error = db->put (db, NULL, &id_dbt, &vcard_dbt, 0);
-
- if (0 == db_error) {
- db_error = db->sync (db, 0);
- if (db_error != 0)
- g_warning ("db->sync failed.\n");
-
- for (iterator = e_list_get_iterator(bf->priv->book_views); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
- CORBA_Environment ev;
- const PASBackendFileBookView *view = e_iterator_get(iterator);
- gboolean old_match, new_match;
-
- CORBA_exception_init(&ev);
-
- bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- old_match = vcard_matches_search (view, old_vcard_string);
- new_match = vcard_matches_search (view, req->vcard);
- if (old_match && new_match)
- pas_book_view_notify_change_1 (view->book_view, req->vcard);
- else if (new_match)
- pas_book_view_notify_add_1 (view->book_view, req->vcard);
- else /* if (old_match) */
- pas_book_view_notify_remove_1 (view->book_view, id);
-
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-
- bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- CORBA_exception_free (&ev);
- }
-
- g_object_unref(iterator);
-
- pas_book_respond_modify (
- book,
- GNOME_Evolution_Addressbook_BookListener_Success);
-
- pas_backend_summary_remove_card (bf->priv->summary, id);
- pas_backend_summary_add_card (bf->priv->summary, req->vcard);
- }
- else {
- pas_book_respond_modify (
- book,
- GNOME_Evolution_Addressbook_BookListener_CardNotFound);
- }
-
- g_free(old_vcard_string);
-
- g_object_unref(card);
-}
-
-static void
-pas_backend_file_build_cards_list(PASBackend *backend,
- PASBackendFileCursorPrivate *cursor_data,
- char *search)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- DB *db = bf->priv->file_db;
- DBC *dbc;
- int db_error;
- DBT id_dbt, vcard_dbt;
- PASBackendCardSExp *card_sexp = NULL;
- gboolean search_needed;
-
- cursor_data->elements = NULL;
-
- search_needed = TRUE;
-
- if (!strcmp (search, "(contains \"x-evolution-any-field\" \"\")"))
- search_needed = FALSE;
-
- card_sexp = pas_backend_card_sexp_new (search);
-
- if (!card_sexp)
- g_warning ("pas_backend_file_build_all_cards_list: error building list\n");
-
- db_error = db->cursor (db, NULL, &dbc, 0);
-
- if (db_error != 0) {
- g_warning ("pas_backend_file_build_all_cards_list: error building list\n");
- }
-
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
- memset (&id_dbt, 0, sizeof (id_dbt));
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_FIRST);
-
- while (db_error == 0) {
-
- /* don't include the version in the list of cards */
- if (id_dbt.size != strlen(PAS_BACKEND_FILE_VERSION_NAME) + 1
- || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
-
- if ((!search_needed) || (card_sexp != NULL && pas_backend_card_sexp_match_vcard (card_sexp, vcard_dbt.data))) {
- cursor_data->elements = g_list_prepend (cursor_data->elements, g_strdup (vcard_dbt.data));
- }
- }
-
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
-
- }
-
- if (db_error != DB_NOTFOUND) {
- g_warning ("pas_backend_file_build_all_cards_list: error building list\n");
- }
- else {
- cursor_data->num_elements = g_list_length (cursor_data->elements);
- cursor_data->elements = g_list_reverse (cursor_data->elements);
- }
-}
-
-static void
-pas_backend_file_process_get_vcard (PASBackend *backend,
- PASBook *book,
- PASGetVCardRequest *req)
-{
- PASBackendFile *bf;
- DB *db;
- DBT id_dbt, vcard_dbt;
- int db_error = 0;
- char *card;
- GNOME_Evolution_Addressbook_BookListener_CallStatus status;
-
- bf = PAS_BACKEND_FILE (pas_book_get_backend (book));
- db = bf->priv->file_db;
-
- string_to_dbt (req->id, &id_dbt);
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
-
- if (db_error == 0) {
- card = vcard_dbt.data;
- status = GNOME_Evolution_Addressbook_BookListener_Success;
- } else {
- card = "";
- status = GNOME_Evolution_Addressbook_BookListener_CardNotFound;
- }
-
- pas_book_respond_get_vcard (book,
- status,
- card);
-}
-
-static void
-pas_backend_file_process_get_cursor (PASBackend *backend,
- PASBook *book,
- PASGetCursorRequest *req)
-{
- /*
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- DB *db = bf->priv->file_db;
- DBT id_dbt, vcard_dbt;
- */
- CORBA_Environment ev;
- int db_error = 0;
- PASBackendFileCursorPrivate *cursor_data;
- PASCardCursor *cursor;
- GNOME_Evolution_Addressbook_Book corba_book;
-
- cursor_data = g_new(PASBackendFileCursorPrivate, 1);
- cursor_data->backend = backend;
- cursor_data->book = book;
-
- pas_backend_file_build_cards_list(backend, cursor_data, req->search);
-
- corba_book = bonobo_object_corba_objref(BONOBO_OBJECT(book));
-
- CORBA_exception_init(&ev);
-
- GNOME_Evolution_Addressbook_Book_ref(corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("pas_backend_file_process_get_cursor: Exception reffing "
- "corba book.\n");
- }
-
- CORBA_exception_free(&ev);
-
- cursor = pas_card_cursor_new(get_length,
- get_nth,
- cursor_data);
-
- g_object_weak_ref (G_OBJECT (cursor),
- cursor_destroy, cursor_data);
-
- pas_book_respond_get_cursor (
- book,
- (db_error == 0
- ? GNOME_Evolution_Addressbook_BookListener_Success
- : GNOME_Evolution_Addressbook_BookListener_CardNotFound),
- cursor);
-}
-
-static void
-pas_backend_file_process_get_book_view (PASBackend *backend,
- PASBook *book,
- PASGetBookViewRequest *req)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- PASBookView *book_view;
- PASBackendFileBookView view;
- EIterator *iterator;
-
- bonobo_object_ref(BONOBO_OBJECT(book));
-
- book_view = pas_book_view_new (req->listener);
-
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
-
- view.book_view = book_view;
- view.search = g_strdup (req->search);
- view.card_sexp = NULL;
- view.change_id = NULL;
- view.change_context = NULL;
-
- e_list_append(bf->priv->book_views, &view);
-
- pas_book_respond_get_book_view (book,
- (book_view != NULL
- ? GNOME_Evolution_Addressbook_BookListener_Success
- : GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */),
- book_view);
-
- if (!pas_backend_is_loaded (backend))
- return;
-
- iterator = e_list_get_iterator(bf->priv->book_views);
- e_iterator_last(iterator);
- pas_backend_file_search (bf, book, e_iterator_get(iterator), FALSE);
- g_object_unref(iterator);
-}
-
-static void
-pas_backend_file_process_get_completion_view (PASBackend *backend,
- PASBook *book,
- PASGetCompletionViewRequest *req)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- PASBookView *book_view;
- PASBackendFileBookView view;
- EIterator *iterator;
-
- bonobo_object_ref(BONOBO_OBJECT(book));
-
- book_view = pas_book_view_new (req->listener);
-
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
-
- view.book_view = book_view;
- view.search = g_strdup (req->search);
- view.card_sexp = NULL;
- view.change_id = NULL;
- view.change_context = NULL;
-
- e_list_append(bf->priv->book_views, &view);
-
- pas_book_respond_get_completion_view (book,
- (book_view != NULL
- ? GNOME_Evolution_Addressbook_BookListener_Success
- : GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */),
- book_view);
-
- if (!pas_backend_is_loaded (backend))
- return;
-
- iterator = e_list_get_iterator(bf->priv->book_views);
- e_iterator_last(iterator);
- pas_backend_file_search (bf, book, e_iterator_get(iterator), TRUE);
- g_object_unref(iterator);
-}
-
-static void
-pas_backend_file_process_get_changes (PASBackend *backend,
- PASBook *book,
- PASGetChangesRequest *req)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- PASBookView *book_view;
- PASBackendFileBookView view;
- PASBackendFileChangeContext ctx;
- EIterator *iterator;
-
- bonobo_object_ref(BONOBO_OBJECT(book));
-
- book_view = pas_book_view_new (req->listener);
-
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
-
- pas_book_respond_get_changes (book,
- (book_view != NULL
- ? GNOME_Evolution_Addressbook_BookListener_Success
- : GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */),
- book_view);
-
- view.book_view = book_view;
- view.change_id = req->change_id;
- view.change_context = &ctx;
- ctx.db = bf->priv->file_db;
- ctx.add_cards = NULL;
- ctx.add_ids = NULL;
- ctx.mod_cards = NULL;
- ctx.mod_ids = NULL;
- ctx.del_ids = NULL;
- view.search = NULL;
- view.card_sexp = NULL;
-
- e_list_append(bf->priv->book_views, &view);
-
- if (!pas_backend_is_loaded (backend))
- return;
-
- iterator = e_list_get_iterator(bf->priv->book_views);
- e_iterator_last(iterator);
- pas_backend_file_changes (bf, book, e_iterator_get(iterator));
- g_object_unref(iterator);
-}
-
-static void
-pas_backend_file_process_check_connection (PASBackend *backend,
- PASBook *book,
- PASCheckConnectionRequest *req)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
-
- pas_book_report_connection (book, bf->priv->file_db != NULL);
-}
-
-static char *
-pas_backend_file_extract_path_from_uri (const char *uri)
-{
- g_assert (strncasecmp (uri, "file:", 5) == 0);
-
- return g_strdup (uri + 5);
-}
-
-static void
-pas_backend_file_process_authenticate_user (PASBackend *backend,
- PASBook *book,
- PASAuthenticateUserRequest *req)
-{
- pas_book_respond_authenticate_user (book,
- GNOME_Evolution_Addressbook_BookListener_Success);
-}
-
-static void
-pas_backend_file_process_get_supported_fields (PASBackend *backend,
- PASBook *book,
- PASGetSupportedFieldsRequest *req)
-{
- EList *fields = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
- ECardSimple *simple;
- ECard *card;
- int i;
-
- /* we support everything, so instantiate an e-card, and loop
- through all fields, adding their ecard_fields. */
-
- card = e_card_new ("");
- simple = e_card_simple_new (card);
-
- for (i = 0; i < E_CARD_SIMPLE_FIELD_LAST; i ++)
- e_list_append (fields, e_card_simple_get_ecard_field (simple, i));
-
- g_object_unref (card);
- g_object_unref (simple);
-
- pas_book_respond_get_supported_fields (book,
- GNOME_Evolution_Addressbook_BookListener_Success,
- fields);
-}
-
-/*
-** versions:
-**
-** 0.0 just a list of cards
-**
-** 0.1 same as 0.0, but with the version tag
-**
-** 0.2 not a real format upgrade, just a hack to fix broken ids caused
-** by a bug in early betas, but we only need to convert them if
-** the previous version is 0.1, since the bug existed after 0.1
-** came about.
-*/
-static gboolean
-pas_backend_file_upgrade_db (PASBackendFile *bf, char *old_version)
-{
- DB *db = bf->priv->file_db;
- int db_error;
- DBT version_name_dbt, version_dbt;
-
- if (strcmp (old_version, "0.0")
- && strcmp (old_version, "0.1")) {
- g_warning ("unsupported version '%s' found in PAS backend file\n",
- old_version);
- return FALSE;
- }
-
- if (!strcmp (old_version, "0.1")) {
- /* we just loop through all the cards in the db,
- giving them valid ids if they don't have them */
- DBT id_dbt, vcard_dbt;
- DBC *dbc;
- int card_failed = 0;
-
- db_error = db->cursor (db, NULL, &dbc, 0);
- if (db_error != 0) {
- g_warning ("unable to get cursor");
- return FALSE;
- }
-
- memset (&id_dbt, 0, sizeof (id_dbt));
- memset (&vcard_dbt, 0, sizeof (vcard_dbt));
-
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_FIRST);
-
- while (db_error == 0) {
- if (id_dbt.size != strlen(PAS_BACKEND_FILE_VERSION_NAME) + 1
- || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
- ECard *card;
-
- card = e_card_new (vcard_dbt.data);
-
- /* the cards we're looking for are
- created with a normal id dbt, but
- with the id field in the vcard set
- to something that doesn't match.
- so, we need to modify the card to
- have the same id as the the dbt. */
- if (strcmp (id_dbt.data, e_card_get_id (card))) {
- char *vcard;
-
- e_card_set_id (card, id_dbt.data);
-
- vcard = e_card_get_vcard (card);
- string_to_dbt (vcard, &vcard_dbt);
-
- db_error = db->put (db, NULL,
- &id_dbt, &vcard_dbt, 0);
-
- g_free (vcard);
-
- if (db_error != 0)
- card_failed++;
- }
-
- g_object_unref (card);
- }
-
- db_error = dbc->c_get(dbc, &id_dbt, &vcard_dbt, DB_NEXT);
- }
-
- if (card_failed) {
- g_warning ("failed to update %d cards\n", card_failed);
- return FALSE;
- }
- }
-
- string_to_dbt (PAS_BACKEND_FILE_VERSION_NAME, &version_name_dbt);
- string_to_dbt (PAS_BACKEND_FILE_VERSION, &version_dbt);
-
- db_error = db->put (db, NULL, &version_name_dbt, &version_dbt, 0);
- if (db_error == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-static gboolean
-pas_backend_file_maybe_upgrade_db (PASBackendFile *bf)
-{
- DB *db = bf->priv->file_db;
- DBT version_name_dbt, version_dbt;
- int db_error;
- char *version;
- gboolean ret_val = TRUE;
-
- string_to_dbt (PAS_BACKEND_FILE_VERSION_NAME, &version_name_dbt);
- memset (&version_dbt, 0, sizeof (version_dbt));
-
- db_error = db->get (db, NULL, &version_name_dbt, &version_dbt, 0);
- if (db_error == 0) {
- /* success */
- version = g_strdup (version_dbt.data);
- }
- else {
- /* key was not in file */
- version = g_strdup ("0.0");
- }
-
- if (strcmp (version, PAS_BACKEND_FILE_VERSION))
- ret_val = pas_backend_file_upgrade_db (bf, version);
-
- g_free (version);
-
- return ret_val;
-}
-
-#define INITIAL_VCARD "BEGIN:VCARD\n\
-X-EVOLUTION-FILE-AS:Ximian, Inc.\n\
-LABEL;WORK;QUOTED-PRINTABLE:401 Park Drive 3 West=0ABoston, MA 02215=0AUSA\n\
-TEL;WORK;VOICE:(617) 375-3800\n\
-TEL;WORK;FAX:(617) 236-8630\n\
-EMAIL;INTERNET:hello@ximian.com\n\
-URL:www.ximian.com/\n\
-ORG:Ximian, Inc.;\n\
-NOTE:Welcome to the Ximian Addressbook.\n\
-END:VCARD"
-
-static GNOME_Evolution_Addressbook_BookListener_CallStatus
-pas_backend_file_load_uri (PASBackend *backend,
- const char *uri)
-{
- PASBackendFile *bf = PAS_BACKEND_FILE (backend);
- char *filename;
- gboolean writable = FALSE;
- int db_error;
- DB *db;
- int major, minor, patch;
- time_t db_mtime;
- struct stat sb;
- char *summary_filename;
-
- g_free(bf->priv->uri);
- bf->priv->uri = g_strdup (uri);
-
- db_version (&major, &minor, &patch);
-
- if (major != 3 ||
- minor != 1 ||
- patch != 17) {
- g_warning ("Wrong version of libdb.");
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
- }
-
- filename = pas_backend_file_extract_path_from_uri (uri);
-
- db_error = e_db3_utils_maybe_recover (filename);
- if (db_error != 0)
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
-
- db_error = db_create (&db, NULL, 0);
- if (db_error != 0)
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
-
- db_error = db->open (db, filename, NULL, DB_HASH, 0, 0666);
-
- if (db_error == DB_OLD_VERSION) {
- db_error = e_db3_utils_upgrade_format (filename);
-
- if (db_error != 0)
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
-
- db_error = db->open (db, filename, NULL, DB_HASH, 0, 0666);
- }
-
- bf->priv->file_db = db;
-
- if (db_error == 0) {
- writable = TRUE;
- } else {
- db_error = db->open (db, filename, NULL, DB_HASH, DB_RDONLY, 0666);
-
- if (db_error != 0) {
- db_error = db->open (db, filename, NULL, DB_HASH, DB_CREATE, 0666);
-
- if (db_error == 0) {
- char *create_initial_file;
- char *dir;
-
- dir = g_path_get_dirname(filename);
- create_initial_file = g_build_filename (dir, "create-initial", NULL);
-
- if (g_file_test(create_initial_file, G_FILE_TEST_EXISTS)) {
- char *id;
- id = do_create(backend, INITIAL_VCARD, NULL);
- g_free (id);
- }
-
- g_free(create_initial_file);
- g_free(dir);
-
- writable = TRUE;
- }
- }
- }
-
- if (db_error != 0) {
- bf->priv->file_db = NULL;
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
- }
-
- if (!pas_backend_file_maybe_upgrade_db (bf)) {
- db->close (db, 0);
- bf->priv->file_db = NULL;
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
- }
-
- g_free (bf->priv->filename);
- bf->priv->filename = filename;
-
- if (stat (bf->priv->filename, &sb) == -1) {
- db->close (db, 0);
- bf->priv->file_db = NULL;
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
- }
- db_mtime = sb.st_mtime;
-
- summary_filename = g_strconcat (bf->priv->filename, ".summary", NULL);
- bf->priv->summary = pas_backend_summary_new (summary_filename, SUMMARY_FLUSH_TIMEOUT);
- g_free (summary_filename);
-
- if (pas_backend_summary_is_up_to_date (bf->priv->summary, db_mtime) == FALSE
- || pas_backend_summary_load (bf->priv->summary) == FALSE ) {
- build_summary (bf->priv);
- }
-
- pas_backend_set_is_loaded (backend, TRUE);
- pas_backend_set_is_writable (backend, writable);
- return GNOME_Evolution_Addressbook_BookListener_Success;
-}
-
-/* Get_uri handler for the addressbook file backend */
-static const char *
-pas_backend_file_get_uri (PASBackend *backend)
-{
- PASBackendFile *bf;
-
- bf = PAS_BACKEND_FILE (backend);
-
- g_assert (bf->priv->uri != NULL);
-
- return bf->priv->uri;
-}
-
-static char *
-pas_backend_file_get_static_capabilities (PASBackend *backend)
-{
- return g_strdup("local,do-initial-query,bulk-removes");
-}
-
-static gboolean
-pas_backend_file_construct (PASBackendFile *backend)
-{
- g_assert (backend != NULL);
- g_assert (PAS_IS_BACKEND_FILE (backend));
-
- if (! pas_backend_construct (PAS_BACKEND (backend)))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * pas_backend_file_new:
- */
-PASBackend *
-pas_backend_file_new (void)
-{
- PASBackendFile *backend;
-
- backend = g_object_new (PAS_TYPE_BACKEND_FILE, NULL);
-
- if (! pas_backend_file_construct (backend)) {
- g_object_unref (backend);
-
- return NULL;
- }
-
- return PAS_BACKEND (backend);
-}
-
-static void
-pas_backend_file_dispose (GObject *object)
-{
- PASBackendFile *bf;
-
- bf = PAS_BACKEND_FILE (object);
-
- if (bf->priv) {
- g_object_unref(bf->priv->book_views);
- if (bf->priv->summary)
- g_object_unref(bf->priv->summary);
- g_free (bf->priv->uri);
- g_free (bf->priv->filename);
-
- g_free (bf->priv);
- bf->priv = NULL;
- }
-
- G_OBJECT_CLASS (pas_backend_file_parent_class)->dispose (object);
-}
-
-static void
-pas_backend_file_class_init (PASBackendFileClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- PASBackendClass *parent_class;
-
- pas_backend_file_parent_class = g_type_class_peek_parent (klass);
-
- parent_class = PAS_BACKEND_CLASS (klass);
-
- /* Set the virtual methods. */
- parent_class->load_uri = pas_backend_file_load_uri;
- parent_class->get_uri = pas_backend_file_get_uri;
- parent_class->get_static_capabilities = pas_backend_file_get_static_capabilities;
-
- parent_class->create_card = pas_backend_file_process_create_card;
- parent_class->remove_cards = pas_backend_file_process_remove_cards;
- parent_class->modify_card = pas_backend_file_process_modify_card;
- parent_class->check_connection = pas_backend_file_process_check_connection;
- parent_class->get_vcard = pas_backend_file_process_get_vcard;
- parent_class->get_cursor = pas_backend_file_process_get_cursor;
- parent_class->get_book_view = pas_backend_file_process_get_book_view;
- parent_class->get_completion_view = pas_backend_file_process_get_completion_view;
- parent_class->get_changes = pas_backend_file_process_get_changes;
- parent_class->authenticate_user = pas_backend_file_process_authenticate_user;
- parent_class->get_supported_fields = pas_backend_file_process_get_supported_fields;
-
- object_class->dispose = pas_backend_file_dispose;
-}
-
-static void
-pas_backend_file_init (PASBackendFile *backend)
-{
- PASBackendFilePrivate *priv;
-
- priv = g_new0 (PASBackendFilePrivate, 1);
- priv->book_views = e_list_new((EListCopyFunc) pas_backend_file_book_view_copy, (EListFreeFunc) pas_backend_file_book_view_free, NULL);
- priv->uri = NULL;
-
- backend->priv = priv;
-}
-
-/**
- * pas_backend_file_get_type:
- */
-GType
-pas_backend_file_get_type (void)
-{
- static GType type = 0;
-
- if (! type) {
- GTypeInfo info = {
- sizeof (PASBackendFileClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) pas_backend_file_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PASBackendFile),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pas_backend_file_init
- };
-
- type = g_type_register_static (PAS_TYPE_BACKEND, "PASBackendFile", &info, 0);
- }
-
- return type;
-}
diff --git a/addressbook/backend/pas/pas-backend-file.h b/addressbook/backend/pas/pas-backend-file.h
deleted file mode 100644
index fd98d2cdd5..0000000000
--- a/addressbook/backend/pas/pas-backend-file.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __PAS_BACKEND_FILE_H__
-#define __PAS_BACKEND_FILE_H__
-
-#include "pas-backend.h"
-
-#define PAS_TYPE_BACKEND_FILE (pas_backend_file_get_type ())
-#define PAS_BACKEND_FILE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BACKEND_FILE, PASBackendFile))
-#define PAS_BACKEND_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_BACKEND_TYPE, PASBackendFileClass))
-#define PAS_IS_BACKEND_FILE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BACKEND_FILE))
-#define PAS_IS_BACKEND_FILE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BACKEND_FILE))
-#define PAS_BACKEND_FILE_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BACKEND_FILE, PASBackendFileClass))
-
-typedef struct _PASBackendFilePrivate PASBackendFilePrivate;
-
-typedef struct {
- PASBackend parent_object;
- PASBackendFilePrivate *priv;
-} PASBackendFile;
-
-typedef struct {
- PASBackendClass parent_class;
-} PASBackendFileClass;
-
-PASBackend *pas_backend_file_new (void);
-GType pas_backend_file_get_type (void);
-
-#endif /* ! __PAS_BACKEND_FILE_H__ */
-
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
deleted file mode 100644
index 1e8677e559..0000000000
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ /dev/null
@@ -1,3555 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author:
- * Chris Toshok (toshok@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#define DEBUG
-
-#include "config.h"
-#include <fcntl.h>
-#include <string.h>
-
-#ifdef DEBUG
-#define LDAP_DEBUG
-#define LDAP_DEBUG_ADD
-#endif
-#include <ldap.h>
-#ifdef DEBUG
-#undef LDAP_DEBUG
-#endif
-
-#if LDAP_VENDOR_VERSION > 20000
-#define OPENLDAP2
-#else
-#define OPENLDAP1
-#endif
-
-#ifdef OPENLDAP2
-#include <ldap_schema.h>
-#endif
-
-#include <sys/time.h>
-
-#include <e-util/e-sexp.h>
-#include <ebook/e-card-simple.h>
-#include <libgnome/gnome-i18n.h>
-
-#include "pas-backend-ldap.h"
-#include "pas-backend-card-sexp.h"
-#include "pas-book.h"
-#include "pas-card-cursor.h"
-
-#include <stdlib.h>
-
-/* this is broken currently, don't enable it */
-/*#define ENABLE_SASL_BINDS*/
-
-typedef enum {
- PAS_BACKEND_LDAP_TLS_NO,
- PAS_BACKEND_LDAP_TLS_ALWAYS,
- PAS_BACKEND_LDAP_TLS_WHEN_POSSIBLE,
-} PASBackendLDAPUseTLS;
-
-/* interval for our poll_ldap timeout */
-#define LDAP_POLL_INTERVAL 20
-
-/* timeout for ldap_result */
-#define LDAP_RESULT_TIMEOUT_MILLIS 10
-
-/* smart grouping stuff */
-#define GROUPING_INITIAL_SIZE 1
-#define GROUPING_MAXIMUM_SIZE 200
-
-/* the next two are in milliseconds */
-#define GROUPING_MINIMUM_WAIT 0 /* we never send updates faster than this, to avoid totally spamming the UI */
-#define GROUPING_MAXIMUM_WAIT 250 /* we always send updates (if there are pending cards) when we hit this */
-
-#define TV_TO_MILLIS(timeval) ((timeval).tv_sec * 1000 + (timeval).tv_usec / 1000)
-
-/* the objectClasses we need */
-#define TOP "top"
-#define PERSON "person"
-#define ORGANIZATIONALPERSON "organizationalPerson"
-#define INETORGPERSON "inetOrgPerson"
-#define CALENTRY "calEntry"
-#define EVOLUTIONPERSON "evolutionPerson"
-
-static gchar *query_prop_to_ldap(gchar *query_prop);
-
-static PASBackendClass *pas_backend_ldap_parent_class;
-typedef struct _PASBackendLDAPCursorPrivate PASBackendLDAPCursorPrivate;
-typedef struct _PASBackendLDAPBookView PASBackendLDAPBookView;
-typedef struct LDAPOp LDAPOp;
-
-
-struct _PASBackendLDAPPrivate {
- char *uri;
- gboolean connected;
-
- gchar *ldap_host; /* the hostname of the server */
- int ldap_port; /* the port of the server */
- char *schema_dn; /* the base dn for schema information */
- gchar *ldap_rootdn; /* the base dn of our searches */
- int ldap_scope; /* the scope used for searches */
- int ldap_limit; /* the search limit */
- int ldap_timeout; /* the search timeout */
-
- gchar *auth_dn;
- gchar *auth_passwd;
-
- gboolean ldap_v3; /* TRUE if the server supports protocol
- revision 3 (necessary for TLS) */
- gboolean starttls; /* TRUE if the *library* supports
- starttls. will be false if openssl
- was not built into openldap. */
- PASBackendLDAPUseTLS use_tls;
-
- EList *book_views;
-
- LDAP *ldap;
-
- EList *supported_fields;
- EList *supported_auth_methods;
-
- /* whether or not there's support for the objectclass we need
- to store all our additional fields */
- gboolean evolutionPersonSupported;
- gboolean calEntrySupported;
- gboolean evolutionPersonChecked;
-
- /* our operations */
- GHashTable *id_to_op;
- int active_ops;
- int poll_timeout;
-};
-
-struct _PASBackendLDAPCursorPrivate {
- PASBackend *backend;
- PASBook *book;
-
- GList *elements;
- long num_elements;
-};
-
-struct _PASBackendLDAPBookView {
- PASBookView *book_view;
- PASBackendLDAPPrivate *blpriv;
- gchar *search;
- PASBackendCardSExp *card_sexp;
- int limit;
-
- LDAPOp *search_op;
-};
-
-typedef void (*LDAPOpHandler)(LDAPOp *op, LDAPMessage *res);
-typedef void (*LDAPOpDtor)(LDAPOp *op);
-
-struct LDAPOp {
- LDAPOpHandler handler;
- LDAPOpDtor dtor;
- PASBackend *backend;
- PASBook *book;
- PASBookView *view;
- int id;
-};
-
-static void ldap_op_add (LDAPOp *op, PASBackend *backend, PASBook *book,
- PASBookView *view, int id, LDAPOpHandler handler, LDAPOpDtor dtor);
-static void ldap_op_finished (LDAPOp *op);
-
-static void ldap_search_op_timeout (LDAPOp *op, glong cur_millis);
-
-static gboolean poll_ldap (PASBackendLDAP *bl);
-
-static ECardSimple *build_card_from_entry (LDAP *ldap, LDAPMessage *e, GList **existing_objectclasses);
-
-static void email_populate (ECardSimple *card, char **values);
-struct berval** email_ber (ECardSimple *card);
-static gboolean email_compare (ECardSimple *ecard1, ECardSimple *ecard2);
-
-static void homephone_populate (ECardSimple *card, char **values);
-struct berval** homephone_ber (ECardSimple *card);
-static gboolean homephone_compare (ECardSimple *ecard1, ECardSimple *ecard2);
-
-static void business_populate (ECardSimple *card, char **values);
-struct berval** business_ber (ECardSimple *card);
-static gboolean business_compare (ECardSimple *ecard1, ECardSimple *ecard2);
-
-static void anniversary_populate (ECardSimple *card, char **values);
-struct berval** anniversary_ber (ECardSimple *card);
-static gboolean anniversary_compare (ECardSimple *ecard1, ECardSimple *ecard2);
-
-static void birthday_populate (ECardSimple *card, char **values);
-struct berval** birthday_ber (ECardSimple *card);
-static gboolean birthday_compare (ECardSimple *ecard1, ECardSimple *ecard2);
-
-static void category_populate (ECardSimple *card, char **values);
-struct berval** category_ber (ECardSimple *card);
-static gboolean category_compare (ECardSimple *ecard1, ECardSimple *ecard2);
-
-struct prop_info {
- ECardSimpleField field_id;
- char *query_prop;
- char *ldap_attr;
-#define PROP_TYPE_STRING 0x01
-#define PROP_TYPE_COMPLEX 0x02
-#define PROP_DN 0x04
-#define PROP_EVOLVE 0x08
- int prop_type;
-
- /* the remaining items are only used for the TYPE_COMPLEX props */
-
- /* used when reading from the ldap server populates ECard with the values in **values. */
- void (*populate_ecard_func)(ECardSimple *card, char **values);
- /* used when writing to an ldap server. returns a NULL terminated array of berval*'s */
- struct berval** (*ber_func)(ECardSimple *card);
- /* used to compare list attributes */
- gboolean (*compare_func)(ECardSimple *card1, ECardSimple *card2);
-
-} prop_info[] = {
-
-#define COMPLEX_PROP(fid,q,a,ctor,ber,cmp) {fid, q, a, PROP_TYPE_COMPLEX, ctor, ber, cmp}
-#define E_COMPLEX_PROP(fid,q,a,ctor,ber,cmp) {fid, q, a, PROP_TYPE_COMPLEX | PROP_EVOLVE, ctor, ber, cmp}
-#define STRING_PROP(fid,q,a) {fid, q, a, PROP_TYPE_STRING}
-#define E_STRING_PROP(fid,q,a) {fid, q, a, PROP_TYPE_STRING | PROP_EVOLVE}
-
-
- /* name fields */
- STRING_PROP (E_CARD_SIMPLE_FIELD_FULL_NAME, "full_name", "cn" ),
- STRING_PROP (E_CARD_SIMPLE_FIELD_FAMILY_NAME, "family_name", "sn" ),
-
- /* email addresses */
- COMPLEX_PROP (E_CARD_SIMPLE_FIELD_EMAIL, "email", "mail", email_populate, email_ber, email_compare),
-
- /* phone numbers */
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_PRIMARY, "primary_phone", "primaryPhone"),
- COMPLEX_PROP (E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, "business_phone", "telephoneNumber", business_populate, business_ber, business_compare),
- COMPLEX_PROP (E_CARD_SIMPLE_FIELD_PHONE_HOME, "home_phone", "homePhone", homephone_populate, homephone_ber, homephone_compare),
- STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_MOBILE, "mobile_phone", "mobile"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_CAR, "car_phone", "carPhone"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, "business_fax", "facsimileTelephoneNumber"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX, "home_fax", "homeFacsimileTelephoneNumber"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_OTHER, "other_phone", "otherPhone"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX, "other_fax", "otherFacsimileTelephoneNumber"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_ISDN, "isdn", "internationaliSDNNumber"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_PAGER, "pager", "pager"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_RADIO, "radio", "radio"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_TELEX, "telex", "telex"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_ASSISTANT, "assistant_phone", "assistantPhone"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_COMPANY, "company_phone", "companyPhone"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_CALLBACK, "callback_phone", "callbackPhone"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_PHONE_TTYTDD, "tty", "tty"),
-
- /* org information */
- STRING_PROP (E_CARD_SIMPLE_FIELD_ORG, "org", "o"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_ORG_UNIT, "org_unit", "ou"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_OFFICE, "office", "roomNumber"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_TITLE, "title", "title"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_ROLE, "role", "businessRole"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_MANAGER, "manager", "managerName"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_ASSISTANT, "assistant", "assistantName"),
-
- /* addresses */
- STRING_PROP (E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, "business_address", "postalAddress"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_ADDRESS_HOME, "home_address", "homePostalAddress"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_ADDRESS_OTHER, "other_address", "otherPostalAddress"),
-
- /* misc fields */
- STRING_PROP (E_CARD_SIMPLE_FIELD_URL, "url", "labeledURI"),
- /* map nickname to displayName */
- STRING_PROP (E_CARD_SIMPLE_FIELD_NICKNAME, "nickname", "displayName"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_SPOUSE, "spouse", "spouseName"),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_NOTE, "note", "note"),
- E_COMPLEX_PROP (E_CARD_SIMPLE_FIELD_ANNIVERSARY, "anniversary", "anniversary", anniversary_populate, anniversary_ber, anniversary_compare),
- E_COMPLEX_PROP (E_CARD_SIMPLE_FIELD_BIRTH_DATE, "birth_date", "birthDate", birthday_populate, birthday_ber, birthday_compare),
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_MAILER, "mailer", "mailer"),
-
- E_STRING_PROP (E_CARD_SIMPLE_FIELD_FILE_AS, "file_as", "fileAs"),
- E_COMPLEX_PROP (E_CARD_SIMPLE_FIELD_CATEGORIES, "categories", "category", category_populate, category_ber, category_compare),
-
- STRING_PROP (E_CARD_SIMPLE_FIELD_CALURI, "caluri", "calCalURI"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_FBURL, "fburl", "calFBURL"),
- STRING_PROP (E_CARD_SIMPLE_FIELD_ICSCALENDAR, "icscalendar", "icsCalendar"),
-
-/* E_CARD_SIMPLE_FIELD_NAME_OR_ORG, */
-
-
-#undef E_STRING_PROP
-#undef STRING_PROP
-#undef E_COMPLEX_PROP
-#undef COMPLEX_PROP
-};
-
-static int num_prop_infos = sizeof(prop_info) / sizeof(prop_info[0]);
-
-static void
-remove_view (int msgid, LDAPOp *op, PASBookView *view)
-{
- if (op->view == view)
- op->view = NULL;
-}
-
-static void
-view_destroy(gpointer data, GObject *where_object_was)
-{
- PASBook *book = (PASBook *)data;
- PASBackendLDAP *bl;
- EIterator *iter;
-
- bl = PAS_BACKEND_LDAP(pas_book_get_backend(book));
-
- iter = e_list_get_iterator (bl->priv->book_views);
-
- while (e_iterator_is_valid (iter)) {
- PASBackendLDAPBookView *view = (PASBackendLDAPBookView*)e_iterator_get (iter);
-
- if (view->book_view == (PASBookView*)where_object_was) {
- GNOME_Evolution_Addressbook_Book corba_book;
- CORBA_Environment ev;
-
- /* if we have an active search, interrupt it */
- if (view->search_op) {
- ldap_op_finished (view->search_op);
- }
- /* and remove us as the view for any other
- operations that might be using us to spew
- status messages to the gui */
- g_hash_table_foreach (bl->priv->id_to_op, (GHFunc)remove_view, view->book_view);
-
- /* free up the view structure */
- g_free (view->search);
- g_object_unref (view->card_sexp);
- g_free (view);
-
- /* and remove it from our list */
- e_iterator_delete (iter);
-
- /* unref the book now */
- corba_book = bonobo_object_corba_objref(BONOBO_OBJECT(book));
-
- CORBA_exception_init(&ev);
-
- GNOME_Evolution_Addressbook_Book_unref(corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("view_destroy: Exception unreffing "
- "corba book.\n");
- }
-
- CORBA_exception_free(&ev);
- break;
- }
-
- e_iterator_next (iter);
- }
-
- g_object_unref (iter);
-
-}
-
-static void
-book_view_notify_status (PASBookView *view, const char *status)
-{
- if (!view)
- return;
- pas_book_view_notify_status_message (view, status);
-}
-
-static PASBookView*
-find_book_view (PASBackendLDAP *bl)
-{
- EIterator *iter = e_list_get_iterator (bl->priv->book_views);
- PASBookView *rv = NULL;
-
- if (e_iterator_is_valid (iter)) {
- /* just always use the first book view */
- PASBackendLDAPBookView *v = (PASBackendLDAPBookView*)e_iterator_get(iter);
- if (v)
- rv = v->book_view;
- }
-
- g_object_unref (iter);
-
- return rv;
-}
-
-static void
-add_to_supported_fields (PASBackendLDAP *bl, char **attrs, GHashTable *attr_hash)
-{
- int i;
- for (i = 0; attrs[i]; i ++) {
- char *query_prop = g_hash_table_lookup (attr_hash, attrs[i]);
-
- if (query_prop) {
- e_list_append (bl->priv->supported_fields, query_prop);
-
- /* handle the list attributes here */
- if (!strcmp (query_prop, "email")) {
- e_list_append (bl->priv->supported_fields, "email_2");
- e_list_append (bl->priv->supported_fields, "email_3");
- }
- else if (!strcmp (query_prop, "business_phone")) {
- e_list_append (bl->priv->supported_fields, "business_phone_2");
- }
- else if (!strcmp (query_prop, "home_phone")) {
- e_list_append (bl->priv->supported_fields, "home_phone_2");
- }
- }
- }
-}
-
-static void
-add_oc_attributes_to_supported_fields (PASBackendLDAP *bl, LDAPObjectClass *oc)
-{
- int i;
- GHashTable *attr_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- for (i = 0; i < num_prop_infos; i ++)
- g_hash_table_insert (attr_hash, prop_info[i].ldap_attr, prop_info[i].query_prop);
-
- if (oc->oc_at_oids_must)
- add_to_supported_fields (bl, oc->oc_at_oids_must, attr_hash);
-
- if (oc->oc_at_oids_may)
- add_to_supported_fields (bl, oc->oc_at_oids_may, attr_hash);
-
- g_hash_table_destroy (attr_hash);
-}
-
-static void
-check_schema_support (PASBackendLDAP *bl)
-{
- char *attrs[2];
- LDAPMessage *resp;
- LDAP *ldap = bl->priv->ldap;
- struct timeval timeout;
-
- if (!bl->priv->schema_dn)
- return;
-
- bl->priv->evolutionPersonChecked = TRUE;
-
- attrs[0] = "objectClasses";
- attrs[1] = NULL;
-
- timeout.tv_sec = 30;
- timeout.tv_usec = 0;
-
- if (ldap_search_ext_s (ldap, bl->priv->schema_dn, LDAP_SCOPE_BASE,
- "(objectClass=subschema)", attrs, 0,
- NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp) == LDAP_SUCCESS) {
- char **values;
-
- values = ldap_get_values (ldap, resp, "objectClasses");
-
- if (values) {
- int i;
- for (i = 0; values[i]; i ++) {
- int j;
- int code;
- const char *err;
- LDAPObjectClass *oc = ldap_str2objectclass (values[i], &code, &err, 0);
-
- if (!oc)
- continue;
-
- for (j = 0; oc->oc_names[j]; j++)
- if (!g_ascii_strcasecmp (oc->oc_names[j], EVOLUTIONPERSON)) {
- g_print ("support found on ldap server for objectclass evolutionPerson\n");
- bl->priv->evolutionPersonSupported = TRUE;
-
- add_oc_attributes_to_supported_fields (bl, oc);
- }
- else if (!g_ascii_strcasecmp (oc->oc_names[j], CALENTRY)) {
- g_print ("support found on ldap server for objectclass calEntry\n");
- bl->priv->calEntrySupported = TRUE;
- add_oc_attributes_to_supported_fields (bl, oc);
- }
- else if (!g_ascii_strcasecmp (oc->oc_names[j], INETORGPERSON)
- || !g_ascii_strcasecmp (oc->oc_names[j], ORGANIZATIONALPERSON)
- || !g_ascii_strcasecmp (oc->oc_names[j], PERSON)) {
- add_oc_attributes_to_supported_fields (bl, oc);
- }
-
- ldap_objectclass_free (oc);
- }
-
- ldap_value_free (values);
- }
- else {
- /* the reason for this is so that if the user
- ends up authenticating to the ldap server,
- we will requery for the subschema values.
- This makes it a bit more robust in the face
- of draconian acl's that keep subschema
- reads from working until the user is
- authed. */
- if (!pas_backend_is_writable (PAS_BACKEND (bl))) {
- g_warning ("subschema read returned nothing before successful auth");
- bl->priv->evolutionPersonChecked = FALSE;
- }
- else {
- g_warning ("subschema read returned nothing after successful auth");
- }
- }
-
- ldap_msgfree (resp);
- }
-}
-
-static void
-get_ldap_library_info ()
-{
- LDAPAPIInfo info;
- LDAP *ldap;
-
- if (LDAP_SUCCESS != ldap_create (&ldap)) {
- g_warning ("couldn't create LDAP* for getting at the client lib api info");
- return;
- }
-
- info.ldapai_info_version = LDAP_API_INFO_VERSION;
-
- if (LDAP_OPT_SUCCESS != ldap_get_option (ldap, LDAP_OPT_API_INFO, &info)) {
- g_warning ("couldn't get ldap api info");
- }
- else {
- int i;
- g_message ("libldap vendor/version: %s %2d.%02d.%02d",
- info.ldapai_vendor_name,
- info.ldapai_vendor_version / 10000,
- (info.ldapai_vendor_version % 10000) / 1000,
- info.ldapai_vendor_version % 1000);
-
- g_message ("extensions present:");
- /* yuck. we have to free these? */
- for (i = 0; info.ldapai_extensions[i]; i++) {
- char *extension = info.ldapai_extensions[i];
- g_message (extension);
- ldap_memfree (extension);
- }
- ldap_memfree (info.ldapai_extensions);
- ldap_memfree (info.ldapai_vendor_name);
- }
-
- ldap_unbind_ext_s (ldap, NULL, NULL);
-}
-
-static int
-query_ldap_root_dse (PASBackendLDAP *bl)
-{
-#define MAX_DSE_ATTRS 20
- LDAP *ldap = bl->priv->ldap;
- LDAPMessage *resp;
- int ldap_error;
- char *attrs[MAX_DSE_ATTRS], **values;
- int i = 0;
- struct timeval timeout;
-
- attrs[i++] = "supportedControl";
- attrs[i++] = "supportedExtension";
- attrs[i++] = "supportedFeatures";
- attrs[i++] = "supportedSASLMechanisms";
- attrs[i++] = "supportedLDAPVersion";
- attrs[i++] = "subschemaSubentry"; /* OpenLDAP's dn for schema information */
- attrs[i++] = "schemaNamingContext"; /* Active directory's dn for schema information */
- attrs[i] = NULL;
-
- timeout.tv_sec = 30;
- timeout.tv_usec = 0;
-
- ldap_error = ldap_search_ext_s (ldap,
- LDAP_ROOT_DSE, LDAP_SCOPE_BASE,
- "(objectclass=*)",
- attrs, 0, NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp);
- if (ldap_error != LDAP_SUCCESS) {
- g_warning ("could not perform query on Root DSE (ldap_error 0x%02x)", ldap_error);
- return ldap_error;
- }
-
- values = ldap_get_values (ldap, resp, "supportedControl");
- if (values) {
- for (i = 0; values[i]; i++)
- g_message ("supported server control: %s", values[i]);
- ldap_value_free (values);
- }
-
- values = ldap_get_values (ldap, resp, "supportedExtension");
- if (values) {
- for (i = 0; values[i]; i++) {
- g_message ("supported server extension: %s", values[i]);
- if (!strcmp (values[i], LDAP_EXOP_START_TLS)) {
- g_message ("server reports LDAP_EXOP_START_TLS");
- }
- }
- ldap_value_free (values);
- }
-
- values = ldap_get_values (ldap, resp, "supportedSASLMechanisms");
- if (values) {
- char *auth_method;
- if (bl->priv->supported_auth_methods)
- g_object_unref (bl->priv->supported_auth_methods);
- bl->priv->supported_auth_methods = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
-
- auth_method = g_strdup_printf ("ldap/simple-binddn|%s", _("Using Distinguished Name (DN)"));
- e_list_append (bl->priv->supported_auth_methods, auth_method);
- g_free (auth_method);
-
- auth_method = g_strdup_printf ("ldap/simple-email|%s", _("Using Email Address"));
- e_list_append (bl->priv->supported_auth_methods, auth_method);
- g_free (auth_method);
-
- for (i = 0; values[i]; i++) {
- auth_method = g_strdup_printf ("sasl/%s|%s", values[i], values[i]);
- e_list_append (bl->priv->supported_auth_methods, auth_method);
- g_free (auth_method);
- g_message ("supported SASL mechanism: %s", values[i]);
- }
- ldap_value_free (values);
- }
-
-
- values = ldap_get_values (ldap, resp, "subschemaSubentry");
- if (!values || !values[0]) {
- if (values) ldap_value_free (values);
- values = ldap_get_values (ldap, resp, "schemaNamingContext");
- }
- if (values && values[0]) {
- g_free (bl->priv->schema_dn);
- bl->priv->schema_dn = g_strdup (values[0]);
- }
- else {
- g_warning ("could not determine location of schema information on LDAP server");
- }
- if (values)
- ldap_value_free (values);
-
- ldap_msgfree (resp);
-
- return LDAP_SUCCESS;
-}
-
-static GNOME_Evolution_Addressbook_BookListener_CallStatus
-pas_backend_ldap_connect (PASBackendLDAP *bl)
-{
- PASBackendLDAPPrivate *blpriv = bl->priv;
-
- /* close connection first if it's open first */
- if (blpriv->ldap)
- ldap_unbind_ext (blpriv->ldap, NULL, NULL);
-
- blpriv->ldap = ldap_init (blpriv->ldap_host, blpriv->ldap_port);
-#if defined (DEBUG) && defined (LDAP_OPT_DEBUG_LEVEL)
- {
- int debug_level = 4;
- ldap_set_option (blpriv->ldap, LDAP_OPT_DEBUG_LEVEL, &debug_level);
- }
-#endif
-
- if (NULL != blpriv->ldap) {
- int ldap_error;
-
- if (bl->priv->use_tls != PAS_BACKEND_LDAP_TLS_NO) {
- int protocol_version = LDAP_VERSION3;
- ldap_error = ldap_set_option (blpriv->ldap, LDAP_OPT_PROTOCOL_VERSION, &protocol_version);
- if (LDAP_OPT_SUCCESS != ldap_error) {
- g_warning ("failed to set protocol version to LDAPv3");
- bl->priv->ldap_v3 = FALSE;
- }
- else
- bl->priv->ldap_v3 = TRUE;
-
- if (!bl->priv->ldap_v3 && bl->priv->use_tls == PAS_BACKEND_LDAP_TLS_ALWAYS) {
- g_message ("TLS not available (fatal version), v3 protocol could not be established (ldap_error 0x%02x)", ldap_error);
- ldap_unbind (blpriv->ldap);
- blpriv->ldap = NULL;
- return GNOME_Evolution_Addressbook_BookListener_TLSNotAvailable;
- }
-
- if (bl->priv->ldap_port == LDAPS_PORT && bl->priv->use_tls == PAS_BACKEND_LDAP_TLS_ALWAYS) {
- int tls_level = LDAP_OPT_X_TLS_HARD;
- ldap_set_option (blpriv->ldap, LDAP_OPT_X_TLS, &tls_level);
- }
- else if (bl->priv->use_tls) {
- ldap_error = ldap_start_tls_s (blpriv->ldap, NULL, NULL);
- if (LDAP_SUCCESS != ldap_error) {
- if (bl->priv->use_tls == PAS_BACKEND_LDAP_TLS_ALWAYS) {
- g_message ("TLS not available (fatal version), (ldap_error 0x%02x)", ldap_error);
- ldap_unbind (blpriv->ldap);
- blpriv->ldap = NULL;
- return GNOME_Evolution_Addressbook_BookListener_TLSNotAvailable;
- }
- else {
- g_message ("TLS not available (ldap_error 0x%02x)", ldap_error);
- }
- }
- else
- g_message ("TLS active");
- }
- }
-
- /* bind anonymously initially, we'll actually
- authenticate the user properly later (in
- authenticate_user) if they've selected
- authentication */
- ldap_error = ldap_simple_bind_s (blpriv->ldap, NULL, NULL);
- if (ldap_error == LDAP_SERVER_DOWN) {
- /* we only want this to be fatal if the server is down. */
- g_warning ("failed to bind anonymously while connecting (ldap_error 0x%02x)", ldap_error);
- return GNOME_Evolution_Addressbook_BookListener_RepositoryOffline;
- }
-
- ldap_error = query_ldap_root_dse (bl);
- /* query_ldap_root_dse will cause the actual
- connect(), so any tcpip problems will show up
- here */
-
- /* we can't just check for LDAP_SUCCESS here since in
- older servers (namely openldap1.x servers), there's
- not a root DSE at all, so the query will fail with
- LDAP_NO_SUCH_OBJECT. */
- if (ldap_error == LDAP_SUCCESS || LDAP_NAME_ERROR (ldap_error)) {
- blpriv->connected = TRUE;
-
- /* check to see if evolutionPerson is supported, if we can (me
- might not be able to if we can't authenticate. if we
- can't, try again in auth_user.) */
- if (!bl->priv->evolutionPersonChecked)
- check_schema_support (bl);
-
- pas_backend_set_is_loaded (PAS_BACKEND (bl), TRUE);
- return GNOME_Evolution_Addressbook_BookListener_Success;
- }
- else
- g_warning ("Failed to perform root dse query anonymously, (ldap_error 0x%02x)", ldap_error);
- }
-
- g_warning ("pas_backend_ldap_connect failed for "
- "'ldap://%s:%d/%s'\n",
- blpriv->ldap_host,
- blpriv->ldap_port,
- blpriv->ldap_rootdn ? blpriv->ldap_rootdn : "");
- blpriv->connected = FALSE;
- return GNOME_Evolution_Addressbook_BookListener_RepositoryOffline;
-}
-
-static gboolean
-pas_backend_ldap_reconnect (PASBackendLDAP *bl, PASBookView *book_view, int ldap_status)
-{
- /* we need to reconnect if we were previously connected */
- if (bl->priv->connected && ldap_status == LDAP_SERVER_DOWN) {
- GNOME_Evolution_Addressbook_BookListener_CallStatus status;
- int ldap_error = LDAP_SUCCESS;
-
- book_view_notify_status (book_view, _("Reconnecting to LDAP server..."));
-
- status = pas_backend_ldap_connect (bl);
-
- if (status != GNOME_Evolution_Addressbook_BookListener_Success) {
- book_view_notify_status (book_view, "");
- return FALSE;
- }
-
- if (bl->priv->auth_dn)
- ldap_error = ldap_simple_bind_s(bl->priv->ldap,
- bl->priv->auth_dn,
- bl->priv->auth_passwd);
- book_view_notify_status (book_view, "");
- return (ldap_error == LDAP_SUCCESS);
- }
- else {
- return FALSE;
- }
-}
-
-static void
-ldap_op_add (LDAPOp *op, PASBackend *backend,
- PASBook *book, PASBookView *view,
- int id,
- LDAPOpHandler handler, LDAPOpDtor dtor)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- op->backend = backend;
- op->book = book;
- op->view = view;
- op->id = id;
- op->handler = handler;
- op->dtor = dtor;
-
- if (g_hash_table_lookup (bl->priv->id_to_op, &op->id)) {
- g_warning ("conflicting ldap msgid's");
- }
-
- g_hash_table_insert (bl->priv->id_to_op,
- &op->id, op);
-
- bl->priv->active_ops ++;
-
- if (bl->priv->poll_timeout == -1)
- bl->priv->poll_timeout = g_timeout_add (LDAP_POLL_INTERVAL,
- (GSourceFunc) poll_ldap,
- bl);
-}
-
-static void
-ldap_op_finished (LDAPOp *op)
-{
- PASBackend *backend = op->backend;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- g_hash_table_remove (bl->priv->id_to_op, &op->id);
-
- /* should handle errors here */
- ldap_abandon (bl->priv->ldap, op->id);
-
- op->dtor (op);
-
- bl->priv->active_ops--;
-
- if (bl->priv->active_ops == 0) {
- if (bl->priv->poll_timeout != -1)
- g_source_remove (bl->priv->poll_timeout);
- bl->priv->poll_timeout = -1;
- }
-}
-
-static void
-ldap_op_change_id (LDAPOp *op, int msg_id)
-{
- PASBackend *backend = op->backend;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- g_hash_table_remove (bl->priv->id_to_op, &op->id);
-
- op->id = msg_id;
-
- g_hash_table_insert (bl->priv->id_to_op,
- &op->id, op);
-}
-
-static int
-ldap_error_to_response (int ldap_error)
-{
- if (ldap_error == LDAP_SUCCESS)
- return GNOME_Evolution_Addressbook_BookListener_Success;
- else if (LDAP_NAME_ERROR (ldap_error))
- return GNOME_Evolution_Addressbook_BookListener_CardNotFound;
- else if (ldap_error == LDAP_INSUFFICIENT_ACCESS)
- return GNOME_Evolution_Addressbook_BookListener_PermissionDenied;
- else if (ldap_error == LDAP_SERVER_DOWN)
- return GNOME_Evolution_Addressbook_BookListener_RepositoryOffline;
- else if (ldap_error == LDAP_ALREADY_EXISTS)
- return GNOME_Evolution_Addressbook_BookListener_CardIdAlreadyExists;
- else
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
-}
-
-
-static char *
-create_dn_from_ecard (ECardSimple *card, const char *root_dn)
-{
- char *cn, *cn_part = NULL;
- char *dn;
-
- cn = e_card_simple_get (card, E_CARD_SIMPLE_FIELD_FULL_NAME);
- if (cn) {
- if (strchr (cn, ',')) {
- /* need to escape commas */
- char *new_cn = g_malloc0 (strlen (cn) * 3 + 1);
- int i, j;
-
- for (i = 0, j = 0; i < strlen (cn); i ++) {
- if (cn[i] == ',') {
- sprintf (new_cn + j, "%%%02X", cn[i]);
- j += 3;
- }
- else {
- new_cn[j++] = cn[i];
- }
- }
- cn_part = g_strdup_printf ("cn=%s", new_cn);
- g_free (new_cn);
- }
- else {
- cn_part = g_strdup_printf ("cn=%s", cn);
- }
- }
- else {
- cn_part = g_strdup ("");
- }
-
- dn = g_strdup_printf ("%s%s%s", cn_part,
- (root_dn && strlen(root_dn)) ? "," : "",
- (root_dn && strlen(root_dn)) ? root_dn: "");
-
- g_free (cn_part);
-
- g_print ("generated dn: %s\n", dn);
-
- return dn;
-}
-
-static void
-free_mods (GPtrArray *mods)
-{
- int i = 0;
- LDAPMod *mod;
-
- while ((mod = g_ptr_array_index (mods, i++))) {
- int j;
- g_free (mod->mod_type);
-
- if (mod->mod_op & LDAP_MOD_BVALUES) {
- for (j = 0; mod->mod_bvalues[j]; j++) {
- g_free (mod->mod_bvalues[j]->bv_val);
- g_free (mod->mod_bvalues[j]);
- }
- }
- else {
- for (j = 0; mod->mod_values[j]; j++)
- g_free (mod->mod_values[j]);
- }
- g_free (mod);
- }
-
- g_ptr_array_free (mods, TRUE);
-}
-
-static GPtrArray*
-build_mods_from_ecards (PASBackendLDAP *bl, ECardSimple *current, ECardSimple *new, gboolean *new_dn_needed)
-{
- gboolean adding = (current == NULL);
- GPtrArray *result = g_ptr_array_new();
- int i;
-
- if (new_dn_needed)
- *new_dn_needed = FALSE;
-
- /* we walk down the list of properties we can deal with (that
- big table at the top of the file) */
-
- for (i = 0; i < num_prop_infos; i ++) {
- gboolean include;
- gboolean new_prop_present = FALSE;
- gboolean current_prop_present = FALSE;
- struct berval** new_prop_bers = NULL;
- char *new_prop = NULL;
- char *current_prop = NULL;
-
- /* XXX if it's an evolutionPerson prop and the ldap
- server doesn't support that objectclass, skip it. */
- if (prop_info[i].prop_type & PROP_EVOLVE && !bl->priv->evolutionPersonSupported)
- continue;
-
- /* get the value for the new card, and compare it to
- the value in the current card to see if we should
- update it -- if adding is TRUE, short circuit the
- check. */
- if (prop_info[i].prop_type & PROP_TYPE_STRING) {
- new_prop = e_card_simple_get (new, prop_info[i].field_id);
- new_prop_present = (new_prop != NULL);
- }
- else {
- new_prop_bers = prop_info[i].ber_func (new);
- new_prop_present = (new_prop_bers != NULL);
- }
-
- /* need to set INCLUDE to true if the field needs to
- show up in the ldap modify request */
- if (adding) {
- /* if we're creating a new card, include it if the
- field is there at all */
- if (prop_info[i].prop_type & PROP_TYPE_STRING)
- include = (new_prop_present && *new_prop); /* empty strings cause problems */
- else
- include = new_prop_present;
- }
- else {
- /* if we're modifying an existing card,
- include it if the current field value is
- different than the new one, if it didn't
- exist previously, or if it's been
- removed. */
- if (prop_info[i].prop_type & PROP_TYPE_STRING) {
- current_prop = e_card_simple_get (current, prop_info[i].field_id);
- current_prop_present = (current_prop != NULL);
-
- if (new_prop && current_prop)
- include = *new_prop && strcmp (new_prop, current_prop);
- else
- include = (!!new_prop != !!current_prop);
- }
- else {
- int j;
- struct berval **current_prop_bers = prop_info[i].ber_func (current);
-
- current_prop_present = (current_prop_bers != NULL);
-
- /* free up the current_prop_bers */
- if (current_prop_bers) {
- for (j = 0; current_prop_bers[j]; j++) {
- g_free (current_prop_bers[j]->bv_val);
- g_free (current_prop_bers[j]);
- }
- g_free (current_prop_bers);
- }
-
- include = !prop_info[i].compare_func (new, current);
- }
- }
-
- if (include) {
- LDAPMod *mod = g_new (LDAPMod, 1);
-
- /* the included attribute has changed - we
- need to update the dn if it's one of the
- attributes we compute the dn from. */
- if (new_dn_needed)
- *new_dn_needed |= prop_info[i].prop_type & PROP_DN;
-
- if (adding) {
- mod->mod_op = LDAP_MOD_ADD;
- }
- else {
- if (!new_prop_present)
- mod->mod_op = LDAP_MOD_DELETE;
- else if (!current_prop_present)
- mod->mod_op = LDAP_MOD_ADD;
- else
- mod->mod_op = LDAP_MOD_REPLACE;
- }
-
- mod->mod_type = g_strdup (prop_info[i].ldap_attr);
-
- if (prop_info[i].prop_type & PROP_TYPE_STRING) {
- mod->mod_values = g_new (char*, 2);
- mod->mod_values[0] = new_prop;
- mod->mod_values[1] = NULL;
- }
- else { /* PROP_TYPE_COMPLEX */
- mod->mod_op |= LDAP_MOD_BVALUES;
- mod->mod_bvalues = new_prop_bers;
- }
-
- g_ptr_array_add (result, mod);
- }
-
- }
-
- /* NULL terminate the list of modifications */
- g_ptr_array_add (result, NULL);
-
- return result;
-}
-
-static void
-add_objectclass_mod (PASBackendLDAP *bl, GPtrArray *mod_array, GList *existing_objectclasses)
-{
-#define FIND_INSERT(oc) \
- if (!g_list_find_custom (existing_objectclasses, (oc), (GCompareFunc)g_ascii_strcasecmp)) \
- g_ptr_array_add (objectclasses, g_strdup ((oc)))
-#define INSERT(oc) \
- g_ptr_array_add (objectclasses, g_strdup ((oc)))
-
- LDAPMod *objectclass_mod;
- GPtrArray *objectclasses = g_ptr_array_new();
-
- if (existing_objectclasses) {
- objectclass_mod = g_new (LDAPMod, 1);
- objectclass_mod->mod_op = LDAP_MOD_ADD;
- objectclass_mod->mod_type = g_strdup ("objectClass");
-
- /* yes, this is a linear search for each of our
- objectclasses, but really, how many objectclasses
- are there going to be in any sane ldap entry? */
- FIND_INSERT (TOP);
- FIND_INSERT (PERSON);
- FIND_INSERT (ORGANIZATIONALPERSON);
- FIND_INSERT (INETORGPERSON);
- if (bl->priv->calEntrySupported)
- FIND_INSERT (CALENTRY);
- if (bl->priv->evolutionPersonSupported)
- FIND_INSERT (EVOLUTIONPERSON);
-
- if (objectclasses->len) {
- g_ptr_array_add (objectclasses, NULL);
- objectclass_mod->mod_values = (char**)objectclasses->pdata;
- g_ptr_array_add (mod_array, objectclass_mod);
- g_ptr_array_free (objectclasses, FALSE);
- }
- else {
- g_ptr_array_free (objectclasses, TRUE);
- g_free (objectclass_mod->mod_type);
- g_free (objectclass_mod);
- }
-
- }
- else {
- objectclass_mod = g_new (LDAPMod, 1);
- objectclass_mod->mod_op = LDAP_MOD_ADD;
- objectclass_mod->mod_type = g_strdup ("objectClass");
-
- INSERT(TOP);
- INSERT(PERSON);
- INSERT(ORGANIZATIONALPERSON);
- INSERT(INETORGPERSON);
- if (bl->priv->calEntrySupported)
- INSERT(CALENTRY);
- if (bl->priv->evolutionPersonSupported)
- INSERT(EVOLUTIONPERSON);
- g_ptr_array_add (objectclasses, NULL);
- objectclass_mod->mod_values = (char**)objectclasses->pdata;
- g_ptr_array_add (mod_array, objectclass_mod);
- g_ptr_array_free (objectclasses, FALSE);
- }
-}
-
-typedef struct {
- LDAPOp op;
- char *dn;
- ECardSimple *new_card;
-} LDAPCreateOp;
-
-static void
-create_card_handler (LDAPOp *op, LDAPMessage *res)
-{
- LDAPCreateOp *create_op = (LDAPCreateOp*)op;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (op->backend);
- LDAP *ldap = bl->priv->ldap;
- int ldap_error;
- int response;
-
- if (LDAP_RES_ADD != ldap_msgtype (res)) {
- g_warning ("incorrect msg type %d passed to create_card_handler", ldap_msgtype (res));
- pas_book_respond_create (op->book,
- GNOME_Evolution_Addressbook_BookListener_OtherError,
- create_op->dn);
- ldap_op_finished (op);
- return;
- }
-
- ldap_parse_result (ldap, res, &ldap_error,
- NULL, NULL, NULL, NULL, 0);
-
- if (ldap_error == LDAP_SUCCESS) {
- /* the card was created, let's let the views know about it */
- EIterator *iter;
-
- iter = e_list_get_iterator (bl->priv->book_views);
- while (e_iterator_is_valid (iter)) {
- CORBA_Environment ev;
- gboolean match;
- PASBackendLDAPBookView *view = (PASBackendLDAPBookView*)e_iterator_get (iter);
- char *new_vcard;
-
- CORBA_exception_init(&ev);
-
- bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- new_vcard = e_card_simple_get_vcard_assume_utf8 (create_op->new_card);
-
- match = pas_backend_card_sexp_match_vcard (view->card_sexp,
- new_vcard);
- if (match) {
- pas_book_view_notify_add_1 (view->book_view,
- new_vcard);
- }
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-
- g_free (new_vcard);
-
- bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- e_iterator_next (iter);
- }
- g_object_unref (iter);
- }
- else {
- ldap_perror (ldap, "create_card");
- }
-
- if (op->view)
- pas_book_view_notify_complete (op->view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-
- /* and lastly respond */
- response = ldap_error_to_response (ldap_error);
- pas_book_respond_create (op->book,
- response,
- create_op->dn);
-
- ldap_op_finished (op);
-}
-
-static void
-create_card_dtor (LDAPOp *op)
-{
- LDAPCreateOp *create_op = (LDAPCreateOp*)op;
-
- g_free (create_op->dn);
- g_object_unref (create_op->new_card);
- g_free (create_op);
-}
-
-static void
-pas_backend_ldap_process_create_card (PASBackend *backend,
- PASBook *book,
- PASCreateCardRequest *req)
-{
- LDAPCreateOp *create_op = g_new (LDAPCreateOp, 1);
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- PASBookView *book_view;
- int create_card_msgid;
- ECard *new_ecard;
- int response;
- int err;
- GPtrArray *mod_array;
- LDAPMod **ldap_mods;
- LDAP *ldap;
-
- book_view = find_book_view (bl);
-
- printf ("vcard = %s\n", req->vcard);
-
- new_ecard = e_card_new (req->vcard);
- create_op->new_card = e_card_simple_new (new_ecard);
-
- create_op->dn = create_dn_from_ecard (create_op->new_card, bl->priv->ldap_rootdn);
- e_card_simple_set_id (create_op->new_card, create_op->dn); /* for the notification code below */
-
- ldap = bl->priv->ldap;
-
- /* build our mods */
- mod_array = build_mods_from_ecards (bl, NULL, create_op->new_card, NULL);
-
-#if 0
- if (!mod_array) {
- /* there's an illegal field in there. report
- UnsupportedAttribute back */
- pas_book_respond_create (book,
- GNOME_Evolution_Addressbook_BookListener_UnsupportedField,
- create_op->dn);
-
- g_free (create_op->dn);
- g_object_unref (create_op->new_card);
- g_free (create_op);
- return;
- }
-#endif
-
- /* remove the NULL at the end */
- g_ptr_array_remove (mod_array, NULL);
-
- /* add our objectclass(es) */
- add_objectclass_mod (bl, mod_array, NULL);
-
- /* then put the NULL back */
- g_ptr_array_add (mod_array, NULL);
-
-#ifdef LDAP_DEBUG_ADD
- {
- int i;
- printf ("Sending the following to the server as ADD\n");
-
- for (i = 0; g_ptr_array_index(mod_array, i); i ++) {
- LDAPMod *mod = g_ptr_array_index(mod_array, i);
- if (mod->mod_op & LDAP_MOD_DELETE)
- printf ("del ");
- else if (mod->mod_op & LDAP_MOD_REPLACE)
- printf ("rep ");
- else
- printf ("add ");
- if (mod->mod_op & LDAP_MOD_BVALUES)
- printf ("ber ");
- else
- printf (" ");
-
- printf (" %s:\n", mod->mod_type);
-
- if (mod->mod_op & LDAP_MOD_BVALUES) {
- int j;
- for (j = 0; mod->mod_bvalues[j] && mod->mod_bvalues[j]->bv_val; j++)
- printf ("\t\t'%s'\n", mod->mod_bvalues[j]->bv_val);
- }
- else {
- int j;
-
- for (j = 0; mod->mod_values[j]; j++)
- printf ("\t\t'%s'\n", mod->mod_values[j]);
- }
- }
- }
-#endif
-
- ldap_mods = (LDAPMod**)mod_array->pdata;
-
- do {
- book_view_notify_status (book_view, _("Adding card to LDAP server..."));
-
- err = ldap_add_ext (ldap, create_op->dn, ldap_mods,
- NULL, NULL, &create_card_msgid);
-
- } while (pas_backend_ldap_reconnect (bl, book_view, err));
-
- /* and clean up */
- free_mods (mod_array);
-
- if (LDAP_SUCCESS != err) {
- response = ldap_error_to_response (err);
- pas_book_respond_create (create_op->op.book,
- response,
- create_op->dn);
- create_card_dtor ((LDAPOp*)create_op);
- return;
- }
- else {
- g_print ("ldap_add_ext returned %d\n", err);
- ldap_op_add ((LDAPOp*)create_op, backend, book,
- book_view, create_card_msgid,
- create_card_handler, create_card_dtor);
- }
-}
-
-
-typedef struct {
- LDAPOp op;
- char *id;
-} LDAPRemoveOp;
-
-static void
-remove_card_handler (LDAPOp *op, LDAPMessage *res)
-{
- LDAPRemoveOp *remove_op = (LDAPRemoveOp*)op;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (op->backend);
- int ldap_error;
-
- if (LDAP_RES_DELETE != ldap_msgtype (res)) {
- g_warning ("incorrect msg type %d passed to remove_card_handler", ldap_msgtype (res));
- pas_book_respond_remove (op->book,
- GNOME_Evolution_Addressbook_BookListener_OtherError);
- ldap_op_finished (op);
- return;
- }
-
- ldap_parse_result (bl->priv->ldap, res, &ldap_error,
- NULL, NULL, NULL, NULL, 0);
-
- if (ldap_error == LDAP_SUCCESS) {
- /* the card was removed, let's let the views know about it */
- EIterator *iter = e_list_get_iterator (bl->priv->book_views);
-
- while (e_iterator_is_valid (iter)) {
- CORBA_Environment ev;
- PASBackendLDAPBookView *view = (PASBackendLDAPBookView*)e_iterator_get (iter);
-
- CORBA_exception_init(&ev);
-
- bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- pas_book_view_notify_remove_1 (view->book_view, remove_op->id);
-
- bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- e_iterator_next (iter);
- }
- g_object_unref (iter);
- }
- else {
- ldap_perror (bl->priv->ldap, "remove_card");
- }
-
- pas_book_respond_remove (remove_op->op.book,
- ldap_error_to_response (ldap_error));
-
- if (op->view)
- pas_book_view_notify_complete (op->view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-}
-
-static void
-remove_card_dtor (LDAPOp *op)
-{
- LDAPRemoveOp *remove_op = (LDAPRemoveOp*)op;
-
- g_free (remove_op->id);
- g_free (remove_op);
-}
-
-static void
-pas_backend_ldap_process_remove_cards (PASBackend *backend,
- PASBook *book,
- PASRemoveCardsRequest *req)
-{
- LDAPRemoveOp *remove_op = g_new (LDAPRemoveOp, 1);
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- PASBookView *book_view;
- int remove_msgid;
- int ldap_error;
-
- book_view = find_book_view (bl);
-
- /*
- ** since we didn't pass "bulk-removes" in our static
- ** capabilities, we should only get 1 length lists here, so
- ** the id we're deleting is the first and only id in the list.
- */
- remove_op->id = g_strdup (req->ids->data);
-
- do {
- book_view_notify_status (book_view, _("Removing card from LDAP server..."));
-
- ldap_error = ldap_delete_ext (bl->priv->ldap,
- remove_op->id,
- NULL, NULL, &remove_msgid);
- } while (pas_backend_ldap_reconnect (bl, book_view, ldap_error));
-
- if (ldap_error != LDAP_SUCCESS) {
- pas_book_respond_remove (remove_op->op.book,
- ldap_error_to_response (ldap_error));
- remove_card_dtor ((LDAPOp*)remove_op);
- return;
- }
- else {
- g_print ("ldap_delete_ext returned %d\n", ldap_error);
- ldap_op_add ((LDAPOp*)remove_op, backend, book,
- book_view, remove_msgid,
- remove_card_handler, remove_card_dtor);
- }
-}
-
-
-/*
-** MODIFY
-**
-** The modification request is actually composed of 2 separate
-** requests. Since we need to get a list of theexisting objectclasses
-** used by the ldap server for the entry, and since the UI only sends
-** us the current card, we need to query the ldap server for the
-** existing card.
-**
-*/
-
-typedef struct {
- LDAPOp op;
- const char *id; /* the id of the card we're modifying */
- char *current_vcard; /* current in the LDAP db */
- ECardSimple *current_card;
- char *vcard; /* the VCard we want to store */
- ECardSimple *card;
- GList *existing_objectclasses;
-} LDAPModifyOp;
-
-static void
-modify_card_modify_handler (LDAPOp *op, LDAPMessage *res)
-{
- LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (op->backend);
- LDAP *ldap = bl->priv->ldap;
- int ldap_error;
-
- if (LDAP_RES_MODIFY != ldap_msgtype (res)) {
- g_warning ("incorrect msg type %d passed to modify_card_handler", ldap_msgtype (res));
- pas_book_respond_modify (op->book,
- GNOME_Evolution_Addressbook_BookListener_OtherError);
- ldap_op_finished (op);
- return;
- }
-
- ldap_parse_result (ldap, res, &ldap_error,
- NULL, NULL, NULL, NULL, 0);
-
- if (ldap_error == LDAP_SUCCESS) {
- /* the card was modified, let's let the views know about it */
- EIterator *iter = e_list_get_iterator (bl->priv->book_views);
- while (e_iterator_is_valid (iter)) {
- CORBA_Environment ev;
- gboolean old_match, new_match;
- PASBackendLDAPBookView *view = (PASBackendLDAPBookView*)e_iterator_get (iter);
-
- CORBA_exception_init(&ev);
-
- bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- old_match = pas_backend_card_sexp_match_vcard (view->card_sexp,
- modify_op->current_vcard);
- new_match = pas_backend_card_sexp_match_vcard (view->card_sexp,
- modify_op->vcard);
- if (old_match && new_match)
- pas_book_view_notify_change_1 (view->book_view, modify_op->vcard);
- else if (new_match)
- pas_book_view_notify_add_1 (view->book_view, modify_op->vcard);
- else /* if (old_match) */
- pas_book_view_notify_remove_1 (view->book_view, e_card_simple_get_id (modify_op->card));
- pas_book_view_notify_complete (view->book_view, GNOME_Evolution_Addressbook_BookViewListener_Success);
-
- bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), &ev);
-
- e_iterator_next (iter);
- }
- g_object_unref (iter);
- }
- else {
- ldap_perror (ldap, "ldap_modify_s");
- }
-
- /* and lastly respond */
- pas_book_respond_modify (op->book,
- ldap_error_to_response (ldap_error));
- ldap_op_finished (op);
-}
-
-static void
-modify_card_search_handler (LDAPOp *op, LDAPMessage *res)
-{
- LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (op->backend);
- LDAP *ldap = bl->priv->ldap;
- int msg_type;
-
- /* if it's successful, we should get called with a
- RES_SEARCH_ENTRY and a RES_SEARCH_RESULT. if it's
- unsuccessful, we should only see a RES_SEARCH_RESULT */
-
- msg_type = ldap_msgtype (res);
- if (msg_type == LDAP_RES_SEARCH_ENTRY) {
- LDAPMessage *e = ldap_first_entry(ldap, res);
-
- if (!e) {
- g_warning ("uh, this shouldn't happen");
- pas_book_respond_modify (op->book,
- GNOME_Evolution_Addressbook_BookListener_OtherError);
- ldap_op_finished (op);
- return;
- }
-
- modify_op->current_card = build_card_from_entry (ldap, e,
- &modify_op->existing_objectclasses);
- modify_op->current_vcard = e_card_simple_get_vcard_assume_utf8 (modify_op->current_card);
- }
- else if (msg_type == LDAP_RES_SEARCH_RESULT) {
- int ldap_error;
- LDAPMod **ldap_mods;
- GPtrArray *mod_array;
- gboolean differences;
- gboolean need_new_dn;
- int modify_card_msgid;
-
- /* grab the result code, and set up the actual modify
- if it was successful */
- ldap_parse_result (bl->priv->ldap, res, &ldap_error,
- NULL, NULL, NULL, NULL, 0);
-
- if (ldap_error != LDAP_SUCCESS) {
- /* more here i'm sure */
- pas_book_respond_modify (op->book,
- ldap_error_to_response (ldap_error));
- ldap_op_finished (op);
- return;
- }
-
- /* build our mods */
- mod_array = build_mods_from_ecards (bl, modify_op->current_card, modify_op->card, &need_new_dn);
- differences = mod_array->len > 0;
-
- if (differences) {
- /* remove the NULL at the end */
- g_ptr_array_remove (mod_array, NULL);
-
- /* add our objectclass(es), making sure
- evolutionPerson is there if it's supported */
- add_objectclass_mod (bl, mod_array, modify_op->existing_objectclasses);
-
- /* then put the NULL back */
- g_ptr_array_add (mod_array, NULL);
-
- ldap_mods = (LDAPMod**)mod_array->pdata;
-
- /* actually perform the ldap modify */
- ldap_error = ldap_modify_ext (ldap, modify_op->id, ldap_mods,
- NULL, NULL, &modify_card_msgid);
-
- if (ldap_error == LDAP_SUCCESS) {
- op->handler = modify_card_modify_handler;
- ldap_op_change_id ((LDAPOp*)modify_op,
- modify_card_msgid);
- }
- else {
- g_warning ("ldap_modify_ext returned %d\n", ldap_error);
- pas_book_respond_modify (op->book,
- ldap_error_to_response (ldap_error));
- ldap_op_finished (op);
- return;
- }
- }
-
- /* and clean up */
- free_mods (mod_array);
- }
- else {
- g_warning ("unhandled result type %d returned", msg_type);
- pas_book_respond_modify (op->book,
- GNOME_Evolution_Addressbook_BookListener_OtherError);
- ldap_op_finished (op);
- }
-}
-
-static void
-modify_card_dtor (LDAPOp *op)
-{
- LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
-
- g_list_foreach (modify_op->existing_objectclasses, (GFunc)g_free, NULL);
- g_list_free (modify_op->existing_objectclasses);
- g_free (modify_op->current_vcard);
- if (modify_op->current_card)
- g_object_unref (modify_op->current_card);
- g_free (modify_op->vcard);
- if (modify_op->card)
- g_object_unref (modify_op->card);
- g_free (modify_op);
-}
-
-static void
-pas_backend_ldap_process_modify_card (PASBackend *backend,
- PASBook *book,
- PASModifyCardRequest *req)
-{
- LDAPModifyOp *modify_op = g_new0 (LDAPModifyOp, 1);
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- ECard *new_ecard;
- int ldap_error;
- LDAP *ldap;
- int modify_card_msgid;
- PASBookView *book_view;
-
- book_view = find_book_view (bl);
-
- modify_op->vcard = g_strdup (req->vcard);
- new_ecard = e_card_new (modify_op->vcard);
- modify_op->card = e_card_simple_new (new_ecard);
- g_object_unref (new_ecard);
- modify_op->id = e_card_simple_get_id(modify_op->card);
-
- ldap = bl->priv->ldap;
-
- book_view_notify_status (book_view, _("Modifying card from LDAP server..."));
-
- do {
- book_view_notify_status (book_view, _("Modifying card from LDAP server..."));
-
- ldap_error = ldap_search_ext (ldap, modify_op->id,
- LDAP_SCOPE_BASE,
- "(objectclass=*)",
- NULL, 0, NULL, NULL,
- NULL, /* XXX timeout */
- 1, &modify_card_msgid);
-
- } while (pas_backend_ldap_reconnect (bl, book_view, ldap_error));
-
- if (ldap_error == LDAP_SUCCESS) {
- ldap_op_add ((LDAPOp*)modify_op, backend, book,
- book_view, modify_card_msgid,
- modify_card_search_handler, modify_card_dtor);
- }
- else {
- g_warning ("ldap_search_ext returned %d\n", ldap_error);
- pas_book_respond_modify (book,
- GNOME_Evolution_Addressbook_BookListener_OtherError);
- modify_card_dtor ((LDAPOp*)modify_op);
- }
-}
-
-
-typedef struct {
- LDAPOp op;
-} LDAPGetVCardOp;
-
-static void
-get_vcard_handler (LDAPOp *op, LDAPMessage *res)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (op->backend);
- int msg_type;
-
- /* the msg_type will be either SEARCH_ENTRY (if we're
- successful) or SEARCH_RESULT (if we're not), so we finish
- the op after either */
- msg_type = ldap_msgtype (res);
- if (msg_type == LDAP_RES_SEARCH_ENTRY) {
- LDAPMessage *e = ldap_first_entry(bl->priv->ldap, res);
- ECardSimple *simple;
- char *vcard;
-
- if (!e) {
- g_warning ("uh, this shouldn't happen");
- pas_book_respond_get_vcard (op->book,
- GNOME_Evolution_Addressbook_BookListener_OtherError,
- "");
- ldap_op_finished (op);
- return;
- }
-
- simple = build_card_from_entry (bl->priv->ldap, e, NULL);
- vcard = e_card_simple_get_vcard_assume_utf8 (simple);
- pas_book_respond_get_vcard (op->book,
- GNOME_Evolution_Addressbook_BookListener_Success,
- vcard);
- g_free (vcard);
- g_object_unref (simple);
- ldap_op_finished (op);
- }
- else if (msg_type == LDAP_RES_SEARCH_RESULT) {
- int ldap_error;
- ldap_parse_result (bl->priv->ldap, res, &ldap_error,
- NULL, NULL, NULL, NULL, 0);
- pas_book_respond_get_vcard (op->book, ldap_error_to_response (ldap_error), "");
- ldap_op_finished (op);
- }
- else {
- g_warning ("unhandled result type %d returned", msg_type);
- pas_book_respond_get_vcard (op->book, GNOME_Evolution_Addressbook_BookListener_OtherError,
- "");
- ldap_op_finished (op);
- }
-
-}
-
-static void
-get_vcard_dtor (LDAPOp *op)
-{
- LDAPGetVCardOp *get_vcard_op = (LDAPGetVCardOp*)op;
-
- g_free (get_vcard_op);
-}
-
-static void
-pas_backend_ldap_process_get_vcard (PASBackend *backend,
- PASBook *book,
- PASGetVCardRequest *req)
-{
- LDAPGetVCardOp *get_vcard_op = g_new0 (LDAPGetVCardOp, 1);
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- LDAP *ldap = bl->priv->ldap;
- int get_vcard_msgid;
- PASBookView *book_view;
- int ldap_error;
-
- book_view = find_book_view (bl);
-
- do {
- ldap_error = ldap_search_ext (ldap, req->id,
- LDAP_SCOPE_BASE,
- "(objectclass=*)",
- NULL, 0, NULL, NULL,
- NULL, /* XXX timeout */
- 1, &get_vcard_msgid);
- } while (pas_backend_ldap_reconnect (bl, book_view, ldap_error));
-
- if (ldap_error == LDAP_SUCCESS) {
- ldap_op_add ((LDAPOp*)get_vcard_op, backend, book,
- book_view, get_vcard_msgid,
- get_vcard_handler, get_vcard_dtor);
- }
- else {
- pas_book_respond_get_vcard (book,
- ldap_error_to_response (ldap_error),
- "");
- get_vcard_dtor ((LDAPOp*)get_vcard_op);
- }
-}
-
-
-typedef struct {
- LDAPOp op;
- PASBackendLDAPCursorPrivate *cursor_data;
- gboolean responded; /* if FALSE, we need to free cursor_data in the dtor */
-} LDAPGetCursorOp;
-
-static long
-get_length(PASCardCursor *cursor, gpointer data)
-{
- PASBackendLDAPCursorPrivate *cursor_data = (PASBackendLDAPCursorPrivate *) data;
-
- return cursor_data->num_elements;
-}
-
-static char *
-get_nth(PASCardCursor *cursor, long n, gpointer data)
-{
- PASBackendLDAPCursorPrivate *cursor_data = (PASBackendLDAPCursorPrivate *) data;
-
- g_return_val_if_fail (n < cursor_data->num_elements, NULL);
-
- return (char*)g_list_nth (cursor_data->elements, n);
-}
-
-static void
-cursor_destroy(gpointer data, GObject *where_object_was)
-{
- PASBackendLDAPCursorPrivate *cursor_data = (PASBackendLDAPCursorPrivate *) data;
-
- if (cursor_data->book) {
- CORBA_Environment ev;
- GNOME_Evolution_Addressbook_Book corba_book;
-
- corba_book = bonobo_object_corba_objref(BONOBO_OBJECT(cursor_data->book));
-
- CORBA_exception_init(&ev);
-
- GNOME_Evolution_Addressbook_Book_unref(corba_book, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("cursor_destroy: Exception unreffing "
- "corba book.\n");
- }
-
- CORBA_exception_free(&ev);
- }
-
- /* free the ldap specific cursor information */
- g_list_foreach (cursor_data->elements, (GFunc)g_free, NULL);
- g_list_free (cursor_data->elements);
-
- g_free(cursor_data);
-}
-
-static void
-get_cursor_handler (LDAPOp *op, LDAPMessage *res)
-{
- LDAPGetCursorOp *cursor_op = (LDAPGetCursorOp*)op;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (op->backend);
- LDAP *ldap = bl->priv->ldap;
- int msg_type;
-
- msg_type = ldap_msgtype (res);
- if (msg_type == LDAP_RES_SEARCH_ENTRY) {
- LDAPMessage *e;
-
- e = ldap_first_entry (ldap, res);
- while (e) {
- ECardSimple *simple;
-
- simple = build_card_from_entry (ldap, e, NULL);
- if (simple) {
- char *vcard = e_card_simple_get_vcard_assume_utf8 (simple);
- cursor_op->cursor_data->num_elements ++;
- cursor_op->cursor_data->elements = g_list_prepend (cursor_op->cursor_data->elements,
- vcard);
- g_object_unref (simple);
- }
- }
- }
- else if (msg_type == LDAP_RES_SEARCH_RESULT) {
- PASCardCursor *cursor = CORBA_OBJECT_NIL;
- int ldap_error;
- ldap_parse_result (bl->priv->ldap, res, &ldap_error,
- NULL, NULL, NULL, NULL, 0);
-
- if (ldap_error == LDAP_SUCCESS) {
- cursor = pas_card_cursor_new(get_length,
- get_nth,
- cursor_op->cursor_data);
-
- g_object_weak_ref (G_OBJECT (cursor), cursor_destroy, cursor_op->cursor_data);
-
- cursor_op->responded = TRUE;
- }
-
- pas_book_respond_get_cursor (cursor_op->cursor_data->book,
- ldap_error_to_response (ldap_error),
- cursor);
-
- ldap_op_finished (op);
- }
- else {
- g_warning ("unhandled result type %d returned", msg_type);
- pas_book_respond_get_cursor (op->book,
- GNOME_Evolution_Addressbook_BookListener_OtherError,
- CORBA_OBJECT_NIL);
- ldap_op_finished (op);
- }
-}
-
-static void
-get_cursor_dtor (LDAPOp *op)
-{
- LDAPGetCursorOp *cursor_op = (LDAPGetCursorOp*)op;
-
- if (!cursor_op->responded) {
- cursor_destroy (cursor_op->cursor_data, NULL);
- }
-
- g_free (op);
-}
-
-static void
-pas_backend_ldap_process_get_cursor (PASBackend *backend,
- PASBook *book,
- PASGetCursorRequest *req)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- LDAP *ldap = bl->priv->ldap;
- int ldap_error;
- int get_cursor_msgid;
- LDAPGetCursorOp *cursor_op;
- PASBookView *book_view;
-
- book_view = find_book_view (bl);
-
- cursor_op = g_new0 (LDAPGetCursorOp, 1);
- cursor_op->cursor_data = g_new0 (PASBackendLDAPCursorPrivate, 1);
-
- do {
- ldap_error = ldap_search_ext (ldap,
- bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- "(objectclass=*)",
- NULL, 0,
- NULL, NULL, NULL, /* timeout */
- 0, &get_cursor_msgid);
- } while (pas_backend_ldap_reconnect (bl, book_view, ldap_error));
-
- if (ldap_error == LDAP_SUCCESS) {
- CORBA_Environment ev;
- GNOME_Evolution_Addressbook_Book corba_book;
-
- corba_book = bonobo_object_corba_objref(BONOBO_OBJECT(book));
-
- CORBA_exception_init(&ev);
-
- GNOME_Evolution_Addressbook_Book_ref(corba_book, &ev);
-
- cursor_op->cursor_data->backend = backend;
- cursor_op->cursor_data->book = book;
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("pas_backend_ldap_process_get_cursor: Exception reffing "
- "corba book.\n");
- }
-
- CORBA_exception_free(&ev);
-
-
- ldap_op_add ((LDAPOp*)cursor_op, backend, book,
- NULL, get_cursor_msgid, get_cursor_handler, get_cursor_dtor);
- }
- else {
- pas_book_respond_get_cursor (book,
- ldap_error_to_response (ldap_error),
- CORBA_OBJECT_NIL);
- get_cursor_dtor ((LDAPOp*)cursor_op);
- }
-}
-
-
-/* List property functions */
-static void
-email_populate(ECardSimple *card, char **values)
-{
- int i;
-
- for (i = 0; values[i] && i < 3; i ++) {
- e_card_simple_set_email (card, i, values[i]);
- }
-}
-
-struct berval**
-email_ber(ECardSimple *card)
-{
- struct berval** result;
- const char *emails[3];
- int i, j, num;
-
- num = 0;
- for (i = 0; i < 3; i ++) {
- emails[i] = e_card_simple_get_email (card, E_CARD_SIMPLE_EMAIL_ID_EMAIL + i);
- if (emails[i])
- num++;
- }
-
- if (num == 0)
- return NULL;
-
- result = g_new (struct berval*, num + 1);
-
- for (i = 0; i < num; i ++)
- result[i] = g_new (struct berval, 1);
-
- j = 0;
- for (i = 0; i < 3; i ++) {
- if (emails[i]) {
- result[j]->bv_val = g_strdup (emails[i]);
- result[j++]->bv_len = strlen (emails[i]);
- }
- }
-
- result[num] = NULL;
-
- return result;
-}
-
-static gboolean
-email_compare (ECardSimple *ecard1, ECardSimple *ecard2)
-{
- const char *email1, *email2;
- int i;
-
- for (i = 0; i < 3; i ++) {
- gboolean equal;
- email1 = e_card_simple_get_email (ecard1, E_CARD_SIMPLE_EMAIL_ID_EMAIL + i);
- email2 = e_card_simple_get_email (ecard2, E_CARD_SIMPLE_EMAIL_ID_EMAIL + i);
-
- if (email1 && email2)
- equal = !strcmp (email1, email2);
- else
- equal = (!!email1 == !!email2);
-
- if (!equal)
- return equal;
- }
-
- return TRUE;
-}
-
-static void
-homephone_populate(ECardSimple *card, char **values)
-{
- if (values[0]) {
- e_card_simple_set (card, E_CARD_SIMPLE_FIELD_PHONE_HOME, values[0]);
- if (values[1])
- e_card_simple_set (card, E_CARD_SIMPLE_FIELD_PHONE_HOME_2, values[1]);
- }
-}
-
-struct berval**
-homephone_ber(ECardSimple *card)
-{
- struct berval** result;
- const char *homephones[3];
- int i, j, num;
-
- num = 0;
- if ((homephones[0] = e_card_simple_get (card, E_CARD_SIMPLE_FIELD_PHONE_HOME)))
- num++;
- if ((homephones[1] = e_card_simple_get (card, E_CARD_SIMPLE_FIELD_PHONE_HOME_2)))
- num++;
-
- if (num == 0)
- return NULL;
-
- result = g_new (struct berval*, num + 1);
-
- for (i = 0; i < num; i ++)
- result[i] = g_new (struct berval, 1);
-
- j = 0;
- for (i = 0; i < 2; i ++) {
- if (homephones[i]) {
- result[j]->bv_val = g_strdup (homephones[i]);
- result[j++]->bv_len = strlen (homephones[i]);
- }
- }
-
- result[num] = NULL;
-
- return result;
-}
-
-static gboolean
-homephone_compare (ECardSimple *ecard1, ECardSimple *ecard2)
-{
- int phone_ids[2] = { E_CARD_SIMPLE_FIELD_PHONE_HOME, E_CARD_SIMPLE_FIELD_PHONE_HOME_2 };
- const char *phone1, *phone2;
- int i;
-
- for (i = 0; i < 2; i ++) {
- gboolean equal;
- phone1 = e_card_simple_get (ecard1, phone_ids[i]);
- phone2 = e_card_simple_get (ecard2, phone_ids[i]);
-
- if (phone1 && phone2)
- equal = !strcmp (phone1, phone2);
- else
- equal = (!!phone1 == !!phone2);
-
- if (!equal)
- return equal;
- }
-
- return TRUE;
-}
-
-static void
-business_populate(ECardSimple *card, char **values)
-{
- if (values[0]) {
- e_card_simple_set (card, E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, values[0]);
- if (values[1])
- e_card_simple_set (card, E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2, values[1]);
- }
-}
-
-struct berval**
-business_ber(ECardSimple *card)
-{
- struct berval** result;
- const char *business_phones[3];
- int i, j, num;
-
- num = 0;
- if ((business_phones[0] = e_card_simple_get (card, E_CARD_SIMPLE_FIELD_PHONE_BUSINESS)))
- num++;
- if ((business_phones[1] = e_card_simple_get (card, E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2)))
- num++;
-
- if (num == 0)
- return NULL;
-
- result = g_new (struct berval*, num + 1);
-
- for (i = 0; i < num; i ++)
- result[i] = g_new (struct berval, 1);
-
- j = 0;
- for (i = 0; i < 2; i ++) {
- if (business_phones[i]) {
- result[j]->bv_val = g_strdup (business_phones[i]);
- result[j++]->bv_len = strlen (business_phones[i]);
- }
- }
-
- result[num] = NULL;
-
- return result;
-}
-
-static gboolean
-business_compare (ECardSimple *ecard1, ECardSimple *ecard2)
-{
- int phone_ids[2] = { E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2 };
- const char *phone1, *phone2;
- int i;
-
- for (i = 0; i < 2; i ++) {
- gboolean equal;
- phone1 = e_card_simple_get (ecard1, phone_ids[i]);
- phone2 = e_card_simple_get (ecard2, phone_ids[i]);
-
- if (phone1 && phone2)
- equal = !strcmp (phone1, phone2);
- else
- equal = (!!phone1 == !!phone2);
-
- if (!equal)
- return equal;
- }
-
- return TRUE;
-}
-
-static void
-anniversary_populate (ECardSimple *card, char **values)
-{
- if (values[0]) {
- ECardDate dt = e_card_date_from_string (values[0]);
- g_object_set (card->card,
- "anniversary", &dt,
- NULL);
- }
-}
-
-struct berval**
-anniversary_ber (ECardSimple *card)
-{
- ECardDate *dt;
- struct berval** result = NULL;
-
- g_object_get (card->card,
- "anniversary", &dt,
- NULL);
-
- if (dt) {
- char *anniversary;
-
- anniversary = e_card_date_to_string (dt);
-
- result = g_new (struct berval*, 2);
- result[0] = g_new (struct berval, 1);
- result[0]->bv_val = anniversary;
- result[0]->bv_len = strlen (anniversary);
-
- result[1] = NULL;
- }
-
- return result;
-}
-
-static gboolean
-anniversary_compare (ECardSimple *ecard1, ECardSimple *ecard2)
-{
- ECardDate *dt;
- char *date1 = NULL, *date2 = NULL;
- gboolean equal;
-
- g_object_get (ecard1->card,
- "anniversary", &dt,
- NULL);
- if (dt)
- date1 = e_card_date_to_string (dt);
-
- g_object_get (ecard2->card,
- "anniversary", &dt,
- NULL);
- if (dt)
- date2 = e_card_date_to_string (dt);
-
- if (date1 && date2)
- equal = !strcmp (date1, date2);
- else
- equal = (!!date1 == !!date2);
-
- g_free (date1);
- g_free (date2);
-
- return equal;
-}
-
-static void
-birthday_populate (ECardSimple *card, char **values)
-{
- if (values[0]) {
- ECardDate dt = e_card_date_from_string (values[0]);
- g_object_set (card->card,
- "birth_date", &dt,
- NULL);
- }
-}
-
-struct berval**
-birthday_ber (ECardSimple *card)
-{
- ECardDate *dt;
- struct berval** result = NULL;
-
- g_object_get (card->card,
- "birth_date", &dt,
- NULL);
-
- if (dt) {
- char *birthday;
-
- birthday = e_card_date_to_string (dt);
-
- result = g_new (struct berval*, 2);
- result[0] = g_new (struct berval, 1);
- result[0]->bv_val = birthday;
- result[0]->bv_len = strlen (birthday);
-
- result[1] = NULL;
- }
-
- return result;
-}
-
-static gboolean
-birthday_compare (ECardSimple *ecard1, ECardSimple *ecard2)
-{
- ECardDate *dt;
- char *date1 = NULL, *date2 = NULL;
- gboolean equal;
-
- g_object_get (ecard1->card,
- "birth_date", &dt,
- NULL);
- if (dt)
- date1 = e_card_date_to_string (dt);
-
- g_object_get (ecard2->card,
- "birth_date", &dt,
- NULL);
- if (dt)
- date2 = e_card_date_to_string (dt);
-
- if (date1 && date2)
- equal = !strcmp (date1, date2);
- else
- equal = (!!date1 == !!date2);
-
- g_free (date1);
- g_free (date2);
-
- return equal;
-}
-
-static void
-category_populate (ECardSimple *card, char **values)
-{
- int i;
- ECard *ecard;
- EList *categories;
-
- g_object_get (card,
- "card", &ecard,
- NULL);
-
- categories = e_list_new((EListCopyFunc) g_strdup,
- (EListFreeFunc) g_free,
- NULL);
-
- for (i = 0; values[i]; i++)
- e_list_append (categories, values[i]);
-
- g_object_set (ecard,
- "category_list", categories,
- NULL);
-
- g_object_unref (categories);
-
- e_card_simple_sync_card (card);
- g_object_unref (ecard);
-}
-
-struct berval**
-category_ber (ECardSimple *card)
-{
- struct berval** result = NULL;
- EList *categories;
- EIterator *iterator;
- ECard *ecard;
- int i;
-
- g_object_get (card,
- "card", &ecard,
- NULL);
-
- g_object_get (ecard,
- "category_list", &categories,
- NULL);
-
- if (e_list_length (categories) != 0) {
- result = g_new0 (struct berval*, e_list_length (categories) + 1);
-
- for (iterator = e_list_get_iterator(categories), i = 0; e_iterator_is_valid (iterator);
- e_iterator_next (iterator), i++) {
- const char *category = e_iterator_get (iterator);
-
- result[i] = g_new (struct berval, 1);
- result[i]->bv_val = g_strdup (category);
- result[i]->bv_len = strlen (category);
- }
-
- g_object_unref (iterator);
- }
-
- g_object_unref (categories);
- g_object_unref (ecard);
- return result;
-}
-
-static gboolean
-category_compare (ECardSimple *ecard1, ECardSimple *ecard2)
-{
- char *categories1, *categories2;
- gboolean equal;
-
- categories1 = e_card_simple_get (ecard1, E_CARD_SIMPLE_FIELD_CATEGORIES);
- categories2 = e_card_simple_get (ecard2, E_CARD_SIMPLE_FIELD_CATEGORIES);
-
- equal = !strcmp (categories1, categories2);
-
- g_free (categories1);
- g_free (categories2);
-
- return equal;
-}
-
-typedef struct {
- GList *list;
- PASBackendLDAP *bl;
-} PASBackendLDAPSExpData;
-
-#define IS_RFC2254_CHAR(c) ((c) == '*' || (c) =='\\' || (c) == '(' || (c) == ')' || (c) == '\0')
-static char *
-rfc2254_escape(char *str)
-{
- int i;
- int len = strlen(str);
- int newlen = 0;
-
- for (i = 0; i < len; i ++) {
- if (IS_RFC2254_CHAR(str[i]))
- newlen += 3;
- else
- newlen ++;
- }
-
- if (len == newlen) {
- return g_strdup (str);
- }
- else {
- char *newstr = g_malloc0 (newlen + 1);
- int j = 0;
- for (i = 0; i < len; i ++) {
- if (IS_RFC2254_CHAR(str[i])) {
- sprintf (newstr + j, "\\%02x", str[i]);
- j+= 3;
- }
- else {
- newstr[j++] = str[i];
- }
- }
- return newstr;
- }
-}
-
-static ESExpResult *
-func_and(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendLDAPSExpData *ldap_data = data;
- ESExpResult *r;
- char ** strings;
-
- if (argc > 0) {
- int i;
-
- strings = g_new0(char*, argc+3);
- strings[0] = g_strdup ("(&");
- strings[argc+3 - 2] = g_strdup (")");
-
- for (i = 0; i < argc; i ++) {
- GList *list_head = ldap_data->list;
- if (!list_head)
- break;
- strings[argc - i] = list_head->data;
- ldap_data->list = g_list_remove_link(list_head, list_head);
- g_list_free_1(list_head);
- }
-
- ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
-
- for (i = 0 ; i < argc + 2; i ++)
- g_free (strings[i]);
-
- g_free (strings);
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-func_or(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendLDAPSExpData *ldap_data = data;
- ESExpResult *r;
- char ** strings;
-
- if (argc > 0) {
- int i;
-
- strings = g_new0(char*, argc+3);
- strings[0] = g_strdup ("(|");
- strings[argc+3 - 2] = g_strdup (")");
-
- for (i = 0; i < argc; i ++) {
- GList *list_head = ldap_data->list;
- if (!list_head)
- break;
- strings[argc - i] = list_head->data;
- ldap_data->list = g_list_remove_link(list_head, list_head);
- g_list_free_1(list_head);
- }
-
- ldap_data->list = g_list_prepend(ldap_data->list, g_strjoinv(" ", strings));
-
- for (i = 0 ; i < argc + 2; i ++)
- g_free (strings[i]);
-
- g_free (strings);
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-func_not(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendLDAPSExpData *ldap_data = data;
- ESExpResult *r;
-
- /* just replace the head of the list with the NOT of it. */
- if (argc > 0) {
- char *term = ldap_data->list->data;
- ldap_data->list->data = g_strdup_printf("(!%s)", term);
- g_free (term);
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendLDAPSExpData *ldap_data = data;
- ESExpResult *r;
-
- if (argc == 2
- && argv[0]->type == ESEXP_RES_STRING
- && argv[1]->type == ESEXP_RES_STRING) {
- char *propname = argv[0]->value.string;
- char *str = rfc2254_escape(argv[1]->value.string);
- gboolean one_star = FALSE;
-
- if (strlen(str) == 0)
- one_star = TRUE;
-
- if (!strcmp (propname, "x-evolution-any-field")) {
- int i;
- int query_length;
- char *big_query;
- char *match_str;
-
- match_str = g_strdup_printf("=*%s%s)",
- str, one_star ? "" : "*");
-
- query_length = 3; /* strlen ("(|") + strlen (")") */
-
- for (i = 0; i < num_prop_infos; i ++) {
- query_length += 1 /* strlen ("(") */ + strlen(prop_info[i].ldap_attr) + strlen (match_str);
- }
-
- big_query = g_malloc0(query_length + 1);
- strcat (big_query, "(|");
- for (i = 0; i < num_prop_infos; i ++) {
- strcat (big_query, "(");
- strcat (big_query, prop_info[i].ldap_attr);
- strcat (big_query, match_str);
- }
- strcat (big_query, ")");
-
- ldap_data->list = g_list_prepend(ldap_data->list, big_query);
-
- g_free (match_str);
- }
- else {
- char *ldap_attr = query_prop_to_ldap(propname);
-
- if (ldap_attr)
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(%s=*%s%s)",
- ldap_attr,
- str,
- one_star ? "" : "*"));
- }
-
- g_free (str);
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendLDAPSExpData *ldap_data = data;
- ESExpResult *r;
-
- if (argc == 2
- && argv[0]->type == ESEXP_RES_STRING
- && argv[1]->type == ESEXP_RES_STRING) {
- char *propname = argv[0]->value.string;
- char *str = rfc2254_escape(argv[1]->value.string);
- char *ldap_attr = query_prop_to_ldap(propname);
-
- if (ldap_attr)
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(%s=%s)",
- ldap_attr, str));
- else {
- g_warning ("unknown query property\n");
- /* we want something that'll always be false */
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup("objectClass=MyBarnIsBiggerThanYourBarn"));
- }
-
- g_free (str);
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendLDAPSExpData *ldap_data = data;
- ESExpResult *r;
-
- if (argc == 2
- && argv[0]->type == ESEXP_RES_STRING
- && argv[1]->type == ESEXP_RES_STRING) {
- char *propname = argv[0]->value.string;
- char *str = rfc2254_escape(argv[1]->value.string);
- char *ldap_attr = query_prop_to_ldap(propname);
-
- /* insert hack for fileAs queries, since we need to do
- the right thing if the server supports them or not,
- and for entries that have no fileAs attribute. */
- if (ldap_attr) {
- if (!strcmp (propname, "full_name")) {
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf(
- "(|(cn=%s*)(sn=%s*))",
- str, str));
- }
- else if (!strcmp (ldap_attr, "fileAs")) {
- if (ldap_data->bl->priv->evolutionPersonSupported)
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(|(fileAs=%s*)(&(!(fileAs=*))(sn=%s*)))",
- str, str));
- else
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(sn=%s*)", str));
- }
- else {
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(%s=%s*)",
- ldap_attr,
- str));
- }
- }
-
- g_free (str);
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- return r;
-}
-
-static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendLDAPSExpData *ldap_data = data;
- ESExpResult *r;
-
- if (argc == 2
- && argv[0]->type == ESEXP_RES_STRING
- && argv[1]->type == ESEXP_RES_STRING) {
- char *propname = argv[0]->value.string;
- char *str = rfc2254_escape(argv[1]->value.string);
- char *ldap_attr = query_prop_to_ldap(propname);
-
- if (ldap_attr)
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf("(%s=*%s)",
- ldap_attr,
- str));
- g_free (str);
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = FALSE;
-
- return r;
-}
-
-/* 'builtin' functions */
-static struct {
- char *name;
- ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
- doesn't execute everything, 0 otherwise */
-} symbols[] = {
- { "and", func_and, 0 },
- { "or", func_or, 0 },
- { "not", func_not, 0 },
- { "contains", func_contains, 0 },
- { "is", func_is, 0 },
- { "beginswith", func_beginswith, 0 },
- { "endswith", func_endswith, 0 },
-};
-
-static gchar *
-pas_backend_ldap_build_query (PASBackendLDAP *bl, gchar *query)
-{
- ESExp *sexp;
- ESExpResult *r;
- gchar *retval;
- PASBackendLDAPSExpData data;
- int i;
-
- data.list = NULL;
- data.bl = bl;
-
- sexp = e_sexp_new();
-
- for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
- if (symbols[i].type == 1) {
- e_sexp_add_ifunction(sexp, 0, symbols[i].name,
- (ESExpIFunc *)symbols[i].func, &data);
- } else {
- e_sexp_add_function(sexp, 0, symbols[i].name,
- symbols[i].func, &data);
- }
- }
-
- e_sexp_input_text(sexp, query, strlen(query));
- e_sexp_parse(sexp);
-
- r = e_sexp_eval(sexp);
-
- e_sexp_result_free(sexp, r);
- e_sexp_unref (sexp);
-
- if (data.list) {
- if (data.list->next) {
- g_warning ("conversion to ldap query string failed");
- retval = NULL;
- g_list_foreach (data.list, (GFunc)g_free, NULL);
- }
- else {
- retval = data.list->data;
- }
- }
- else {
- g_warning ("conversion to ldap query string failed");
- retval = NULL;
- }
-
- g_list_free (data.list);
- return retval;
-}
-
-static gchar *
-query_prop_to_ldap(gchar *query_prop)
-{
- int i;
-
- for (i = 0; i < num_prop_infos; i ++)
- if (!strcmp (query_prop, prop_info[i].query_prop))
- return prop_info[i].ldap_attr;
-
- return NULL;
-}
-
-
-typedef struct {
- LDAPOp op;
- PASBackendLDAPBookView *view;
-
- /* grouping stuff */
- GList *pending_adds; /* the cards we're sending */
- int num_pending_adds; /* the number waiting to be sent */
- int target_pending_adds; /* the cutoff that forces a flush to the client, if it happens before the timeout */
- int num_sent_this_time; /* the number of cards we sent to the client before the most recent timeout */
- int num_sent_last_time; /* the number of cards we sent to the client before the previous timeout */
- glong grouping_time_start;
-
- /* used by search_handler to only send the status messages once */
- gboolean notified_receiving_results;
-} LDAPSearchOp;
-
-static ECardSimple *
-build_card_from_entry (LDAP *ldap, LDAPMessage *e, GList **existing_objectclasses)
-{
- ECard *ecard = e_card_new ("");
- ECardSimple *card = e_card_simple_new (ecard);
- char *dn;
- char *attr;
- BerElement *ber = NULL;
-
- dn = ldap_get_dn(ldap, e);
- e_card_simple_set_id (card, dn);
- ldap_memfree (dn);
-
- for (attr = ldap_first_attribute (ldap, e, &ber); attr;
- attr = ldap_next_attribute (ldap, e, ber)) {
- int i;
- struct prop_info *info = NULL;
- char **values;
-
- if (existing_objectclasses && !g_ascii_strcasecmp (attr, "objectclass")) {
- values = ldap_get_values (ldap, e, attr);
- for (i = 0; values[i]; i ++)
- *existing_objectclasses = g_list_append (*existing_objectclasses, g_strdup (values[i]));
-
- ldap_value_free (values);
- }
- else {
- for (i = 0; i < num_prop_infos; i ++)
- if (!g_ascii_strcasecmp (attr, prop_info[i].ldap_attr)) {
- info = &prop_info[i];
- break;
- }
-
- if (info) {
- values = ldap_get_values (ldap, e, attr);
-
- if (values) {
- if (info->prop_type & PROP_TYPE_STRING) {
- /* if it's a normal property just set the string */
- if (values[0])
- e_card_simple_set (card, info->field_id, values[0]);
-
- }
- else if (info->prop_type & PROP_TYPE_COMPLEX) {
- /* if it's a list call the ecard-populate function,
- which calls g_object_set to set the property */
- info->populate_ecard_func(card,
- values);
- }
-
- ldap_value_free (values);
- }
- }
- }
-
- ldap_memfree (attr);
- }
-
- if (ber)
- ber_free (ber, 0);
-
- e_card_simple_sync_card (card);
-
- g_object_unref (ecard);
-
- return card;
-}
-
-static gboolean
-poll_ldap (PASBackendLDAP *bl)
-{
- LDAP *ldap = bl->priv->ldap;
- int rc;
- LDAPMessage *res;
- GTimeVal cur_time;
- glong cur_millis;
- struct timeval timeout;
- EIterator *iter;
-
- if (!bl->priv->active_ops) {
- g_warning ("poll_ldap being called for backend with no active operations");
- return FALSE;
- }
-
- timeout.tv_sec = 0;
- timeout.tv_usec = LDAP_RESULT_TIMEOUT_MILLIS * 1000;
-
- rc = ldap_result (ldap, LDAP_RES_ANY, 0, &timeout, &res);
- if (rc != 0) {/* rc == 0 means timeout exceeded */
- if (rc == -1) {
- PASBookView *book_view = find_book_view (bl);
- g_warning ("ldap_result returned -1, restarting ops");
-
- pas_backend_ldap_reconnect (bl, book_view, LDAP_SERVER_DOWN);
-#if 0
- if (bl->priv->connected)
- restart_ops (bl);
-#endif
- }
- else {
- int msgid = ldap_msgid (res);
- LDAPOp *op;
-
- op = g_hash_table_lookup (bl->priv->id_to_op, &msgid);
-
- if (op)
- op->handler (op, res);
- else
- g_warning ("unknown operation, msgid = %d", msgid);
-
- ldap_msgfree(res);
- }
- }
-
- g_get_current_time (&cur_time);
- cur_millis = TV_TO_MILLIS (cur_time);
-
- iter = e_list_get_iterator (bl->priv->book_views);
- while (e_iterator_is_valid (iter)) {
- PASBackendLDAPBookView *view = (PASBackendLDAPBookView *)e_iterator_get (iter);
- if (view->search_op) {
- bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), NULL);
-
- ldap_search_op_timeout (view->search_op, cur_millis);
-
- bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), NULL);
- }
- e_iterator_next (iter);
- }
- g_object_unref (iter);
-
- return TRUE;
-}
-
-static void
-send_pending_adds (LDAPSearchOp *search_op)
-{
- search_op->num_sent_this_time += search_op->num_pending_adds;
- pas_book_view_notify_add (search_op->op.view, search_op->pending_adds);
- g_list_foreach (search_op->pending_adds, (GFunc)g_free, NULL);
- g_list_free (search_op->pending_adds);
- search_op->pending_adds = NULL;
- search_op->num_pending_adds = 0;
-}
-
-static void
-ldap_search_op_timeout (LDAPOp *op, glong cur_millis)
-{
- LDAPSearchOp *search_op = (LDAPSearchOp*)op;
-
- if (cur_millis - search_op->grouping_time_start > GROUPING_MINIMUM_WAIT) {
-
- if (search_op->num_pending_adds >= search_op->target_pending_adds)
- send_pending_adds (search_op);
-
- if (cur_millis - search_op->grouping_time_start > GROUPING_MAXIMUM_WAIT) {
- GTimeVal new_start;
-
- if (search_op->num_pending_adds)
- send_pending_adds (search_op);
- search_op->target_pending_adds = MIN (GROUPING_MAXIMUM_SIZE,
- (search_op->num_sent_this_time + search_op->num_sent_last_time) / 2);
- search_op->target_pending_adds = MAX (search_op->target_pending_adds, 1);
-
-#ifdef PERFORMANCE_SPEW
- printf ("num sent this time %d, last time %d, target pending adds set to %d\n",
- search_op->num_sent_this_time,
- search_op->num_sent_last_time,
- search_op->target_pending_adds);
-#endif
- g_get_current_time (&new_start);
- search_op->grouping_time_start = TV_TO_MILLIS (new_start);
- search_op->num_sent_last_time = search_op->num_sent_this_time;
- search_op->num_sent_this_time = 0;
- }
- }
-}
-
-static void
-ldap_search_handler (LDAPOp *op, LDAPMessage *res)
-{
- LDAPSearchOp *search_op = (LDAPSearchOp*)op;
- PASBackendLDAPBookView *view = search_op->view;
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (op->backend);
- LDAP *ldap = bl->priv->ldap;
- LDAPMessage *e;
- int msg_type;
-
- bonobo_object_dup_ref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), NULL);
-
- if (!search_op->notified_receiving_results) {
- search_op->notified_receiving_results = TRUE;
- book_view_notify_status (op->view, _("Receiving LDAP search results..."));
- }
-
- msg_type = ldap_msgtype (res);
- if (msg_type == LDAP_RES_SEARCH_ENTRY) {
- e = ldap_first_entry(ldap, res);
-
- while (NULL != e) {
- ECardSimple *card = build_card_from_entry (ldap, e, NULL);
-
- search_op->pending_adds = g_list_append (search_op->pending_adds,
- e_card_simple_get_vcard_assume_utf8 (card));
- search_op->num_pending_adds ++;
-
- g_object_unref (card);
-
- e = ldap_next_entry(ldap, e);
- }
- }
- else if (msg_type == LDAP_RES_SEARCH_RESULT) {
- int ldap_error;
-
- ldap_parse_result (ldap, res, &ldap_error,
- NULL, NULL, NULL, NULL, 0);
-
- g_warning ("search returned %d\n", ldap_error);
-
- /* the entry that marks the end of our search */
- if (search_op->num_pending_adds)
- send_pending_adds (search_op);
-
- if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
- pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_SearchTimeLimitExceeded);
- else if (ldap_error == LDAP_SIZELIMIT_EXCEEDED)
- pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_SearchSizeLimitExceeded);
- else if (ldap_error == LDAP_SUCCESS)
- pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_Success);
- else
- pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_OtherError);
-
- ldap_op_finished (op);
- }
- else {
- g_warning ("unhandled search result type %d returned", msg_type);
- if (search_op->num_pending_adds)
- send_pending_adds (search_op);
- pas_book_view_notify_complete (search_op->op.view, GNOME_Evolution_Addressbook_BookViewListener_OtherError);
- ldap_op_finished (op);
- }
-
-
- bonobo_object_release_unref(bonobo_object_corba_objref(BONOBO_OBJECT(view->book_view)), NULL);
-}
-
-static void
-ldap_search_dtor (LDAPOp *op)
-{
- LDAPSearchOp *search_op = (LDAPSearchOp*) op;
-
- /* unhook us from our PASBackendLDAPBookView */
- if (search_op->view)
- search_op->view->search_op = NULL;
-
- g_list_foreach (search_op->pending_adds, (GFunc)g_free, NULL);
- g_list_free (search_op->pending_adds);
- search_op->pending_adds = NULL;
- search_op->num_pending_adds = 0;
-
- g_free (search_op);
-}
-
-static void
-pas_backend_ldap_search (PASBackendLDAP *bl,
- PASBook *book,
- PASBackendLDAPBookView *view)
-{
- char *ldap_query;
-
- ldap_query = pas_backend_ldap_build_query(bl, view->search);
-
- if (ldap_query != NULL) {
- LDAP *ldap = bl->priv->ldap;
- int ldap_err;
- GTimeVal search_start;
- int search_msgid;
-
- printf ("searching server using filter: %s\n", ldap_query);
-
- do {
- book_view_notify_status (view->book_view, _("Searching..."));
-
- ldap_err = ldap_search_ext (ldap, bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- ldap_query,
- NULL, 0,
- NULL, /* XXX */
- NULL, /* XXX */
- NULL, /* XXX timeout */
- view->limit, &search_msgid);
- } while (pas_backend_ldap_reconnect (bl, view->book_view, ldap_err));
-
- g_free (ldap_query);
-
- if (ldap_err != LDAP_SUCCESS) {
- book_view_notify_status (view->book_view, ldap_err2string(ldap_err));
- return;
- }
- else if (search_msgid == -1) {
- book_view_notify_status (view->book_view,
- _("Error performing search"));
- return;
- }
- else {
- LDAPSearchOp *op = g_new0 (LDAPSearchOp, 1);
-
- op->target_pending_adds = GROUPING_INITIAL_SIZE;
-
- g_get_current_time (&search_start);
- op->grouping_time_start = TV_TO_MILLIS (search_start);
-
- op->view = view;
-
- view->search_op = (LDAPOp*)op;
-
- ldap_op_add ((LDAPOp*)op, PAS_BACKEND(bl), book, view->book_view,
- search_msgid,
- ldap_search_handler, ldap_search_dtor);
-
- }
- return;
- }
- else {
- pas_book_view_notify_complete (view->book_view,
- GNOME_Evolution_Addressbook_BookViewListener_InvalidQuery);
- return;
- }
-
-}
-
-static void
-ldap_get_view (PASBackend *backend,
- PASBook *book,
- const char *search,
- GNOME_Evolution_Addressbook_BookViewListener listener,
- int limit)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- PASBookView *book_view;
- PASBackendLDAPBookView *view;
-
- book_view = pas_book_view_new (listener);
-
- bonobo_object_ref(BONOBO_OBJECT(book));
- g_object_weak_ref (G_OBJECT (book_view), view_destroy, book);
-
- view = g_new0(PASBackendLDAPBookView, 1);
- view->book_view = book_view;
- view->search = g_strdup(search);
- view->card_sexp = pas_backend_card_sexp_new (view->search);
- view->blpriv = bl->priv;
- view->limit = limit;
-
- e_list_append(bl->priv->book_views, view);
-
- pas_book_respond_get_book_view (book,
- (book_view != NULL
- ? GNOME_Evolution_Addressbook_BookListener_Success
- : GNOME_Evolution_Addressbook_BookListener_CardNotFound /* XXX */),
- book_view);
-
- pas_backend_ldap_search (bl, book, view);
-
- bonobo_object_unref (BONOBO_OBJECT (book_view));
-}
-
-static void
-pas_backend_ldap_process_get_book_view (PASBackend *backend,
- PASBook *book,
- PASGetBookViewRequest *req)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- ldap_get_view (backend, book, req->search, req->listener,
- bl->priv->ldap_limit);
-}
-
-static void
-pas_backend_ldap_process_get_completion_view (PASBackend *backend,
- PASBook *book,
- PASGetCompletionViewRequest *req)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- ldap_get_view (backend, book, req->search, req->listener,
- MIN (bl->priv->ldap_limit, 100));
-}
-
-static void
-pas_backend_ldap_process_get_changes (PASBackend *backend,
- PASBook *book,
- PASGetChangesRequest *req)
-{
- /* FIXME: implement */
-}
-
-static void
-pas_backend_ldap_process_check_connection (PASBackend *backend,
- PASBook *book,
- PASCheckConnectionRequest *req)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- pas_book_report_connection (book, bl->priv->connected);
-}
-
-#define LDAP_SIMPLE_PREFIX "ldap/simple-"
-#define SASL_PREFIX "sasl/"
-
-static void
-pas_backend_ldap_process_authenticate_user (PASBackend *backend,
- PASBook *book,
- PASAuthenticateUserRequest *req)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- int ldap_error;
- char *dn = NULL;
-
- if (!strncasecmp (req->auth_method, LDAP_SIMPLE_PREFIX, strlen (LDAP_SIMPLE_PREFIX))) {
-
- if (!strcmp (req->auth_method, "ldap/simple-email")) {
- LDAPMessage *res, *e;
- char *query = g_strdup_printf ("(mail=%s)", req->user);
-
- ldap_error = ldap_search_s (bl->priv->ldap,
- bl->priv->ldap_rootdn,
- bl->priv->ldap_scope,
- query,
- NULL, 0, &res);
- g_free (query);
-
- if (ldap_error == LDAP_SUCCESS) {
- char *entry_dn;
-
- e = ldap_first_entry (bl->priv->ldap, res);
-
- entry_dn = ldap_get_dn (bl->priv->ldap, e);
- dn = g_strdup(entry_dn);
-
- ldap_memfree (entry_dn);
- ldap_msgfree (res);
- }
- else {
- pas_book_respond_authenticate_user (book,
- GNOME_Evolution_Addressbook_BookListener_PermissionDenied);
- return;
- }
- }
- else if (!strcmp (req->auth_method, "ldap/simple-binddn")) {
- dn = g_strdup (req->user);
- }
-
- /* now authenticate against the DN we were either supplied or queried for */
- printf ("simple auth as %s\n", dn);
- ldap_error = ldap_simple_bind_s(bl->priv->ldap,
- dn,
- req->passwd);
-
- pas_book_respond_authenticate_user (book,
- ldap_error_to_response (ldap_error));
- }
-#ifdef ENABLE_SASL_BINDS
- else if (!strncasecmp (req->auth_method, SASL_PREFIX, strlen (SASL_PREFIX))) {
- g_print ("sasl bind (mech = %s) as %s", req->auth_method + strlen (SASL_PREFIX), req->user);
- ldap_error = ldap_sasl_bind_s (bl->priv->ldap,
- NULL,
- req->auth_method + strlen (SASL_PREFIX),
- req->passwd,
- NULL,
- NULL,
- NULL);
-
- if (ldap_error == LDAP_NOT_SUPPORTED)
- pas_book_respond_authenticate_user (book,
- GNOME_Evolution_Addressbook_BookListener_UnsupportedAuthenticationMethod);
- else
- pas_book_respond_authenticate_user (book,
- ldap_error_to_response (ldap_error));
- }
-#endif
- else {
- pas_book_respond_authenticate_user (book,
- GNOME_Evolution_Addressbook_BookListener_UnsupportedAuthenticationMethod);
- return;
- }
-
- if (ldap_error == LDAP_SUCCESS) {
- bl->priv->auth_dn = dn;
- bl->priv->auth_passwd = g_strdup (req->passwd);
-
- pas_backend_set_is_writable (backend, TRUE);
-
- /* force a requery on the root dse since some ldap
- servers are set up such that they don't report
- anything (including the schema DN) until the user
- is authenticated */
- if (!bl->priv->evolutionPersonChecked) {
- ldap_error = query_ldap_root_dse (bl);
-
- if (LDAP_SUCCESS == ldap_error) {
- if (!bl->priv->evolutionPersonChecked)
- check_schema_support (bl);
- }
- else
- g_warning ("Failed to perform root dse query after authenticating, (ldap_error 0x%02x)", ldap_error);
- }
-
- pas_book_report_writable (book, TRUE);
- }
-
-}
-
-static void
-pas_backend_ldap_process_get_supported_fields (PASBackend *backend,
- PASBook *book,
- PASGetSupportedFieldsRequest *req)
-
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- pas_book_respond_get_supported_fields (book,
- GNOME_Evolution_Addressbook_BookListener_Success,
- bl->priv->supported_fields);
-}
-
-static void
-pas_backend_ldap_process_get_supported_auth_methods (PASBackend *backend,
- PASBook *book,
- PASGetSupportedAuthMethodsRequest *req)
-
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
-
- pas_book_respond_get_supported_auth_methods (book,
- GNOME_Evolution_Addressbook_BookListener_Success,
- bl->priv->supported_auth_methods);
-}
-
-static GNOME_Evolution_Addressbook_BookListener_CallStatus
-pas_backend_ldap_load_uri (PASBackend *backend,
- const char *uri)
-{
- PASBackendLDAP *bl = PAS_BACKEND_LDAP (backend);
- LDAPURLDesc *lud;
- int ldap_error;
- char **attributes;
- int i;
- int limit = 100;
- int timeout = 60; /* 1 minute */
-
- g_assert (bl->priv->connected == FALSE);
-
- attributes = g_strsplit (uri, ";", 0);
-
- if (attributes[0] == NULL)
- return FALSE;
-
- for (i = 1; attributes[i]; i++) {
- char *equals;
- char *value;
- int key_length;
- equals = strchr (attributes[i], '=');
- if (equals) {
- key_length = equals - attributes[i];
- value = equals + 1;
- } else {
- key_length = strlen (attributes[i]);
- value = NULL;
- }
-
- if (key_length == strlen("limit") && !strncmp (attributes[i], "limit", key_length)) {
- if (value)
- limit = atoi(value);
- }
- else if (key_length == strlen("ssl") && !strncmp (attributes[i], "ssl", key_length)) {
- if (value) {
- if (!strncmp (value, "always", 6)) {
- bl->priv->use_tls = PAS_BACKEND_LDAP_TLS_ALWAYS;
- }
- else if (!strncmp (value, "whenever_possible", 3)) {
- bl->priv->use_tls = PAS_BACKEND_LDAP_TLS_WHEN_POSSIBLE;
- }
- else if (strncmp (value, "never", 5)) {
- g_warning ("unhandled value for use_tls, not using it");
- }
- }
- else {
- bl->priv->use_tls = PAS_BACKEND_LDAP_TLS_WHEN_POSSIBLE;
- }
- }
- else if (key_length == strlen("timeout") && !strncmp (attributes[i], "timeout", key_length)) {
- if (value)
- timeout = atoi (value);
- }
- }
-
- ldap_error = ldap_url_parse ((char*)attributes[0], &lud);
- g_strfreev (attributes);
-
- if (ldap_error == LDAP_SUCCESS) {
- g_free(bl->priv->uri);
- bl->priv->uri = g_strdup (uri);
- bl->priv->ldap_host = g_strdup(lud->lud_host);
- bl->priv->ldap_port = lud->lud_port;
- /* if a port wasn't specified, default to LDAP_PORT */
- if (bl->priv->ldap_port == 0)
- bl->priv->ldap_port = LDAP_PORT;
- bl->priv->ldap_rootdn = g_strdup(lud->lud_dn);
- bl->priv->ldap_limit = limit;
- bl->priv->ldap_timeout = timeout;
- bl->priv->ldap_scope = lud->lud_scope;
-
- ldap_free_urldesc(lud);
-
- return pas_backend_ldap_connect (bl);
- } else
- return GNOME_Evolution_Addressbook_BookListener_OtherError;
-}
-
-/* Get_uri handler for the addressbook LDAP backend */
-static const char *
-pas_backend_ldap_get_uri (PASBackend *backend)
-{
- PASBackendLDAP *bl;
-
- bl = PAS_BACKEND_LDAP (backend);
- return bl->priv->uri;
-}
-
-static char*
-pas_backend_ldap_get_static_capabilities (PASBackend *backend)
-{
- return g_strdup("net");
-}
-
-static gboolean
-pas_backend_ldap_construct (PASBackendLDAP *backend)
-{
- g_assert (backend != NULL);
- g_assert (PAS_IS_BACKEND_LDAP (backend));
-
- if (! pas_backend_construct (PAS_BACKEND (backend)))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * pas_backend_ldap_new:
- */
-PASBackend *
-pas_backend_ldap_new (void)
-{
- PASBackendLDAP *backend;
-
- backend = g_object_new (PAS_TYPE_BACKEND_LDAP, NULL);
-
- if (! pas_backend_ldap_construct (backend)) {
- g_object_unref (backend);
-
- return NULL;
- }
-
- return PAS_BACKEND (backend);
-}
-
-static gboolean
-call_dtor (int msgid, LDAPOp *op, gpointer data)
-{
- ldap_abandon (PAS_BACKEND_LDAP(op->backend)->priv->ldap, op->id);
-
- op->dtor (op);
-
- return TRUE;
-}
-
-static void
-pas_backend_ldap_dispose (GObject *object)
-{
- PASBackendLDAP *bl;
-
- bl = PAS_BACKEND_LDAP (object);
-
- if (bl->priv) {
- g_hash_table_foreach_remove (bl->priv->id_to_op, (GHRFunc)call_dtor, NULL);
- g_hash_table_destroy (bl->priv->id_to_op);
-
- if (bl->priv->poll_timeout != -1) {
- printf ("removing timeout\n");
- g_source_remove (bl->priv->poll_timeout);
- }
-
- g_object_unref (bl->priv->book_views);
-
- if (bl->priv->supported_fields)
- g_object_unref (bl->priv->supported_fields);
-
- if (bl->priv->supported_auth_methods)
- g_object_unref (bl->priv->supported_auth_methods);
-
- g_free (bl->priv->uri);
-
- g_free (bl->priv);
- bl->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (pas_backend_ldap_parent_class)->dispose)
- G_OBJECT_CLASS (pas_backend_ldap_parent_class)->dispose (object);
-}
-
-static void
-pas_backend_ldap_class_init (PASBackendLDAPClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- PASBackendClass *parent_class;
-
- /* get client side information (extensions present in the library) */
- get_ldap_library_info ();
-
- pas_backend_ldap_parent_class = g_type_class_peek_parent (klass);
-
- parent_class = PAS_BACKEND_CLASS (klass);
-
- /* Set the virtual methods. */
- parent_class->load_uri = pas_backend_ldap_load_uri;
- parent_class->get_uri = pas_backend_ldap_get_uri;
- parent_class->get_static_capabilities = pas_backend_ldap_get_static_capabilities;
-
- parent_class->create_card = pas_backend_ldap_process_create_card;
- parent_class->remove_cards = pas_backend_ldap_process_remove_cards;
- parent_class->modify_card = pas_backend_ldap_process_modify_card;
- parent_class->check_connection = pas_backend_ldap_process_check_connection;
- parent_class->get_vcard = pas_backend_ldap_process_get_vcard;
- parent_class->get_cursor = pas_backend_ldap_process_get_cursor;
- parent_class->get_book_view = pas_backend_ldap_process_get_book_view;
- parent_class->get_completion_view = pas_backend_ldap_process_get_completion_view;
- parent_class->get_changes = pas_backend_ldap_process_get_changes;
- parent_class->authenticate_user = pas_backend_ldap_process_authenticate_user;
- parent_class->get_supported_fields = pas_backend_ldap_process_get_supported_fields;
- parent_class->get_supported_auth_methods = pas_backend_ldap_process_get_supported_auth_methods;
-
- object_class->dispose = pas_backend_ldap_dispose;
-}
-
-static void
-pas_backend_ldap_init (PASBackendLDAP *backend)
-{
- PASBackendLDAPPrivate *priv;
-
- priv = g_new0 (PASBackendLDAPPrivate, 1);
-
- priv->supported_fields = e_list_new ((EListCopyFunc)g_strdup, (EListFreeFunc)g_free, NULL);
- priv->ldap_limit = 100;
- priv->id_to_op = g_hash_table_new (g_int_hash, g_int_equal);
- priv->poll_timeout = -1;
- priv->book_views = e_list_new (NULL, NULL, NULL);
-
- backend->priv = priv;
-}
-
-/**
- * pas_backend_ldap_get_type:
- */
-GType
-pas_backend_ldap_get_type (void)
-{
- static GType type = 0;
-
- if (! type) {
- GTypeInfo info = {
- sizeof (PASBackendLDAPClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) pas_backend_ldap_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PASBackendLDAP),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pas_backend_ldap_init
- };
-
- type = g_type_register_static (PAS_TYPE_BACKEND, "PASBackendLDAP", &info, 0);
- }
-
- return type;
-}
diff --git a/addressbook/backend/pas/pas-backend-ldap.h b/addressbook/backend/pas/pas-backend-ldap.h
deleted file mode 100644
index ca04ee6a21..0000000000
--- a/addressbook/backend/pas/pas-backend-ldap.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __PAS_BACKEND_LDAP_H__
-#define __PAS_BACKEND_LDAP_H__
-
-#include "pas-backend.h"
-
-#define PAS_TYPE_BACKEND_LDAP (pas_backend_ldap_get_type ())
-#define PAS_BACKEND_LDAP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BACKEND_LDAP, PASBackendLDAP))
-#define PAS_BACKEND_LDAP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_BACKEND_TYPE, PASBackendLDAPClass))
-#define PAS_IS_BACKEND_LDAP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BACKEND_LDAP))
-#define PAS_IS_BACKEND_LDAP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BACKEND_LDAP))
-#define PAS_BACKEND_LDAP_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BACKEND_LDAP, PASBackendLDAPClass))
-
-typedef struct _PASBackendLDAPPrivate PASBackendLDAPPrivate;
-
-typedef struct {
- PASBackend parent_object;
- PASBackendLDAPPrivate *priv;
-} PASBackendLDAP;
-
-typedef struct {
- PASBackendClass parent_class;
-} PASBackendLDAPClass;
-
-PASBackend *pas_backend_ldap_new (void);
-GType pas_backend_ldap_get_type (void);
-
-#endif /* ! __PAS_BACKEND_LDAP_H__ */
-
diff --git a/addressbook/backend/pas/pas-backend-summary.c b/addressbook/backend/pas/pas-backend-summary.c
deleted file mode 100644
index 6c2c9a45c8..0000000000
--- a/addressbook/backend/pas/pas-backend-summary.c
+++ /dev/null
@@ -1,1092 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * pas-backend-summary.c
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <netinet/in.h>
-
-#include <gal/widgets/e-unicode.h>
-
-#include "ebook/e-card-simple.h"
-#include "pas-backend-summary.h"
-#include "e-util/e-sexp.h"
-
-static GObjectClass *parent_class;
-
-struct _PASBackendSummaryPrivate {
- char *summary_path;
- FILE *fp;
- guint32 file_version;
- time_t mtime;
- gboolean upgraded;
- gboolean dirty;
- int flush_timeout_millis;
- int flush_timeout;
- GPtrArray *items;
- GHashTable *id_to_item;
- guint32 num_items; /* used only for loading */
-#ifdef SUMMARY_STATS
- int size;
-#endif
-};
-
-typedef struct {
- char *id;
- char *nickname;
- char *full_name;
- char *given_name;
- char *surname;
- char *file_as;
- char *email_1;
- char *email_2;
- char *email_3;
- gboolean wants_html;
- gboolean wants_html_set;
- gboolean list;
- gboolean list_show_addresses;
-} PASBackendSummaryItem;
-
-typedef struct {
- /* these lengths do *not* including the terminating \0, as
- it's not stored on disk. */
- guint16 id_len;
- guint16 nickname_len;
- guint16 full_name_len; /* version 3.0 field */
- guint16 given_name_len;
- guint16 surname_len;
- guint16 file_as_len;
- guint16 email_1_len;
- guint16 email_2_len;
- guint16 email_3_len;
- guint8 wants_html;
- guint8 wants_html_set;
- guint8 list;
- guint8 list_show_addresses;
-} PASBackendSummaryDiskItem;
-
-typedef struct {
- guint32 file_version;
- guint32 num_items;
- guint32 summary_mtime; /* version 2.0 field */
-} PASBackendSummaryHeader;
-
-#define PAS_SUMMARY_MAGIC "PAS-SUMMARY"
-#define PAS_SUMMARY_MAGIC_LEN 11
-
-#define PAS_SUMMARY_FILE_VERSION_1_0 1000
-#define PAS_SUMMARY_FILE_VERSION_2_0 2000
-#define PAS_SUMMARY_FILE_VERSION_3_0 3000
-#define PAS_SUMMARY_FILE_VERSION_4_0 4000
-
-#define PAS_SUMMARY_FILE_VERSION PAS_SUMMARY_FILE_VERSION_4_0
-
-static void
-free_summary_item (PASBackendSummaryItem *item)
-{
- g_free (item->id);
- g_free (item->nickname);
- g_free (item->full_name);
- g_free (item->given_name);
- g_free (item->surname);
- g_free (item->file_as);
- g_free (item->email_1);
- g_free (item->email_2);
- g_free (item->email_3);
- g_free (item);
-}
-
-static void
-clear_items (PASBackendSummary *summary)
-{
- int i;
- int num = summary->priv->items->len;
- for (i = 0; i < num; i++) {
- PASBackendSummaryItem *item = g_ptr_array_remove_index_fast (summary->priv->items, 0);
- g_hash_table_remove (summary->priv->id_to_item, item->id);
- free_summary_item (item);
- }
-}
-
-PASBackendSummary*
-pas_backend_summary_new (const char *summary_path, int flush_timeout_millis)
-{
- PASBackendSummary *summary = g_object_new (PAS_TYPE_BACKEND_SUMMARY, NULL);
-
- summary->priv->summary_path = g_strdup (summary_path);
- summary->priv->flush_timeout_millis = flush_timeout_millis;
- summary->priv->file_version = PAS_SUMMARY_FILE_VERSION_4_0;
-
- return summary;
-}
-
-static void
-pas_backend_summary_dispose (GObject *object)
-{
- PASBackendSummary *summary = PAS_BACKEND_SUMMARY (object);
-
- if (summary->priv) {
- if (summary->priv->dirty)
- g_warning ("Destroying dirty summary");
-
- if (summary->priv->flush_timeout) {
- g_source_remove (summary->priv->flush_timeout);
- summary->priv->flush_timeout = 0;
- }
-
- if (summary->priv->fp)
- fclose (summary->priv->fp);
-
- g_free (summary->priv->summary_path);
- clear_items (summary);
- g_ptr_array_free (summary->priv->items, TRUE);
-
- g_hash_table_destroy (summary->priv->id_to_item);
-
- g_free (summary->priv);
- summary->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-pas_backend_summary_class_init (PASBackendSummaryClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- /* Set the virtual methods. */
-
- object_class->dispose = pas_backend_summary_dispose;
-}
-
-static void
-pas_backend_summary_init (PASBackendSummary *summary)
-{
- PASBackendSummaryPrivate *priv;
-
- priv = g_new(PASBackendSummaryPrivate, 1);
-
- summary->priv = priv;
-
- priv->summary_path = NULL;
- priv->fp = NULL;
- priv->dirty = FALSE;
- priv->upgraded = FALSE;
- priv->items = g_ptr_array_new();
- priv->id_to_item = g_hash_table_new (g_str_hash, g_str_equal);
- priv->flush_timeout_millis = 0;
- priv->flush_timeout = 0;
-#ifdef SUMMARY_STATS
- priv->size = 0;
-#endif
-}
-
-/**
- * pas_backend_summary_get_type:
- */
-GType
-pas_backend_summary_get_type (void)
-{
- static GType type = 0;
-
- if (! type) {
- GTypeInfo info = {
- sizeof (PASBackendSummaryClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) pas_backend_summary_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PASBackendSummary),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pas_backend_summary_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "PASBackendSummary", &info, 0);
- }
-
- return type;
-}
-
-
-static gboolean
-pas_backend_summary_check_magic (PASBackendSummary *summary, FILE *fp)
-{
- char buf [PAS_SUMMARY_MAGIC_LEN + 1];
- int rv;
-
- memset (buf, 0, sizeof (buf));
-
- rv = fread (buf, PAS_SUMMARY_MAGIC_LEN, 1, fp);
- if (rv != 1)
- return FALSE;
- if (strcmp (buf, PAS_SUMMARY_MAGIC))
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
-pas_backend_summary_load_header (PASBackendSummary *summary, FILE *fp,
- PASBackendSummaryHeader *header)
-{
- int rv;
-
- rv = fread (&header->file_version, sizeof (header->file_version), 1, fp);
- if (rv != 1)
- return FALSE;
-
- header->file_version = ntohl (header->file_version);
-
- if (header->file_version < PAS_SUMMARY_FILE_VERSION) {
- return FALSE; /* this will cause the entire summary to be rebuilt */
- }
-
- rv = fread (&header->num_items, sizeof (header->num_items), 1, fp);
- if (rv != 1)
- return FALSE;
-
- header->num_items = ntohl (header->num_items);
-
- rv = fread (&header->summary_mtime, sizeof (header->summary_mtime), 1, fp);
- if (rv != 1)
- return FALSE;
- header->summary_mtime = ntohl (header->summary_mtime);
-
- return TRUE;
-}
-
-static char *
-read_string (FILE *fp, int len)
-{
- char *buf;
- int rv;
-
- buf = g_new0 (char, len + 1);
-
- rv = fread (buf, len, 1, fp);
- if (rv != 1) {
- g_free (buf);
- return NULL;
- }
-
- return buf;
-}
-
-static gboolean
-pas_backend_summary_load_item (PASBackendSummary *summary,
- PASBackendSummaryItem **new_item)
-{
- PASBackendSummaryItem *item;
- char *buf;
- FILE *fp = summary->priv->fp;
-
- if (summary->priv->file_version >= PAS_SUMMARY_FILE_VERSION_4_0) {
- PASBackendSummaryDiskItem disk_item;
- int rv = fread (&disk_item, sizeof (disk_item), 1, fp);
- if (rv != 1)
- return FALSE;
-
- disk_item.id_len = ntohs (disk_item.id_len);
- disk_item.nickname_len = ntohs (disk_item.nickname_len);
- disk_item.full_name_len = ntohs (disk_item.full_name_len);
- disk_item.given_name_len = ntohs (disk_item.given_name_len);
- disk_item.surname_len = ntohs (disk_item.surname_len);
- disk_item.file_as_len = ntohs (disk_item.file_as_len);
- disk_item.email_1_len = ntohs (disk_item.email_1_len);
- disk_item.email_2_len = ntohs (disk_item.email_2_len);
- disk_item.email_3_len = ntohs (disk_item.email_3_len);
-
- item = g_new0 (PASBackendSummaryItem, 1);
-
- item->wants_html = disk_item.wants_html;
- item->wants_html_set = disk_item.wants_html_set;
- item->list = disk_item.list;
- item->list_show_addresses = disk_item.list_show_addresses;
-
- if (disk_item.id_len) {
- buf = read_string (fp, disk_item.id_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->id = buf;
- }
-
- if (disk_item.nickname_len) {
- buf = read_string (fp, disk_item.nickname_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->nickname = buf;
- }
-
- if (disk_item.full_name_len) {
- buf = read_string (fp, disk_item.full_name_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->full_name = buf;
- }
-
- if (disk_item.given_name_len) {
- buf = read_string (fp, disk_item.given_name_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->given_name = buf;
- }
-
- if (disk_item.surname_len) {
- buf = read_string (fp, disk_item.surname_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->surname = buf;
- }
-
- if (disk_item.file_as_len) {
- buf = read_string (fp, disk_item.file_as_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->file_as = buf;
- }
-
- if (disk_item.email_1_len) {
- buf = read_string (fp, disk_item.email_1_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->email_1 = buf;
- }
-
- if (disk_item.email_2_len) {
- buf = read_string (fp, disk_item.email_2_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->email_2 = buf;
- }
-
- if (disk_item.email_3_len) {
- buf = read_string (fp, disk_item.email_3_len);
- if (!buf) {
- free_summary_item (item);
- return FALSE;
- }
- item->email_3 = buf;
- }
-
- /* the only field that has to be there is the id */
- if (!item->id) {
- free_summary_item (item);
- return FALSE;
- }
- }
- else {
- /* unhandled file version */
- return FALSE;
- }
-
- *new_item = item;
- return TRUE;
-}
-
-/* opens the file and loads the header */
-static gboolean
-pas_backend_summary_open (PASBackendSummary *summary)
-{
- FILE *fp;
- PASBackendSummaryHeader header;
- struct stat sb;
-
- if (summary->priv->fp)
- return TRUE;
-
- if (stat (summary->priv->summary_path, &sb) == -1) {
- /* if there's no summary present, look for the .new
- file and rename it if it's there, and attempt to
- load that */
- char *new_filename = g_strconcat (summary->priv->summary_path, ".new", NULL);
- if (stat (new_filename, &sb) == -1) {
- g_warning ("no summary present");
- g_free (new_filename);
- return FALSE;
- }
- else {
- rename (new_filename, summary->priv->summary_path);
- g_free (new_filename);
- }
- }
-
- fp = fopen (summary->priv->summary_path, "r");
- if (!fp) {
- g_warning ("failed to open summary file");
- return FALSE;
- }
-
- if (!pas_backend_summary_check_magic (summary, fp)) {
- g_warning ("file is not a valid summary file");
- fclose (fp);
- return FALSE;
- }
-
- if (!pas_backend_summary_load_header (summary, fp, &header)) {
- g_warning ("failed to read summary header");
- fclose (fp);
- return FALSE;
- }
-
- summary->priv->num_items = header.num_items;
- summary->priv->file_version = header.file_version;
- summary->priv->mtime = header.summary_mtime;
- summary->priv->fp = fp;
-
- return TRUE;
-}
-
-gboolean
-pas_backend_summary_load (PASBackendSummary *summary)
-{
- PASBackendSummaryItem *new_item;
- int i;
-
- if (!pas_backend_summary_open (summary))
- return FALSE;
-
- for (i = 0; i < summary->priv->num_items; i ++) {
- if (!pas_backend_summary_load_item (summary, &new_item)) {
- g_warning ("error while reading summary item");
- clear_items (summary);
- fclose (summary->priv->fp);
- summary->priv->fp = NULL;
- summary->priv->dirty = FALSE;
- return FALSE;
- }
-
- g_ptr_array_add (summary->priv->items, new_item);
- g_hash_table_insert (summary->priv->id_to_item, new_item->id, new_item);
- }
-
- if (summary->priv->upgraded) {
- pas_backend_summary_save (summary);
- }
- summary->priv->dirty = FALSE;
-
- return TRUE;
-}
-
-static gboolean
-pas_backend_summary_save_magic (FILE *fp)
-{
- int rv;
- rv = fwrite (PAS_SUMMARY_MAGIC, PAS_SUMMARY_MAGIC_LEN, 1, fp);
- if (rv != 1)
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
-pas_backend_summary_save_header (PASBackendSummary *summary, FILE *fp)
-{
- PASBackendSummaryHeader header;
- int rv;
-
- header.file_version = htonl (PAS_SUMMARY_FILE_VERSION);
- header.num_items = htonl (summary->priv->items->len);
- header.summary_mtime = htonl (time (NULL));
-
- rv = fwrite (&header, sizeof (header), 1, fp);
- if (rv != 1)
- return FALSE;
-
- return TRUE;
-}
-
-static gboolean
-save_string (const char *str, FILE *fp)
-{
- int rv;
-
- if (!str || !*str)
- return TRUE;
-
- rv = fwrite (str, strlen (str), 1, fp);
- return (rv == 1);
-}
-
-static gboolean
-pas_backend_summary_save_item (PASBackendSummary *summary, FILE *fp, PASBackendSummaryItem *item)
-{
- PASBackendSummaryDiskItem disk_item;
- int len;
- int rv;
-
- len = item->id ? strlen (item->id) : 0;
- disk_item.id_len = htons (len);
-
- len = item->nickname ? strlen (item->nickname) : 0;
- disk_item.nickname_len = htons (len);
-
- len = item->given_name ? strlen (item->given_name) : 0;
- disk_item.given_name_len = htons (len);
-
- len = item->full_name ? strlen (item->full_name) : 0;
- disk_item.full_name_len = htons (len);
-
- len = item->surname ? strlen (item->surname) : 0;
- disk_item.surname_len = htons (len);
-
- len = item->file_as ? strlen (item->file_as) : 0;
- disk_item.file_as_len = htons (len);
-
- len = item->email_1 ? strlen (item->email_1) : 0;
- disk_item.email_1_len = htons (len);
-
- len = item->email_2 ? strlen (item->email_2) : 0;
- disk_item.email_2_len = htons (len);
-
- len = item->email_3 ? strlen (item->email_3) : 0;
- disk_item.email_3_len = htons (len);
-
- disk_item.wants_html = item->wants_html;
- disk_item.wants_html_set = item->wants_html_set;
- disk_item.list = item->list;
- disk_item.list_show_addresses = item->list_show_addresses;
-
- rv = fwrite (&disk_item, sizeof(disk_item), 1, fp);
- if (rv != 1)
- return FALSE;
-
- if (!save_string (item->id, fp))
- return FALSE;
- if (!save_string (item->nickname, fp))
- return FALSE;
- if (!save_string (item->full_name, fp))
- return FALSE;
- if (!save_string (item->given_name, fp))
- return FALSE;
- if (!save_string (item->surname, fp))
- return FALSE;
- if (!save_string (item->file_as, fp))
- return FALSE;
- if (!save_string (item->email_1, fp))
- return FALSE;
- if (!save_string (item->email_2, fp))
- return FALSE;
- if (!save_string (item->email_3, fp))
- return FALSE;
-
- return TRUE;
-}
-
-gboolean
-pas_backend_summary_save (PASBackendSummary *summary)
-{
- struct stat sb;
- FILE *fp = NULL;
- char *new_filename = NULL;
- int i;
-
- if (!summary->priv->dirty)
- return TRUE;
-
- new_filename = g_strconcat (summary->priv->summary_path, ".new", NULL);
-
- fp = fopen (new_filename, "w");
- if (!fp) {
- g_warning ("could not create new summary file");
- goto lose;
- }
-
- if (!pas_backend_summary_save_magic (fp)) {
- g_warning ("could not write magic to new summary file");
- goto lose;
- }
-
- if (!pas_backend_summary_save_header (summary, fp)) {
- g_warning ("could not write header to new summary file");
- goto lose;
- }
-
- for (i = 0; i < summary->priv->items->len; i ++) {
- PASBackendSummaryItem *item = g_ptr_array_index (summary->priv->items, i);
- if (!pas_backend_summary_save_item (summary, fp, item)) {
- g_warning ("failed to write an item to new summary file, errno = %d", errno);
- goto lose;
- }
- }
-
- fclose (fp);
-
- /* if we have a queued flush, clear it (since we just flushed) */
- if (summary->priv->flush_timeout) {
- g_source_remove (summary->priv->flush_timeout);
- summary->priv->flush_timeout = 0;
- }
-
- /* unlink the old summary and rename the new one */
- unlink (summary->priv->summary_path);
- rename (new_filename, summary->priv->summary_path);
-
- g_free (new_filename);
-
- /* lastly, update the in memory mtime to that of the file */
- if (stat (summary->priv->summary_path, &sb) == -1) {
- g_warning ("error stat'ing saved summary");
- }
- else {
- summary->priv->mtime = sb.st_mtime;
- }
-
- return TRUE;
-
- lose:
- if (fp)
- fclose (fp);
- if (new_filename)
- unlink (new_filename);
- g_free (new_filename);
- return FALSE;
-}
-
-void
-pas_backend_summary_add_card (PASBackendSummary *summary, const char *vcard)
-{
- ECard *card;
- ECardSimple *simple;
- PASBackendSummaryItem *new_item;
-
- card = e_card_new ((char*)vcard);
- simple = e_card_simple_new (card);
-
- new_item = g_new (PASBackendSummaryItem, 1);
-
- new_item->id = g_strdup (e_card_simple_get_id (simple));
- new_item->nickname = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_NICKNAME);
- new_item->full_name = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_FULL_NAME);
- new_item->given_name = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_GIVEN_NAME);
- new_item->surname = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_FAMILY_NAME);
- new_item->file_as = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_FILE_AS);
- new_item->email_1 = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_EMAIL);
- new_item->email_2 = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_EMAIL_2);
- new_item->email_3 = e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_EMAIL_3);
- new_item->list = e_card_evolution_list (card);
- new_item->list_show_addresses = e_card_evolution_list_show_addresses (card);
- new_item->wants_html = card->wants_html;
- new_item->wants_html_set = card->wants_html_set;
-
- g_ptr_array_add (summary->priv->items, new_item);
- g_hash_table_insert (summary->priv->id_to_item, new_item->id, new_item);
-
- g_object_unref (simple);
- g_object_unref (card);
-
-#ifdef SUMMARY_STATS
- summary->priv->size += sizeof (PASBackendSummaryItem);
- summary->priv->size += new_item->id ? strlen (new_item->id) : 0;
- summary->priv->size += new_item->nickname ? strlen (new_item->nickname) : 0;
- summary->priv->size += new_item->full_name ? strlen (new_item->full_name) : 0;
- summary->priv->size += new_item->given_name ? strlen (new_item->given_name) : 0;
- summary->priv->size += new_item->surname ? strlen (new_item->surname) : 0;
- summary->priv->size += new_item->file_as ? strlen (new_item->file_as) : 0;
- summary->priv->size += new_item->email_1 ? strlen (new_item->email_1) : 0;
- summary->priv->size += new_item->email_2 ? strlen (new_item->email_2) : 0;
- summary->priv->size += new_item->email_3 ? strlen (new_item->email_3) : 0;
-#endif
- pas_backend_summary_touch (summary);
-}
-
-void
-pas_backend_summary_remove_card (PASBackendSummary *summary, const char *id)
-{
- PASBackendSummaryItem *item = g_hash_table_lookup (summary->priv->id_to_item, id);
-
- if (item) {
- g_ptr_array_remove (summary->priv->items, item);
- g_hash_table_remove (summary->priv->id_to_item, id);
- free_summary_item (item);
- pas_backend_summary_touch (summary);
- return;
- }
-
- g_warning ("pas_backend_summary_remove_card: unable to locate id `%s'", id);
-}
-
-static gboolean
-summary_flush_func (gpointer data)
-{
- PASBackendSummary *summary = PAS_BACKEND_SUMMARY (data);
-
- if (!summary->priv->dirty) {
- summary->priv->flush_timeout = 0;
- return FALSE;
- }
-
- if (!pas_backend_summary_save (summary)) {
- /* this isn't fatal, as we can just either 1) flush
- out with the next change, or 2) regen the summary
- when we next load the uri */
- g_warning ("failed to flush summary file to disk");
- return TRUE; /* try again after the next timeout */
- }
-
- g_warning ("flushed summary to disk");
-
- /* we only want this to execute once, so return FALSE and set
- summary->flush_timeout to 0 */
- summary->priv->flush_timeout = 0;
- return FALSE;
-}
-
-void
-pas_backend_summary_touch (PASBackendSummary *summary)
-{
- summary->priv->dirty = TRUE;
- if (!summary->priv->flush_timeout
- && summary->priv->flush_timeout_millis)
- summary->priv->flush_timeout = g_timeout_add (summary->priv->flush_timeout_millis,
- summary_flush_func, summary);
-}
-
-gboolean
-pas_backend_summary_is_up_to_date (PASBackendSummary *summary, time_t t)
-{
- if (!pas_backend_summary_open (summary))
- return FALSE;
- else
- return summary->priv->mtime >= t;
-}
-
-
-/* we only want to do summary queries if the query is over the set fields in the summary */
-
-static ESExpResult *
-func_check(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- ESExpResult *r;
- int truth = FALSE;
-
- if (argc == 2
- && argv[0]->type == ESEXP_RES_STRING
- && argv[1]->type == ESEXP_RES_STRING) {
- char *query_name = argv[0]->value.string;
-
- if (!strcmp (query_name, "nickname") ||
- !strcmp (query_name, "full_name") ||
- !strcmp (query_name, "file_as") ||
- !strcmp (query_name, "email")) {
- truth = TRUE;
- }
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_BOOL);
- r->value.bool = truth;
-
- return r;
-}
-
-/* 'builtin' functions */
-static struct {
- char *name;
- ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
- doesn't execute everything, 0 otherwise */
-} check_symbols[] = {
- { "contains", func_check, 0 },
- { "is", func_check, 0 },
- { "beginswith", func_check, 0 },
- { "endswith", func_check, 0 },
-};
-
-gboolean
-pas_backend_summary_is_summary_query (PASBackendSummary *summary, const char *query)
-{
- ESExp *sexp;
- ESExpResult *r;
- gboolean retval;
- int i;
- int esexp_error;
-
- sexp = e_sexp_new();
-
- for(i=0;i<sizeof(check_symbols)/sizeof(check_symbols[0]);i++) {
- if (check_symbols[i].type == 1) {
- e_sexp_add_ifunction(sexp, 0, check_symbols[i].name,
- (ESExpIFunc *)check_symbols[i].func, summary);
- } else {
- e_sexp_add_function(sexp, 0, check_symbols[i].name,
- check_symbols[i].func, summary);
- }
- }
-
- e_sexp_input_text(sexp, query, strlen(query));
- esexp_error = e_sexp_parse(sexp);
-
- if (esexp_error == -1) {
- return FALSE;
- }
-
- r = e_sexp_eval(sexp);
-
- retval = (r && r->type == ESEXP_RES_BOOL && r->value.bool);
-
- e_sexp_result_free(sexp, r);
-
- e_sexp_unref (sexp);
-
- return retval;
-}
-
-
-
-/* the actual query mechanics */
-static ESExpResult *
-do_compare (PASBackendSummary *summary, struct _ESExp *f, int argc,
- struct _ESExpResult **argv,
- char *(*compare)(const char*, const char*))
-{
- GPtrArray *result = g_ptr_array_new ();
- ESExpResult *r;
- int i;
-
- if (argc == 2
- && argv[0]->type == ESEXP_RES_STRING
- && argv[1]->type == ESEXP_RES_STRING) {
-
- for (i = 0; i < summary->priv->items->len; i ++) {
- PASBackendSummaryItem *item = g_ptr_array_index (summary->priv->items, i);
- if (!strcmp (argv[0]->value.string, "full_name")) {
- char *given = item->given_name;
- char *surname = item->surname;
- if ((given && compare (given, argv[1]->value.string))
- || (surname && compare (surname, argv[1]->value.string)))
- g_ptr_array_add (result, item->id);
- }
- else if (!strcmp (argv[0]->value.string, "email")) {
- char *email_1 = item->email_1;
- char *email_2 = item->email_2;
- char *email_3 = item->email_3;
- if ((email_1 && compare (email_1, argv[1]->value.string))
- || (email_2 && compare (email_2, argv[1]->value.string))
- || (email_3 && compare (email_3, argv[1]->value.string)))
- g_ptr_array_add (result, item->id);
- }
- else if (!strcmp (argv[0]->value.string, "file_as")) {
- char *file_as = item->file_as;
- if (file_as && compare (file_as, argv[1]->value.string))
- g_ptr_array_add (result, item->id);
- }
- else if (!strcmp (argv[0]->value.string, "nickname")) {
- char *nickname = item->nickname;
- if (nickname && compare (nickname, argv[1]->value.string))
- g_ptr_array_add (result, item->id);
- }
- }
- }
-
- r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
- r->value.ptrarray = result;
-
- return r;
-}
-
-static ESExpResult *
-func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendSummary *summary = data;
-
- return do_compare (summary, f, argc, argv, (char *(*)(const char*, const char*)) e_utf8_strstrcase);
-}
-
-static char *
-is_helper (const char *s1, const char *s2)
-{
- if (!strcasecmp(s1, s2))
- return (char*)s1;
- else
- return NULL;
-}
-
-static ESExpResult *
-func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendSummary *summary = data;
-
- return do_compare (summary, f, argc, argv, is_helper);
-}
-
-static char *
-endswith_helper (const char *s1, const char *s2)
-{
- char *p;
- if ((p = (char*)e_utf8_strstrcase(s1, s2))
- && (strlen(p) == strlen(s2)))
- return p;
- else
- return NULL;
-}
-
-static ESExpResult *
-func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendSummary *summary = data;
-
- return do_compare (summary, f, argc, argv, endswith_helper);
-}
-
-static char *
-beginswith_helper (const char *s1, const char *s2)
-{
- char *p;
- if ((p = (char*)e_utf8_strstrcase(s1, s2))
- && (p == s1))
- return p;
- else
- return NULL;
-}
-
-static ESExpResult *
-func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data)
-{
- PASBackendSummary *summary = data;
-
- return do_compare (summary, f, argc, argv, beginswith_helper);
-}
-
-/* 'builtin' functions */
-static struct {
- char *name;
- ESExpFunc *func;
- int type; /* set to 1 if a function can perform shortcut evaluation, or
- doesn't execute everything, 0 otherwise */
-} symbols[] = {
- { "contains", func_contains, 0 },
- { "is", func_is, 0 },
- { "beginswith", func_beginswith, 0 },
- { "endswith", func_endswith, 0 },
-};
-
-GPtrArray*
-pas_backend_summary_search (PASBackendSummary *summary, const char *query)
-{
- ESExp *sexp;
- ESExpResult *r;
- GPtrArray *retval = g_ptr_array_new();
- int i;
- int esexp_error;
-
- sexp = e_sexp_new();
-
- for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
- if (symbols[i].type == 1) {
- e_sexp_add_ifunction(sexp, 0, symbols[i].name,
- (ESExpIFunc *)symbols[i].func, summary);
- } else {
- e_sexp_add_function(sexp, 0, symbols[i].name,
- symbols[i].func, summary);
- }
- }
-
- e_sexp_input_text(sexp, query, strlen(query));
- esexp_error = e_sexp_parse(sexp);
-
- if (esexp_error == -1) {
- return NULL;
- }
-
- r = e_sexp_eval(sexp);
-
- if (r && r->type == ESEXP_RES_ARRAY_PTR && r->value.ptrarray) {
- GPtrArray *ptrarray = r->value.ptrarray;
- int i;
-
- for (i = 0; i < ptrarray->len; i ++)
- g_ptr_array_add (retval, g_ptr_array_index (ptrarray, i));
- }
-
- e_sexp_result_free(sexp, r);
-
- e_sexp_unref (sexp);
-
- return retval;
-}
-
-char*
-pas_backend_summary_get_summary_vcard(PASBackendSummary *summary, const char *id)
-{
- PASBackendSummaryItem *item = g_hash_table_lookup (summary->priv->id_to_item, id);
-
- if (item) {
- ECard *card = e_card_new ("");
- ECardSimple *simple = e_card_simple_new (card);
- char *vcard;
-
- e_card_simple_set_id (simple, item->id);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FILE_AS, item->file_as);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_GIVEN_NAME, item->given_name);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FAMILY_NAME, item->surname);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_NICKNAME, item->nickname);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FULL_NAME, item->full_name);
- e_card_simple_set_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL, item->email_1);
- e_card_simple_set_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_2, item->email_2);
- e_card_simple_set_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_3, item->email_3);
-
- e_card_simple_sync_card (simple);
-
- card->list = item->list;
- card->wants_html = item->wants_html;
- card->wants_html_set = item->wants_html_set;
- card->list_show_addresses = item->list_show_addresses;
-
- vcard = e_card_simple_get_vcard (simple);
-
- g_object_unref (simple);
- g_object_unref (card);
-
- return vcard;
- }
- else {
- g_warning ("in unable to locate card `%s' in summary", id);
- return NULL;
- }
-}
-
diff --git a/addressbook/backend/pas/pas-backend-summary.h b/addressbook/backend/pas/pas-backend-summary.h
deleted file mode 100644
index 54083855d5..0000000000
--- a/addressbook/backend/pas/pas-backend-summary.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * pas-backend-summary.h
- * Copyright 2000, 2001, Ximian, Inc.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef __PAS_BACKEND_SUMMARY_H__
-#define __PAS_BACKEND_SUMMARY_H__
-
-#include <glib.h>
-#include <glib-object.h>
-
-#define PAS_TYPE_BACKEND_SUMMARY (pas_backend_summary_get_type ())
-#define PAS_BACKEND_SUMMARY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BACKEND_SUMMARY, PASBackendSummary))
-#define PAS_BACKEND_SUMMARY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_BACKEND_TYPE, PASBackendSummaryClass))
-#define PAS_IS_BACKEND_SUMMARY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BACKEND_SUMMARY))
-#define PAS_IS_BACKEND_SUMMARY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BACKEND_SUMMARY))
-#define PAS_BACKEND_SUMMARY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BACKEND_SUMMARY, PASBackendSummaryClass))
-
-typedef struct _PASBackendSummaryPrivate PASBackendSummaryPrivate;
-
-typedef struct {
- GObject parent_object;
- PASBackendSummaryPrivate *priv;
-} PASBackendSummary;
-
-typedef struct {
- GObjectClass parent_class;
-} PASBackendSummaryClass;
-
-PASBackendSummary* pas_backend_summary_new (const char *summary_path,
- int flush_timeout_millis);
-GType pas_backend_summary_get_type (void);
-
-/* returns FALSE if the load fails for any reason (including that the
- summary is out of date), TRUE if it succeeds */
-gboolean pas_backend_summary_load (PASBackendSummary *summary);
-/* returns FALSE if the save fails, TRUE if it succeeds (or isn't required due to no changes) */
-gboolean pas_backend_summary_save (PASBackendSummary *summary);
-
-void pas_backend_summary_add_card (PASBackendSummary *summary, const char *vcard);
-void pas_backend_summary_remove_card (PASBackendSummary *summary, const char *id);
-
-void pas_backend_summary_touch (PASBackendSummary *summary);
-
-/* returns TRUE if the summary's mtime is >= @t. */
-gboolean pas_backend_summary_is_up_to_date (PASBackendSummary *summary, time_t t);
-
-gboolean pas_backend_summary_is_summary_query (PASBackendSummary *summary, const char *query);
-GPtrArray* pas_backend_summary_search (PASBackendSummary *summary, const char *query);
-char* pas_backend_summary_get_summary_vcard (PASBackendSummary *summary, const char *id);
-
-#endif /* __PAS_BACKEND_SUMMARY_H__ */
diff --git a/addressbook/backend/pas/pas-backend.c b/addressbook/backend/pas/pas-backend.c
deleted file mode 100644
index acc6ed2a2c..0000000000
--- a/addressbook/backend/pas/pas-backend.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <config.h>
-#include "pas-backend.h"
-#include "pas-marshal.h"
-
-struct _PASBackendPrivate {
- GList *clients;
- gboolean loaded, writable;
-};
-
-/* Signal IDs */
-enum {
- LAST_CLIENT_GONE,
- LAST_SIGNAL
-};
-
-static guint pas_backend_signals[LAST_SIGNAL];
-
-static GObjectClass *parent_class;
-
-gboolean
-pas_backend_construct (PASBackend *backend)
-{
- return TRUE;
-}
-
-GNOME_Evolution_Addressbook_BookListener_CallStatus
-pas_backend_load_uri (PASBackend *backend,
- const char *uri)
-{
- g_return_val_if_fail (backend != NULL, FALSE);
- g_return_val_if_fail (PAS_IS_BACKEND (backend), FALSE);
- g_return_val_if_fail (uri != NULL, FALSE);
- g_return_val_if_fail (backend->priv->loaded == FALSE, FALSE);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->load_uri != NULL);
-
- return (* PAS_BACKEND_GET_CLASS (backend)->load_uri) (backend, uri);
-}
-
-/**
- * pas_backend_get_uri:
- * @backend: An addressbook backend.
- *
- * Queries the URI that an addressbook backend is serving.
- *
- * Return value: URI for the backend.
- **/
-const char *
-pas_backend_get_uri (PASBackend *backend)
-{
- g_return_val_if_fail (backend != NULL, NULL);
- g_return_val_if_fail (PAS_IS_BACKEND (backend), NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_uri != NULL);
-
- return (* PAS_BACKEND_GET_CLASS (backend)->get_uri) (backend);
-}
-
-
-void
-pas_backend_create_card (PASBackend *backend,
- PASBook *book,
- PASCreateCardRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->vcard != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->create_card != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->create_card) (backend, book, req);
-}
-
-void
-pas_backend_remove_cards (PASBackend *backend,
- PASBook *book,
- PASRemoveCardsRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->ids != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->remove_cards != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->remove_cards) (backend, book, req);
-}
-
-void
-pas_backend_modify_card (PASBackend *backend,
- PASBook *book,
- PASModifyCardRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->vcard != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->modify_card != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->modify_card) (backend, book, req);
-}
-
-void
-pas_backend_check_connection (PASBackend *backend,
- PASBook *book,
- PASCheckConnectionRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->check_connection != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->check_connection) (backend, book, req);
-}
-
-void
-pas_backend_get_vcard (PASBackend *backend,
- PASBook *book,
- PASGetVCardRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->id != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_vcard != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->get_vcard) (backend, book, req);
-}
-
-void
-pas_backend_get_cursor (PASBackend *backend,
- PASBook *book,
- PASGetCursorRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->search != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_cursor != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->get_cursor) (backend, book, req);
-}
-
-void
-pas_backend_get_book_view (PASBackend *backend,
- PASBook *book,
- PASGetBookViewRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->search != NULL && req->listener != CORBA_OBJECT_NIL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_book_view != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->get_book_view) (backend, book, req);
-}
-
-void
-pas_backend_get_completion_view (PASBackend *backend,
- PASBook *book,
- PASGetCompletionViewRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->search != NULL && req->listener != CORBA_OBJECT_NIL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_completion_view != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->get_completion_view) (backend, book, req);
-}
-
-void
-pas_backend_get_changes (PASBackend *backend,
- PASBook *book,
- PASGetChangesRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL && req->change_id != NULL && req->listener != CORBA_OBJECT_NIL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_changes != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->get_changes) (backend, book, req);
-}
-
-void
-pas_backend_authenticate_user (PASBackend *backend,
- PASBook *book,
- PASAuthenticateUserRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->authenticate_user != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->authenticate_user) (backend, book, req);
-}
-
-void
-pas_backend_get_supported_fields (PASBackend *backend,
- PASBook *book,
- PASGetSupportedFieldsRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_supported_fields != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->get_supported_fields) (backend, book, req);
-}
-
-void
-pas_backend_get_supported_auth_methods (PASBackend *backend,
- PASBook *book,
- PASGetSupportedAuthMethodsRequest *req)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
- g_return_if_fail (req != NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_supported_auth_methods != NULL);
-
- (* PAS_BACKEND_GET_CLASS (backend)->get_supported_auth_methods) (backend, book, req);
-}
-
-static void
-process_client_requests (PASBook *book, gpointer user_data)
-{
- PASBackend *backend;
- PASRequest *req;
-
- backend = PAS_BACKEND (user_data);
-
- req = pas_book_pop_request (book);
- if (req == NULL)
- return;
-
- switch (req->op) {
- case CreateCard:
- pas_backend_create_card (backend, book, &req->create);
- break;
-
- case RemoveCards:
- pas_backend_remove_cards (backend, book, &req->remove);
- break;
-
- case ModifyCard:
- pas_backend_modify_card (backend, book, &req->modify);
- break;
-
- case CheckConnection:
- pas_backend_check_connection (backend, book, &req->check_connection);
- break;
-
- case GetVCard:
- pas_backend_get_vcard (backend, book, &req->get_vcard);
- break;
-
- case GetCursor:
- pas_backend_get_cursor (backend, book, &req->get_cursor);
- break;
-
- case GetBookView:
- pas_backend_get_book_view (backend, book, &req->get_book_view);
- break;
-
- case GetCompletionView:
- pas_backend_get_completion_view (backend, book, &req->get_completion_view);
- break;
-
- case GetChanges:
- pas_backend_get_changes (backend, book, &req->get_changes);
- break;
-
- case AuthenticateUser:
- pas_backend_authenticate_user (backend, book, &req->auth_user);
- break;
-
- case GetSupportedFields:
- pas_backend_get_supported_fields (backend, book, &req->get_supported_fields);
- break;
-
- case GetSupportedAuthMethods:
- pas_backend_get_supported_auth_methods (backend, book, &req->get_supported_auth_methods);
- break;
- }
-
- pas_book_free_request (req);
-}
-
-static void
-book_destroy_cb (gpointer data, GObject *where_book_was)
-{
- PASBackend *backend = PAS_BACKEND (data);
-
- pas_backend_remove_client (backend, (PASBook *)where_book_was);
-}
-
-static void
-last_client_gone (PASBackend *backend)
-{
- g_signal_emit (backend, pas_backend_signals[LAST_CLIENT_GONE], 0);
-}
-
-static gboolean
-add_client (PASBackend *backend,
- GNOME_Evolution_Addressbook_BookListener listener)
-{
- PASBook *book;
-
- book = pas_book_new (backend, listener);
- if (!book) {
- if (!backend->priv->clients)
- last_client_gone (backend);
-
- return FALSE;
- }
-
- g_object_weak_ref (G_OBJECT (book), book_destroy_cb, backend);
-
- g_signal_connect (book, "requests_queued",
- G_CALLBACK (process_client_requests), backend);
-
- backend->priv->clients = g_list_prepend (backend->priv->clients, book);
-
- if (backend->priv->loaded) {
- pas_book_respond_open (
- book, GNOME_Evolution_Addressbook_BookListener_Success);
- } else {
- pas_book_respond_open (
- book, GNOME_Evolution_Addressbook_BookListener_OtherError);
- }
-
- pas_book_report_writable (book, backend->priv->writable);
-
- bonobo_object_unref (BONOBO_OBJECT (book));
-
- return TRUE;
-}
-
-/**
- * pas_backend_add_client:
- * @backend: An addressbook backend.
- * @listener: Listener for notification to the client.
- *
- * Adds a client to an addressbook backend.
- *
- * Return value: TRUE on success, FALSE on failure to add the client.
- */
-gboolean
-pas_backend_add_client (PASBackend *backend,
- GNOME_Evolution_Addressbook_BookListener listener)
-{
- g_return_val_if_fail (PAS_IS_BACKEND (backend), FALSE);
- g_return_val_if_fail (listener != CORBA_OBJECT_NIL, FALSE);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->add_client != NULL);
-
- return PAS_BACKEND_GET_CLASS (backend)->add_client (backend, listener);
-}
-
-static void
-remove_client (PASBackend *backend,
- PASBook *book)
-{
- /* Disconnect */
- backend->priv->clients = g_list_remove (backend->priv->clients, book);
-
- /* When all clients go away, notify the parent factory about it so that
- * it may decide whether to kill the backend or not.
- */
- if (!backend->priv->clients)
- last_client_gone (backend);
-}
-
-void
-pas_backend_remove_client (PASBackend *backend,
- PASBook *book)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
- g_return_if_fail (PAS_IS_BOOK (book));
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->remove_client != NULL);
-
- PAS_BACKEND_GET_CLASS (backend)->remove_client (backend, book);
-}
-
-char *
-pas_backend_get_static_capabilities (PASBackend *backend)
-{
- g_return_val_if_fail (backend != NULL, NULL);
- g_return_val_if_fail (PAS_IS_BACKEND (backend), NULL);
-
- g_assert (PAS_BACKEND_GET_CLASS (backend)->get_static_capabilities != NULL);
-
- return PAS_BACKEND_GET_CLASS (backend)->get_static_capabilities (backend);
-}
-
-gboolean
-pas_backend_is_loaded (PASBackend *backend)
-{
- g_return_val_if_fail (PAS_IS_BACKEND (backend), FALSE);
-
- return backend->priv->loaded;
-}
-
-void
-pas_backend_set_is_loaded (PASBackend *backend, gboolean is_loaded)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
-
- backend->priv->loaded = is_loaded;
-}
-
-gboolean
-pas_backend_is_writable (PASBackend *backend)
-{
- g_return_val_if_fail (PAS_IS_BACKEND (backend), FALSE);
-
- return backend->priv->writable;
-}
-
-void
-pas_backend_set_is_writable (PASBackend *backend, gboolean is_writable)
-{
- g_return_if_fail (PAS_IS_BACKEND (backend));
-
- backend->priv->writable = is_writable;
-}
-
-static void
-pas_backend_init (PASBackend *backend)
-{
- PASBackendPrivate *priv;
-
- priv = g_new0 (PASBackendPrivate, 1);
- priv->clients = NULL;
-
- backend->priv = priv;
-}
-
-static void
-pas_backend_dispose (GObject *object)
-{
- PASBackend *backend;
-
- backend = PAS_BACKEND (object);
-
- if (backend->priv) {
- g_list_free (backend->priv->clients);
- g_free (backend->priv);
-
- backend->priv = NULL;
- }
-
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-pas_backend_class_init (PASBackendClass *klass)
-{
- GObjectClass *object_class;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class = (GObjectClass *) klass;
-
- klass->add_client = add_client;
- klass->remove_client = remove_client;
-
- object_class->dispose = pas_backend_dispose;
-
- pas_backend_signals[LAST_CLIENT_GONE] =
- g_signal_new ("last_client_gone",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (PASBackendClass, last_client_gone),
- NULL, NULL,
- pas_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-/**
- * pas_backend_get_type:
- */
-GType
-pas_backend_get_type (void)
-{
- static GType type = 0;
-
- if (! type) {
- GTypeInfo info = {
- sizeof (PASBackendClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
- (GClassInitFunc) pas_backend_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (PASBackend),
- 0, /* n_preallocs */
- (GInstanceInitFunc) pas_backend_init
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "PASBackend", &info, 0);
- }
-
- return type;
-}
diff --git a/addressbook/backend/pas/pas-backend.h b/addressbook/backend/pas/pas-backend.h
deleted file mode 100644
index b33518116e..0000000000
--- a/addressbook/backend/pas/pas-backend.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * An abstract class which defines the API to a given backend.
- * There will be one PASBackend object for every URI which is loaded.
- *
- * Two people will call into the PASBackend API:
- *
- * 1. The PASBookFactory, when it has been asked to load a book.
- * It will create a new PASBackend if one is not already running
- * for the requested URI. It will call pas_backend_add_client to
- * add a new client to an existing PASBackend server.
- *
- * 2. A PASBook, when a client has requested an operation on the
- * GNOME_Evolution_Addressbook_Book interface.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __PAS_BACKEND_H__
-#define __PAS_BACKEND_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <pas/addressbook.h>
-
-#define PAS_TYPE_BACKEND (pas_backend_get_type ())
-#define PAS_BACKEND(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BACKEND, PASBackend))
-#define PAS_BACKEND_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_TYPE_BACKEND, PASBackendClass))
-#define PAS_IS_BACKEND(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BACKEND))
-#define PAS_IS_BACKEND_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BACKEND))
-#define PAS_BACKEND_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((k), PAS_TYPE_BACKEND, PASBackendClass))
-
-typedef struct _PASBackend PASBackend;
-typedef struct _PASBackendPrivate PASBackendPrivate;
-
-#include <pas/pas-book.h>
-
-struct _PASBackend {
- GObject parent_object;
- PASBackendPrivate *priv;
-};
-
-typedef struct {
- GObjectClass parent_class;
-
- /* Virtual methods */
- GNOME_Evolution_Addressbook_BookListener_CallStatus (*load_uri) (PASBackend *backend, const char *uri);
- const char *(* get_uri) (PASBackend *backend);
- gboolean (*add_client) (PASBackend *backend, GNOME_Evolution_Addressbook_BookListener listener);
- void (*remove_client) (PASBackend *backend, PASBook *book);
- char *(*get_static_capabilities) (PASBackend *backend);
-
- void (*create_card) (PASBackend *backend, PASBook *book, PASCreateCardRequest *req);
- void (*remove_cards) (PASBackend *backend, PASBook *book, PASRemoveCardsRequest *req);
- void (*modify_card) (PASBackend *backend, PASBook *book, PASModifyCardRequest *req);
- void (*check_connection) (PASBackend *backend, PASBook *book, PASCheckConnectionRequest *req);
- void (*get_vcard) (PASBackend *backend, PASBook *book, PASGetVCardRequest *req);
- void (*get_cursor) (PASBackend *backend, PASBook *book, PASGetCursorRequest *req);
- void (*get_book_view) (PASBackend *backend, PASBook *book, PASGetBookViewRequest *req);
- void (*get_completion_view) (PASBackend *backend, PASBook *book, PASGetCompletionViewRequest *req);
- void (*get_changes) (PASBackend *backend, PASBook *book, PASGetChangesRequest *req);
- void (*authenticate_user) (PASBackend *backend, PASBook *book, PASAuthenticateUserRequest *req);
- void (*get_supported_fields) (PASBackend *backend, PASBook *book, PASGetSupportedFieldsRequest *req);
- void (*get_supported_auth_methods) (PASBackend *backend, PASBook *book, PASGetSupportedAuthMethodsRequest *req);
-
- /* Notification signals */
- void (* last_client_gone) (PASBackend *backend);
-} PASBackendClass;
-
-typedef PASBackend * (*PASBackendFactoryFn) (void);
-
-gboolean pas_backend_construct (PASBackend *backend);
-
-GNOME_Evolution_Addressbook_BookListener_CallStatus
- pas_backend_load_uri (PASBackend *backend,
- const char *uri);
-const char *pas_backend_get_uri (PASBackend *backend);
-
-gboolean pas_backend_add_client (PASBackend *backend,
- GNOME_Evolution_Addressbook_BookListener listener);
-void pas_backend_remove_client (PASBackend *backend,
- PASBook *book);
-char *pas_backend_get_static_capabilities (PASBackend *backend);
-
-gboolean pas_backend_is_loaded (PASBackend *backend);
-
-gboolean pas_backend_is_writable (PASBackend *backend);
-
-void pas_backend_create_card (PASBackend *backend,
- PASBook *book,
- PASCreateCardRequest *req);
-void pas_backend_remove_cards (PASBackend *backend,
- PASBook *book,
- PASRemoveCardsRequest *req);
-void pas_backend_modify_card (PASBackend *backend,
- PASBook *book,
- PASModifyCardRequest *req);
-void pas_backend_check_connection (PASBackend *backend,
- PASBook *book,
- PASCheckConnectionRequest *req);
-void pas_backend_get_vcard (PASBackend *backend,
- PASBook *book,
- PASGetVCardRequest *req);
-void pas_backend_get_cursor (PASBackend *backend,
- PASBook *book,
- PASGetCursorRequest *req);
-void pas_backend_get_book_view (PASBackend *backend,
- PASBook *book,
- PASGetBookViewRequest *req);
-void pas_backend_get_completion_view (PASBackend *backend,
- PASBook *book,
- PASGetCompletionViewRequest *req);
-void pas_backend_get_changes (PASBackend *backend,
- PASBook *book,
- PASGetChangesRequest *req);
-void pas_backend_authenticate_user (PASBackend *backend,
- PASBook *book,
- PASAuthenticateUserRequest *req);
-void pas_backend_get_supported_fields (PASBackend *backend,
- PASBook *book,
- PASGetSupportedFieldsRequest *req);
-void pas_backend_get_supported_auth_methods (PASBackend *backend,
- PASBook *book,
- PASGetSupportedAuthMethodsRequest *req);
-
-
-GType pas_backend_get_type (void);
-
-
-/* protected functions for subclasses */
-void pas_backend_set_is_loaded (PASBackend *backend,
- gboolean is_loaded);
-void pas_backend_set_is_writable (PASBackend *backend,
- gboolean is_writable);
-
-#endif /* ! __PAS_BACKEND_H__ */
-
diff --git a/addressbook/backend/pas/pas-book-factory.c b/addressbook/backend/pas/pas-book-factory.c
deleted file mode 100644
index 2d6ed1e65b..0000000000
--- a/addressbook/backend/pas/pas-book-factory.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <config.h>
-#include <string.h>
-
-#include "addressbook.h"
-#include "pas-book-factory.h"
-#include "pas-marshal.h"
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-main.h>
-
-#define DEFAULT_PAS_BOOK_FACTORY_OAF_ID "OAFIID:GNOME_Evolution_Wombat_ServerFactory"
-
-static BonoboObjectClass *pas_book_factory_parent_class;
-
-typedef struct {
- char *uri;
- GNOME_Evolution_Addressbook_BookListener listener;
-} PASBookFactoryQueuedRequest;
-
-struct _PASBookFactoryPrivate {
- gint idle_id;
- GHashTable *backends;
- GHashTable *active_server_map;
- GList *queued_requests;
-
- /* OAFIID of the factory */
- char *iid;
-
- /* Whether the factory has been registered with OAF yet */
- guint registered : 1;
-};
-
-/* Signal IDs */
-enum {
- LAST_BOOK_GONE,
- LAST_SIGNAL
-};
-
-static guint factory_signals[LAST_SIGNAL];
-
-static char *
-pas_book_factory_canonicalize_uri (const char *uri)
-{
- /* FIXME: What do I do here? */
-
- return g_strdup (uri);
-}
-
-static char *
-pas_book_factory_extract_proto_from_uri (const char *uri)
-{
- char *proto;
- char *p;
-
- p = strchr (uri, ':');
-
- if (p == NULL)
- return NULL;
-
- proto = g_malloc0 (p - uri + 1);
-
- strncpy (proto, uri, p - uri);
-
- return proto;
-}
-
-/**
- * pas_book_factory_register_backend:
- * @factory:
- * @proto:
- * @backend:
- */
-void
-pas_book_factory_register_backend (PASBookFactory *factory,
- const char *proto,
- PASBackendFactoryFn backend)
-{
- g_return_if_fail (factory != NULL);
- g_return_if_fail (PAS_IS_BOOK_FACTORY (factory));
- g_return_if_fail (proto != NULL);
- g_return_if_fail (backend != NULL);
-
- if (g_hash_table_lookup (factory->priv->backends, proto) != NULL) {
- g_warning ("pas_book_factory_register_backend: "
- "Proto \"%s\" already registered!\n", proto);
- }
-
- g_hash_table_insert (factory->priv->backends,
- g_strdup (proto), backend);
-}
-
-/**
- * pas_book_factory_get_n_backends:
- * @factory: An addressbook factory.
- *
- * Queries the number of running addressbook backends in an addressbook factory.
- *
- * Return value: Number of running backends.
- **/
-int
-pas_book_factory_get_n_backends (PASBookFactory *factory)
-{
- g_return_val_if_fail (factory != NULL, -1);
- g_return_val_if_fail (PAS_IS_BOOK_FACTORY (factory), -1);
-
- return g_hash_table_size (factory->priv->active_server_map);
-}
-
-static void
-dump_active_server_map_entry (gpointer key, gpointer value, gpointer data)
-{
- char *uri;
- PASBackend *backend;
-
- uri = key;
- backend = PAS_BACKEND (value);
-
- g_message (" %s: %p", uri, backend);
-}
-
-void
-pas_book_factory_dump_active_backends (PASBookFactory *factory)
-{
- g_message ("Active PAS backends");
-
- g_hash_table_foreach (factory->priv->active_server_map,
- dump_active_server_map_entry,
- NULL);
-
-}
-
-/* Callback used when a backend loses its last connected client */
-static void
-backend_last_client_gone_cb (PASBackend *backend, gpointer data)
-{
- PASBookFactory *factory;
- const char *uri;
-
- factory = PAS_BOOK_FACTORY (data);
-
- /* Remove the backend from the active server map */
-
- uri = pas_backend_get_uri (backend);
- if (uri) {
- gpointer orig_key;
- gboolean result;
- char *orig_uri;
-
- result = g_hash_table_lookup_extended (factory->priv->active_server_map, uri,
- &orig_key, NULL);
- g_assert (result != FALSE);
-
- orig_uri = orig_key;
-
- g_hash_table_remove (factory->priv->active_server_map, orig_uri);
- g_free (orig_uri);
-
- g_object_unref (backend);
-
- /* Notify upstream if there are no more backends */
- }
-
- if (g_hash_table_size (factory->priv->active_server_map) == 0)
- g_signal_emit (G_OBJECT (factory), factory_signals[LAST_BOOK_GONE], 0);
-}
-
-static PASBackendFactoryFn
-pas_book_factory_lookup_backend_factory (PASBookFactory *factory,
- const char *uri)
-{
- PASBackendFactoryFn backend_fn;
- char *proto;
- char *canonical_uri;
-
- g_assert (factory != NULL);
- g_assert (PAS_IS_BOOK_FACTORY (factory));
- g_assert (uri != NULL);
-
- canonical_uri = pas_book_factory_canonicalize_uri (uri);
- if (canonical_uri == NULL)
- return NULL;
-
- proto = pas_book_factory_extract_proto_from_uri (canonical_uri);
- if (proto == NULL) {
- g_free (canonical_uri);
- return NULL;
- }
-
- backend_fn = g_hash_table_lookup (factory->priv->backends, proto);
-
- g_free (proto);
- g_free (canonical_uri);
-
- return backend_fn;
-}
-
-static PASBackend *
-pas_book_factory_launch_backend (PASBookFactory *factory,
- GNOME_Evolution_Addressbook_BookListener listener,
- const char *uri)
-{
- PASBackendFactoryFn backend_factory;
- PASBackend *backend;
-
- backend_factory = pas_book_factory_lookup_backend_factory (
- factory, uri);
-
- if (!backend_factory) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- GNOME_Evolution_Addressbook_BookListener_notifyBookOpened (
- listener,
- GNOME_Evolution_Addressbook_BookListener_ProtocolNotSupported,
- CORBA_OBJECT_NIL,
- &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("pas_book_factory_launch_backend(): could not notify "
- "the listener");
-
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- backend = (* backend_factory) ();
- if (!backend) {
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- GNOME_Evolution_Addressbook_BookListener_notifyBookOpened (
- listener,
- GNOME_Evolution_Addressbook_BookListener_OtherError,
- CORBA_OBJECT_NIL,
- &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("pas_book_factory_launch_backend(): could not notify "
- "the listener");
-
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- g_hash_table_insert (factory->priv->active_server_map,
- g_strdup (uri),
- backend);
-
- g_signal_connect (backend, "last_client_gone",
- G_CALLBACK (backend_last_client_gone_cb),
- factory);
-
- return backend;
-}
-
-static void
-pas_book_factory_process_request (PASBookFactory *factory,
- PASBookFactoryQueuedRequest *request)
-{
- PASBackend *backend;
- char *uri;
- GNOME_Evolution_Addressbook_BookListener listener;
- CORBA_Environment ev;
-
- uri = request->uri;
- listener = request->listener;
- g_free (request);
-
- /* Look up the backend and create one if needed */
-
- backend = g_hash_table_lookup (factory->priv->active_server_map, uri);
-
- if (!backend) {
- GNOME_Evolution_Addressbook_BookListener_CallStatus status;
-
- backend = pas_book_factory_launch_backend (factory, listener, uri);
- if (!backend)
- goto out;
-
- status = pas_backend_load_uri (backend, uri);
- if (status != GNOME_Evolution_Addressbook_BookListener_Success) {
- /* tell the listener that we failed to open the book */
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyBookOpened (
- listener, status,
- CORBA_OBJECT_NIL,
- &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_open: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-
- backend_last_client_gone_cb (backend, factory);
-
- goto out;
- }
-
- pas_backend_add_client (backend, listener);
-
- goto out;
- }
-
- pas_backend_add_client (backend, listener);
-
- out:
- g_free (uri);
-
- CORBA_exception_init (&ev);
- CORBA_Object_release (listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("pas_book_factory_process_request(): could not release the listener");
-
- CORBA_exception_free (&ev);
-}
-
-static gboolean
-pas_book_factory_process_queue (PASBookFactory *factory)
-{
- /* Process pending Book-creation requests. */
- if (factory->priv->queued_requests != NULL) {
- PASBookFactoryQueuedRequest *request;
- GList *l;
-
- l = factory->priv->queued_requests;
- request = l->data;
-
- pas_book_factory_process_request (factory, request);
-
- factory->priv->queued_requests = g_list_remove_link (
- factory->priv->queued_requests, l);
- g_list_free_1 (l);
- }
-
- if (factory->priv->queued_requests == NULL) {
-
- factory->priv->idle_id = 0;
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-pas_book_factory_queue_request (PASBookFactory *factory,
- const char *uri,
- const GNOME_Evolution_Addressbook_BookListener listener)
-{
- PASBookFactoryQueuedRequest *request;
- GNOME_Evolution_Addressbook_BookListener listener_copy;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- listener_copy = CORBA_Object_duplicate (listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("PASBookFactory: Could not duplicate BookListener!\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_exception_free (&ev);
-
- request = g_new0 (PASBookFactoryQueuedRequest, 1);
- request->listener = listener_copy;
- request->uri = g_strdup (uri);
-
- factory->priv->queued_requests =
- g_list_prepend (factory->priv->queued_requests, request);
-
- if (! factory->priv->idle_id) {
- factory->priv->idle_id =
- g_idle_add ((GSourceFunc) pas_book_factory_process_queue, factory);
- }
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_BookFactory_openBook (PortableServer_Servant servant,
- const CORBA_char *uri,
- const GNOME_Evolution_Addressbook_BookListener listener,
- CORBA_Environment *ev)
-{
- PASBookFactory *factory = PAS_BOOK_FACTORY (bonobo_object (servant));
- PASBackendFactoryFn backend_factory;
-
- backend_factory = pas_book_factory_lookup_backend_factory (factory, uri);
-
- if (backend_factory == NULL) {
- GNOME_Evolution_Addressbook_BookListener_notifyBookOpened (
- listener,
- GNOME_Evolution_Addressbook_BookListener_ProtocolNotSupported,
- CORBA_OBJECT_NIL,
- ev);
-
- return;
- }
-
- pas_book_factory_queue_request (factory, uri, listener);
-}
-
-static void
-pas_book_factory_construct (PASBookFactory *factory)
-{
- /* nothing to do here.. */
-}
-
-/**
- * pas_book_factory_new:
- */
-PASBookFactory *
-pas_book_factory_new (void)
-{
- PASBookFactory *factory;
-
- factory = g_object_new (PAS_TYPE_BOOK_FACTORY, NULL);
-
- pas_book_factory_construct (factory);
-
- return factory;
-}
-
-/**
- * pas_book_factory_activate:
- */
-gboolean
-pas_book_factory_activate (PASBookFactory *factory, const char *iid)
-{
- PASBookFactoryPrivate *priv;
- Bonobo_RegistrationResult result;
- char *tmp_iid;
-
- g_return_val_if_fail (factory != NULL, FALSE);
- g_return_val_if_fail (PAS_IS_BOOK_FACTORY (factory), FALSE);
-
- priv = factory->priv;
-
- g_return_val_if_fail (!priv->registered, FALSE);
-
- /* if iid is NULL, use the default factory OAFIID */
- if (iid)
- tmp_iid = g_strdup (iid);
- else
- tmp_iid = g_strdup (DEFAULT_PAS_BOOK_FACTORY_OAF_ID);
-
- result = bonobo_activation_active_server_register (tmp_iid, bonobo_object_corba_objref (BONOBO_OBJECT (factory)));
-
- switch (result) {
- case Bonobo_ACTIVATION_REG_SUCCESS:
- priv->registered = TRUE;
- priv->iid = tmp_iid;
- return TRUE;
- case Bonobo_ACTIVATION_REG_NOT_LISTED:
- g_message ("Error registering the PAS factory: not listed");
- break;
- case Bonobo_ACTIVATION_REG_ALREADY_ACTIVE:
- g_message ("Error registering the PAS factory: already active");
- break;
- case Bonobo_ACTIVATION_REG_ERROR:
- default:
- g_message ("Error registering the PAS factory: generic error");
- break;
- }
-
- g_free (tmp_iid);
- return FALSE;
-}
-
-static void
-pas_book_factory_init (PASBookFactory *factory)
-{
- factory->priv = g_new0 (PASBookFactoryPrivate, 1);
-
- factory->priv->active_server_map = g_hash_table_new (g_str_hash, g_str_equal);
- factory->priv->backends = g_hash_table_new (g_str_hash, g_str_equal);
- factory->priv->queued_requests = NULL;
- factory->priv->registered = FALSE;
-}
-
-static void
-free_active_server_map_entry (gpointer key, gpointer value, gpointer data)
-{
- char *uri;
- PASBackend *backend;
-
- uri = key;
- g_free (uri);
-
- backend = PAS_BACKEND (value);
- g_object_unref (backend);
-}
-
-static void
-remove_backends_entry (gpointer key, gpointer value, gpointer data)
-{
- char *uri;
-
- uri = key;
- g_free (uri);
-}
-
-static void
-pas_book_factory_dispose (GObject *object)
-{
- PASBookFactory *factory = PAS_BOOK_FACTORY (object);
-
- if (factory->priv) {
- PASBookFactoryPrivate *priv = factory->priv;
- GList *l;
-
- for (l = priv->queued_requests; l != NULL; l = l->next) {
- PASBookFactoryQueuedRequest *request = l->data;
- CORBA_Environment ev;
-
- g_free (request->uri);
-
- CORBA_exception_init (&ev);
- CORBA_Object_release (request->listener, &ev);
- CORBA_exception_free (&ev);
-
- g_free (request);
- }
- g_list_free (priv->queued_requests);
- priv->queued_requests = NULL;
-
- g_hash_table_foreach (priv->active_server_map,
- free_active_server_map_entry,
- NULL);
- g_hash_table_destroy (priv->active_server_map);
- priv->active_server_map = NULL;
-
- g_hash_table_foreach (priv->backends,
- remove_backends_entry,
- NULL);
- g_hash_table_destroy (priv->backends);
- priv->backends = NULL;
-
- if (priv->registered) {
- bonobo_activation_active_server_unregister (priv->iid,
- bonobo_object_corba_objref (BONOBO_OBJECT (factory)));
- priv->registered = FALSE;
- }
-
- g_free (priv->iid);
-
- g_free (priv);
- factory->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (pas_book_factory_parent_class)->dispose)
- G_OBJECT_CLASS (pas_book_factory_parent_class)->dispose (object);
-}
-
-static void
-pas_book_factory_class_init (PASBookFactoryClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- POA_GNOME_Evolution_Addressbook_BookFactory__epv *epv;
-
- pas_book_factory_parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = pas_book_factory_dispose;
-
- factory_signals[LAST_BOOK_GONE] =
- g_signal_new ("last_book_gone",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (PASBookFactoryClass, last_book_gone),
- NULL, NULL,
- pas_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
-
- epv = &klass->epv;
-
- epv->openBook = impl_GNOME_Evolution_Addressbook_BookFactory_openBook;
-}
-
-BONOBO_TYPE_FUNC_FULL (
- PASBookFactory,
- GNOME_Evolution_Addressbook_BookFactory,
- BONOBO_TYPE_OBJECT,
- pas_book_factory);
diff --git a/addressbook/backend/pas/pas-book-factory.h b/addressbook/backend/pas/pas-book-factory.h
deleted file mode 100644
index 9d099a6f2c..0000000000
--- a/addressbook/backend/pas/pas-book-factory.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <pas/pas-backend.h>
-#include <bonobo/bonobo-object.h>
-
-#ifndef __PAS_BOOK_FACTORY_H__
-#define __PAS_BOOK_FACTORY_H__
-
-G_BEGIN_DECLS
-
-#define PAS_TYPE_BOOK_FACTORY (pas_book_factory_get_type ())
-#define PAS_BOOK_FACTORY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BOOK_FACTORY, PASBookFactory))
-#define PAS_BOOK_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_TYPE_BOOK_FACTORY, PASBookFactoryClass))
-#define PAS_IS_BOOK_FACTORY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BOOK_FACTORY))
-#define PAS_IS_BOOK_FACTORY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BOOK_FACTORY))
-#define PAS_BOOK_FACTORY_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BOOK_FACTORY, PASBookFactoryClass))
-
-typedef struct _PASBookFactoryPrivate PASBookFactoryPrivate;
-
-typedef struct {
- BonoboObject parent_object;
- PASBookFactoryPrivate *priv;
-} PASBookFactory;
-
-typedef struct {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Addressbook_BookFactory__epv epv;
-
- /* Notification signals */
-
- void (* last_book_gone) (PASBookFactory *factory);
-} PASBookFactoryClass;
-
-PASBookFactory *pas_book_factory_new (void);
-
-void pas_book_factory_register_backend (PASBookFactory *factory,
- const char *proto,
- PASBackendFactoryFn backend_factory);
-
-int pas_book_factory_get_n_backends (PASBookFactory *factory);
-
-void pas_book_factory_dump_active_backends (PASBookFactory *factory);
-
-gboolean pas_book_factory_activate (PASBookFactory *factory, const char *iid);
-
-GType pas_book_factory_get_type (void);
-
-G_END_DECLS
-
-#endif /* ! __PAS_BOOK_FACTORY_H__ */
diff --git a/addressbook/backend/pas/pas-book-view.c b/addressbook/backend/pas/pas-book-view.c
deleted file mode 100644
index fce4173f0f..0000000000
--- a/addressbook/backend/pas/pas-book-view.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * pas-book-view.c
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <config.h>
-#include <glib.h>
-#include <bonobo/bonobo-main.h>
-#include "pas-book-view.h"
-
-static BonoboObjectClass *pas_book_view_parent_class;
-
-struct _PASBookViewPrivate {
- GNOME_Evolution_Addressbook_BookViewListener listener;
-};
-
-/**
- * pas_book_view_notify_change:
- */
-void
-pas_book_view_notify_change (PASBookView *book_view,
- const GList *cards)
-{
- CORBA_Environment ev;
- gint i, length;
- CORBA_sequence_GNOME_Evolution_Addressbook_VCard card_sequence;
-
- length = g_list_length((GList *) cards);
-
- card_sequence._buffer = CORBA_sequence_GNOME_Evolution_Addressbook_VCard_allocbuf(length);
- card_sequence._maximum = length;
- card_sequence._length = length;
-
- for ( i = 0; cards; cards = g_list_next(cards), i++ ) {
- card_sequence._buffer[i] = CORBA_string_dup((char *) cards->data);
- }
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookViewListener_notifyCardChanged (
- book_view->priv->listener, &card_sequence, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_view_notify_change: Exception signaling BookViewListener!\n");
- }
-
- CORBA_exception_free (&ev);
-
- CORBA_free(card_sequence._buffer);
-}
-
-void
-pas_book_view_notify_change_1 (PASBookView *book_view,
- const char *card)
-{
- GList *list = g_list_append(NULL, (char *) card);
- pas_book_view_notify_change(book_view, list);
- g_list_free(list);
-}
-
-/**
- * pas_book_view_notify_remove:
- */
-void
-pas_book_view_notify_remove_1 (PASBookView *book_view,
- const char *id)
-{
- GList *ids = NULL;
-
- ids = g_list_prepend (ids, (char*)id);
-
- pas_book_view_notify_remove (book_view, ids);
-
- g_list_free (ids);
-}
-
-void
-pas_book_view_notify_remove (PASBookView *book_view,
- const GList *ids)
-{
- GNOME_Evolution_Addressbook_CardIdList idlist;
- CORBA_Environment ev;
- const GList *l;
- int num_ids, i;
-
- CORBA_exception_init (&ev);
-
- num_ids = g_list_length ((GList*)ids);
- idlist._buffer = CORBA_sequence_GNOME_Evolution_Addressbook_CardId_allocbuf (num_ids);
- idlist._maximum = num_ids;
- idlist._length = num_ids;
-
- for (l = ids, i = 0; l; l=l->next, i ++) {
- idlist._buffer[i] = CORBA_string_dup (l->data);
- }
-
- GNOME_Evolution_Addressbook_BookViewListener_notifyCardsRemoved (
- book_view->priv->listener, &idlist, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_view_notify_remove: Exception signaling BookViewListener!\n");
- }
-
- CORBA_free(idlist._buffer);
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_view_notify_add:
- */
-void
-pas_book_view_notify_add (PASBookView *book_view,
- const GList *cards)
-{
- CORBA_Environment ev;
- gint i, length;
- CORBA_sequence_GNOME_Evolution_Addressbook_VCard card_sequence;
-
- length = g_list_length((GList *)cards);
-
- card_sequence._buffer = CORBA_sequence_GNOME_Evolution_Addressbook_VCard_allocbuf(length);
- card_sequence._maximum = length;
- card_sequence._length = length;
-
- for ( i = 0; cards; cards = g_list_next(cards), i++ ) {
- card_sequence._buffer[i] = CORBA_string_dup((char *) cards->data);
- }
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookViewListener_notifyCardAdded (
- book_view->priv->listener, &card_sequence, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_view_notify_add: Exception signaling BookViewListener!\n");
- }
-
- CORBA_exception_free (&ev);
-
- CORBA_free(card_sequence._buffer);
-}
-
-void
-pas_book_view_notify_add_1 (PASBookView *book_view,
- const char *card)
-{
- GList *list = g_list_append(NULL, (char *) card);
- pas_book_view_notify_add(book_view, list);
- g_list_free(list);
-}
-
-void
-pas_book_view_notify_complete (PASBookView *book_view,
- GNOME_Evolution_Addressbook_BookViewListener_CallStatus status)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookViewListener_notifySequenceComplete (
- book_view->priv->listener, status, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_view_notify_complete: Exception signaling BookViewListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-void
-pas_book_view_notify_status_message (PASBookView *book_view,
- const char *message)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookViewListener_notifyStatusMessage (
- book_view->priv->listener, message, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_view_notify_status_message: Exception signaling BookViewListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-static void
-pas_book_view_construct (PASBookView *book_view,
- GNOME_Evolution_Addressbook_BookViewListener listener)
-{
- PASBookViewPrivate *priv;
- CORBA_Environment ev;
-
- g_return_if_fail (book_view != NULL);
- g_return_if_fail (listener != CORBA_OBJECT_NIL);
-
- priv = book_view->priv;
-
- CORBA_exception_init (&ev);
-
- bonobo_object_dup_ref (listener, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("Unable to duplicate & ref listener object in pas-book-view.c\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_exception_free (&ev);
-
- priv->listener = listener;
-}
-
-/**
- * pas_book_view_new:
- */
-PASBookView *
-pas_book_view_new (GNOME_Evolution_Addressbook_BookViewListener listener)
-{
- PASBookView *book_view;
-
- book_view = g_object_new (PAS_TYPE_BOOK_VIEW, NULL);
-
- pas_book_view_construct (book_view, listener);
-
- return book_view;
-}
-
-static void
-pas_book_view_dispose (GObject *object)
-{
- PASBookView *book_view = PAS_BOOK_VIEW (object);
-
- if (book_view->priv) {
- bonobo_object_release_unref (book_view->priv->listener, NULL);
-
- g_free (book_view->priv);
- book_view->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (pas_book_view_parent_class)->dispose)
- G_OBJECT_CLASS (pas_book_view_parent_class)->dispose (object);
-}
-
-static void
-pas_book_view_class_init (PASBookViewClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- pas_book_view_parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = pas_book_view_dispose;
-}
-
-static void
-pas_book_view_init (PASBookView *book_view)
-{
- book_view->priv = g_new0 (PASBookViewPrivate, 1);
- book_view->priv->listener = CORBA_OBJECT_NIL;
-}
-
-BONOBO_TYPE_FUNC_FULL (
- PASBookView,
- GNOME_Evolution_Addressbook_BookView,
- BONOBO_TYPE_OBJECT,
- pas_book_view);
diff --git a/addressbook/backend/pas/pas-book-view.h b/addressbook/backend/pas/pas-book-view.h
deleted file mode 100644
index dd6c74c596..0000000000
--- a/addressbook/backend/pas/pas-book-view.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * A wrapper object which exports the GNOME_Evolution_Addressbook_Book CORBA interface
- * and which maintains a request queue.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __PAS_BOOK_VIEW_H__
-#define __PAS_BOOK_VIEW_H__
-
-#include <bonobo/bonobo-object.h>
-#include <pas/addressbook.h>
-#include <glib.h>
-#include <glib-object.h>
-
-#define PAS_TYPE_BOOK_VIEW (pas_book_view_get_type ())
-#define PAS_BOOK_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BOOK_VIEW, PASBookView))
-#define PAS_BOOK_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_TYPE_BOOK_VIEW, PASBookViewClass))
-#define PAS_IS_BOOK_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BOOK_VIEW))
-#define PAS_IS_BOOK_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BOOK_VIEW))
-#define PAS_BOOK_VIEW_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BOOK_VIEW, PASBookView))
-
-typedef struct _PASBookView PASBookView;
-typedef struct _PASBookViewClass PASBookViewClass;
-typedef struct _PASBookViewPrivate PASBookViewPrivate;
-
-struct _PASBookView {
- BonoboObject parent_object;
- PASBookViewPrivate *priv;
-};
-
-struct _PASBookViewClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Addressbook_BookView__epv epv;
-};
-
-
-PASBookView *pas_book_view_new (GNOME_Evolution_Addressbook_BookViewListener listener);
-
-void pas_book_view_notify_change (PASBookView *book_view,
- const GList *cards);
-void pas_book_view_notify_change_1 (PASBookView *book_view,
- const char *card);
-void pas_book_view_notify_remove (PASBookView *book_view,
- const GList *ids);
-void pas_book_view_notify_remove_1 (PASBookView *book_view,
- const char *id);
-void pas_book_view_notify_add (PASBookView *book_view,
- const GList *cards);
-void pas_book_view_notify_add_1 (PASBookView *book_view,
- const char *card);
-void pas_book_view_notify_complete (PASBookView *book_view,
- GNOME_Evolution_Addressbook_BookViewListener_CallStatus);
-void pas_book_view_notify_status_message (PASBookView *book_view,
- const char *message);
-
-GType pas_book_view_get_type (void);
-
-#endif /* ! __PAS_BOOK_VIEW_H__ */
diff --git a/addressbook/backend/pas/pas-book.c b/addressbook/backend/pas/pas-book.c
deleted file mode 100644
index dc626e59e1..0000000000
--- a/addressbook/backend/pas/pas-book.c
+++ /dev/null
@@ -1,1026 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * pas-book.c
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#include <config.h>
-#include <bonobo/bonobo-main.h>
-#include "e-util/e-list.h"
-#include "pas-backend.h"
-#include "pas-marshal.h"
-
-static BonoboObjectClass *pas_book_parent_class;
-POA_GNOME_Evolution_Addressbook_Book__vepv pas_book_vepv;
-
-enum {
- REQUESTS_QUEUED,
- LAST_SIGNAL
-};
-
-static guint pas_book_signals [LAST_SIGNAL];
-
-struct _PASBookPrivate {
- PASBackend *backend;
- GNOME_Evolution_Addressbook_BookListener listener;
-
- GList *request_queue;
- gint timeout_id;
-
- guint timeout_lock : 1;
-};
-
-static gboolean
-pas_book_check_queue (PASBook *book)
-{
- if (book->priv->timeout_lock)
- return TRUE;
-
- book->priv->timeout_lock = TRUE;
-
- if (book->priv->request_queue != NULL) {
- g_signal_emit (book, pas_book_signals [REQUESTS_QUEUED], 0);
- }
-
- if (book->priv->request_queue == NULL) {
- book->priv->timeout_id = 0;
- book->priv->timeout_lock = FALSE;
- bonobo_object_unref (BONOBO_OBJECT (book));
- return FALSE;
- }
-
- book->priv->timeout_lock = FALSE;
-
- return TRUE;
-}
-
-static void
-pas_book_queue_request (PASBook *book, PASRequest *req)
-{
- book->priv->request_queue =
- g_list_append (book->priv->request_queue, req);
-
- if (book->priv->timeout_id == 0) {
- bonobo_object_ref (BONOBO_OBJECT (book));
- book->priv->timeout_id = g_timeout_add (20, (GSourceFunc) pas_book_check_queue, book);
- }
-}
-
-static void
-pas_book_queue_create_card (PASBook *book, const char *vcard)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = CreateCard;
- req->create.vcard = g_strdup (vcard);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_remove_cards (PASBook *book,
- const GNOME_Evolution_Addressbook_CardIdList *ids)
-{
- PASRequest *req;
- int i;
-
- req = g_new0 (PASRequest, 1);
- req->op = RemoveCards;
- req->remove.ids = NULL;
-
- for (i = 0; i < ids->_length; i ++) {
- req->remove.ids = g_list_append (req->remove.ids, g_strdup (ids->_buffer[i]));
- }
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_modify_card (PASBook *book, const char *vcard)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = ModifyCard;
- req->modify.vcard = g_strdup (vcard);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_get_cursor (PASBook *book, const char *search)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = GetCursor;
- req->get_cursor.search = g_strdup(search);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_get_vcard (PASBook *book, const char *id)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = GetVCard;
- req->get_vcard.id = g_strdup(id);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_authenticate_user (PASBook *book,
- const char *user, const char *passwd, const char *auth_method)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = AuthenticateUser;
- req->auth_user.user = g_strdup(user);
- req->auth_user.passwd = g_strdup(passwd);
- req->auth_user.auth_method = g_strdup(auth_method);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_get_supported_fields (PASBook *book)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = GetSupportedFields;
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_get_supported_auth_methods (PASBook *book)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = GetSupportedAuthMethods;
-
- pas_book_queue_request (book, req);
-}
-
-
-static void
-pas_book_queue_get_book_view (PASBook *book, const GNOME_Evolution_Addressbook_BookViewListener listener, const char *search)
-{
- PASRequest *req;
- CORBA_Environment ev;
-
- req = g_new0 (PASRequest, 1);
- req->op = GetBookView;
- req->get_book_view.search = g_strdup(search);
-
- CORBA_exception_init (&ev);
-
- req->get_book_view.listener = bonobo_object_dup_ref(listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_queue_get_book_view: Exception "
- "duplicating BookViewListener!\n");
- }
-
- CORBA_exception_free (&ev);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_get_completion_view (PASBook *book, const GNOME_Evolution_Addressbook_BookViewListener listener, const char *search)
-{
- PASRequest *req;
- CORBA_Environment ev;
-
- req = g_new0 (PASRequest, 1);
- req->op = GetCompletionView;
- req->get_book_view.search = g_strdup(search);
-
- CORBA_exception_init (&ev);
-
- req->get_book_view.listener = bonobo_object_dup_ref(listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_queue_get_completion_view: Exception "
- "duplicating BookViewListener!\n");
- }
-
- CORBA_exception_free (&ev);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_get_changes (PASBook *book, const GNOME_Evolution_Addressbook_BookViewListener listener, const char *change_id)
-{
- PASRequest *req;
- CORBA_Environment ev;
-
- req = g_new0 (PASRequest, 1);
- req->op = GetChanges;
- req->get_changes.change_id= g_strdup(change_id);
-
- CORBA_exception_init (&ev);
-
- req->get_changes.listener = bonobo_object_dup_ref(listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_queue_get_changes: Exception "
- "duplicating BookViewListener!\n");
- }
-
- CORBA_exception_free (&ev);
-
- pas_book_queue_request (book, req);
-}
-
-static void
-pas_book_queue_check_connection (PASBook *book)
-{
- PASRequest *req;
-
- req = g_new0 (PASRequest, 1);
- req->op = CheckConnection;
-
- pas_book_queue_request (book, req);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_getVCard (PortableServer_Servant servant,
- const CORBA_char *id,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_get_vcard (book, id);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_authenticateUser (PortableServer_Servant servant,
- const char* user,
- const char* passwd,
- const char* auth_method,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_authenticate_user (book, user, passwd, auth_method);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_addCard (PortableServer_Servant servant,
- const CORBA_char *vcard,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_create_card (book, (const char *) vcard);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_removeCards (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_CardIdList *ids,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_remove_cards (book, ids);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_modifyCard (PortableServer_Servant servant,
- const CORBA_char *vcard,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_modify_card (book, (const char *) vcard);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_getCursor (PortableServer_Servant servant,
- const CORBA_char *search,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_get_cursor (book, search);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_getBookView (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookViewListener listener,
- const CORBA_char *search,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_get_book_view (book, listener, search);
-}
-
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_getCompletionView (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookViewListener listener,
- const CORBA_char *search,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_get_completion_view (book, listener, search);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_getChanges (PortableServer_Servant servant,
- const GNOME_Evolution_Addressbook_BookViewListener listener,
- const CORBA_char *change_id,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_get_changes (book, listener, change_id);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_checkConnection (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_check_connection (book);
-}
-
-static char *
-impl_GNOME_Evolution_Addressbook_Book_getStaticCapabilities (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
- char *temp;
- char *ret_val;
-
- temp = pas_backend_get_static_capabilities (book->priv->backend);
- ret_val = CORBA_string_dup(temp);
- g_free(temp);
- return ret_val;
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_getSupportedFields (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_get_supported_fields (book);
-}
-
-static void
-impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- PASBook *book = PAS_BOOK (bonobo_object (servant));
-
- pas_book_queue_get_supported_auth_methods (book);
-}
-
-/**
- * pas_book_get_backend:
- */
-PASBackend *
-pas_book_get_backend (PASBook *book)
-{
- g_return_val_if_fail (book != NULL, NULL);
- g_return_val_if_fail (PAS_IS_BOOK (book), NULL);
-
- return book->priv->backend;
-}
-
-/**
- * pas_book_get_listener:
- */
-GNOME_Evolution_Addressbook_BookListener
-pas_book_get_listener (PASBook *book)
-{
- g_return_val_if_fail (book != NULL, CORBA_OBJECT_NIL);
- g_return_val_if_fail (PAS_IS_BOOK (book), CORBA_OBJECT_NIL);
-
- return book->priv->listener;
-}
-
-/**
- * pas_book_check_pending
- */
-gint
-pas_book_check_pending (PASBook *book)
-{
- g_return_val_if_fail (book != NULL, -1);
- g_return_val_if_fail (PAS_IS_BOOK (book), -1);
-
- return g_list_length (book->priv->request_queue);
-}
-
-/**
- * pas_book_pop_request:
- */
-PASRequest *
-pas_book_pop_request (PASBook *book)
-{
- GList *popped;
- PASRequest *req;
-
- g_return_val_if_fail (book != NULL, NULL);
- g_return_val_if_fail (PAS_IS_BOOK (book), NULL);
-
- if (book->priv->request_queue == NULL)
- return NULL;
-
- req = book->priv->request_queue->data;
-
- popped = book->priv->request_queue;
- book->priv->request_queue =
- g_list_remove_link (book->priv->request_queue, popped);
-
- g_list_free_1 (popped);
-
- return req;
-}
-
-/**
- * pas_book_respond_open:
- */
-void
-pas_book_respond_open (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- if (status == GNOME_Evolution_Addressbook_BookListener_Success) {
- GNOME_Evolution_Addressbook_BookListener_notifyBookOpened (
- book->priv->listener, status,
- bonobo_object_corba_objref (BONOBO_OBJECT (book)),
- &ev);
- } else {
- GNOME_Evolution_Addressbook_BookListener_notifyBookOpened (
- book->priv->listener, status,
- CORBA_OBJECT_NIL, &ev);
- }
-
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_open: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_create:
- */
-void
-pas_book_respond_create (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const char *id)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyCardCreated (
- book->priv->listener, status, (char *)id, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_create: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_remove:
- */
-void
-pas_book_respond_remove (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyCardsRemoved (
- book->priv->listener, status, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_remove: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_modify:
- */
-void
-pas_book_respond_modify (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyCardModified (
- book->priv->listener, status, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_modify: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_authenticate_user:
- */
-void
-pas_book_respond_authenticate_user (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyAuthenticationResult (
- book->priv->listener, status, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_authenticate_user: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-void
-pas_book_respond_get_supported_fields (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- EList *fields)
-{
- CORBA_Environment ev;
- GNOME_Evolution_Addressbook_stringlist stringlist;
- int num_fields;
- EIterator *iter;
- int i;
-
- CORBA_exception_init (&ev);
-
- num_fields = e_list_length (fields);
-
- stringlist._buffer = CORBA_sequence_CORBA_string_allocbuf (num_fields);
- stringlist._maximum = num_fields;
- stringlist._length = num_fields;
-
- iter = e_list_get_iterator (fields);
-
- for (i = 0; e_iterator_is_valid (iter); e_iterator_next (iter), i ++) {
- stringlist._buffer[i] = CORBA_string_dup (e_iterator_get(iter));
- }
-
- g_object_unref (fields);
-
- GNOME_Evolution_Addressbook_BookListener_notifySupportedFields (
- book->priv->listener, status,
- &stringlist,
- &ev);
-
- CORBA_exception_free (&ev);
-
- CORBA_free(stringlist._buffer);
-}
-
-void
-pas_book_respond_get_supported_auth_methods (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- EList *auth_methods)
-{
- CORBA_Environment ev;
- GNOME_Evolution_Addressbook_stringlist stringlist;
- int num_auth_methods;
- EIterator *iter;
- int i;
-
- CORBA_exception_init (&ev);
-
- num_auth_methods = e_list_length (auth_methods);
-
- stringlist._buffer = CORBA_sequence_CORBA_string_allocbuf (num_auth_methods);
- stringlist._maximum = num_auth_methods;
- stringlist._length = num_auth_methods;
-
- iter = e_list_get_iterator (auth_methods);
-
- for (i = 0; e_iterator_is_valid (iter); e_iterator_next (iter), i ++) {
- stringlist._buffer[i] = CORBA_string_dup (e_iterator_get(iter));
- }
-
- g_object_unref (auth_methods);
-
- GNOME_Evolution_Addressbook_BookListener_notifySupportedAuthMethods (
- book->priv->listener, status,
- &stringlist,
- &ev);
-
- CORBA_exception_free (&ev);
-
- CORBA_free(stringlist._buffer);
-}
-
-/**
- * pas_book_respond_get_cursor:
- */
-void
-pas_book_respond_get_cursor (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASCardCursor *cursor)
-{
- CORBA_Environment ev;
- CORBA_Object object;
-
- CORBA_exception_init (&ev);
-
- object = bonobo_object_corba_objref(BONOBO_OBJECT(cursor));
-
- GNOME_Evolution_Addressbook_BookListener_notifyCursorRequested (
- book->priv->listener, status, object, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_get_cursor: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_get_book_view:
- */
-void
-pas_book_respond_get_book_view (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASBookView *book_view)
-{
- CORBA_Environment ev;
- CORBA_Object object;
-
- CORBA_exception_init (&ev);
-
- object = bonobo_object_corba_objref(BONOBO_OBJECT(book_view));
-
- GNOME_Evolution_Addressbook_BookListener_notifyViewRequested (
- book->priv->listener, status, object, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_get_book_view: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_get_book_view:
- */
-void
-pas_book_respond_get_completion_view (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASBookView *completion_view)
-{
- CORBA_Environment ev;
- CORBA_Object object;
-
- CORBA_exception_init (&ev);
-
- object = bonobo_object_corba_objref(BONOBO_OBJECT(completion_view));
-
- GNOME_Evolution_Addressbook_BookListener_notifyViewRequested (
- book->priv->listener, status, object, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_get_completion_view: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_get_changes:
- */
-void
-pas_book_respond_get_vcard (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- char *vcard)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyCardRequested (
- book->priv->listener, status, vcard, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_get_card: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_respond_get_changes:
- */
-void
-pas_book_respond_get_changes (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASBookView *book_view)
-{
- CORBA_Environment ev;
- CORBA_Object object;
-
- CORBA_exception_init (&ev);
-
- object = bonobo_object_corba_objref(BONOBO_OBJECT(book_view));
-
- GNOME_Evolution_Addressbook_BookListener_notifyChangesRequested (
- book->priv->listener, status, object, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_respond_get_changes: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_report_connection:
- */
-void
-pas_book_report_connection (PASBook *book,
- gboolean connected)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyConnectionStatus (
- book->priv->listener, (CORBA_boolean) connected, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_report_connection: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_report_writable:
- */
-void
-pas_book_report_writable (PASBook *book,
- gboolean writable)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_BookListener_notifyWritable (
- book->priv->listener, (CORBA_boolean) writable, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_report_writable: Exception "
- "responding to BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-static void
-pas_book_construct (PASBook *book,
- PASBackend *backend,
- GNOME_Evolution_Addressbook_BookListener listener)
-{
- PASBookPrivate *priv;
- CORBA_Environment ev;
-
- g_return_if_fail (book != NULL);
-
- priv = book->priv;
-
- priv->backend = backend;
-
- CORBA_exception_init (&ev);
- book->priv->listener = CORBA_Object_duplicate (listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_message ("pas_book_construct(): could not duplicate the listener");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_exception_free (&ev);
-
- priv->listener = listener;
-}
-
-/**
- * pas_book_new:
- */
-PASBook *
-pas_book_new (PASBackend *backend,
- GNOME_Evolution_Addressbook_BookListener listener)
-{
- PASBook *book;
-
- book = g_object_new (PAS_TYPE_BOOK, NULL);
-
- pas_book_construct (book, backend, listener);
-
- return book;
-}
-
-void
-pas_book_free_request (PASRequest *req)
-{
- CORBA_Environment ev;
- switch (req->op) {
- case CreateCard:
- g_free (req->create.id);
- g_free (req->create.vcard);
- break;
- case RemoveCards:
- g_list_foreach (req->remove.ids, (GFunc)g_free, NULL);
- g_list_free (req->remove.ids);
- break;
- case ModifyCard:
- g_free (req->modify.vcard);
- break;
- case GetVCard:
- g_free (req->get_vcard.id);
- break;
- case GetCursor:
- g_free (req->get_cursor.search);
- break;
- case GetBookView:
- g_free (req->get_book_view.search);
- CORBA_exception_init (&ev);
- bonobo_object_release_unref (req->get_book_view.listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("pas_book_free_request(GetBookView): could not release the listener");
-
- CORBA_exception_free (&ev);
- break;
- case GetCompletionView:
- g_free (req->get_completion_view.search);
- CORBA_exception_init (&ev);
- bonobo_object_release_unref (req->get_completion_view.listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("pas_book_free_request(GetCompletionView): could not release the listener");
-
- CORBA_exception_free (&ev);
- break;
- case GetChanges:
- g_free (req->get_changes.change_id);
- CORBA_exception_init (&ev);
- bonobo_object_release_unref (req->get_changes.listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("pas_book_free_request(GetChanges): could not release the listener");
-
- CORBA_exception_free (&ev);
- break;
- case CheckConnection:
- /* nothing to free */
- break;
- case AuthenticateUser:
- g_free (req->auth_user.user);
- g_free (req->auth_user.passwd);
- g_free (req->auth_user.auth_method);
- break;
- case GetSupportedFields:
- /* nothing to free */
- break;
- case GetSupportedAuthMethods:
- /* nothing to free */
- break;
- }
-
- g_free (req);
-}
-
-static void
-pas_book_dispose (GObject *object)
-{
- PASBook *book = PAS_BOOK (object);
-
- if (book->priv) {
- GList *l;
- CORBA_Environment ev;
-
- for (l = book->priv->request_queue; l != NULL; l = l->next) {
- pas_book_free_request ((PASRequest *)l->data);
- }
- g_list_free (book->priv->request_queue);
-
- /* We should never ever have timeout_id == 0 when we
- get destroyed, unless there is some sort of
- reference counting bug. Still, we do this to try
- to avoid horrible crashes in those situations. */
- if (book->priv->timeout_id) {
- g_warning ("PASBook destroyed with non-zero timeout_id. This shouldn't happen.");
- g_source_remove (book->priv->timeout_id);
- book->priv->timeout_id = 0;
- }
-
- CORBA_exception_init (&ev);
- CORBA_Object_release (book->priv->listener, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION)
- g_message ("pas_book_construct(): could not release the listener");
-
- CORBA_exception_free (&ev);
-
- g_free (book->priv);
- book->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (pas_book_parent_class)->dispose)
- G_OBJECT_CLASS (pas_book_parent_class)->dispose (object);
-}
-
-static void
-pas_book_class_init (PASBookClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- POA_GNOME_Evolution_Addressbook_Book__epv *epv;
-
- pas_book_parent_class = g_type_class_peek_parent (klass);
-
- pas_book_signals [REQUESTS_QUEUED] =
- g_signal_new ("requests_queued",
- G_OBJECT_CLASS_TYPE(object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (PASBookClass, requests_queued),
- NULL, NULL,
- pas_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- object_class->dispose = pas_book_dispose;
-
- epv = &klass->epv;
-
- epv->getVCard = impl_GNOME_Evolution_Addressbook_Book_getVCard;
- epv->authenticateUser = impl_GNOME_Evolution_Addressbook_Book_authenticateUser;
- epv->addCard = impl_GNOME_Evolution_Addressbook_Book_addCard;
- epv->removeCards = impl_GNOME_Evolution_Addressbook_Book_removeCards;
- epv->modifyCard = impl_GNOME_Evolution_Addressbook_Book_modifyCard;
- epv->checkConnection = impl_GNOME_Evolution_Addressbook_Book_checkConnection;
- epv->getStaticCapabilities = impl_GNOME_Evolution_Addressbook_Book_getStaticCapabilities;
- epv->getSupportedFields = impl_GNOME_Evolution_Addressbook_Book_getSupportedFields;
- epv->getSupportedAuthMethods = impl_GNOME_Evolution_Addressbook_Book_getSupportedAuthMethods;
- epv->getCursor = impl_GNOME_Evolution_Addressbook_Book_getCursor;
- epv->getBookView = impl_GNOME_Evolution_Addressbook_Book_getBookView;
- epv->getCompletionView = impl_GNOME_Evolution_Addressbook_Book_getCompletionView;
- epv->getChanges = impl_GNOME_Evolution_Addressbook_Book_getChanges;
-}
-
-static void
-pas_book_init (PASBook *book)
-{
- book->priv = g_new0 (PASBookPrivate, 1);
- book->priv->timeout_id = 0;
- book->priv->request_queue = NULL;
- book->priv->timeout_id = 0;
- book->priv->timeout_lock = FALSE;
-}
-
-BONOBO_TYPE_FUNC_FULL (
- PASBook,
- GNOME_Evolution_Addressbook_Book,
- BONOBO_TYPE_OBJECT,
- pas_book);
diff --git a/addressbook/backend/pas/pas-book.h b/addressbook/backend/pas/pas-book.h
deleted file mode 100644
index 761f906437..0000000000
--- a/addressbook/backend/pas/pas-book.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * A wrapper object which exports the GNOME_Evolution_Addressbook_Book CORBA interface
- * and which maintains a request queue.
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __PAS_BOOK_H__
-#define __PAS_BOOK_H__
-
-#include <bonobo/bonobo-object.h>
-#include <pas/addressbook.h>
-#include <pas/pas-book-view.h>
-#include "e-util/e-list.h"
-
-#include <pas/pas-backend.h>
-#include <pas/pas-card-cursor.h>
-
-#define PAS_TYPE_BOOK (pas_book_get_type ())
-#define PAS_BOOK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_BOOK, PASBook))
-#define PAS_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_BOOK_FACTORY_TYPE, PASBookClass))
-#define PAS_IS_BOOK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_BOOK))
-#define PAS_IS_BOOK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_BOOK))
-#define PAS_BOOK_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_BOOK, PASBookClass))
-
-typedef struct _PASBook PASBook;
-typedef struct _PASBookPrivate PASBookPrivate;
-
-typedef enum {
- CreateCard,
- RemoveCards,
- ModifyCard,
- GetVCard,
- GetCursor,
- GetBookView,
- GetCompletionView,
- GetChanges,
- CheckConnection,
- AuthenticateUser,
- GetSupportedFields,
- GetSupportedAuthMethods
-} PASOperation;
-
-typedef struct {
- PASOperation op;
- char *id;
- char *vcard;
-} PASCreateCardRequest;
-
-typedef struct {
- PASOperation op;
- GList *ids;
-} PASRemoveCardsRequest;
-
-typedef struct {
- PASOperation op;
- char *vcard;
-} PASModifyCardRequest;
-
-typedef struct {
- PASOperation op;
- char *id;
-} PASGetVCardRequest;
-
-typedef struct {
- PASOperation op;
- char *search;
-} PASGetCursorRequest;
-
-typedef struct {
- PASOperation op;
- char *search;
- GNOME_Evolution_Addressbook_BookViewListener listener;
-} PASGetBookViewRequest;
-
-typedef struct {
- PASOperation op;
- char *search;
- GNOME_Evolution_Addressbook_BookViewListener listener;
-} PASGetCompletionViewRequest;
-
-typedef struct {
- PASOperation op;
- char *change_id;
- GNOME_Evolution_Addressbook_BookViewListener listener;
-} PASGetChangesRequest;
-
-typedef struct {
- PASOperation op;
-} PASCheckConnectionRequest;
-
-typedef struct {
- PASOperation op;
- char *user;
- char *passwd;
- char *auth_method;
-} PASAuthenticateUserRequest;
-
-typedef struct {
- PASOperation op;
-} PASGetSupportedFieldsRequest;
-
-typedef struct {
- PASOperation op;
-} PASGetSupportedAuthMethodsRequest;
-
-typedef union {
- PASOperation op;
-
- PASCreateCardRequest create;
- PASRemoveCardsRequest remove;
- PASModifyCardRequest modify;
- PASGetVCardRequest get_vcard;
- PASGetCursorRequest get_cursor;
- PASGetBookViewRequest get_book_view;
- PASGetCompletionViewRequest get_completion_view;
- PASGetChangesRequest get_changes;
- PASCheckConnectionRequest check_connection;
- PASAuthenticateUserRequest auth_user;
- PASGetSupportedFieldsRequest get_supported_fields;
- PASGetSupportedAuthMethodsRequest get_supported_auth_methods;
-} PASRequest;
-
-struct _PASBook {
- BonoboObject parent_object;
- PASBookPrivate *priv;
-};
-
-typedef struct {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Addressbook_Book__epv epv;
-
- /* Signals */
- void (*requests_queued) (void);
-} PASBookClass;
-
-
-typedef gboolean (*PASBookCanWriteFn) (PASBook *book);
-typedef gboolean (*PASBookCanWriteCardFn) (PASBook *book, const char *id);
-
-PASBook *pas_book_new (PASBackend *backend,
- GNOME_Evolution_Addressbook_BookListener listener);
-PASBackend *pas_book_get_backend (PASBook *book);
-GNOME_Evolution_Addressbook_BookListener pas_book_get_listener (PASBook *book);
-int pas_book_check_pending (PASBook *book);
-PASRequest *pas_book_pop_request (PASBook *book);
-void pas_book_free_request (PASRequest *request);
-void pas_book_respond_open (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status);
-void pas_book_respond_create (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- const char *id);
-void pas_book_respond_remove (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status);
-void pas_book_respond_modify (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status);
-void pas_book_respond_authenticate_user (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status);
-void pas_book_respond_get_supported_fields (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- EList *fields);
-void pas_book_respond_get_supported_auth_methods (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- EList *fields);
-
-void pas_book_respond_get_cursor (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASCardCursor *cursor);
-void pas_book_respond_get_book_view (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASBookView *book_view);
-void pas_book_respond_get_completion_view (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASBookView *completion_view);
-void pas_book_respond_get_vcard (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- char *vcard);
-void pas_book_respond_get_changes (PASBook *book,
- GNOME_Evolution_Addressbook_BookListener_CallStatus status,
- PASBookView *book_view);
-void pas_book_report_connection (PASBook *book,
- gboolean connected);
-
-void pas_book_report_writable (PASBook *book,
- gboolean writable);
-
-GType pas_book_get_type (void);
-
-#endif /* ! __PAS_BOOK_H__ */
diff --git a/addressbook/backend/pas/pas-card-cursor.c b/addressbook/backend/pas/pas-card-cursor.c
deleted file mode 100644
index 9637bb1fb7..0000000000
--- a/addressbook/backend/pas/pas-card-cursor.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * pas-card-cursor.c: Implements card cursors.
- *
- * Author:
- * Christopher James Lahey <clahey@ximian.com.
- */
-
-#include <config.h>
-#include <bonobo/bonobo-main.h>
-#include "addressbook.h"
-#include "pas-card-cursor.h"
-
-struct _PASCardCursorPrivate {
- long (*get_length) (PASCardCursor *cursor, gpointer data);
- char * (*get_nth) (PASCardCursor *cursor, long n, gpointer data);
- gpointer data;
-};
-
-/*
- * A pointer to our parent object class
- */
-static BonoboObjectClass *parent_class;
-
-/*
- * Implemented GObject::dispose
- */
-static void
-pas_card_cursor_dispose (GObject *object)
-{
- PASCardCursor *cursor = PAS_CARD_CURSOR (object);
-
- if ( cursor->priv ) {
- g_free ( cursor->priv );
- cursor->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-/*
- * CORBA Demo::Echo::echo method implementation
- */
-static CORBA_long
-impl_pas_card_cursor_get_length (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- PASCardCursor *cursor = PAS_CARD_CURSOR (bonobo_object (servant));
- if ( cursor->priv->get_length )
- return cursor->priv->get_length( cursor, cursor->priv->data );
- else
- return 0;
-}
-
-/*
- * CORBA Demo::Echo::echo method implementation
- */
-static char *
-impl_pas_card_cursor_get_nth (PortableServer_Servant servant,
- const CORBA_long n,
- CORBA_Environment *ev)
-{
- PASCardCursor *cursor = PAS_CARD_CURSOR (bonobo_object (servant));
- if ( cursor->priv->get_nth ) {
- char *vcard = cursor->priv->get_nth( cursor, n, cursor->priv->data );
- char *retval = CORBA_string_dup (vcard);
- g_free (vcard);
- return retval;
- } else
- return CORBA_string_dup ("");
-}
-
-static void
-pas_card_cursor_class_init (PASCardCursorClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- POA_GNOME_Evolution_Addressbook_CardCursor__epv *epv;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = pas_card_cursor_dispose;
-
-
- epv = &klass->epv;
-
- epv->count = impl_pas_card_cursor_get_length;
- epv->getNth = impl_pas_card_cursor_get_nth;
-}
-
-static void
-pas_card_cursor_init (PASCardCursor *cursor)
-{
- cursor->priv = g_new0(PASCardCursorPrivate, 1);
- cursor->priv->get_length = NULL;
- cursor->priv->get_nth = NULL;
- cursor->priv->data = NULL;
-}
-
-static void
-pas_card_cursor_construct (PASCardCursor *cursor,
- PASCardCursorLengthFunc get_length,
- PASCardCursorNthFunc get_nth,
- gpointer data)
-{
- PASCardCursorPrivate *priv;
-
- g_return_if_fail (cursor != NULL);
- g_return_if_fail (PAS_IS_CARD_CURSOR (cursor));
-
- priv = cursor->priv;
-
- priv->get_length = get_length;
- priv->get_nth = get_nth;
- priv->data = data;
-}
-
-PASCardCursor *
-pas_card_cursor_new (PASCardCursorLengthFunc get_length,
- PASCardCursorNthFunc get_nth,
- gpointer data)
-{
- PASCardCursor *cursor;
-
- cursor = g_object_new (PAS_TYPE_CARD_CURSOR, NULL);
-
- pas_card_cursor_construct (cursor,
- get_length,
- get_nth,
- data);
-
- return cursor;
-}
-
-BONOBO_TYPE_FUNC_FULL (
- PASCardCursor,
- GNOME_Evolution_Addressbook_CardCursor,
- BONOBO_TYPE_OBJECT,
- pas_card_cursor);
diff --git a/addressbook/backend/pas/pas-card-cursor.h b/addressbook/backend/pas/pas-card-cursor.h
deleted file mode 100644
index db5b05c0c2..0000000000
--- a/addressbook/backend/pas/pas-card-cursor.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Nat Friedman (nat@ximian.com)
- *
- * Copyright 2000, Ximian, Inc.
- */
-
-#ifndef __PAS_CARD_CURSOR_H__
-#define __PAS_CARD_CURSOR_H__
-
-#include <bonobo/bonobo-object.h>
-#include <pas/addressbook.h>
-
-G_BEGIN_DECLS
-
-#define PAS_TYPE_CARD_CURSOR (pas_card_cursor_get_type ())
-#define PAS_CARD_CURSOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PAS_TYPE_CARD_CURSOR, PASCardCursor))
-#define PAS_CARD_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PAS_TYPE_CARD_CURSOR, PASCardCursorClass))
-#define PAS_IS_CARD_CURSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PAS_TYPE_CARD_CURSOR))
-#define PAS_IS_CARD_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PAS_TYPE_CARD_CURSOR))
-#define PAS_CARD_CURSOR_GET_CLASS(k) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAS_TYPE_CARD_CURSOR, PASCardCursorClass))
-
-typedef struct _PASCardCursor PASCardCursor;
-typedef struct _PASCardCursorPrivate PASCardCursorPrivate;
-typedef struct _PASCardCursorClass PASCardCursorClass;
-
-typedef long (*PASCardCursorLengthFunc) (PASCardCursor *cursor, gpointer data);
-typedef char * (*PASCardCursorNthFunc) (PASCardCursor *cursor, long n, gpointer data);
-
-struct _PASCardCursor {
- BonoboObject parent;
- PASCardCursorPrivate *priv;
-};
-
-struct _PASCardCursorClass {
- BonoboObjectClass parent;
-
- POA_GNOME_Evolution_Addressbook_CardCursor__epv epv;
-};
-
-
-
-/* Creating a new addressbook. */
-PASCardCursor *pas_card_cursor_new (PASCardCursorLengthFunc get_length,
- PASCardCursorNthFunc get_nth,
- gpointer data);
-
-GType pas_card_cursor_get_type (void);
-POA_GNOME_Evolution_Addressbook_CardCursor__epv *
- pas_card_cursor_get_epv (void);
-
-G_END_DECLS
-
-#endif /* ! __PAS_CARD_CURSOR_H__ */
diff --git a/addressbook/backend/pas/pas-marshal.list b/addressbook/backend/pas/pas-marshal.list
deleted file mode 100644
index fa33740eaa..0000000000
--- a/addressbook/backend/pas/pas-marshal.list
+++ /dev/null
@@ -1 +0,0 @@
-NONE:NONE
diff --git a/addressbook/conduit/.cvsignore b/addressbook/conduit/.cvsignore
deleted file mode 100644
index 87b35d3be5..0000000000
--- a/addressbook/conduit/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-.deps
-.libs
-*.lo
-Makefile.in
-Makefile
-libeaddress_conduit.la
-e-address-conduit-control-applet
-e-address-conduit-control-applet.desktop
-e-address.conduit
diff --git a/addressbook/conduit/Makefile.am b/addressbook/conduit/Makefile.am
deleted file mode 100644
index e7767dbcae..0000000000
--- a/addressbook/conduit/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/e-util \
- -I$(top_builddir)/e-util \
- $(PISOCK_CFLAGS) \
- $(EVOLUTION_ADDRESSBOOK_CONDUIT_CFLAGS)
-
-# Address Conduit
-e_address_conduitsdir=$(libdir)/gnome-pilot/conduits
-e_address_conduits_LTLIBRARIES = libeaddress_conduit.la
-
-libeaddress_conduit_la_SOURCES = \
- address-conduit.c
-
-libeaddress_conduit_la_LDFLAGS = -module -avoid-version
-libeaddress_conduit_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/addressbook/backend/ebook/libebook-static.la \
- $(top_builddir)/e-util/ename/libename-static.la \
- $(top_builddir)/libversit/libversit.la \
- $(top_builddir)/e-util/libeconduit-static.la \
- $(top_builddir)/camel/libcamel.la \
- $(EVOLUTION_ADDRESSBOOK_CONDUIT_LIBS)
-
-e-address.conduit: e-address.conduit.in Makefile
- sed -e 's^\@prefix\@^$(prefix)^g' \
- -e 's^\@datadir\@^$(datadir)^g' \
- < $(srcdir)/e-address.conduit.in > e-address.conduit.tmp \
- && mv e-address.conduit.tmp e-address.conduit
-
-
-Conduitdir = $(datadir)/gnome-pilot/conduits/
-Conduit_DATA = e-address.conduit
-
-EXTRA_DIST = \
- e-address.conduit.in
-
-install-data-local:
- $(mkinstalldirs) $(Conduitdir)
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
deleted file mode 100644
index 5f95287b98..0000000000
--- a/addressbook/conduit/address-conduit.c
+++ /dev/null
@@ -1,1908 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* Evolution addressbook - Address Conduit
- *
- * Copyright (C) 1998 Free Software Foundation
- * Copyright (C) 2000 Ximian, Inc.
- *
- * Authors: Eskil Heyn Olsen <deity@eskil.dk>
- * JP Rosevear <jpr@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#define G_LOG_DOMAIN "eaddrconduit"
-
-#include <bonobo.h>
-#include <libxml/parser.h>
-#include <pi-source.h>
-#include <pi-socket.h>
-#include <pi-dlp.h>
-#include <pi-address.h>
-#include <ebook/e-book.h>
-#include <ebook/e-book-util.h>
-#include <ebook/e-card-types.h>
-#include <ebook/e-card-cursor.h>
-#include <ebook/e-card.h>
-#include <ebook/e-card-simple.h>
-#include <gpilotd/gnome-pilot-conduit.h>
-#include <gpilotd/gnome-pilot-conduit-sync-abs.h>
-#include <libgpilotdCM/gnome-pilot-conduit-management.h>
-#include <libgpilotdCM/gnome-pilot-conduit-config.h>
-#include <e-dialog-widgets.h>
-#include <e-pilot-map.h>
-#include <e-pilot-settings.h>
-#include <e-pilot-util.h>
-
-GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
-void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
-
-#define CONDUIT_VERSION "0.1.2"
-
-#define DEBUG_CONDUIT 1
-/* #undef DEBUG_CONDUIT */
-
-#ifdef DEBUG_CONDUIT
-#define LOG(x) x
-#else
-#define LOG(x)
-#endif
-
-#define WARN g_warning
-#define INFO g_message
-
-typedef struct {
- EBookStatus status;
- char *id;
-} CardObjectChangeStatus;
-
-typedef enum {
- CARD_ADDED,
- CARD_MODIFIED,
- CARD_DELETED
-} CardObjectChangeType;
-
-typedef struct
-{
- ECard *card;
- CardObjectChangeType type;
-} CardObjectChange;
-
-enum {
- LABEL_WORK,
- LABEL_HOME,
- LABEL_FAX,
- LABEL_OTHER,
- LABEL_EMAIL,
- LABEL_MAIN,
- LABEL_PAGER,
- LABEL_MOBILE
-};
-
-static ECardSimpleField priority [] = {
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS,
- E_CARD_SIMPLE_FIELD_PHONE_HOME,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX,
- E_CARD_SIMPLE_FIELD_EMAIL,
- E_CARD_SIMPLE_FIELD_PHONE_PAGER,
- E_CARD_SIMPLE_FIELD_PHONE_MOBILE,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2,
- E_CARD_SIMPLE_FIELD_PHONE_HOME_2,
- E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX,
- E_CARD_SIMPLE_FIELD_EMAIL_2,
- E_CARD_SIMPLE_FIELD_PHONE_OTHER,
- E_CARD_SIMPLE_FIELD_PHONE_PRIMARY,
- E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX,
- E_CARD_SIMPLE_FIELD_EMAIL_3,
- E_CARD_SIMPLE_FIELD_LAST
-};
-
-static int priority_label [] = {
- LABEL_WORK,
- LABEL_HOME,
- LABEL_FAX,
- LABEL_EMAIL,
- LABEL_PAGER,
- LABEL_MOBILE,
- LABEL_WORK,
- LABEL_HOME,
- LABEL_FAX,
- LABEL_EMAIL,
- LABEL_OTHER,
- LABEL_MAIN,
- LABEL_FAX,
- LABEL_EMAIL,
- -1
-};
-
-typedef struct _EAddrLocalRecord EAddrLocalRecord;
-typedef struct _EAddrConduitCfg EAddrConduitCfg;
-typedef struct _EAddrConduitGui EAddrConduitGui;
-typedef struct _EAddrConduitContext EAddrConduitContext;
-
-/* Local Record */
-struct _EAddrLocalRecord {
- /* The stuff from gnome-pilot-conduit-standard-abs.h
- Must be first in the structure, or instances of this
- structure cannot be used by gnome-pilot-conduit-standard-abs.
- */
- GnomePilotDesktopRecord local;
-
- /* The corresponding ECard object */
- ECard *ecard;
-
- /* pilot-link address structure, used for implementing Transmit. */
- struct Address *addr;
-};
-
-
-static void
-addrconduit_destroy_record (EAddrLocalRecord *local)
-{
- g_object_unref (local->ecard);
- free_Address (local->addr);
- g_free (local->addr);
- g_free (local);
-}
-
-/* Configuration */
-struct _EAddrConduitCfg {
- guint32 pilot_id;
- GnomePilotConduitSyncType sync_type;
-
- gboolean secret;
- ECardSimpleAddressId default_address;
-
- gchar *last_uri;
-};
-
-static EAddrConduitCfg *
-addrconduit_load_configuration (guint32 pilot_id)
-{
- EAddrConduitCfg *c;
- GnomePilotConduitManagement *management;
- GnomePilotConduitConfig *config;
- gchar *address, prefix[256];
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-address-conduit/Pilot_%u/",
- pilot_id);
-
- c = g_new0 (EAddrConduitCfg,1);
- g_assert (c != NULL);
-
- c->pilot_id = pilot_id;
- management = gnome_pilot_conduit_management_new ("e_address_conduit", GNOME_PILOT_CONDUIT_MGMT_ID);
- gtk_object_ref (GTK_OBJECT (management));
- gtk_object_sink (GTK_OBJECT (management));
- config = gnome_pilot_conduit_config_new (management, pilot_id);
- gtk_object_ref (GTK_OBJECT (config));
- gtk_object_sink (GTK_OBJECT (config));
- if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type))
- c->sync_type = GnomePilotConduitSyncTypeNotSet;
- gtk_object_unref (GTK_OBJECT (config));
- gtk_object_unref (GTK_OBJECT (management));
-
- /* Custom settings */
- gnome_config_push_prefix (prefix);
-
- c->secret = gnome_config_get_bool ("secret=FALSE");
- address = gnome_config_get_string ("default_address=business");
- if (!strcmp (address, "business"))
- c->default_address = E_CARD_SIMPLE_ADDRESS_ID_BUSINESS;
- else if (!strcmp (address, "home"))
- c->default_address = E_CARD_SIMPLE_ADDRESS_ID_HOME;
- else if (!strcmp (address, "other"))
- c->default_address = E_CARD_SIMPLE_ADDRESS_ID_OTHER;
- g_free (address);
- c->last_uri = gnome_config_get_string ("last_uri");
-
- gnome_config_pop_prefix ();
-
- return c;
-}
-
-static void
-addrconduit_save_configuration (EAddrConduitCfg *c)
-{
- gchar prefix[256];
-
- g_snprintf (prefix, 255, "/gnome-pilot.d/e-address-conduit/Pilot_%u/",
- c->pilot_id);
-
- gnome_config_push_prefix (prefix);
- gnome_config_set_bool ("secret", c->secret);
- switch (c->default_address) {
- case E_CARD_SIMPLE_ADDRESS_ID_BUSINESS:
- gnome_config_set_string ("default_address", "business");
- break;
- case E_CARD_SIMPLE_ADDRESS_ID_HOME:
- gnome_config_set_string ("default_address", "home");
- break;
- case E_CARD_SIMPLE_ADDRESS_ID_OTHER:
- gnome_config_set_string ("default_address", "other");
- break;
- default:
- g_warning ("Unknown default_address value");
- }
- gnome_config_set_string ("last_uri", c->last_uri);
- gnome_config_pop_prefix ();
-
- gnome_config_sync ();
- gnome_config_drop_all ();
-}
-
-static EAddrConduitCfg*
-addrconduit_dupe_configuration (EAddrConduitCfg *c)
-{
- EAddrConduitCfg *retval;
-
- g_return_val_if_fail (c != NULL, NULL);
-
- retval = g_new0 (EAddrConduitCfg, 1);
- retval->sync_type = c->sync_type;
- retval->pilot_id = c->pilot_id;
-
- retval->secret = c->secret;
- retval->default_address = c->default_address;
- retval->last_uri = g_strdup (c->last_uri);
-
- return retval;
-}
-
-static void
-addrconduit_destroy_configuration (EAddrConduitCfg *c)
-{
- g_return_if_fail (c != NULL);
-
- g_free (c->last_uri);
- g_free (c);
-}
-
-/* Gui */
-struct _EAddrConduitGui {
- GtkWidget *default_address;
-};
-
-static EAddrConduitGui *
-e_addr_gui_new (EPilotSettings *ps)
-{
- EAddrConduitGui *gui;
- GtkWidget *lbl, *menu;
- gint rows, i;
- static const char *items[] = {"Business", "Home", "Other", NULL};
-
- g_return_val_if_fail (ps != NULL, NULL);
- g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL);
-
- gtk_table_resize (GTK_TABLE (ps), E_PILOT_SETTINGS_TABLE_ROWS + 1,
- E_PILOT_SETTINGS_TABLE_COLS);
-
- gui = g_new0 (EAddrConduitGui, 1);
-
- rows = E_PILOT_SETTINGS_TABLE_ROWS;
- lbl = gtk_label_new (_("Default Sync Address:"));
- gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5);
- gui->default_address = gtk_option_menu_new ();
- menu = gtk_menu_new ();
- for (i = 0; items[i] != NULL; i++) {
- GtkWidget *item;
-
- item = gtk_menu_item_new_with_label (items[i]);
- gtk_widget_show (item);
-
- gtk_menu_append (GTK_MENU (menu), item);
- }
- gtk_widget_show (menu);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->default_address), menu);
- gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, rows, rows + 1);
- gtk_table_attach_defaults (GTK_TABLE (ps), gui->default_address, 1, 2, rows, rows + 1);
- gtk_widget_show (lbl);
- gtk_widget_show (gui->default_address);
-
- return gui;
-}
-
-static const int default_address_map[] = {
- E_CARD_SIMPLE_ADDRESS_ID_BUSINESS,
- E_CARD_SIMPLE_ADDRESS_ID_HOME,
- E_CARD_SIMPLE_ADDRESS_ID_OTHER,
- -1
-};
-
-static void
-e_addr_gui_fill_widgets (EAddrConduitGui *gui, EAddrConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- e_dialog_option_menu_set (gui->default_address,
- cfg->default_address,
- default_address_map);
-}
-
-static void
-e_addr_gui_fill_config (EAddrConduitGui *gui, EAddrConduitCfg *cfg)
-{
- g_return_if_fail (gui != NULL);
- g_return_if_fail (cfg != NULL);
-
- cfg->default_address = e_dialog_option_menu_get (gui->default_address,
- default_address_map);
-}
-
-static void
-e_addr_gui_destroy (EAddrConduitGui *gui)
-{
- g_free (gui);
-}
-
-/* Context */
-struct _EAddrConduitContext {
- GnomePilotDBInfo *dbi;
-
- EAddrConduitCfg *cfg;
- EAddrConduitCfg *new_cfg;
- EAddrConduitGui *gui;
- GtkWidget *ps;
-
- struct AddressAppInfo ai;
-
- EBook *ebook;
- GList *cards;
- GList *changed;
- GHashTable *changed_hash;
- GList *locals;
-
- gboolean address_load_tried;
- gboolean address_load_success;
-
- EPilotMap *map;
-};
-
-static EAddrConduitContext *
-e_addr_context_new (guint32 pilot_id)
-{
- EAddrConduitContext *ctxt = g_new0 (EAddrConduitContext, 1);
-
- ctxt->cfg = addrconduit_load_configuration (pilot_id);
- ctxt->new_cfg = addrconduit_dupe_configuration (ctxt->cfg);
- ctxt->gui = NULL;
- ctxt->ps = NULL;
- ctxt->ebook = NULL;
- ctxt->cards = NULL;
- ctxt->changed_hash = NULL;
- ctxt->changed = NULL;
- ctxt->locals = NULL;
- ctxt->map = NULL;
-
- return ctxt;
-}
-
-static void
-e_addr_context_destroy (EAddrConduitContext *ctxt)
-{
- GList *l;
-
- g_return_if_fail (ctxt != NULL);
-
- if (ctxt->cfg != NULL)
- addrconduit_destroy_configuration (ctxt->cfg);
- if (ctxt->new_cfg != NULL)
- addrconduit_destroy_configuration (ctxt->new_cfg);
- if (ctxt->gui != NULL)
- e_addr_gui_destroy (ctxt->gui);
-
- if (ctxt->ebook != NULL)
- g_object_unref (ctxt->ebook);
-
- if (ctxt->cards != NULL) {
- for (l = ctxt->cards; l != NULL; l = l->next)
- g_object_unref (l->data);
- g_list_free (ctxt->cards);
- }
-
- if (ctxt->changed_hash != NULL)
- g_hash_table_destroy (ctxt->changed_hash);
-
- if (ctxt->changed != NULL) {
- CardObjectChange *coc;
-
- for (l = ctxt->changed; l != NULL; l = l->next) {
- coc = l->data;
-
- g_object_unref (coc->card);
- g_free (coc);
- }
- g_list_free (ctxt->changed);
- }
-
- if (ctxt->locals != NULL) {
- for (l = ctxt->locals; l != NULL; l = l->next)
- addrconduit_destroy_record (l->data);
- g_list_free (ctxt->locals);
- }
-
- if (ctxt->map != NULL)
- e_pilot_map_destroy (ctxt->map);
-
- g_free (ctxt);
-}
-
-/* Debug routines */
-static char *
-print_local (EAddrLocalRecord *local)
-{
- static char buff[ 4096 ];
-
- if (local == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- if (local->addr) {
- g_snprintf (buff, 4096, "['%s' '%s' '%s']",
- local->addr->entry[entryLastname] ?
- local->addr->entry[entryLastname] : "",
- local->addr->entry[entryFirstname] ?
- local->addr->entry[entryFirstname] : "",
- local->addr->entry[entryCompany] ?
- local->addr->entry[entryCompany] : "");
- return buff;
- }
-
- return "";
-}
-
-static char *print_remote (GnomePilotRecord *remote)
-{
- static char buff[ 4096 ];
- struct Address addr;
-
- if (remote == NULL) {
- sprintf (buff, "[NULL]");
- return buff;
- }
-
- memset (&addr, 0, sizeof (struct Address));
- unpack_Address (&addr, remote->record, remote->length);
-
- g_snprintf (buff, 4096, "['%s' '%s' '%s']",
- addr.entry[entryLastname] ?
- addr.entry[entryLastname] : "",
- addr.entry[entryFirstname] ?
- addr.entry[entryFirstname] : "",
- addr.entry[entryCompany] ?
- addr.entry[entryCompany] : "");
-
- free_Address (&addr);
-
- return buff;
-}
-
-/* Addressbok Server routines */
-static void
-add_card_cb (EBook *ebook, EBookStatus status, const char *id, gpointer closure)
-{
- CardObjectChangeStatus *cons = closure;
-
- cons->status = status;
- cons->id = g_strdup (id);
-
- gtk_main_quit();
-}
-
-static void
-status_cb (EBook *ebook, EBookStatus status, gpointer closure)
-{
- (*(EBookStatus*)closure) = status;
- gtk_main_quit();
-}
-
-static void
-cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer closure)
-{
- EAddrConduitContext *ctxt = (EAddrConduitContext*)closure;
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- long length;
- int i;
-
- ctxt->address_load_success = TRUE;
-
- length = e_card_cursor_get_length (cursor);
- ctxt->cards = NULL;
- for (i = 0; i < length; i ++) {
- ECard *card = e_card_cursor_get_nth (cursor, i);
-
- if (e_card_evolution_list (card))
- continue;
-
- ctxt->cards = g_list_append (ctxt->cards, card);
- }
-
- gtk_main_quit(); /* end the sub event loop */
- }
- else {
- WARN (_("Cursor could not be loaded\n"));
- gtk_main_quit(); /* end the sub event loop */
- }
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- EAddrConduitContext *ctxt = (EAddrConduitContext*)closure;
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- e_book_get_cursor (book, "(contains \"full_name\" \"\")", cursor_cb, ctxt);
- } else {
- WARN (_("EBook not loaded\n"));
- gtk_main_quit(); /* end the sub event loop */
- }
-}
-
-static int
-start_addressbook_server (EAddrConduitContext *ctxt)
-{
- g_return_val_if_fail(ctxt!=NULL,-2);
-
- ctxt->ebook = e_book_new ();
-
- e_book_load_default_book (ctxt->ebook, book_open_cb, ctxt);
-
- /* run a sub event loop to turn ebook's async loading into a
- synchronous call */
- gtk_main ();
-
- if (ctxt->address_load_success)
- return 0;
-
- return -1;
-}
-
-/* Utility routines */
-static char *
-map_name (EAddrConduitContext *ctxt)
-{
- char *filename = NULL;
-
- filename = g_strdup_printf ("%s/evolution/local/Contacts/pilot-map-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id);
-
- return filename;
-}
-
-static GList *
-next_changed_item (EAddrConduitContext *ctxt, GList *changes)
-{
- CardObjectChange *coc;
- GList *l;
-
- for (l = changes; l != NULL; l = l->next) {
- coc = l->data;
-
- if (g_hash_table_lookup (ctxt->changed_hash, e_card_get_id (coc->card)))
- return l;
- }
-
- return NULL;
-}
-
-static ECardSimpleField
-get_next_mail (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_EMAIL;
-
- switch (*field) {
- case E_CARD_SIMPLE_FIELD_EMAIL:
- return E_CARD_SIMPLE_FIELD_EMAIL_2;
- case E_CARD_SIMPLE_FIELD_EMAIL_2:
- return E_CARD_SIMPLE_FIELD_EMAIL_3;
- default:
- }
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static ECardSimpleField
-get_next_home (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_PHONE_HOME;
-
- switch (*field) {
- case E_CARD_SIMPLE_FIELD_PHONE_HOME:
- return E_CARD_SIMPLE_FIELD_PHONE_HOME_2;
- default:
- }
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static ECardSimpleField
-get_next_work (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_PHONE_BUSINESS;
-
- switch (*field) {
- case E_CARD_SIMPLE_FIELD_PHONE_BUSINESS:
- return E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2;
- default:
- }
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static ECardSimpleField
-get_next_fax (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX;
-
- switch (*field) {
- case E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX:
- return E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX;
- case E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX:
- return E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX;
- default:
- }
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static ECardSimpleField
-get_next_other (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_PHONE_OTHER;
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static ECardSimpleField
-get_next_main (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_PHONE_PRIMARY;
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static ECardSimpleField
-get_next_pager (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_PHONE_PAGER;
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static ECardSimpleField
-get_next_mobile (ECardSimpleField *field)
-{
- if (field == NULL)
- return E_CARD_SIMPLE_FIELD_PHONE_MOBILE;
-
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-static void
-get_next_init (ECardSimpleField *next_mail,
- ECardSimpleField *next_home,
- ECardSimpleField *next_work,
- ECardSimpleField *next_fax,
- ECardSimpleField *next_other,
- ECardSimpleField *next_main,
- ECardSimpleField *next_pager,
- ECardSimpleField *next_mobile)
-{
- *next_mail = get_next_mail (NULL);
- *next_home = get_next_home (NULL);
- *next_work = get_next_work (NULL);
- *next_fax = get_next_fax (NULL);
- *next_other = get_next_other (NULL);
- *next_main = get_next_main (NULL);
- *next_pager = get_next_pager (NULL);
- *next_mobile = get_next_mobile (NULL);
-}
-
-static gboolean
-is_next_done (ECardSimpleField field)
-{
- if (field == E_CARD_SIMPLE_FIELD_LAST)
- return TRUE;
-
- return FALSE;
-}
-
-static gboolean
-is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local)
-{
- ECardSimpleField next_mail, next_home, next_work, next_fax;
- ECardSimpleField next_other, next_main, next_pager, next_mobile;
- gboolean syncable = TRUE;
- int i, l = 0;
-
- /* See if there are fields we can't sync or not in priority order */
- get_next_init (&next_mail, &next_home, &next_work, &next_fax,
- &next_other, &next_main, &next_pager, &next_mobile);
-
- for (i = entryPhone1; i <= entryPhone5 && syncable; i++) {
- int phonelabel = local->addr->phoneLabel[i - entryPhone1];
- const char *phone_str = local->addr->entry[i];
- gboolean empty = !(phone_str && *phone_str);
-
- if (empty)
- continue;
-
- for ( ; priority_label[l] != -1; l++)
- if (phonelabel == priority_label[l])
- break;
-
- if (priority_label[l] == -1) {
- syncable = FALSE;
- continue;
- }
-
- if (phonelabel == LABEL_EMAIL) {
- if (is_next_done (next_mail) || next_mail != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_mail = get_next_mail (&next_mail);
- } else if (phonelabel == LABEL_HOME) {
- if (is_next_done (next_home) || next_home != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_home = get_next_home (&next_home);
- } else if (phonelabel == LABEL_WORK) {
- if (is_next_done (next_work) || next_work != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_work = get_next_work (&next_work);
- } else if (phonelabel == LABEL_FAX) {
- if (is_next_done (next_fax) || next_fax != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_fax = get_next_fax (&next_fax);
- } else if (phonelabel == LABEL_OTHER) {
- if (is_next_done (next_other) || next_other != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_other = get_next_other (&next_other);
- } else if (phonelabel == LABEL_MAIN) {
- if (is_next_done (next_main) || next_main != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_main = get_next_main (&next_main);
- } else if (phonelabel == LABEL_PAGER) {
- if (is_next_done (next_pager) || next_pager != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_pager = get_next_pager (&next_pager);
- } else if (phonelabel == LABEL_MOBILE) {
- if (is_next_done (next_mobile) || next_mobile != priority[l]) {
- syncable = FALSE;
- break;
- }
- next_mobile = get_next_mobile (&next_mobile);
- }
- }
-
- return syncable;
-}
-
-static char *
-get_entry_text (struct Address address, int field)
-{
- if (address.entry[field])
- return e_pilot_utf8_from_pchar (address.entry[field]);
-
- return g_strdup ("");
-}
-
-static void
-clear_entry_text (struct Address address, int field)
-{
- if (address.entry[field]) {
- free (address.entry[field]);
- address.entry[field] = NULL;
- }
-}
-
-static void
-compute_status (EAddrConduitContext *ctxt, EAddrLocalRecord *local, const char *uid)
-{
- CardObjectChange *coc;
-
- local->local.archived = FALSE;
- local->local.secret = FALSE;
-
- coc = g_hash_table_lookup (ctxt->changed_hash, uid);
-
- if (coc == NULL) {
- local->local.attr = GnomePilotRecordNothing;
- return;
- }
-
- switch (coc->type) {
- case CARD_ADDED:
- local->local.attr = GnomePilotRecordNew;
- break;
- case CARD_MODIFIED:
- local->local.attr = GnomePilotRecordModified;
- break;
- case CARD_DELETED:
- local->local.attr = GnomePilotRecordDeleted;
- break;
- }
-}
-
-static GnomePilotRecord
-local_record_to_pilot_record (EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- GnomePilotRecord p;
- static char record[0xffff];
-
- g_assert (local->addr != NULL );
-
- LOG (g_message ( "local_record_to_pilot_record\n" ));
-
- p.ID = local->local.ID;
- p.category = local->local.category;
- p.attr = local->local.attr;
- p.archived = local->local.archived;
- p.secret = local->local.secret;
-
- /* Generate pilot record structure */
- p.record = record;
- p.length = pack_Address (local->addr, p.record, 0xffff);
-
- return p;
-}
-
-static void
-local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitContext *ctxt)
-{
- ECardSimple *simple;
- const ECardDeliveryAddress *delivery;
- ECardSimpleAddressId mailing_address;
- int phone = entryPhone1;
-
- gboolean syncable;
- int i;
-
- g_return_if_fail (local != NULL);
- g_return_if_fail (ecard != NULL);
-
- local->ecard = ecard;
- g_object_ref (ecard);
- simple = e_card_simple_new (ecard);
-
- local->local.ID = e_pilot_map_lookup_pid (ctxt->map, ecard->id, TRUE);
-
- compute_status (ctxt, local, ecard->id);
-
- local->addr = g_new0 (struct Address, 1);
-
- /* Handle the fields and category we don't sync by making sure
- * we don't overwrite them
- */
- if (local->local.ID != 0) {
- struct Address addr;
- char record[0xffff];
- int cat = 0;
-
- if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
- ctxt->dbi->db_handle,
- local->local.ID, &record,
- NULL, NULL, NULL, &cat) > 0) {
- local->local.category = cat;
- memset (&addr, 0, sizeof (struct Address));
- unpack_Address (&addr, record, 0xffff);
- for (i = 0; i < 5; i++) {
- if (addr.entry[entryPhone1 + i])
- local->addr->entry[entryPhone1 + i] =
- strdup (addr.entry[entryPhone1 + i]);
- local->addr->phoneLabel[i] = addr.phoneLabel[i];
- }
- local->addr->showPhone = addr.showPhone;
- for (i = 0; i < 4; i++) {
- if (addr.entry[entryCustom1 + i])
- local->addr->entry[entryCustom1 + i] =
- strdup (addr.entry[entryCustom1 + i]);
- }
- free_Address (&addr);
- }
- }
-
- if (ecard->name) {
- local->addr->entry[entryFirstname] = e_pilot_utf8_to_pchar (ecard->name->given);
- local->addr->entry[entryLastname] = e_pilot_utf8_to_pchar (ecard->name->family);
- }
-
- local->addr->entry[entryCompany] = e_pilot_utf8_to_pchar (ecard->org);
- local->addr->entry[entryTitle] = e_pilot_utf8_to_pchar (ecard->title);
-
- mailing_address = -1;
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- const ECardAddrLabel *address;
-
- address = e_card_simple_get_address(simple, i);
- if (address && (address->flags & E_CARD_ADDR_DEFAULT))
- mailing_address = i;
- }
- if (mailing_address == -1)
- mailing_address = ctxt->cfg->default_address;
-
- delivery = e_card_simple_get_delivery_address (simple, mailing_address);
- if (delivery) {
- char *add;
-
- /* If the address has 2 lines, make sure both get added */
- if (delivery->ext != NULL)
- add = g_strconcat (delivery->street, "\n", delivery->ext, NULL);
- else
- add = g_strdup (delivery->street);
- local->addr->entry[entryAddress] = e_pilot_utf8_to_pchar (add);
- g_free (add);
-
- local->addr->entry[entryCity] = e_pilot_utf8_to_pchar (delivery->city);
- local->addr->entry[entryState] = e_pilot_utf8_to_pchar (delivery->region);
- local->addr->entry[entryZip] = e_pilot_utf8_to_pchar (delivery->code);
- local->addr->entry[entryCountry] = e_pilot_utf8_to_pchar (delivery->country);
- }
-
- /* Phone numbers */
-
- /* See if everything is syncable */
- syncable = is_syncable (ctxt, local);
-
- if (syncable) {
- INFO ("Syncable");
-
- /* Sync by priority */
- for (i = 0, phone = entryPhone1;
- priority[i] != E_CARD_SIMPLE_FIELD_LAST && phone <= entryPhone5; i++) {
- const char *phone_str;
-
- phone_str = e_card_simple_get_const (simple, priority[i]);
- if (phone_str && *phone_str) {
- clear_entry_text (*local->addr, phone);
- local->addr->entry[phone] = e_pilot_utf8_to_pchar (phone_str);
- local->addr->phoneLabel[phone - entryPhone1] = priority_label[i];
- phone++;
- }
- }
- for ( ; phone <= entryPhone5; phone++)
- local->addr->phoneLabel[phone - entryPhone1] = phone - entryPhone1;
- local->addr->showPhone = 0;
- } else {
- ECardSimpleField next_mail, next_home, next_work, next_fax;
- ECardSimpleField next_other, next_main, next_pager, next_mobile;
-
- INFO ("Not Syncable");
- get_next_init (&next_mail, &next_home, &next_work, &next_fax,
- &next_other, &next_main, &next_pager, &next_mobile);
-
- /* Not completely syncable, so do the best we can */
- for (i = entryPhone1; i <= entryPhone5; i++) {
- int phonelabel = local->addr->phoneLabel[i - entryPhone1];
- const char *phone_str = NULL;
-
- if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) {
- phone_str = e_card_simple_get_const (simple, next_mail);
- next_mail = get_next_mail (&next_mail);
- } else if (phonelabel == LABEL_HOME && !is_next_done (next_home)) {
- phone_str = e_card_simple_get_const (simple, next_home);
- next_home = get_next_home (&next_home);
- } else if (phonelabel == LABEL_WORK && !is_next_done (next_work)) {
- phone_str = e_card_simple_get_const (simple, next_work);
- next_work = get_next_work (&next_work);
- } else if (phonelabel == LABEL_FAX && !is_next_done (next_fax)) {
- phone_str = e_card_simple_get_const (simple, next_fax);
- next_fax = get_next_fax (&next_fax);
- } else if (phonelabel == LABEL_OTHER && !is_next_done (next_other)) {
- phone_str = e_card_simple_get_const (simple, next_other);
- next_other = get_next_other (&next_other);
- } else if (phonelabel == LABEL_MAIN && !is_next_done (next_main)) {
- phone_str = e_card_simple_get_const (simple, next_main);
- next_main = get_next_main (&next_main);
- } else if (phonelabel == LABEL_PAGER && !is_next_done (next_pager)) {
- phone_str = e_card_simple_get_const (simple, next_pager);
- next_pager = get_next_pager (&next_pager);
- } else if (phonelabel == LABEL_MOBILE && !is_next_done (next_mobile)) {
- phone_str = e_card_simple_get_const (simple, next_mobile);
- next_mobile = get_next_mobile (&next_mobile);
- }
-
- if (phone_str && *phone_str) {
- clear_entry_text (*local->addr, i);
- local->addr->entry[i] = e_pilot_utf8_to_pchar (phone_str);
- }
- }
- }
-
- /* Note */
- local->addr->entry[entryNote] = e_pilot_utf8_to_pchar (ecard->note);
-
- g_object_unref (simple);
-}
-
-static void
-local_record_from_uid (EAddrLocalRecord *local,
- const char *uid,
- EAddrConduitContext *ctxt)
-{
- ECard *ecard = NULL;
- GList *l;
-
- g_assert (local != NULL);
-
- for (l = ctxt->cards; l != NULL; l = l->next) {
- ecard = l->data;
-
- if (ecard->id && !strcmp (ecard->id, uid))
- break;
-
- ecard = NULL;
- }
-
- if (ecard != NULL) {
- local_record_from_ecard (local, ecard, ctxt);
- } else {
- ecard = e_card_new ("");
- e_card_set_id (ecard, uid);
- local_record_from_ecard (local, ecard, ctxt);
- g_object_unref (ecard);
- }
-}
-
-static ECard *
-ecard_from_remote_record(EAddrConduitContext *ctxt,
- GnomePilotRecord *remote,
- ECard *in_card)
-{
- struct Address address;
- ECard *ecard;
- ECardSimple *simple;
- ECardName *name;
- ECardDeliveryAddress *delivery;
- ECardAddrLabel *label;
- ECardSimpleAddressId mailing_address;
- char *txt, *find;
- ECardSimpleField next_mail, next_home, next_work, next_fax;
- ECardSimpleField next_other, next_main, next_pager, next_mobile;
- int i;
-
- g_return_val_if_fail(remote!=NULL,NULL);
- memset (&address, 0, sizeof (struct Address));
- unpack_Address (&address, remote->record, remote->length);
-
- if (in_card == NULL)
- ecard = e_card_new("");
- else
- ecard = e_card_duplicate (in_card);
-
- /* Name */
- name = e_card_name_copy (ecard->name);
- name->given = get_entry_text (address, entryFirstname);
- name->family = get_entry_text (address, entryLastname);
-
- simple = e_card_simple_new (ecard);
- txt = e_card_name_to_string (name);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_FULL_NAME, txt);
- e_card_simple_set_name (simple, name);
-
- /* File as */
- if (!(txt && *txt))
- e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_FILE_AS,
- address.entry[entryCompany]);
-
- g_free (txt);
- e_card_name_unref (name);
-
- /* Title and Company */
- txt = get_entry_text (address, entryTitle);
- e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_TITLE, txt);
- g_free (txt);
-
- txt = get_entry_text (address, entryCompany);
- e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_ORG, txt);
- g_free (txt);
-
- /* Address */
- mailing_address = -1;
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- const ECardAddrLabel *addr;
-
- addr = e_card_simple_get_address(simple, i);
- if (addr && (addr->flags & E_CARD_ADDR_DEFAULT))
- mailing_address = i;
- }
- if (mailing_address == -1)
- mailing_address = ctxt->cfg->default_address;
-
- delivery = e_card_delivery_address_new ();
- delivery->flags |= E_CARD_ADDR_DEFAULT;
- txt = get_entry_text (address, entryAddress);
- if ((find = strchr (txt, '\n')) != NULL) {
- *find = '\0';
- find++;
- }
- delivery->street = txt;
- delivery->ext = find != NULL ? find : g_strdup ("");
- delivery->city = get_entry_text (address, entryCity);
- delivery->region = get_entry_text (address, entryState);
- delivery->country = get_entry_text (address, entryCountry);
- delivery->code = get_entry_text (address, entryZip);
-
- label = e_card_address_label_new ();
- label->flags |= E_CARD_ADDR_DEFAULT;
- label->data = e_card_delivery_address_to_string (delivery);
-
- e_card_simple_set_address (simple, mailing_address, label);
- e_card_simple_set_delivery_address (simple, mailing_address, delivery);
-
- e_card_delivery_address_unref (delivery);
- e_card_address_label_unref (label);
-
- /* Phone numbers */
- get_next_init (&next_mail, &next_home, &next_work, &next_fax,
- &next_other, &next_main, &next_pager, &next_mobile);
-
- for (i = entryPhone1; i <= entryPhone5; i++) {
- int phonelabel = address.phoneLabel[i - entryPhone1];
- char *phonenum = get_entry_text (address, i);
-
- if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) {
- e_card_simple_set (simple, next_mail, phonenum);
- next_mail = get_next_mail (&next_mail);
- } else if (phonelabel == LABEL_HOME && !is_next_done (next_home)) {
- e_card_simple_set (simple, next_home, phonenum);
- next_home = get_next_home (&next_home);
- } else if (phonelabel == LABEL_WORK && !is_next_done (next_work)) {
- e_card_simple_set (simple, next_work, phonenum);
- next_work = get_next_work (&next_work);
- } else if (phonelabel == LABEL_FAX && !is_next_done (next_fax)) {
- e_card_simple_set (simple, next_fax, phonenum);
- next_fax = get_next_fax (&next_fax);
- } else if (phonelabel == LABEL_OTHER && !is_next_done (next_other)) {
- e_card_simple_set (simple, next_other, phonenum);
- next_other = get_next_other (&next_other);
- } else if (phonelabel == LABEL_MAIN && !is_next_done (next_main)) {
- e_card_simple_set (simple, next_main, phonenum);
- next_main = get_next_main (&next_main);
- } else if (phonelabel == LABEL_PAGER && !is_next_done (next_pager)) {
- e_card_simple_set (simple, next_pager, phonenum);
- next_pager = get_next_pager (&next_pager);
- } else if (phonelabel == LABEL_MOBILE && !is_next_done (next_mobile)) {
- e_card_simple_set (simple, next_mobile, phonenum);
- next_mobile = get_next_mobile (&next_mobile);
- }
-
- g_free (phonenum);
- }
-
- /* Note */
- txt = get_entry_text (address, entryNote);
- e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_NOTE, txt);
- g_free (txt);
-
- e_card_simple_sync_card (simple);
- g_object_unref(simple);
-
- free_Address(&address);
-
- return ecard;
-}
-
-static void
-check_for_slow_setting (GnomePilotConduit *c, EAddrConduitContext *ctxt)
-{
- GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c);
- int map_count;
- const char *uri;
-
- map_count = g_hash_table_size (ctxt->map->pid_map);
- if (map_count == 0)
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
-
- /* Or if the URI's don't match */
- uri = e_book_get_uri (ctxt->ebook);
- LOG (g_message (" Current URI %s (%s)\n", uri, ctxt->cfg->last_uri ? ctxt->cfg->last_uri : "<NONE>"));
- if (ctxt->cfg->last_uri != NULL && strcmp (ctxt->cfg->last_uri, uri)) {
- gnome_pilot_conduit_standard_set_slow (conduit, TRUE);
- e_pilot_map_clear (ctxt->map);
- }
-
- if (gnome_pilot_conduit_standard_get_slow (conduit)) {
- ctxt->map->write_touched_only = TRUE;
- LOG (g_message ( " doing slow sync\n" ));
- } else {
- LOG (g_message ( " doing fast sync\n" ));
- }
-}
-
-static void
-card_added (EBookView *book_view, const GList *cards, EAddrConduitContext *ctxt)
-{
- const GList *l;
-
- for (l = cards; l != NULL; l = l->next) {
- ECard *card = E_CARD (l->data);
- CardObjectChange *coc;
-
- if (e_card_evolution_list (card))
- continue;
-
- coc = g_new0 (CardObjectChange, 1);
- coc->card = card;
- coc->type = CARD_ADDED;
-
- g_object_ref (coc->card);
- ctxt->changed = g_list_prepend (ctxt->changed, coc);
- if (!e_pilot_map_uid_is_archived (ctxt->map, e_card_get_id (coc->card)))
- g_hash_table_insert (ctxt->changed_hash, (gpointer)e_card_get_id (coc->card), coc);
- }
-}
-
-static void
-card_changed (EBookView *book_view, const GList *cards, EAddrConduitContext *ctxt)
-{
- const GList *l;
-
- for (l = cards; l != NULL; l = l->next) {
- ECard *card = E_CARD (l->data);
- CardObjectChange *coc;
-
- if (e_card_evolution_list (card))
- continue;
-
- coc = g_new0 (CardObjectChange, 1);
- coc->card = E_CARD (l->data);
- coc->type = CARD_MODIFIED;
-
- g_object_ref (coc->card);
- ctxt->changed = g_list_prepend (ctxt->changed, coc);
- if (!e_pilot_map_uid_is_archived (ctxt->map, e_card_get_id (coc->card)))
- g_hash_table_insert (ctxt->changed_hash, (gpointer)e_card_get_id (coc->card), coc);
- }
-}
-
-
-static void
-card_removed (EBookView *book_view, GList *ids, EAddrConduitContext *ctxt)
-{
- GList *l;
-
- for (l = ids; l != NULL; l = l->next) {
- const char *id = l->data;
- CardObjectChange *coc;
- gboolean archived;
-
- archived = e_pilot_map_uid_is_archived (ctxt->map, id);
-
- /* If its deleted, not in the archive and not in the map its a list */
- if (!archived && e_pilot_map_lookup_pid (ctxt->map, id, FALSE) == 0)
- return;
-
- coc = g_new0 (CardObjectChange, 1);
- coc->card = e_card_new ("");
- e_card_set_id (coc->card, id);
- coc->type = CARD_DELETED;
-
- ctxt->changed = g_list_prepend (ctxt->changed, coc);
-
- if (!archived)
- g_hash_table_insert (ctxt->changed_hash, (gpointer)e_card_get_id (coc->card), coc);
- else
- e_pilot_map_remove_by_uid (ctxt->map, id);
- }
-}
-
-static void
-sequence_complete (EBookView *book_view, EBookViewStatus status, EAddrConduitContext *ctxt)
-{
- g_signal_handlers_disconnect_matched(book_view,
- G_SIGNAL_MATCH_DATA,
- 0, 0,
- NULL, NULL, ctxt);
- g_object_unref (book_view);
- gtk_main_quit ();
-}
-
-static void
-view_cb (EBook *book, EBookStatus status, EBookView *book_view, gpointer data)
-{
- EAddrConduitContext *ctxt = data;
-
- g_object_ref (book_view);
-
- g_signal_connect (book_view, "card_added",
- G_CALLBACK (card_added), ctxt);
- g_signal_connect (book_view, "card_changed",
- G_CALLBACK (card_changed), ctxt);
- g_signal_connect (book_view, "card_removed",
- G_CALLBACK (card_removed), ctxt);
- g_signal_connect (book_view, "sequence_complete",
- G_CALLBACK (sequence_complete), ctxt);
-
-}
-
-/* Pilot syncing callbacks */
-static gint
-pre_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- EAddrConduitContext *ctxt)
-{
- GnomePilotConduitSyncAbs *abs_conduit;
-/* GList *l; */
- int len;
- unsigned char *buf;
- char *filename;
- char *change_id;
-/* gint num_records; */
-
- abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit);
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
- LOG (g_message ( "pre_sync: Addressbook Conduit v.%s", CONDUIT_VERSION ));
- /* g_message ("Addressbook Conduit v.%s", CONDUIT_VERSION); */
-
- ctxt->dbi = dbi;
- ctxt->ebook = NULL;
-
- if (start_addressbook_server (ctxt) != 0) {
- WARN(_("Could not start wombat server"));
- gnome_pilot_conduit_error (conduit, _("Could not start wombat"));
- return -1;
- }
-
- /* Load the uid <--> pilot id mappings */
- filename = map_name (ctxt);
- e_pilot_map_read (filename, &ctxt->map);
- g_free (filename);
-
- /* Count and hash the changes */
- change_id = g_strdup_printf ("pilot-sync-evolution-addressbook-%d", ctxt->cfg->pilot_id);
- ctxt->changed_hash = g_hash_table_new (g_str_hash, g_str_equal);
- e_book_get_changes (ctxt->ebook, change_id, view_cb, ctxt);
-
- /* Force the view loading to be synchronous */
- gtk_main ();
- g_free (change_id);
-
- /* Set the count information */
-/* num_records = cal_client_get_n_objects (ctxt->client, CALOBJ_TYPE_TODO); */
-/* gnome_pilot_conduit_sync_abs_set_num_local_records(abs_conduit, num_records); */
-/* gnome_pilot_conduit_sync_abs_set_num_new_local_records (abs_conduit, add_records); */
-/* gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records); */
-/* gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records); */
-
- buf = (unsigned char*)g_malloc (0xffff);
- len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
- (unsigned char *)buf, 0xffff);
-
- if (len < 0) {
- WARN (_("Could not read pilot's Address application block"));
- WARN ("dlp_ReadAppBlock(...) = %d", len);
- gnome_pilot_conduit_error (conduit,
- _("Could not read pilot's Address application block"));
- return -1;
- }
- unpack_AddressAppInfo (&(ctxt->ai), buf, len);
- g_free (buf);
-
- check_for_slow_setting (conduit, ctxt);
- if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot
- || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot)
- ctxt->map->write_touched_only = TRUE;
-
- return 0;
-}
-
-static gint
-post_sync (GnomePilotConduit *conduit,
- GnomePilotDBInfo *dbi,
- EAddrConduitContext *ctxt)
-{
- gchar *filename, *change_id;
-
- LOG (g_message ( "post_sync: Address Conduit v.%s", CONDUIT_VERSION ));
-
- g_free (ctxt->cfg->last_uri);
- ctxt->cfg->last_uri = g_strdup (e_book_get_uri (ctxt->ebook));
- addrconduit_save_configuration (ctxt->cfg);
-
- filename = map_name (ctxt);
- e_pilot_map_write (filename, ctxt->map);
- g_free (filename);
-
- /* FIX ME ugly hack - our changes musn't count, this does introduce
- * a race condition if anyone changes a record elsewhere during sycnc
- */
- change_id = g_strdup_printf ("pilot-sync-evolution-addressbook-%d", ctxt->cfg->pilot_id);
- e_book_get_changes (ctxt->ebook, change_id, view_cb, ctxt);
- g_free (change_id);
- gtk_main ();
-
- LOG (g_message ( "---------------------------------------------------------\n" ));
-
- return 0;
-}
-
-static gint
-set_pilot_id (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- guint32 ID,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "set_pilot_id: setting to %d\n", ID ));
-
- e_pilot_map_insert (ctxt->map, ID, local->ecard->id, FALSE);
-
- return 0;
-}
-
-static gint
-set_status_cleared (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "set_status_cleared: clearing status\n" ));
-
- g_hash_table_remove (ctxt->changed_hash, e_card_get_id (local->ecard));
-
- return 0;
-}
-
-static gint
-for_each (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord **local,
- EAddrConduitContext *ctxt)
-{
- static GList *cards, *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, -1);
-
- if (*local == NULL) {
- LOG (g_message ( "beginning for_each" ));
-
- cards = ctxt->cards;
- count = 0;
-
- if (cards != NULL) {
- LOG (g_message ( "iterating over %d records", g_list_length (cards) ));
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, cards->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
-
- iterator = cards;
- } else {
- LOG (g_message ( "no events" ));
- (*local) = NULL;
- return 0;
- }
- } else {
- count++;
- if (g_list_next (iterator)) {
- iterator = g_list_next (iterator);
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, iterator->data, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each ending" ));
-
- /* Tell the pilot the iteration is over */
- *local = NULL;
-
- return 0;
- }
- }
-
- return 0;
-}
-
-static gint
-for_each_modified (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord **local,
- EAddrConduitContext *ctxt)
-{
- static GList *iterator;
- static int count;
-
- g_return_val_if_fail (local != NULL, 0);
-
- if (*local == NULL) {
- LOG (g_message ( "for_each_modified beginning\n" ));
-
- iterator = ctxt->changed;
-
- count = 0;
-
- iterator = next_changed_item (ctxt, iterator);
- if (iterator != NULL) {
- CardObjectChange *coc = iterator->data;
-
- LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash) ));
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, coc->card, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "no events" ));
-
- *local = NULL;
- }
- } else {
- count++;
- iterator = g_list_next (iterator);
- if (iterator && (iterator = next_changed_item (ctxt, iterator))) {
- CardObjectChange *coc = iterator->data;
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_ecard (*local, coc->card, ctxt);
- g_list_prepend (ctxt->locals, *local);
- } else {
- LOG (g_message ( "for_each_modified ending" ));
-
- /* Signal the iteration is over */
- *local = NULL;
-
- return 0;
- }
- }
-
- return 0;
-}
-
-static gint
-compare (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- GnomePilotRecord local_pilot;
- int retval = 0;
-
- LOG (g_message ("compare: local=%s remote=%s...\n",
- print_local (local), print_remote (remote)));
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (remote != NULL, -1);
-
- local_pilot = local_record_to_pilot_record (local, ctxt);
-
- if (remote->length != local_pilot.length
- || memcmp (local_pilot.record, remote->record, remote->length))
- retval = 1;
-
- if (retval == 0)
- LOG (g_message ( " equal" ));
- else
- LOG (g_message ( " not equal" ));
-
- return retval;
-}
-
-static gint
-add_record (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- ECard *ecard;
- CardObjectChangeStatus cons;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) ));
-
- ecard = ecard_from_remote_record (ctxt, remote, NULL);
-
- /* add the ecard to the server */
- e_book_add_card (ctxt->ebook, ecard, add_card_cb, &cons);
-
- gtk_main(); /* enter sub mainloop */
-
- if (cons.status != E_BOOK_STATUS_SUCCESS) {
- WARN ("add_record: failed to add card to ebook\n");
- return -1;
- }
-
- e_card_set_id (ecard, cons.id);
- e_pilot_map_insert (ctxt->map, remote->ID, ecard->id, FALSE);
-
- g_object_unref (ecard);
-
- return retval;
-}
-
-static gint
-replace_record (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- ECard *new_ecard;
- EBookStatus commit_status;
- CardObjectChange *coc;
- CardObjectChangeStatus cons;
- char *old_id;
- int retval = 0;
-
- g_return_val_if_fail (remote != NULL, -1);
-
- LOG (g_message ("replace_record: replace %s with %s\n",
- print_local (local), print_remote (remote)));
-
- old_id = g_strdup (e_card_get_id (local->ecard));
- coc = g_hash_table_lookup (ctxt->changed_hash, old_id);
-
- new_ecard = ecard_from_remote_record (ctxt, remote, local->ecard);
- g_object_unref (local->ecard);
- local->ecard = new_ecard;
-
- if (coc && coc->type == CARD_DELETED)
- e_book_add_card (ctxt->ebook, local->ecard, add_card_cb, &cons);
- else
- e_book_commit_card (ctxt->ebook, local->ecard, status_cb, &commit_status);
-
- gtk_main (); /* enter sub mainloop */
-
- /* Adding a record causes wombat to assign a new uid so we must tidy */
- if (coc && coc->type == CARD_DELETED) {
- gboolean arch = e_pilot_map_uid_is_archived (ctxt->map, e_card_get_id (local->ecard));
-
- e_card_set_id (local->ecard, cons.id);
- e_pilot_map_insert (ctxt->map, remote->ID, cons.id, arch);
-
- coc = g_hash_table_lookup (ctxt->changed_hash, old_id);
- if (coc) {
- g_hash_table_remove (ctxt->changed_hash, e_card_get_id (coc->card));
- g_object_unref (coc->card);
- g_object_ref (local->ecard);
- coc->card = local->ecard;
- g_hash_table_insert (ctxt->changed_hash, (gpointer)e_card_get_id (coc->card), coc);
- }
-
- commit_status = cons.status;
- }
-
- if (commit_status != E_BOOK_STATUS_SUCCESS)
- WARN ("replace_record: failed to update card in ebook\n");
-
- return retval;
-}
-
-static gint
-delete_record (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- EBookStatus commit_status;
- int retval = 0;
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (local->ecard != NULL, -1);
-
- LOG (g_message ( "delete_record: delete %s\n", print_local (local) ));
-
- e_pilot_map_remove_by_uid (ctxt->map, local->ecard->id);
- e_book_remove_card_by_id (ctxt->ebook, local->ecard->id, status_cb, &commit_status);
-
- gtk_main (); /* enter sub mainloop */
-
- if (commit_status != E_BOOK_STATUS_SUCCESS && commit_status != E_BOOK_STATUS_CARD_NOT_FOUND)
- WARN ("delete_record: failed to delete card in ebook\n");
-
- return retval;
-}
-
-static gint
-archive_record (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- gboolean archive,
- EAddrConduitContext *ctxt)
-{
- int retval = 0;
-
- g_return_val_if_fail (local != NULL, -1);
-
- LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" ));
-
- e_pilot_map_insert (ctxt->map, local->local.ID, local->ecard->id, archive);
-
- return retval;
-}
-
-static gint
-match (GnomePilotConduitSyncAbs *conduit,
- GnomePilotRecord *remote,
- EAddrLocalRecord **local,
- EAddrConduitContext *ctxt)
-{
- const char *uid;
-
- LOG (g_message ("match: looking for local copy of %s\n",
- print_remote (remote)));
-
- g_return_val_if_fail (local != NULL, -1);
- g_return_val_if_fail (remote != NULL, -1);
-
- *local = NULL;
- uid = e_pilot_map_lookup_uid (ctxt->map, remote->ID, TRUE);
-
- if (!uid)
- return 0;
-
- LOG (g_message ( " matched\n" ));
-
- *local = g_new0 (EAddrLocalRecord, 1);
- local_record_from_uid (*local, uid, ctxt);
-
- return 0;
-}
-
-static gint
-free_match (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "free_match: freeing\n" ));
-
- g_return_val_if_fail (local != NULL, -1);
-
- addrconduit_destroy_record (local);
-
- return 0;
-}
-
-static gint
-prepare (GnomePilotConduitSyncAbs *conduit,
- EAddrLocalRecord *local,
- GnomePilotRecord *remote,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "prepare: encoding local %s\n", print_local (local) ));
-
- *remote = local_record_to_pilot_record (local, ctxt);
-
- return 0;
-}
-
-/* Pilot Settings Callbacks */
-static void
-fill_widgets (EAddrConduitContext *ctxt)
-{
- e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps),
- ctxt->cfg->secret);
-
- e_addr_gui_fill_widgets (ctxt->gui, ctxt->cfg);
-}
-
-static gint
-create_settings_window (GnomePilotConduit *conduit,
- GtkWidget *parent,
- EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "create_settings_window" ));
-
- ctxt->ps = e_pilot_settings_new ();
- ctxt->gui = e_addr_gui_new (E_PILOT_SETTINGS (ctxt->ps));
-
- gtk_container_add (GTK_CONTAINER (parent), ctxt->ps);
- gtk_widget_show (ctxt->ps);
-
- fill_widgets (ctxt);
-
- return 0;
-}
-static void
-display_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "display_settings" ));
-
- fill_widgets (ctxt);
-}
-
-static void
-save_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "save_settings" ));
-
- ctxt->new_cfg->secret =
- e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps));
- e_addr_gui_fill_config (ctxt->gui, ctxt->new_cfg);
-
- addrconduit_save_configuration (ctxt->new_cfg);
-}
-
-static void
-revert_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt)
-{
- LOG (g_message ( "revert_settings" ));
-
- addrconduit_save_configuration (ctxt->cfg);
- addrconduit_destroy_configuration (ctxt->new_cfg);
- ctxt->new_cfg = addrconduit_dupe_configuration (ctxt->cfg);
-}
-
-GnomePilotConduit *
-conduit_get_gpilot_conduit (guint32 pilot_id)
-{
- GtkObject *retval;
- EAddrConduitContext *ctxt;
-
- LOG (g_message ( "in address's conduit_get_gpilot_conduit\n" ));
-
- retval = gnome_pilot_conduit_sync_abs_new ("AddressDB", 0x61646472);
- g_assert (retval != NULL);
-
- ctxt = e_addr_context_new (pilot_id);
- gtk_object_set_data (GTK_OBJECT (retval), "addrconduit_context", ctxt);
-
- gtk_signal_connect (retval, "pre_sync", (GtkSignalFunc) pre_sync, ctxt);
- gtk_signal_connect (retval, "post_sync", (GtkSignalFunc) post_sync, ctxt);
-
- gtk_signal_connect (retval, "set_pilot_id", (GtkSignalFunc) set_pilot_id, ctxt);
- gtk_signal_connect (retval, "set_status_cleared", (GtkSignalFunc) set_status_cleared, ctxt);
-
- gtk_signal_connect (retval, "for_each", (GtkSignalFunc) for_each, ctxt);
- gtk_signal_connect (retval, "for_each_modified", (GtkSignalFunc) for_each_modified, ctxt);
- gtk_signal_connect (retval, "compare", (GtkSignalFunc) compare, ctxt);
-
- gtk_signal_connect (retval, "add_record", (GtkSignalFunc) add_record, ctxt);
- gtk_signal_connect (retval, "replace_record", (GtkSignalFunc) replace_record, ctxt);
- gtk_signal_connect (retval, "delete_record", (GtkSignalFunc) delete_record, ctxt);
- gtk_signal_connect (retval, "archive_record", (GtkSignalFunc) archive_record, ctxt);
-
- gtk_signal_connect (retval, "match", (GtkSignalFunc) match, ctxt);
- gtk_signal_connect (retval, "free_match", (GtkSignalFunc) free_match, ctxt);
-
- gtk_signal_connect (retval, "prepare", (GtkSignalFunc) prepare, ctxt);
-
- /* Gui Settings */
- gtk_signal_connect (retval, "create_settings_window", (GtkSignalFunc) create_settings_window, ctxt);
- gtk_signal_connect (retval, "display_settings", (GtkSignalFunc) display_settings, ctxt);
- gtk_signal_connect (retval, "save_settings", (GtkSignalFunc) save_settings, ctxt);
- gtk_signal_connect (retval, "revert_settings", (GtkSignalFunc) revert_settings, ctxt);
-
- return GNOME_PILOT_CONDUIT (retval);
-}
-
-void
-conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit)
-{
- EAddrConduitContext *ctxt;
-
- ctxt = gtk_object_get_data (GTK_OBJECT (conduit),
- "addrconduit_context");
-
- e_addr_context_destroy (ctxt);
-
- gtk_object_destroy (GTK_OBJECT (conduit));
-}
diff --git a/addressbook/conduit/e-address.conduit.in b/addressbook/conduit/e-address.conduit.in
deleted file mode 100644
index e5a5ab765e..0000000000
--- a/addressbook/conduit/e-address.conduit.in
+++ /dev/null
@@ -1,9 +0,0 @@
-<gnome-pilot-conduit version="1.0">
- <conduit id="e_address_conduit" type="shlib" location="@prefix@/lib/gnome-pilot/conduits/libeaddress_conduit.so"/>
- <name value="EAddress"/>
- <conduit-attribute name="description" value="Synchronizes Addressbook with Evolution"/>
- <conduit-attribute name="default-synctype" value="synchronize"/>
- <conduit-attribute name="valid-synctypes" value="synchronize copy_from_pilot copy_to_pilot"/>
- <conduit-attribute name="settings" value="TRUE"/>
- <conduit-attribute name="icon" value="@datadir@/images/evolution/conduits/48_evo-address-conduit.png"/>
-</gnome-pilot-conduit>
diff --git a/addressbook/gui/.cvsignore b/addressbook/gui/.cvsignore
deleted file mode 100644
index 09980ae6ba..0000000000
--- a/addressbook/gui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/gui/Makefile.am b/addressbook/gui/Makefile.am
deleted file mode 100644
index 6b0850da5d..0000000000
--- a/addressbook/gui/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = contact-editor contact-list-editor merging widgets search component
diff --git a/addressbook/gui/component/.cvsignore b/addressbook/gui/component/.cvsignore
deleted file mode 100644
index 7f76d480fb..0000000000
--- a/addressbook/gui/component/.cvsignore
+++ /dev/null
@@ -1,14 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-evolution-addressbook
-evolution-addressbook.pure
-test-addressbook
-GNOME_Evolution_Addressbook.server
-GNOME_Evolution_Addressbook.server.in
-addressbook-marshal.c
-addressbook-marshal.h
diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
deleted file mode 100644
index 6d46c5fbbe..0000000000
--- a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in
+++ /dev/null
@@ -1,123 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Factory"
- type="shlib"
- location="@COMPONENTDIR@/libevolution-addressbook.so">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_MiniCard_Control"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Bonobo/PersistStream:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="text/vcard"/>
- <item value="text/x-vcard"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook card viewer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Control"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/addressbook-control:1.0"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook folder viewer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_ShellComponent"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/ShellComponent:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook component"/>
-
- <oaf_attribute name="evolution:shell_component_icon" type="string"
- value="evolution-contacts.png"/>
- <oaf_attribute name="evolution:shell_component_launch_order" type="number"
- value="2"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_AddressWidget"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/address-widget:1.0"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook address viewer"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_AddressPopup"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:BonoboControl/address-widget:1.0"/>
- <item value="IDL:GNOME/Control:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook address pop-up"/>
-
-</oaf_server>
-
-<oaf_server iid="OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/ConfigControl:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution:config_item:title" type="string"
- _value="Directory Servers"/>
-
- <oaf_attribute name="evolution:config_item:description" type="string"
- _value="Configure access to LDAP directory servers here"/>
-
- <oaf_attribute name="evolution:config_item:icon_name" type="string"
- value="ldap-settings.png"/>
-
- <oaf_attribute name="evolution:config_item:type" type="stringv">
- <item value="contacts/ldap"/>
- </oaf_attribute>
-
- <oaf_attribute name="evolution:config_item:priority" type="string" value="-6"/>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook LDAP Configuration Control"/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
deleted file mode 100644
index e13f8d853b..0000000000
--- a/addressbook/gui/component/Makefile.am
+++ /dev/null
@@ -1,107 +0,0 @@
-SUBDIRS = select-names
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-addressbook\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/shell \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_srcdir)/addressbook/gui/contact-editor \
- -I$(top_srcdir)/addressbook/gui/contact-list-editor \
- -I$(top_srcdir)/addressbook/gui/minicard \
- -I$(top_srcdir)/addressbook/gui/widgets \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- $(LDAP_CFLAGS) \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-component_LTLIBRARIES = libevolution-addressbook.la
-
-libevolution_addressbook_la_SOURCES = \
- addressbook-component.c \
- addressbook-component.h \
- addressbook-config.c \
- addressbook-config.h \
- addressbook-storage.c \
- addressbook-storage.h \
- addressbook.c \
- addressbook.h \
- component-factory.c \
- e-cardlist-model.c \
- e-cardlist-model.h \
- e-address-widget.h \
- e-address-widget.c \
- e-address-popup.h \
- e-address-popup.c
-
-libevolution_addressbook_la_LIBADD = \
- select-names/libeselectnames.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/addressbook/gui/widgets/libeminicard.la \
- $(top_builddir)/addressbook/printing/libecontactprint.la \
- $(top_builddir)/addressbook/gui/search/libeaddressbooksearch.la \
- $(top_builddir)/filter/libfilter.la \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \
- $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/addressbook/gui/merging/libecardmerging.la \
- $(top_builddir)/widgets/menus/libmenus.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS) $(LDAP_LIBS)
-
-
-
-libevolution_addressbook_la_LDFLAGS = -module -avoid-version
-
-# GConf schemas
-
-schemadir = $(GCONF_SCHEMA_FILE_DIR)
-schema_DATA = apps_evolution_addressbook.schemas
-
-install-data-local:
- if test -z "$(DESTDIR)" ; then \
- for p in $(schema_DATA) ; do \
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p; \
- done \
- fi
-
-server_in_files = GNOME_Evolution_Addressbook.server.in.in
-server_DATA = $(server_in_files:.server.in.in=.server)
-%.server.in: %.server.in.in
- sed -e "s|\@COMPONENTDIR\@|$(componentdir)|" $< > $@
-
-@INTLTOOL_SERVER_RULE@
-
-glade_DATA = ldap-config.glade
-
-BUILT_SOURCES = $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- $(glade_DATA) \
- $(schema_DATA) \
- $(server_DATA) \
- $(server_in_files)
-
-if ENABLE_PURIFY
-PLINK = $(LIBTOOL) --mode=link $(PURIFY) $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-
-all-local: evolution-addressbook.pure
-
-evolution-addressbook.pure: evolution-addressbook
- @rm -f evolution-addressbook.pure
- $(PLINK) $(evolution_addressbook_LDFLAGS) $(evolution_addressbook_OBJECTS) $(evolution_addressbook_LDADD) $(LIBS)
-
-endif
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
deleted file mode 100644
index f90df5f65a..0000000000
--- a/addressbook/gui/component/addressbook-component.c
+++ /dev/null
@@ -1,641 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* addressbook-component.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <libgnomevfs/gnome-vfs-types.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-directory.h>
-#include <libgnomevfs/gnome-vfs-file-info.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-main.h>
-
-#include "evolution-shell-component.h"
-#include "evolution-shell-component-dnd.h"
-#include "evolution-storage.h"
-#include "e-folder-list.h"
-
-#include "ebook/e-book.h"
-#include "ebook/e-card.h"
-#include "ebook/e-book-util.h"
-
-#include "addressbook-config.h"
-#include "addressbook-storage.h"
-#include "addressbook-component.h"
-#include "addressbook.h"
-#include "addressbook/gui/merging/e-card-merging.h"
-#include "addressbook/gui/widgets/e-addressbook-util.h"
-
-
-
-#define GNOME_EVOLUTION_ADDRESSBOOK_COMPONENT_ID "OAFIID:GNOME_Evolution_Addressbook_ShellComponent"
-
-EvolutionShellClient *global_shell_client = NULL;
-
-EvolutionShellClient *
-addressbook_component_get_shell_client (void)
-{
- return global_shell_client;
-}
-
-static char *accepted_dnd_types[] = {
- "text/x-vcard",
- NULL
-};
-
-static const EvolutionShellComponentFolderType folder_types[] = {
- { "contacts", "evolution-contacts.png", N_("Contacts"), N_("Folder containing contact information"),
- TRUE, accepted_dnd_types, NULL },
- { "contacts/ldap", "ldap.png", N_("LDAP Server"), N_("LDAP server containing contact information"),
- FALSE, accepted_dnd_types, NULL },
- { "contacts/public", "evolution-contacts.png", N_("Public Contacts"), N_("Public folder containing contact information"),
- FALSE, accepted_dnd_types, NULL },
- { NULL }
-};
-
-#define IS_CONTACT_TYPE(x) (g_ascii_strcasecmp((x), "contacts") == 0 || g_ascii_strcasecmp ((x), "contacts/ldap") == 0 || g_ascii_strcasecmp((x), "contacts/public") == 0)
-
-/* EvolutionShellComponent methods and signals. */
-
-static EvolutionShellComponentResult
-create_view (EvolutionShellComponent *shell_component,
- const char *physical_uri,
- const char *type,
- const char *view_info,
- BonoboControl **control_return,
- void *closure)
-{
- BonoboControl *control;
-
- if (!IS_CONTACT_TYPE (type))
- return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE;
-
- control = addressbook_new_control ();
- bonobo_control_set_property (control, NULL, "folder_uri", TC_CORBA_string, physical_uri, NULL);
-
- *control_return = control;
-
- return EVOLUTION_SHELL_COMPONENT_OK;
-}
-
-static void
-create_folder (EvolutionShellComponent *shell_component,
- const char *physical_uri,
- const char *type,
- const GNOME_Evolution_ShellComponentListener listener,
- void *closure)
-{
- CORBA_Environment ev;
- GNOME_Evolution_ShellComponentListener_Result result;
-
- if (!IS_CONTACT_TYPE (type))
- result = GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE;
- else
- result = GNOME_Evolution_ShellComponentListener_OK;
-
- CORBA_exception_init(&ev);
- GNOME_Evolution_ShellComponentListener_notifyResult(listener, result, &ev);
- CORBA_exception_free(&ev);
-}
-
-static void
-remove_folder (EvolutionShellComponent *shell_component,
- const char *physical_uri,
- const char *type,
- const GNOME_Evolution_ShellComponentListener listener,
- void *closure)
-{
- CORBA_Environment ev;
- char *db_path, *summary_path, *subdir_path;
- struct stat sb;
- int rv;
-
- CORBA_exception_init(&ev);
-
- if (!IS_CONTACT_TYPE (type)) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE,
- &ev);
- CORBA_exception_free(&ev);
- return;
- }
-
- if (!strncmp (physical_uri, "ldap://", 7)) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_UNSUPPORTED_OPERATION,
- &ev);
- CORBA_exception_free(&ev);
- return;
- }
- if (strncmp (physical_uri, "file://", 7)) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_INVALID_URI,
- &ev);
- CORBA_exception_free(&ev);
- return;
- }
-
- subdir_path = g_build_filename (physical_uri + 7, "subfolders", NULL);
- rv = stat (subdir_path, &sb);
- g_free (subdir_path);
- if (rv != -1) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_HAS_SUBFOLDERS,
- &ev);
- CORBA_exception_free(&ev);
- return;
- }
-
- db_path = g_build_filename (physical_uri + 7, "addressbook.db", NULL);
- summary_path = g_build_filename (physical_uri + 7, "addressbook.db.summary", NULL);
- rv = unlink (db_path);
-
- if (rv == 0 || (rv == -1 && errno == ENOENT))
- rv = unlink (summary_path);
-
- if (rv == 0 || (rv == -1 && errno == ENOENT)) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_OK,
- &ev);
- }
- else {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED,
- &ev);
- }
-
- g_free (db_path);
- g_free (summary_path);
-
- CORBA_exception_free(&ev);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-/* This code is cut & pasted from calendar/gui/component-factory.c */
-
-static GNOME_Evolution_ShellComponentListener_Result
-xfer_file (GnomeVFSURI *base_src_uri,
- GnomeVFSURI *base_dest_uri,
- const char *file_name,
- int remove_source)
-{
- GnomeVFSURI *src_uri, *dest_uri;
- GnomeVFSHandle *hin, *hout;
- GnomeVFSResult result;
- GnomeVFSFileInfo file_info;
- GnomeVFSFileSize size;
- char *buffer;
-
- src_uri = gnome_vfs_uri_append_file_name (base_src_uri, file_name);
-
- result = gnome_vfs_open_uri (&hin, src_uri, GNOME_VFS_OPEN_READ);
- if (result == GNOME_VFS_ERROR_NOT_FOUND) {
- gnome_vfs_uri_unref (src_uri);
- return GNOME_Evolution_ShellComponentListener_OK; /* No need to xfer anything. */
- }
- if (result != GNOME_VFS_OK) {
- gnome_vfs_uri_unref (src_uri);
- return GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED;
- }
-
- result = gnome_vfs_get_file_info_uri (src_uri, &file_info, GNOME_VFS_FILE_INFO_DEFAULT);
- if (result != GNOME_VFS_OK) {
- gnome_vfs_uri_unref (src_uri);
- return GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED;
- }
-
- dest_uri = gnome_vfs_uri_append_file_name (base_dest_uri, file_name);
-
- result = gnome_vfs_create_uri (&hout, dest_uri, GNOME_VFS_OPEN_WRITE, FALSE, 0600);
- if (result != GNOME_VFS_OK) {
- gnome_vfs_close (hin);
- gnome_vfs_uri_unref (src_uri);
- gnome_vfs_uri_unref (dest_uri);
- return GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED;
- }
-
- /* write source file to destination file */
- buffer = g_malloc (file_info.size);
- result = gnome_vfs_read (hin, buffer, file_info.size, &size);
- if (result != GNOME_VFS_OK) {
- gnome_vfs_close (hin);
- gnome_vfs_close (hout);
- gnome_vfs_uri_unref (src_uri);
- gnome_vfs_uri_unref (dest_uri);
- g_free (buffer);
- return GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED;
- }
-
- result = gnome_vfs_write (hout, buffer, file_info.size, &size);
- if (result != GNOME_VFS_OK) {
- gnome_vfs_close (hin);
- gnome_vfs_close (hout);
- gnome_vfs_uri_unref (src_uri);
- gnome_vfs_uri_unref (dest_uri);
- g_free (buffer);
- return GNOME_Evolution_ShellComponentListener_PERMISSION_DENIED;
- }
-
- if (remove_source) {
- char *text_uri;
-
- /* Sigh, we have to do this as there is no gnome_vfs_unlink_uri(). :-( */
-
- text_uri = gnome_vfs_uri_to_string (src_uri, GNOME_VFS_URI_HIDE_NONE);
- result = gnome_vfs_unlink (text_uri);
- g_free (text_uri);
- }
-
- gnome_vfs_close (hin);
- gnome_vfs_close (hout);
- gnome_vfs_uri_unref (src_uri);
- gnome_vfs_uri_unref (dest_uri);
- g_free (buffer);
-
- return GNOME_Evolution_ShellComponentListener_OK;
-}
-
-static void
-xfer_folder (EvolutionShellComponent *shell_component,
- const char *source_physical_uri,
- const char *destination_physical_uri,
- const char *type,
- gboolean remove_source,
- const GNOME_Evolution_ShellComponentListener listener,
- void *closure)
-{
- CORBA_Environment ev;
-
- GnomeVFSURI *src_uri;
- GnomeVFSURI *dest_uri;
- GnomeVFSResult result;
-
- CORBA_exception_init (&ev);
-
- if (!IS_CONTACT_TYPE (type)) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_UNSUPPORTED_TYPE,
- &ev);
- CORBA_exception_free(&ev);
- return;
- }
-
- if (!strncmp (source_physical_uri, "ldap://", 7)
- || !strncmp (destination_physical_uri, "ldap://", 7)) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_UNSUPPORTED_OPERATION,
- &ev);
- CORBA_exception_free(&ev);
- return;
- }
-
- if (strncmp (source_physical_uri, "file://", 7)
- || strncmp (destination_physical_uri, "file://", 7)) {
- GNOME_Evolution_ShellComponentListener_notifyResult (listener,
- GNOME_Evolution_ShellComponentListener_INVALID_URI,
- &ev);
- CORBA_exception_free(&ev);
- return;
- }
-
- /* check URIs */
- src_uri = gnome_vfs_uri_new (source_physical_uri);
- dest_uri = gnome_vfs_uri_new (destination_physical_uri);
- if (!src_uri || ! dest_uri) {
- GNOME_Evolution_ShellComponentListener_notifyResult (
- listener,
- GNOME_Evolution_ShellComponentListener_INVALID_URI,
- &ev);
- gnome_vfs_uri_unref (src_uri);
- gnome_vfs_uri_unref (dest_uri);
- CORBA_exception_free (&ev);
- return;
- }
-
- result = xfer_file (src_uri, dest_uri, "addressbook.db", remove_source);
-
- if ((result == GNOME_Evolution_ShellComponentListener_OK) && remove_source) {
- char *summary_uri;
-
- summary_uri = g_strconcat (source_physical_uri, "/addressbook.db.summary", NULL);
- result = gnome_vfs_unlink (summary_uri);
- g_free (summary_uri);
- }
-
- GNOME_Evolution_ShellComponentListener_notifyResult (listener, result, &ev);
-
- gnome_vfs_uri_unref (src_uri);
- gnome_vfs_uri_unref (dest_uri);
-
- CORBA_exception_free (&ev);
-}
-
-static char*
-get_dnd_selection (EvolutionShellComponent *shell_component,
- const char *physical_uri,
- int type,
- int *format_return,
- const char **selection_return,
- int *selection_length_return,
- void *closure)
-{
- /* g_print ("should get dnd selection for %s\n", physical_uri); */
- return NULL;
-}
-
-static int owner_count = 0;
-
-static void
-owner_set_cb (EvolutionShellComponent *shell_component,
- EvolutionShellClient *shell_client,
- const char *evolution_homedir,
- gpointer user_data)
-{
- owner_count ++;
-
- if (global_shell_client == NULL)
- global_shell_client = shell_client;
-
- addressbook_storage_setup (shell_component, evolution_homedir);
-}
-
-static void
-owner_unset_cb (EvolutionShellComponent *shell_component,
- GNOME_Evolution_Shell shell_interface,
- gpointer user_data)
-{
- owner_count --;
-
- if (owner_count == 0)
- global_shell_client = NULL;
-
- addressbook_storage_cleanup ();
-}
-
-/* FIXME We should perhaps take the time to figure out if the book is editable. */
-static void
-new_item_cb (EBook *book, gpointer closure)
-{
- gboolean is_list = GPOINTER_TO_INT (closure);
- if (book == NULL)
- return;
- if (is_list)
- e_addressbook_show_contact_list_editor (book, e_card_new(""), TRUE, TRUE);
- else
- e_addressbook_show_contact_editor (book, e_card_new(""), TRUE, TRUE);
-}
-
-static void
-user_create_new_item_cb (EvolutionShellComponent *shell_component,
- const char *id,
- const char *parent_folder_physical_uri,
- const char *parent_folder_type,
- gpointer data)
-{
- gboolean is_contact_list;
- if (!strcmp (id, "contact")) {
- is_contact_list = FALSE;
- } else if (!strcmp (id, "contact_list")) {
- is_contact_list = TRUE;
- } else {
- g_warning ("Don't know how to create item of type \"%s\"", id);
- return;
- }
- if (IS_CONTACT_TYPE (parent_folder_type)) {
- e_book_use_address_book_by_uri (parent_folder_physical_uri,
- new_item_cb, GINT_TO_POINTER (is_contact_list));
- } else {
- e_book_use_default_book (new_item_cb, GINT_TO_POINTER (is_contact_list));
- }
-}
-
-
-/* Destination side DnD */
-
-static CORBA_boolean
-destination_folder_handle_motion (EvolutionShellComponentDndDestinationFolder *folder,
- const char *physical_uri,
- const char *folder_type,
- const GNOME_Evolution_ShellComponentDnd_DestinationFolder_Context * destination_context,
- GNOME_Evolution_ShellComponentDnd_Action * suggested_action_return,
- gpointer user_data)
-{
- *suggested_action_return = GNOME_Evolution_ShellComponentDnd_ACTION_MOVE;
- return TRUE;
-}
-
-static void
-dnd_drop_book_open_cb (EBook *book, EBookStatus status, GList *card_list)
-{
- GList *l;
-
- for (l = card_list; l; l = l->next) {
- ECard *card = l->data;
-
- e_card_merging_book_add_card (book, card, NULL /* XXX */, NULL);
- }
-}
-
-static CORBA_boolean
-destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *folder,
- const char *physical_uri,
- const char *folder_type,
- const GNOME_Evolution_ShellComponentDnd_DestinationFolder_Context * destination_context,
- const GNOME_Evolution_ShellComponentDnd_Action action,
- const GNOME_Evolution_ShellComponentDnd_Data * data,
- gpointer user_data)
-{
- EBook *book;
- GList *card_list;
- char *expanded_uri;
-
- if (action == GNOME_Evolution_ShellComponentDnd_ACTION_LINK)
- return FALSE; /* we can't create links in our addressbook format */
-
- /* g_print ("in destination_folder_handle_drop (%s)\n", physical_uri); */
-
- card_list = e_card_load_cards_from_string_with_default_charset (data->bytes._buffer, "ISO-8859-1");
-
- expanded_uri = e_book_expand_uri (physical_uri);
-
- book = e_book_new ();
- addressbook_load_uri (book, expanded_uri,
- (EBookCallback)dnd_drop_book_open_cb, card_list);
-
- g_free (expanded_uri);
-
- return TRUE;
-}
-
-
-/* Quitting. */
-
-static gboolean
-request_quit (EvolutionShellComponent *shell_component,
- void *data)
-{
- if (! e_contact_editor_request_close_all ()
- || ! e_contact_list_editor_request_close_all ())
- return FALSE;
- else
- return TRUE;
-}
-
-
-/* The factory function. */
-
-static void
-add_creatable_item (EvolutionShellComponent *shell_component,
- const char *id,
- const char *description,
- const char *menu_description,
- const char *tooltip,
- char menu_shortcut,
- const char *icon_name)
-{
- char *icon_path;
- GdkPixbuf *icon;
-
- if (icon_name == NULL) {
- icon_path = NULL;
- icon = NULL;
- } else {
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, icon_name, NULL);
- icon = gdk_pixbuf_new_from_file (icon_path, NULL);
- }
-
- evolution_shell_component_add_user_creatable_item (shell_component,
- id,
- description,
- menu_description,
- tooltip,
- "contacts",
- menu_shortcut,
- icon);
-
-
- if (icon != NULL)
- gdk_pixbuf_unref (icon);
- g_free (icon_path);
-}
-
-static BonoboObject *
-create_component (void)
-{
- EvolutionShellComponent *shell_component;
- EvolutionShellComponentDndDestinationFolder *destination_interface;
-
- shell_component = evolution_shell_component_new (folder_types, NULL,
- create_view, create_folder,
- remove_folder, xfer_folder,
- NULL, NULL,
- get_dnd_selection,
- request_quit,
- NULL);
-
- destination_interface = evolution_shell_component_dnd_destination_folder_new (destination_folder_handle_motion,
- destination_folder_handle_drop,
- shell_component);
-
- bonobo_object_add_interface (BONOBO_OBJECT (shell_component),
- BONOBO_OBJECT (destination_interface));
-
- add_creatable_item (shell_component, "contact",
- _("New Contact"), _("_Contact"),
- _("Create a new contact"), 'c',
- "evolution-contacts-mini.png");
- add_creatable_item (shell_component, "contact_list",
- _("New Contact List"), _("Contact _List"),
- _("Create a new contact list"), 'l',
- "contact-list-16.png");
-
- g_signal_connect (shell_component, "owner_set",
- G_CALLBACK (owner_set_cb), NULL);
- g_signal_connect (shell_component, "owner_unset",
- G_CALLBACK (owner_unset_cb), NULL);
- g_signal_connect (shell_component, "user_create_new_item",
- G_CALLBACK (user_create_new_item_cb), NULL);
-
- return BONOBO_OBJECT (shell_component);
-}
-
-static void
-ensure_completion_uris_exist()
-{
- /* Initialize the completion uris if they aren't set yet. The
- default set is just the local Contacts folder. */
- EConfigListener *db;
- char *val;
-
- db = e_book_get_config_database ();
-
- val = e_config_listener_get_string (db, "/apps/evolution/addressbook/completion/uris");
-
- if (val && !*val) {
- g_free (val);
- val = NULL;
- }
-
- if (!val) {
- EFolderListItem f[2];
- char *dirname, *uri;
- /* in the case where the user is running for the first
- time, populate the list with the local contact
- folder */
- dirname = g_build_filename (g_get_home_dir (), "evolution/local/Contacts", NULL);
- uri = g_strdup_printf ("file://%s", dirname);
-
- f[0].uri = "evolution:/local/Contacts";
- f[0].physical_uri = uri;
- f[0].display_name = _("Contacts");
-
- memset (&f[1], 0, sizeof (f[1]));
-
- val = e_folder_list_create_xml (f);
-
- g_free (dirname);
- g_free (uri);
- e_config_listener_set_string (db, "/apps/evolution/addressbook/completion/uris", val);
- }
-
- g_free (val);
-}
-
-
-/* FIXME this is wrong. */
-BonoboObject *
-addressbook_component_init (void)
-{
- ensure_completion_uris_exist ();
- return create_component ();
-}
diff --git a/addressbook/gui/component/addressbook-component.h b/addressbook/gui/component/addressbook-component.h
deleted file mode 100644
index 4c6f0cdd8b..0000000000
--- a/addressbook/gui/component/addressbook-component.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* addressbook-component.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifndef _ADDRESSBOOK_COMPONENT_H
-#define _ADDRESSBOOK_COMPONENT_H
-
-#include "evolution-shell-component.h"
-#include "evolution-storage.h"
-
-BonoboObject *addressbook_component_init (void);
-EvolutionShellClient *addressbook_component_get_shell_client (void);
-
-#endif /* _ADDRESSBOOK_COMPONENT_H */
diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c
deleted file mode 100644
index e2855ac7f4..0000000000
--- a/addressbook/gui/component/addressbook-config.c
+++ /dev/null
@@ -1,1766 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- **/
-
-/*#define STANDALONE*/
-/*#define NEW_ADVANCED_UI*/
-
-#include <config.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <sys/time.h>
-
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-druid.h>
-#include <libgnomeui/gnome-druid-page.h>
-
-#include <bonobo/bonobo-generic-factory.h>
-
-#include <glade/glade.h>
-
-#include "addressbook.h"
-#include "addressbook-component.h"
-#include "addressbook-config.h"
-#include "addressbook-storage.h"
-
-#include "evolution-config-control.h"
-#include <shell/e-folder-list.h>
-
-#include <gal/e-table/e-table-memory-store.h>
-#include <gal/e-table/e-table-scrolled.h>
-
-
-#ifdef HAVE_LDAP
-#include "ldap.h"
-#include "ldap_schema.h"
-#endif
-
-#define LDAP_PORT_STRING "389"
-#define LDAPS_PORT_STRING "636"
-
-#define GLADE_FILE_NAME "ldap-config.glade"
-#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory"
-#define LDAP_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl"
-
-#ifdef HAVE_LDAP
-GtkWidget* addressbook_dialog_create_sources_table (char *name, char *string1, char *string2,
- int num1, int num2);
-GtkWidget* supported_bases_create_table (char *name, char *string1, char *string2,
- int num1, int num2);
-
-#ifdef NEW_ADVANCED_UI
-GtkWidget* objectclasses_create_server_table (char *name, char *string1, char *string2,
- int num1, int num2);
-GtkWidget* objectclasses_create_evolution_table (char *name, char *string1, char *string2,
- int num1, int num2);
-#endif
-
-/* default objectclasses */
-#define TOP "top"
-#define PERSON "person"
-#define ORGANIZATIONALPERSON "organizationalPerson"
-#define INETORGPERSON "inetOrgPerson"
-#define EVOLUTIONPERSON "evolutionPerson"
-#define CALENTRY "calEntry"
-
-
-typedef struct {
- GtkWidget *notebook;
- int page_num;
-} FocusHelpClosure;
-
-static void
-focus_help (GtkWidget *w, GdkEventFocus *event, FocusHelpClosure *closure)
-{
- gtk_notebook_set_current_page (GTK_NOTEBOOK(closure->notebook), closure->page_num);
-}
-
-static void
-add_focus_handler (GtkWidget *widget, GtkWidget *notebook, int page_num)
-{
- FocusHelpClosure *focus_closure = g_new0 (FocusHelpClosure, 1);
- focus_closure->notebook = notebook;
- focus_closure->page_num = page_num;
-
- g_signal_connect_data (G_OBJECT (widget),
- "focus_in_event" /* XXX */,
- G_CALLBACK (focus_help),
- focus_closure,
- (GClosureNotify) g_free,
- (GConnectFlags)0);
-}
-
-typedef struct _AddressbookDialog AddressbookDialog;
-typedef struct _AddressbookSourceDialog AddressbookSourceDialog;
-typedef void (*ModifyFunc)(GtkWidget *item, AddressbookSourceDialog *dialog);
-
-struct _AddressbookDialog {
- EvolutionConfigControl *config_control;
- GtkWidget *page;
-
- GladeXML *gui;
- GNOME_Evolution_Shell shell;
-
- GtkWidget *sourcesTable;
- GtkTreeModel *sourcesModel;
- GtkTreeSelection *sourcesSelection;
- GtkWidget *addSource;
- GtkWidget *editSource;
- GtkWidget *deleteSource;
-
-};
-
-
-struct _AddressbookSourceDialog {
- AddressbookDialog *addressbook_dialog;
- GladeXML *gui;
-
- GtkWidget *window;
- GtkWidget *druid; /* only used (obviously) in the druid */
-
- /* info page fields */
- ModifyFunc general_modify_func;
- GtkWidget *host;
- GtkWidget *auth_optionmenu;
- AddressbookLDAPAuthType auth;
- GtkWidget *auth_label_notebook;
- GtkWidget *auth_entry_notebook;
- GtkWidget *email;
- GtkWidget *binddn;
-
- /* connecting page fields */
- ModifyFunc connecting_modify_func;
- GtkWidget *port_combo;
- GtkWidget *ssl_optionmenu;
- AddressbookLDAPSSLType ssl;
-
- /* searching page fields */
- ModifyFunc searching_modify_func;
- GtkWidget *rootdn;
- AddressbookLDAPScopeType scope;
- GtkWidget *scope_optionmenu;
- GtkWidget *timeout_scale;
- GtkWidget *limit_spinbutton;
-
- /* display name page fields */
- GtkWidget *display_name;
- gboolean display_name_changed; /* only used in the druid */
-
- gboolean schema_query_successful;
-
-#ifdef NEW_ADVANCED_UI
- /* objectclasses tab fields */
- GPtrArray *server_objectclasses; /* the objectclasses available on the server */
- GPtrArray *evolution_objectclasses; /* the objectclasses evolution will use */
- GPtrArray *default_objectclasses; /* the objectclasses we default to (actually the
- intersection between defaults and server_objectclasses) */
- ModifyFunc objectclasses_modify_func;
- GtkWidget *objectclasses_server_table;
- ETableModel *objectclasses_server_model;
- GtkWidget *objectclasses_evolution_table;
- ETableModel *objectclasses_evolution_model;
- GtkWidget *objectclasses_add_button;
- GtkWidget *objectclasses_remove_button;
-
- /* refs we keep around so we can add/hide the tabs */
- GtkWidget *objectclasses_tab;
- GtkWidget *objectclasses_label;
- GtkWidget *mappings_tab;
- GtkWidget *mappings_label;
- GtkWidget *dn_customization_tab;
- GtkWidget *dn_customization_label;
-#endif
-
- /* stuff for the account editor window */
- GtkTreeIter *source_model_row;
- GtkWidget *ok_button;
- GtkWidget *cancel_button;
- GtkWidget *advanced_button_notebook;
- GtkWidget *notebook; /* the toplevel notebook */
-
- gboolean advanced;
-
-};
-
-
-/* ldap api foo */
-static LDAP *
-addressbook_ldap_init (GtkWidget *window, AddressbookSource *source)
-{
- LDAP *ldap = ldap_init (source->host, atoi(source->port));
-
- if (!ldap) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (GTK_WINDOW(window),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Failed to connect to LDAP server"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
-
- return NULL;
- }
-
- /* XXX do TLS if it's configured in */
-
- return ldap;
-}
-
-static int
-addressbook_ldap_auth (GtkWidget *window, AddressbookSource *source, LDAP *ldap)
-{
- int ldap_error;
-
- /* XXX use auth info from source */
- ldap_error = ldap_simple_bind_s (ldap, NULL, NULL);
- if (LDAP_SUCCESS != ldap_error) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (GTK_WINDOW (window),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Failed to authenticate with LDAP server"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- }
- return ldap_error;
-
-}
-
-static int
-addressbook_root_dse_query (GtkWindow *window, AddressbookSource *source, LDAP *ldap, char **attrs, LDAPMessage **resp)
-{
- int ldap_error;
- struct timeval timeout;
-
- /* 3 second timeout */
- timeout.tv_sec = 3;
- timeout.tv_usec = 0;
-
- ldap_error = ldap_search_ext_s (ldap,
- LDAP_ROOT_DSE, LDAP_SCOPE_BASE,
- "(objectclass=*)",
- attrs, 0, NULL, NULL, &timeout, LDAP_NO_LIMIT, resp);
- if (LDAP_SUCCESS != ldap_error) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (window,
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Could not perform query on Root DSE"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- }
-
- return ldap_error;
-}
-
-
-static AddressbookSource *
-addressbook_dialog_get_source (AddressbookSourceDialog *dialog)
-{
- AddressbookSource *source = g_new0 (AddressbookSource, 1);
-
- source->name = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->display_name)));
- source->host = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->host)));
- source->email_addr = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->email)));
- source->binddn = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->binddn)));
- source->port = g_strdup (gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(dialog->port_combo)->entry)));
- source->rootdn = g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->rootdn)));
- source->limit = atoi(gtk_entry_get_text (GTK_ENTRY (dialog->limit_spinbutton)));
- source->scope = dialog->scope;
- source->auth = dialog->auth;
- source->ssl = dialog->ssl;
-
- addressbook_storage_init_source_uri (source);
-
- return source;
-}
-
-static void
-addressbook_source_dialog_set_source (AddressbookSourceDialog *dialog, AddressbookSource *source)
-{
- char *string;
- gtk_entry_set_text (GTK_ENTRY (dialog->display_name), source && source->name ? source->name : "");
- gtk_entry_set_text (GTK_ENTRY (dialog->host), source && source->host ? source->host : "");
- gtk_entry_set_text (GTK_ENTRY (dialog->email), source && source->email_addr ? source->email_addr : "");
- gtk_entry_set_text (GTK_ENTRY (dialog->binddn), source && source->binddn ? source->binddn : "");
- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO(dialog->port_combo)->entry), source ? source->port : LDAP_PORT_STRING);
- gtk_entry_set_text (GTK_ENTRY (dialog->rootdn), source && source->rootdn ? source->rootdn : "");
-
- string = g_strdup_printf ("%d", source ? source->limit : 100);
- gtk_entry_set_text (GTK_ENTRY (dialog->limit_spinbutton), string);
- g_free (string);
-
- dialog->auth = source ? source->auth : ADDRESSBOOK_LDAP_AUTH_NONE;
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->auth_optionmenu), dialog->auth);
- if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) {
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1);
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1);
- }
- gtk_widget_set_sensitive (dialog->auth_label_notebook, dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE);
- gtk_widget_set_sensitive (dialog->auth_entry_notebook, dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE);
-
- dialog->scope = source ? source->scope : ADDRESSBOOK_LDAP_SCOPE_ONELEVEL;
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->scope_optionmenu), dialog->scope);
-
- dialog->ssl = source ? source->ssl : ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE;
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->ssl_optionmenu), dialog->ssl);
-}
-
-static void
-addressbook_source_dialog_destroy (gpointer data, GObject *where_object_was)
-{
- AddressbookSourceDialog *dialog = data;
-#ifdef NEW_ADVANCED_UI
-#define IF_UNREF(x) if (x) g_object_unref ((x))
-
- int i;
-
- if (dialog->server_objectclasses) {
- for (i = 0; i < dialog->server_objectclasses->len; i ++)
- ldap_objectclass_free (g_ptr_array_index (dialog->server_objectclasses, i));
- g_ptr_array_free (dialog->server_objectclasses, TRUE);
- }
-
- if (dialog->evolution_objectclasses) {
- for (i = 0; i < dialog->evolution_objectclasses->len; i ++)
- ldap_objectclass_free (g_ptr_array_index (dialog->evolution_objectclasses, i));
- g_ptr_array_free (dialog->evolution_objectclasses, TRUE);
- }
-
- if (dialog->default_objectclasses) {
- for (i = 0; i < dialog->default_objectclasses->len; i ++)
- ldap_objectclass_free (g_ptr_array_index (dialog->default_objectclasses, i));
- g_ptr_array_free (dialog->default_objectclasses, TRUE);
- }
-
- IF_UNREF (dialog->objectclasses_server_model);
- IF_UNREF (dialog->objectclasses_evolution_model);
-
- IF_UNREF (dialog->objectclasses_tab);
- IF_UNREF (dialog->objectclasses_label);
- IF_UNREF (dialog->mappings_tab);
- IF_UNREF (dialog->mappings_label);
- IF_UNREF (dialog->dn_customization_tab);
- IF_UNREF (dialog->dn_customization_label);
-
-#undef IF_UNREF
-#endif
-
- if (dialog->source_model_row) {
- gtk_tree_iter_free (dialog->source_model_row);
- dialog->source_model_row = NULL;
- }
-
- g_object_unref (dialog->gui);
-
- g_free (dialog);
-}
-
-static void
-addressbook_add_server_druid_cancel (GtkWidget *widget, AddressbookSourceDialog *dialog)
-{
- gtk_widget_destroy (dialog->window);
-}
-
-static void
-addressbook_add_server_druid_finish (GnomeDruidPage *druid_page, GtkWidget *gnome_druid, AddressbookSourceDialog *sdialog)
-{
- AddressbookSource *source = addressbook_dialog_get_source (sdialog);
- AddressbookDialog *dialog = sdialog->addressbook_dialog;
- GtkTreeIter iter;
-
- printf ("in finish (%s,%s)\n", source->name, source->host);
-
- gtk_list_store_append (GTK_LIST_STORE (dialog->sourcesModel), &iter);
-
- gtk_list_store_set (GTK_LIST_STORE (dialog->sourcesModel), &iter,
- 0, source->name,
- 1, source->host,
- 2, source,
- -1);
-
- evolution_config_control_changed (dialog->config_control);
-
- /* tear down the widgets */
- gtk_widget_destroy (sdialog->window);
-}
-
-static void
-reparent_to_vbox (AddressbookSourceDialog *dialog, char *vbox_name, char *widget_name)
-{
- GtkWidget *vbox, *widget;
-
- vbox = glade_xml_get_widget (dialog->gui, vbox_name);
- widget = glade_xml_get_widget (dialog->gui, widget_name);
-
- gtk_widget_reparent (widget, vbox);
- gtk_box_set_child_packing (GTK_BOX (vbox), widget, TRUE, TRUE, 0, GTK_PACK_START);
-}
-
-static void
-auth_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->auth = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- dialog->general_modify_func (item, dialog);
-
- if (dialog->auth == 0) {
- gtk_widget_set_sensitive (dialog->auth_label_notebook, FALSE);
- gtk_widget_set_sensitive (dialog->auth_entry_notebook, FALSE);
- }
- else {
- gtk_widget_set_sensitive (dialog->auth_label_notebook, TRUE);
- gtk_widget_set_sensitive (dialog->auth_entry_notebook, TRUE);
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1);
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1);
- }
-}
-
-static void
-add_auth_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- g_signal_connect (item, "activate",
- G_CALLBACK (auth_optionmenu_activated), dialog);
-}
-
-static void
-setup_general_tab (AddressbookSourceDialog *dialog, ModifyFunc modify_func)
-{
- GtkWidget *general_tab_help;
- GtkWidget *menu;
-
- general_tab_help = glade_xml_get_widget (dialog->gui, "general-tab-help");
-
- dialog->general_modify_func = modify_func;
- dialog->host = glade_xml_get_widget (dialog->gui, "server-name-entry");
- g_signal_connect (dialog->host, "changed",
- G_CALLBACK (modify_func), dialog);
- add_focus_handler (dialog->host, general_tab_help, 0);
-
- dialog->auth_label_notebook = glade_xml_get_widget (dialog->gui, "auth-label-notebook");
- dialog->auth_entry_notebook = glade_xml_get_widget (dialog->gui, "auth-entry-notebook");
- dialog->email = glade_xml_get_widget (dialog->gui, "email-entry");
- g_signal_connect (dialog->email, "changed",
- G_CALLBACK (modify_func), dialog);
- add_focus_handler (dialog->email, general_tab_help, 1);
- dialog->binddn = glade_xml_get_widget (dialog->gui, "dn-entry");
- g_signal_connect (dialog->binddn, "changed",
- G_CALLBACK (modify_func), dialog);
- add_focus_handler (dialog->binddn, general_tab_help, 2);
-
- dialog->auth_optionmenu = glade_xml_get_widget (dialog->gui, "auth-optionmenu");
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->auth_optionmenu));
- gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_auth_activate_cb, dialog);
- add_focus_handler (dialog->auth_optionmenu, general_tab_help, 3);
-}
-
-static gboolean
-general_tab_check (AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
- const char *string;
-
- string = gtk_entry_get_text (GTK_ENTRY (dialog->host));
- if (!string || !string[0])
- valid = FALSE;
-
- if (valid) {
- if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) {
- if (dialog->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN)
- string = gtk_entry_get_text (GTK_ENTRY (dialog->binddn));
- else
- string = gtk_entry_get_text (GTK_ENTRY (dialog->email));
-
- if (!string || !string[0])
- valid = FALSE;
- }
- }
-
- return valid;
-}
-
-static void
-druid_info_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- general_tab_check (dialog), /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-static void
-druid_info_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog)
-{
- druid_info_page_modify_cb (NULL, dialog);
- /* stick the focus in the hostname field */
- gtk_widget_grab_focus (dialog->host);
-}
-
-
-/* connecting page */
-static void
-ssl_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->ssl = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- dialog->connecting_modify_func (item, dialog);
-}
-
-static void
-ssl_optionmenu_selected (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- GtkWidget *connecting_tab_help;
- int ssl_type = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- connecting_tab_help = glade_xml_get_widget (dialog->gui, "connecting-tab-help");
-
- gtk_notebook_set_current_page (GTK_NOTEBOOK(connecting_tab_help), ssl_type + 1);
-}
-
-static void
-add_ssl_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- g_signal_connect (item, "activate",
- G_CALLBACK (ssl_optionmenu_activated), dialog);
- g_signal_connect (item, "select",
- G_CALLBACK (ssl_optionmenu_selected), dialog);
-}
-
-static void
-port_changed_func (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- /* if the port value is ldaps, set the SSL/TLS option menu to
- Always and desensitize it */
- const char *string = gtk_entry_get_text (GTK_ENTRY (item));
-
- dialog->connecting_modify_func (item, dialog);
-
- if (!strcmp (string, LDAPS_PORT_STRING)) {
- dialog->ssl = ADDRESSBOOK_LDAP_SSL_ALWAYS;
- gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->ssl_optionmenu),
- dialog->ssl);
-
- gtk_widget_set_sensitive (dialog->ssl_optionmenu, FALSE);
- }
- else {
- gtk_widget_set_sensitive (dialog->ssl_optionmenu, TRUE);
- }
-
-}
-
-static void
-setup_connecting_tab (AddressbookSourceDialog *dialog, ModifyFunc modify_func)
-{
- GtkWidget *menu;
- GtkWidget *connecting_tab_help;
-
- dialog->connecting_modify_func = modify_func;
-
- connecting_tab_help = glade_xml_get_widget (dialog->gui, "connecting-tab-help");
-
- dialog->port_combo = glade_xml_get_widget (dialog->gui, "port-combo");
- add_focus_handler (dialog->port_combo, connecting_tab_help, 0);
- add_focus_handler (GTK_COMBO(dialog->port_combo)->entry, connecting_tab_help, 0);
- g_signal_connect (GTK_COMBO(dialog->port_combo)->entry, "changed",
- G_CALLBACK (modify_func), dialog);
- g_signal_connect (GTK_COMBO(dialog->port_combo)->entry, "changed",
- G_CALLBACK (port_changed_func), dialog);
- dialog->ssl_optionmenu = glade_xml_get_widget (dialog->gui, "ssl-optionmenu");
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->ssl_optionmenu));
- gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_ssl_activate_cb, dialog);
-}
-
-static gboolean
-connecting_tab_check (AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
- const char *string;
-
- string = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(dialog->port_combo)->entry));
- if (!string || !string[0])
- valid = FALSE;
-
- return valid;
-}
-
-static void
-druid_connecting_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- connecting_tab_check (dialog), /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-static void
-druid_connecting_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog)
-{
- druid_connecting_page_modify_cb (NULL, dialog);
- /* stick the focus in the port combo */
- gtk_widget_grab_focus (GTK_COMBO(dialog->port_combo)->entry);
-}
-
-
-/* searching page */
-static ETableMemoryStoreColumnInfo bases_table_columns[] = {
- E_TABLE_MEMORY_STORE_STRING,
- E_TABLE_MEMORY_STORE_TERMINATOR
-};
-
-#define BASES_TABLE_SPEC \
-"<ETableSpecification cursor-mode=\"line\" no-headers=\"true\"> \
- <ETableColumn model_col= \"0\" _title=\"Base\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
- <ETableState> \
- <column source=\"0\"/> \
- <grouping></grouping> \
- </ETableState> \
-</ETableSpecification>"
-
-GtkWidget*
-supported_bases_create_table (char *name, char *string1, char *string2, int num1, int num2)
-{
- GtkWidget *table;
- ETableModel *model;
-
- model = e_table_memory_store_new (bases_table_columns);
-
- table = e_table_scrolled_new (model, NULL, BASES_TABLE_SPEC, NULL);
-
- g_object_set_data (G_OBJECT (table), "model", model);
-
- return table;
-}
-
-static gboolean
-do_ldap_root_dse_query (GtkWidget *dialog, ETableModel *model, AddressbookSource *source, char ***rvalues)
-{
- LDAP* ldap;
- char *attrs[2];
- int ldap_error;
- char **values;
- LDAPMessage *resp;
- int i;
-
- ldap = addressbook_ldap_init (dialog, source);
- if (!ldap)
- return FALSE;
-
- if (LDAP_SUCCESS != addressbook_ldap_auth (dialog, source, ldap))
- goto fail;
-
- attrs[0] = "namingContexts";
- attrs[1] = NULL;
-
- ldap_error = addressbook_root_dse_query (GTK_WINDOW (dialog), source, ldap, attrs, &resp);
-
- if (ldap_error != LDAP_SUCCESS)
- goto fail;
-
- values = ldap_get_values (ldap, resp, "namingContexts");
- if (!values || values[0] == NULL) {
- GtkWidget *error_dialog;
- error_dialog = gtk_message_dialog_new (GTK_WINDOW (dialog),
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("The server responded with no supported search bases"));
- g_signal_connect (error_dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (error_dialog);
- goto fail;
- }
-
- for (i = 0; values[i]; i++)
- e_table_memory_store_insert (E_TABLE_MEMORY_STORE (model),
- -1, GINT_TO_POINTER(i), values[i]);
-
- *rvalues = values;
-
- ldap_unbind_s (ldap);
- return TRUE;
-
- fail:
- ldap_unbind_s (ldap);
- return FALSE;
-}
-
-static void
-search_base_selection_model_changed (ESelectionModel *selection_model, GtkWidget *dialog)
-{
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
- GTK_RESPONSE_OK,
- e_selection_model_selected_count (selection_model) == 1);
-}
-
-static void
-query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog)
-{
- ESelectionModel *selection_model;
- AddressbookSource *source = addressbook_dialog_get_source (sdialog);
- GtkWidget *dialog;
- GtkWidget *supported_bases_table;
- ETableModel *model;
- int id;
- char **values;
-
- dialog = glade_xml_get_widget (sdialog->gui, "supported-bases-dialog");
-
- supported_bases_table = glade_xml_get_widget (sdialog->gui, "supported-bases-table");
- gtk_widget_show (supported_bases_table);
- selection_model = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(supported_bases_table)));
- model = g_object_get_data (G_OBJECT (supported_bases_table), "model");
-
- g_signal_connect (selection_model, "selection_changed",
- G_CALLBACK (search_base_selection_model_changed), dialog);
-
- search_base_selection_model_changed (selection_model, dialog);
-
- if (do_ldap_root_dse_query (dialog, model, source, &values)) {
- id = gtk_dialog_run (GTK_DIALOG (dialog));
-
- gtk_widget_hide (dialog);
-
- if (id == GTK_RESPONSE_OK) {
- int i;
- /* OK was clicked */
-
- /* ugh. */
- for (i = 0; values[i]; i ++) {
- if (e_selection_model_is_row_selected (selection_model, i)) {
- gtk_entry_set_text (GTK_ENTRY (sdialog->rootdn), values[i]);
- break; /* single selection, so we can quit when we've found it. */
- }
- }
- }
-
- ldap_value_free (values);
-
- e_table_memory_store_clear (E_TABLE_MEMORY_STORE (model));
- }
-
- addressbook_source_free (source);
-}
-
-static void
-scope_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->scope = g_list_index (gtk_container_get_children (GTK_CONTAINER (item->parent)),
- item);
-
- if (dialog->searching_modify_func)
- dialog->searching_modify_func (item, dialog);
-}
-
-static void
-add_scope_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- g_signal_connect (item, "activate",
- G_CALLBACK (scope_optionmenu_activated), dialog);
-}
-
-static void
-setup_searching_tab (AddressbookSourceDialog *dialog, ModifyFunc modify_func)
-{
- GtkWidget *menu;
- GtkWidget *rootdn_button;
- GtkWidget *searching_tab_help;
-
- dialog->searching_modify_func = modify_func;
-
- searching_tab_help = glade_xml_get_widget (dialog->gui, "searching-tab-help");
-
- dialog->rootdn = glade_xml_get_widget (dialog->gui, "rootdn-entry");
- add_focus_handler (dialog->rootdn, searching_tab_help, 0);
- if (modify_func)
- g_signal_connect (dialog->rootdn, "changed",
- G_CALLBACK (modify_func), dialog);
-
- dialog->scope_optionmenu = glade_xml_get_widget (dialog->gui, "scope-optionmenu");
- add_focus_handler (dialog->scope_optionmenu, searching_tab_help, 1);
- menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->scope_optionmenu));
- gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_scope_activate_cb, dialog);
-
- dialog->timeout_scale = glade_xml_get_widget (dialog->gui, "timeout-scale");
- add_focus_handler (dialog->timeout_scale, searching_tab_help, 2);
- if (modify_func)
- g_signal_connect (GTK_RANGE(dialog->timeout_scale)->adjustment,
- "value_changed",
- G_CALLBACK (modify_func), dialog);
-
- dialog->limit_spinbutton = glade_xml_get_widget (dialog->gui, "download-limit-spinbutton");
- if (modify_func)
- g_signal_connect (dialog->limit_spinbutton, "changed",
- G_CALLBACK (modify_func), dialog);
-
- /* special handling for the "Show Supported Bases button" */
- rootdn_button = glade_xml_get_widget (dialog->gui, "rootdn-button");
- g_signal_connect (rootdn_button, "clicked",
- G_CALLBACK(query_for_supported_bases), dialog);
-}
-
-static void
-druid_searching_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog)
-{
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- TRUE, /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-
-/* display name page */
-static gboolean
-display_name_check (AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
- const char *string;
-
- string = gtk_entry_get_text (GTK_ENTRY (dialog->display_name));
- if (!string || !string[0])
- valid = FALSE;
-
- return valid;
-}
-
-static void
-display_name_page_prepare (GtkWidget *page, GtkWidget *gnome_druid, AddressbookSourceDialog *dialog)
-{
- if (!dialog->display_name_changed) {
- const char *server_name = gtk_entry_get_text (GTK_ENTRY (dialog->host));
- gtk_entry_set_text (GTK_ENTRY (dialog->display_name), server_name);
- }
-
- gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid),
- TRUE, /* back */
- display_name_check (dialog), /* next */
- TRUE, /* cancel */
- FALSE /* help */);
-}
-
-static void
-druid_display_name_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- dialog->display_name_changed = TRUE;
- display_name_page_prepare (NULL, NULL, dialog);
-}
-
-
-#ifdef NEW_ADVANCED_UI
-/* objectclasses page */
-static ETableMemoryStoreColumnInfo objectclasses_table_columns[] = {
- E_TABLE_MEMORY_STORE_STRING,
- E_TABLE_MEMORY_STORE_TERMINATOR
-};
-
-#define OBJECTCLASSES_TABLE_SPEC \
-"<ETableSpecification cursor-mode=\"line\" no-headers=\"true\"> \
- <ETableColumn model_col= \"0\" _title=\"Objectclass\" expansion=\"1.0\" minimum_width=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> \
- <ETableState> \
- <column source=\"0\"/> \
- <grouping> <leaf column=\"0\" ascending=\"true\"/> </grouping> \
- </ETableState> \
-</ETableSpecification>"
-
-GtkWidget*
-objectclasses_create_server_table (char *name, char *string1, char *string2,
- int num1, int num2)
-{
- GtkWidget *table;
- ETableModel *model;
-
- model = e_table_memory_store_new (objectclasses_table_columns);
-
- table = e_table_scrolled_new (model, NULL, OBJECTCLASSES_TABLE_SPEC, NULL);
-
- g_object_set_data (G_OBJECT (table), "model", model);
-
- return table;
-}
-
-GtkWidget*
-objectclasses_create_evolution_table (char *name, char *string1, char *string2,
- int num1, int num2)
-{
- GtkWidget *table;
- ETableModel *model;
-
- model = e_table_memory_store_new (objectclasses_table_columns);
-
- table = e_table_scrolled_new (model, NULL, OBJECTCLASSES_TABLE_SPEC, NULL);
-
- g_object_set_data (G_OBJECT (table), "model", model);
-
- return table;
-}
-
-static void
-objectclasses_add_foreach (int model_row, AddressbookSourceDialog *dialog)
-{
- LDAPObjectClass *oc = e_table_memory_get_data (E_TABLE_MEMORY (dialog->objectclasses_server_model), model_row);
- e_table_memory_store_remove (E_TABLE_MEMORY_STORE (dialog->objectclasses_server_model), model_row);
- /* XXX remove from the server array */
- e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model),
- -1, oc, oc->oc_names[0]);
- /* XXX add to the evolution array */
-}
-
-static void
-objectclasses_add (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- ESelectionModel *esm = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_server_table)));
-
- e_selection_model_foreach (esm, (EForeachFunc)objectclasses_add_foreach, dialog);
- dialog->objectclasses_modify_func (item, dialog);
-}
-
-static void
-objectclasses_server_double_click (ETable *et, int row, int col, GdkEvent *event, AddressbookSourceDialog *dialog)
-{
- objectclasses_add_foreach (row, dialog);
- dialog->objectclasses_modify_func (GTK_WIDGET (et), dialog);
-}
-
-static void
-objectclasses_remove_foreach (int model_row, AddressbookSourceDialog *dialog)
-{
- LDAPObjectClass *oc = e_table_memory_get_data (E_TABLE_MEMORY (dialog->objectclasses_evolution_model), model_row);
- e_table_memory_store_remove (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model), model_row);
- /* XXX remove from the evolution array */
- e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->objectclasses_server_model),
- -1, oc, oc->oc_names[0]);
- /* XXX add to the server array */
-}
-
-static void
-objectclasses_remove (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- ESelectionModel *esm = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_evolution_table)));
-
- e_selection_model_foreach (esm, (EForeachFunc)objectclasses_add_foreach, dialog);
-
- dialog->objectclasses_modify_func (item, dialog);
-}
-
-static void
-objectclasses_evolution_double_click (ETable *et, int row, int col, GdkEvent *event, AddressbookSourceDialog *dialog)
-{
- objectclasses_remove_foreach (row, dialog);
- dialog->objectclasses_modify_func (GTK_WIDGET (et), dialog);
-}
-
-static void
-objectclasses_restore_default (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- int i;
-
- dialog->objectclasses_modify_func (item, dialog);
-
- /* clear out our evolution list */
- for (i = 0; i < dialog->evolution_objectclasses->len; i ++) {
- g_ptr_array_add (dialog->server_objectclasses, g_ptr_array_index (dialog->evolution_objectclasses, i));
- }
- g_ptr_array_set_size (dialog->evolution_objectclasses, 0);
-
- e_table_memory_store_clear (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model));
-
- for (i = 0; i < dialog->default_objectclasses->len; i++) {
- LDAPObjectClass *oc = g_ptr_array_index (dialog->default_objectclasses, i);
- g_ptr_array_add (dialog->evolution_objectclasses, oc);
- e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model),
- i, oc, oc->oc_names[0]);
- }
-}
-
-static void
-server_selection_model_changed (ESelectionModel *selection_model, AddressbookSourceDialog *dialog)
-{
- gtk_widget_set_sensitive (dialog->objectclasses_add_button,
- e_selection_model_selected_count (selection_model) > 0);
-}
-
-static void
-evolution_selection_model_changed (ESelectionModel *selection_model, AddressbookSourceDialog *dialog)
-{
- gtk_widget_set_sensitive (dialog->objectclasses_remove_button,
- e_selection_model_selected_count (selection_model) > 0);
-}
-
-static void
-setup_objectclasses_tab (AddressbookSourceDialog *dialog, GtkSignalFunc modify_func)
-{
- ETable *table;
- GtkWidget *restore_default;
- ESelectionModel *esm;
-
- dialog->server_objectclasses = g_ptr_array_new ();
- dialog->evolution_objectclasses = g_ptr_array_new ();
- dialog->default_objectclasses = g_ptr_array_new ();
-
- dialog->objectclasses_modify_func = modify_func;
-
- dialog->objectclasses_server_table = glade_xml_get_widget (dialog->gui, "objectclasses-server-table");
- dialog->objectclasses_server_model = g_object_get_data (G_OBJECT (dialog->objectclasses_server_table), "model");
-
- dialog->objectclasses_evolution_table = glade_xml_get_widget (dialog->gui, "objectclasses-evolution-table");
- dialog->objectclasses_evolution_model = g_object_get_data (G_OBJECT (dialog->objectclasses_evolution_table), "model");
-
- table = e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_server_table));
- g_signal_connect (table, "double_click",
- G_CALLBACK (objectclasses_server_double_click), dialog);
- esm = e_table_get_selection_model (table);
- g_signal_connect (esm, "selection_changed",
- server_selection_model_changed, dialog);
-
- table = e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_evolution_table));
- g_signal_connect (table, "double_click",
- G_CALLBACK (objectclasses_evolution_double_click), dialog);
- esm = e_table_get_selection_model (table);
- g_signal_connect (esm, "selection_changed",
- evolution_selection_model_changed, dialog);
-
- dialog->objectclasses_add_button = glade_xml_get_widget (dialog->gui, "objectclasses-add-button");
- g_signal_connect (dialog->objectclasses_add_button, "clicked",
- G_CALLBACK(objectclasses_add), dialog);
-
- dialog->objectclasses_remove_button = glade_xml_get_widget (dialog->gui, "objectclasses-remove-button");
- g_signal_connect (dialog->objectclasses_remove_button, "clicked",
- G_CALLBACK(objectclasses_remove), dialog);
-
- restore_default = glade_xml_get_widget (dialog->gui, "objectclasses-default-button");
- g_signal_connect (restore_default, "clicked",
- G_CALLBACK(objectclasses_restore_default), dialog);
-}
-#endif
-
-
-static AddressbookSourceDialog *
-addressbook_add_server_druid (AddressbookDialog *dialog)
-{
- AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1);
- GtkWidget *page;
-
- sdialog->addressbook_dialog = dialog;
-
- sdialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL);
-
- sdialog->window = glade_xml_get_widget (sdialog->gui, "account-druid-window");
- sdialog->druid = glade_xml_get_widget (sdialog->gui, "account-druid");
-
- /* info page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-info-page");
- reparent_to_vbox (sdialog, "account-druid-general-vbox", "general-tab");
- setup_general_tab (sdialog, druid_info_page_modify_cb);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK(druid_info_page_prepare), sdialog);
-
- /* connecting page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-connecting-page");
- reparent_to_vbox (sdialog, "account-druid-connecting-vbox", "connecting-tab");
- setup_connecting_tab (sdialog, druid_connecting_page_modify_cb);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK(druid_connecting_page_prepare), sdialog);
-
- /* searching page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-searching-page");
- reparent_to_vbox (sdialog, "account-druid-searching-vbox", "searching-tab");
- setup_searching_tab (sdialog, NULL);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK(druid_searching_page_prepare), sdialog);
-
- /* display name page */
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-display-name-page");
- sdialog->display_name = glade_xml_get_widget (sdialog->gui, "druid-display-name-entry");
- g_signal_connect (sdialog->display_name, "changed",
- G_CALLBACK(druid_display_name_page_modify_cb), sdialog);
- g_signal_connect_after (page, "prepare",
- G_CALLBACK(display_name_page_prepare), sdialog);
-
- page = glade_xml_get_widget (sdialog->gui, "add-server-druid-finish-page");
- g_signal_connect (page, "finish",
- G_CALLBACK(addressbook_add_server_druid_finish), sdialog);
- g_signal_connect (sdialog->druid, "cancel",
- G_CALLBACK(addressbook_add_server_druid_cancel), sdialog);
- g_object_weak_ref (G_OBJECT (sdialog->window),
- addressbook_source_dialog_destroy, sdialog);
-
- /* make sure we fill in the default values */
- addressbook_source_dialog_set_source (sdialog, NULL);
-
- gtk_window_set_type_hint (GTK_WINDOW (sdialog->window), GDK_WINDOW_TYPE_HINT_DIALOG);
- gtk_window_set_modal (GTK_WINDOW (sdialog->window), TRUE);
-
- gtk_widget_show_all (sdialog->window);
-
- return sdialog;
-}
-
-static void
-editor_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog)
-{
- gboolean valid = TRUE;
-
- valid = display_name_check (dialog);
- if (valid)
- valid = general_tab_check (dialog);
-#if 0
- if (valid)
- valid = connecting_tab_check (dialog);
- if (valid)
- valid = searching_tab_check (dialog);
-#endif
-
- gtk_widget_set_sensitive (dialog->ok_button, valid);
-}
-
-static void
-set_advanced_button_state (AddressbookSourceDialog *dialog)
-{
- if (dialog->advanced) {
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 0);
-#ifdef NEW_ADVANCED_UI
- gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->objectclasses_tab, dialog->objectclasses_label);
- gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->mappings_tab, dialog->mappings_label);
- gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->dn_customization_tab, dialog->dn_customization_label);
-#endif
- }
- else {
-#ifdef NEW_ADVANCED_UI
- gtk_notebook_set_current_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 1);
-
- /* hide the advanced tabs of the main notebook */
- gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 5);
- gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 4);
- gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 3);
-#endif
- }
-}
-
-#ifdef NEW_ADVANCED_UI
-static void
-advanced_button_clicked (GtkWidget *button, AddressbookSourceDialog *dialog)
-{
- dialog->advanced = !dialog->advanced;
- set_advanced_button_state (dialog);
-}
-
-static gboolean
-do_schema_query (AddressbookSourceDialog *sdialog)
-{
- LDAP *ldap;
- int ldap_error;
- char *schema_dn;
- char *attrs[3];
- char **values;
- int i;
- AddressbookSource *source = addressbook_dialog_get_source (sdialog);
- LDAPMessage *resp;
- struct timeval timeout;
-
- ldap = addressbook_ldap_init (sdialog->window, source);
- if (!ldap)
- goto fail;
-
- if (LDAP_SUCCESS != addressbook_ldap_auth (sdialog->window, source, ldap))
- goto fail;
-
- attrs[0] = "subschemaSubentry";
- attrs[1] = NULL;
-
- ldap_error = addressbook_root_dse_query (sdialog->window, source, ldap, attrs, &resp);
-
- if (ldap_error != LDAP_SUCCESS)
- goto fail;
-
- values = ldap_get_values (ldap, resp, "subschemaSubentry");
- if (!values || values[0] == NULL) {
- GtkWidget *dialog;
- dialog = gnome_ok_dialog_parented (_("This server does not support LDAPv3 schema information"), GTK_WINDOW (sdialog->window));
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- goto fail;
- }
-
- schema_dn = g_strdup (values[0]);
-
- ldap_value_free (values);
- ldap_msgfree (resp);
-
- attrs[0] = "objectClasses";
- attrs[1] = NULL;
-
- /* 3 second timeout */
- timeout.tv_sec = 3;
- timeout.tv_usec = 0;
-
- ldap_error = ldap_search_ext_s (ldap, schema_dn, LDAP_SCOPE_BASE,
- "(objectClass=subschema)", attrs, 0,
- NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp);
- if (LDAP_SUCCESS != ldap_error) {
- GtkWidget *dialog;
- dialog = gnome_error_dialog_parented (_("Error retrieving schema information"), GTK_WINDOW (sdialog->window));
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- goto fail;
- }
-
- values = ldap_get_values (ldap, resp, "objectClasses");
- if (!values) {
- GtkWidget *dialog;
- dialog = gnome_error_dialog_parented (_("Server did not respond with valid schema information"), GTK_WINDOW (sdialog->window));
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- goto fail;
- }
-
- for (i = 0; values[i]; i ++) {
- int j;
- int code;
- const char *err;
- LDAPObjectClass *oc = ldap_str2objectclass (values[i], &code, &err, 0);
-
- if (!oc)
- continue;
-
- /* we fill in the default list of classes here */
- for (j = 0; oc->oc_names[j]; j ++) {
- if (!g_strcasecmp (oc->oc_names[j], EVOLUTIONPERSON) ||
- !g_strcasecmp (oc->oc_names[j], INETORGPERSON) ||
- !g_strcasecmp (oc->oc_names[j], ORGANIZATIONALPERSON) ||
- !g_strcasecmp (oc->oc_names[j], PERSON) ||
- !g_strcasecmp (oc->oc_names[j], CALENTRY) ||
- !g_strcasecmp (oc->oc_names[j], TOP))
- g_ptr_array_add (sdialog->default_objectclasses, oc);
- }
-
- g_ptr_array_add (sdialog->server_objectclasses, oc);
- }
-
- addressbook_source_free (source);
- ldap_unbind_s (ldap);
- return TRUE;
-
- fail:
- addressbook_source_free (source);
- if (ldap)
- ldap_unbind_s (ldap);
- return FALSE;
-}
-
-static void
-edit_dialog_switch_page (GtkNotebook *notebook,
- GtkNotebookPage *page, guint page_num,
- AddressbookSourceDialog *sdialog)
-{
- if (page_num >= 3 && !sdialog->schema_query_successful) {
- int i;
-
- gtk_widget_set_sensitive (GTK_WIDGET (notebook), FALSE);
-
- sdialog->schema_query_successful = do_schema_query (sdialog);
-
- if (sdialog->schema_query_successful) {
- /* fill in the objectclasses model */
- for (i = 0; i < sdialog->server_objectclasses->len; i ++) {
- LDAPObjectClass *oc = g_ptr_array_index (sdialog->server_objectclasses, i);
- e_table_memory_store_insert (E_TABLE_MEMORY_STORE (sdialog->objectclasses_server_model),
- -1, oc, oc->oc_names[0]);
- }
- gtk_widget_set_sensitive (page->child, TRUE);
- }
- else {
- gtk_widget_set_sensitive (page->child, FALSE);
- }
-
- gtk_widget_set_sensitive (GTK_WIDGET (notebook), TRUE);
- }
-}
-#endif
-
-static gboolean
-edit_dialog_store_change (AddressbookSourceDialog *sdialog)
-{
- AddressbookSource *source = addressbook_dialog_get_source (sdialog);
- AddressbookDialog *dialog = sdialog->addressbook_dialog;
- AddressbookSource *old_source;
-
- /* check the display name for uniqueness */
- if (FALSE /* XXX */) {
- return FALSE;
- }
-
- /* store the new source in the addressbook dialog */
- gtk_tree_model_get (dialog->sourcesModel,
- sdialog->source_model_row,
- 2, &old_source,
- -1);
- addressbook_source_free (old_source);
-
- gtk_list_store_set (GTK_LIST_STORE (dialog->sourcesModel),
- sdialog->source_model_row,
- 0, source->name,
- 1, source->host,
- 2, source,
- -1);
-
- /* and let the config control know about the change */
- evolution_config_control_changed (dialog->config_control);
-
- return TRUE;
-}
-
-static void
-edit_dialog_cancel_clicked (GtkWidget *item, AddressbookSourceDialog *sdialog)
-{
- gtk_widget_destroy (sdialog->window);
-}
-
-static void
-edit_dialog_ok_clicked (GtkWidget *item, AddressbookSourceDialog *sdialog)
-{
- if (edit_dialog_store_change (sdialog)) {
- gtk_widget_destroy (sdialog->window);
- }
-}
-
-static AddressbookSourceDialog*
-addressbook_edit_server_dialog (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *model_row,
- gpointer data)
-{
- AddressbookDialog *dialog = data;
- AddressbookSource *source;
- AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1);
- GtkWidget *general_tab_help;
-#ifdef NEW_ADVANCED_UI
- GtkWidget *fewer_options_button, *more_options_button;
-#endif
-
- gtk_tree_model_get (model, model_row,
- 2, &source,
- -1);
-
- sdialog->addressbook_dialog = dialog;
- sdialog->source_model_row = gtk_tree_iter_copy (model_row);
-
- sdialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL);
-
- sdialog->window = glade_xml_get_widget (sdialog->gui, "account-editor-window");
-
- /* general tab */
- general_tab_help = glade_xml_get_widget (dialog->gui, "general-tab-help");
- reparent_to_vbox (sdialog, "account-editor-general-vbox", "general-tab");
- setup_general_tab (sdialog, editor_modify_cb);
- sdialog->display_name = glade_xml_get_widget (sdialog->gui, "account-editor-display-name-entry");
- g_signal_connect (sdialog->display_name, "changed",
- G_CALLBACK (editor_modify_cb), sdialog);
- add_focus_handler (sdialog->display_name, general_tab_help, 4);
-
- /* connecting tab */
- reparent_to_vbox (sdialog, "account-editor-connecting-vbox", "connecting-tab");
- setup_connecting_tab (sdialog, editor_modify_cb);
-
- /* searching tab */
- reparent_to_vbox (sdialog, "account-editor-searching-vbox", "searching-tab");
- setup_searching_tab (sdialog, editor_modify_cb);
-
-#ifdef NEW_ADVANCED_UI
- /* objectclasses tab */
- reparent_to_vbox (sdialog, "account-editor-objectclasses-vbox", "objectclasses-tab");
- setup_objectclasses_tab (sdialog, editor_modify_cb);
-
- /* mappings tab */
- reparent_to_vbox (sdialog, "account-editor-mappings-vbox", "mappings-tab");
- /* XXX setup_mappings_tab */
-
- /* dn customization tab */
- reparent_to_vbox (sdialog, "account-editor-dn-customization-vbox", "dn-customization-tab");
- /* XXX setup_dn_customization_tab */
-#endif
-
- sdialog->notebook = glade_xml_get_widget (sdialog->gui, "account-editor-notebook");
-
- sdialog->ok_button = glade_xml_get_widget (sdialog->gui, "account-editor-ok-button");
- sdialog->cancel_button = glade_xml_get_widget (sdialog->gui, "account-editor-cancel-button");
-
-#if NEW_ADVANCED_UI
- sdialog->advanced_button_notebook = glade_xml_get_widget (sdialog->gui, "account-editor-advanced-button-notebook");
- fewer_options_button = glade_xml_get_widget (sdialog->gui, "account-editor-fewer-options-button");
- more_options_button = glade_xml_get_widget (sdialog->gui, "account-editor-more-options-button");
-#endif
-
-#ifdef NEW_ADVANCED_UI
- sdialog->objectclasses_label = glade_xml_get_widget (sdialog->gui, "account-editor-objectclasses-label");
- g_object_ref (sdialog->objectclasses_label);
- sdialog->objectclasses_tab = glade_xml_get_widget (sdialog->gui, "account-editor-objectclasses-vbox");
- g_object_ref (sdialog->objectclasses_tab);
- sdialog->mappings_label = glade_xml_get_widget (sdialog->gui, "account-editor-mappings-label");
- g_object_ref (sdialog->mappings_label);
- sdialog->mappings_tab = glade_xml_get_widget (sdialog->gui, "account-editor-mappings-vbox");
- g_object_ref (sdialog->mappings_tab);
- sdialog->dn_customization_label = glade_xml_get_widget (sdialog->gui, "account-editor-dn-customization-label");
- g_object_ref (sdialog->dn_customization_label);
- sdialog->dn_customization_tab = glade_xml_get_widget (sdialog->gui, "account-editor-dn-customization-vbox");
- g_object_ref (sdialog->dn_customization_tab);
-#endif
-
- addressbook_source_dialog_set_source (sdialog, source);
-
- set_advanced_button_state (sdialog);
-
-#ifdef NEW_ADVANCED_UI
- g_signal_connect (fewer_options_button,
- "clicked", advanced_button_clicked, sdialog);
- g_signal_connect (more_options_button,
- "clicked", advanced_button_clicked, sdialog);
-
-#endif
-
-#ifdef NEW_ADVANCED_UI
- /* set up a signal handler to query for schema info if the user switches to the advanced tabs */
- g_signal_connect (sdialog->notebook, "switch_page",
- G_CALLBACK (edit_dialog_switch_page), sdialog);
-#endif
-
- g_signal_connect (sdialog->ok_button,
- "clicked", G_CALLBACK(edit_dialog_ok_clicked), sdialog);
- g_signal_connect (sdialog->cancel_button,
- "clicked", G_CALLBACK(edit_dialog_cancel_clicked), sdialog);
- g_object_weak_ref (G_OBJECT (sdialog->window),
- addressbook_source_dialog_destroy, sdialog);
-
- gtk_widget_set_sensitive (sdialog->ok_button, FALSE);
-
- gtk_window_set_type_hint (GTK_WINDOW (sdialog->window), GDK_WINDOW_TYPE_HINT_DIALOG);
- gtk_window_set_modal (GTK_WINDOW (sdialog->window), TRUE);
-
- gtk_widget_show (sdialog->window);
-
- return sdialog;
-}
-
-static void
-add_source_clicked (GtkWidget *widget, AddressbookDialog *dialog)
-{
- addressbook_add_server_druid (dialog);
-}
-
-static void
-edit_source_clicked (GtkWidget *widget, AddressbookDialog *dialog)
-{
- gtk_tree_selection_selected_foreach (dialog->sourcesSelection,
- (GtkTreeSelectionForeachFunc)addressbook_edit_server_dialog,
- dialog);
-}
-
-static void
-delete_server (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *model_row,
- gpointer data)
-{
- AddressbookDialog *dialog = data;
-
- gtk_list_store_remove (GTK_LIST_STORE (dialog->sourcesModel),
- model_row);
-}
-
-static void
-delete_source_clicked (GtkWidget *widget, AddressbookDialog *dialog)
-{
- gtk_tree_selection_selected_foreach (dialog->sourcesSelection,
- delete_server,
- dialog);
-
- evolution_config_control_changed (dialog->config_control);
-}
-
-static void
-ldap_config_control_destroy_callback (gpointer data,
- GObject *where_object_was)
-{
- AddressbookDialog *dialog;
-
- dialog = (AddressbookDialog *) data;
-
- g_object_unref (dialog->gui);
-
- /* XXX free more stuff here */
-
- g_free (dialog);
-}
-
-static void
-ldap_config_control_apply_callback (EvolutionConfigControl *config_control,
- void *data)
-{
- AddressbookDialog *dialog;
- GtkTreeIter iter;
-
- dialog = (AddressbookDialog *) data;
-
- addressbook_storage_clear_sources();
-
- if (! gtk_tree_model_get_iter_first (dialog->sourcesModel,
- &iter))
- return;
-
- do {
- AddressbookSource *source;
-
- gtk_tree_model_get (dialog->sourcesModel,
- &iter,
- 2, &source,
- -1);
-
- addressbook_storage_add_source (addressbook_source_copy (source));
- } while (gtk_tree_model_iter_next (dialog->sourcesModel, &iter));
-
- addressbook_storage_write_sources();
-}
-
-static void
-sources_selection_changed (GtkTreeSelection *selection, AddressbookDialog *dialog)
-{
- gboolean sensitive;
- GtkTreeIter iter;
-
- sensitive = gtk_tree_selection_get_selected (selection, NULL, &iter);
-
- gtk_widget_set_sensitive (dialog->editSource, sensitive);
- gtk_widget_set_sensitive (dialog->deleteSource, sensitive);
-}
-
-static void
-sources_table_row_activated (GtkTreeView *tree_view, GtkTreePath *path,
- GtkTreeViewColumn *column, AddressbookDialog *dialog)
-{
- GtkTreeIter iter;
- gtk_tree_model_get_iter (dialog->sourcesModel, &iter, path);
- addressbook_edit_server_dialog (dialog->sourcesModel, NULL, &iter, dialog);
-}
-
-
-static AddressbookDialog *
-ldap_dialog_new (GNOME_Evolution_Shell shell)
-{
- AddressbookDialog *dialog;
- GList *l;
- GtkWidget *scrolled;
-
- dialog = g_new0 (AddressbookDialog, 1);
-
- dialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL);
- dialog->shell = shell;
-
- scrolled = glade_xml_get_widget (dialog->gui, "sourcesTable");
- dialog->sourcesTable = g_object_get_data (G_OBJECT (scrolled), "table");
- dialog->sourcesModel = g_object_get_data (G_OBJECT (scrolled), "model");
- dialog->sourcesSelection = g_object_get_data (G_OBJECT (scrolled), "selection");
-
- g_signal_connect (dialog->sourcesTable, "row_activated",
- G_CALLBACK (sources_table_row_activated), dialog);
-
-
- dialog->addSource = glade_xml_get_widget (dialog->gui, "addSource");
- g_signal_connect (dialog->addSource, "clicked",
- G_CALLBACK (add_source_clicked),
- dialog);
-
- dialog->editSource = glade_xml_get_widget (dialog->gui, "editSource");
- g_signal_connect (dialog->editSource, "clicked",
- G_CALLBACK (edit_source_clicked),
- dialog);
-
- dialog->deleteSource = glade_xml_get_widget (dialog->gui, "deleteSource");
- g_signal_connect (dialog->deleteSource, "clicked",
- G_CALLBACK (delete_source_clicked),
- dialog);
-
- l = addressbook_storage_get_sources ();
- for (; l != NULL; l = l->next) {
- AddressbookSource *source;
- GtkTreeIter iter;
-
- source = addressbook_source_copy ((AddressbookSource*)l->data);
-
- gtk_list_store_append (GTK_LIST_STORE (dialog->sourcesModel), &iter);
-
- gtk_list_store_set (GTK_LIST_STORE (dialog->sourcesModel), &iter,
- 0, source->name,
- 1, source->host,
- 2, source,
- -1);
- }
-
- g_signal_connect (dialog->sourcesSelection, "changed",
- G_CALLBACK (sources_selection_changed), dialog);
-
- sources_selection_changed (dialog->sourcesSelection, dialog);
-
- dialog->page = glade_xml_get_widget (dialog->gui, "addressbook-sources");
-
- gtk_widget_show_all (dialog->page);
-
- return dialog;
-}
-
-GtkWidget*
-addressbook_dialog_create_sources_table (char *name, char *string1, char *string2, int num1, int num2)
-{
- GtkWidget *table, *scrolled;
- GtkTreeSelection *selection;
- GtkCellRenderer *renderer;
- GtkListStore *model;
-
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
- model = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
- table = gtk_tree_view_new_with_model ((GtkTreeModel *) model);
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Account Name"),
- renderer, "text", 0, NULL);
- gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Server Name"),
- renderer, "text", 1, NULL);
-
- selection = gtk_tree_view_get_selection ((GtkTreeView *) table);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- gtk_tree_view_set_headers_visible ((GtkTreeView *) table, TRUE);
-
- gtk_container_add (GTK_CONTAINER (scrolled), table);
-
- g_object_set_data (G_OBJECT (scrolled), "model", model);
- g_object_set_data (G_OBJECT (scrolled), "selection", selection);
- g_object_set_data (G_OBJECT (scrolled), "table", table);
-
- gtk_widget_show (scrolled);
- gtk_widget_show (table);
-
- return scrolled;
-}
-#endif /* HAVE_LDAP */
-
-static EvolutionConfigControl *
-ldap_config_control_new (GNOME_Evolution_Shell shell)
-{
- GtkWidget *control_widget;
- EvolutionConfigControl *control;
-
-#ifdef HAVE_LDAP
- AddressbookDialog *dialog;
-
- dialog = ldap_dialog_new (shell);
-
- control_widget = dialog->page;
-
- gtk_widget_ref (control_widget);
-
- gtk_container_remove (GTK_CONTAINER (control_widget->parent), control_widget);
-#else
- control_widget = gtk_label_new (_("LDAP was not enabled in this build of Evolution"));
- gtk_widget_set_sensitive (control_widget, FALSE);
- gtk_widget_show (control_widget);
-#endif
-
- control = evolution_config_control_new (control_widget);
-
-#ifdef HAVE_LDAP
- dialog->config_control = control;
- g_signal_connect (dialog->config_control, "apply",
- G_CALLBACK (ldap_config_control_apply_callback), dialog);
- g_object_weak_ref (G_OBJECT (dialog->config_control),
- ldap_config_control_destroy_callback, dialog);
-
- gtk_widget_unref (dialog->page);
-#endif
-
- return control;
-}
-
-
-EvolutionConfigControl *
-addressbook_config_control_new (void)
-{
- GNOME_Evolution_Shell shell;
-
- shell = evolution_shell_client_corba_objref (addressbook_component_get_shell_client ());
- if (! shell)
- return NULL;
-
- return ldap_config_control_new (shell);
-}
-
-void
-addressbook_config_create_new_source (const char *new_source, GtkWidget *parent)
-{
-#ifdef HAVE_LDAP
-#if 0
- AddressbookSourceDialog *dialog;
- GladeXML *gui;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL);
-
- dialog = addressbook_source_dialog (gui, NULL, parent);
-
- gtk_entry_set_text (GTK_ENTRY (dialog->name), new_source);
-
- dialog->id = gtk_dialog_run (GTK_DIALOG (dialog->dialog));
-
- gtk_widget_hide (dialog->dialog);
-
- g_object_unref (dialog->gui);
-
- if (dialog->id == GTK_RESPONSE_OK) {
- /* Ok was clicked */
- addressbook_storage_add_source (addressbook_source_copy(dialog->source));
- addressbook_storage_write_sources();
- }
-#endif
-#endif /* HAVE_LDAP */
-}
-
-#ifdef STANDALONE
-int
-main(int argc, char **argv)
-{
- AddressbookDialog *dialog;
-
- gnome_init_with_popt_table ("evolution-addressbook", "0.0",
- argc, argv, oaf_popt_options, 0, NULL);
-
- glade_init ();
-
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- textdomain (GETTEXT_PACKAGE);
-
-#if 0
- g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
-#endif
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- dialog = ldap_dialog_new (NULL);
-
- gtk_widget_show (glade_xml_get_widget (dialog->gui, "addressbook-sources-window"));
-
- gtk_main();
-
- return 0;
-}
-#endif
diff --git a/addressbook/gui/component/addressbook-config.h b/addressbook/gui/component/addressbook-config.h
deleted file mode 100644
index c1f88e3425..0000000000
--- a/addressbook/gui/component/addressbook-config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* addressbook-storage.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- **/
-
-#ifndef __ADDRESSBOOK_CONFIG_H__
-#define __ADDRESSBOOK_CONFIG_H__
-
-#include "addressbook-storage.h"
-#include "evolution-config-control.h"
-
-EvolutionConfigControl *addressbook_config_control_new (void);
-
-void addressbook_config_create_new_source (const char *new_source,
- GtkWidget *parent);
-
-#endif /* __ADDRESSBOOK_CONFIG_H__ */
diff --git a/addressbook/gui/component/addressbook-storage.c b/addressbook/gui/component/addressbook-storage.c
deleted file mode 100644
index 6f087b6c7e..0000000000
--- a/addressbook/gui/component/addressbook-storage.c
+++ /dev/null
@@ -1,731 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-ldap-storage.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Toshok
- */
-
-/* The addressbook-sources.xml file goes like this:
-
- <?xml version="1.0"?>
- <addressbooks>
- <contactserver>
- <name>LDAP Server</name>
- <host>ldap.server.com</host>
- <port>389</port>
- <rootdn></rootdn>
- <authmethod>simple</authmethod>
- <emailaddr>toshok@blubag.com</emailaddr>
- <limit>100</limit>
- <rememberpass/>
- </contactserver>
- </addressbooks>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "addressbook-storage.h"
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <bonobo/bonobo-object.h>
-
-#include <gal/util/e-util.h>
-#include <gal/util/e-xml-utils.h>
-#include <libgnome/gnome-i18n.h>
-
-#include "evolution-shell-component.h"
-
-#include "addressbook-config.h"
-
-#define ADDRESSBOOK_SOURCES_XML "addressbook-sources.xml"
-
-#ifdef HAVE_LDAP
-static gboolean load_source_data (const char *file_path);
-#endif
-
-static gboolean save_source_data (const char *file_path);
-static void deregister_storage (void);
-
-static GList *sources;
-static EvolutionStorage *storage;
-static char *storage_path;
-static GNOME_Evolution_Shell corba_shell;
-
-void
-addressbook_storage_setup (EvolutionShellComponent *shell_component,
- const char *evolution_homedir)
-{
- EvolutionShellClient *shell_client;
-
- shell_client = evolution_shell_component_get_owner (shell_component);
- if (shell_client == CORBA_OBJECT_NIL) {
- g_warning ("We have no shell!?");
- return;
- }
-
- corba_shell = evolution_shell_client_corba_objref (shell_client);
-
- sources = NULL;
-
- if (storage_path)
- g_free (storage_path);
- storage_path = g_build_filename (evolution_homedir, ADDRESSBOOK_SOURCES_XML, NULL);
-#ifdef HAVE_LDAP
- if (!load_source_data (storage_path))
- deregister_storage ();
-#endif
-}
-
-void
-addressbook_storage_cleanup (void)
-{
- if (storage != NULL) {
- bonobo_object_unref (storage);
- storage = NULL;
- }
-}
-
-#ifdef HAVE_LDAP
-static void
-notify_listener (const Bonobo_Listener listener,
- GNOME_Evolution_Storage_Result corba_result)
-{
- CORBA_any any;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- any._type = TC_GNOME_Evolution_Storage_Result;
- any._value = &corba_result;
-
- Bonobo_Listener_event (listener, "result", &any, &ev);
-
- CORBA_exception_free (&ev);
-}
-
-static void
-remove_ldap_folder (EvolutionStorage *storage, const Bonobo_Listener listener,
- const CORBA_char *path, const CORBA_char *physical_uri,
- gpointer data)
-{
-
- addressbook_storage_remove_source (path + 1);
- addressbook_storage_write_sources();
-
- notify_listener (listener, GNOME_Evolution_Storage_OK);
-}
-
-static void
-create_ldap_folder (EvolutionStorage *storage, const Bonobo_Listener listener,
- const CORBA_char *path, const CORBA_char *type,
- const CORBA_char *description, const CORBA_char *parent_physical_uri,
- gpointer data)
-{
- if (strcmp (type, "contacts")) {
- notify_listener (listener, GNOME_Evolution_Storage_UNSUPPORTED_TYPE);
- return;
- }
-
- if (strcmp (parent_physical_uri, "")) {/* ldap servers can't have subfolders */
- notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI);
- return;
- }
- addressbook_config_create_new_source (path + 1, NULL);
-
- notify_listener (listener, GNOME_Evolution_Storage_OK);
-}
-#endif
-
-
-EvolutionStorage *
-addressbook_get_other_contact_storage (void)
-{
-#ifdef HAVE_LDAP
- EvolutionStorageResult result;
-
- if (storage == NULL) {
- storage = evolution_storage_new (_("Other Contacts"), FALSE);
- g_signal_connect (storage,
- "remove_folder",
- G_CALLBACK (remove_ldap_folder), NULL);
- g_signal_connect (storage,
- "create_folder",
- G_CALLBACK (create_ldap_folder), NULL);
- result = evolution_storage_register_on_shell (storage, corba_shell);
- switch (result) {
- case EVOLUTION_STORAGE_OK:
- break;
- case EVOLUTION_STORAGE_ERROR_GENERIC :
- g_warning("register_storage: generic error");
- break;
- case EVOLUTION_STORAGE_ERROR_CORBA :
- g_warning("register_storage: corba error");
- break;
- case EVOLUTION_STORAGE_ERROR_ALREADYREGISTERED :
- g_warning("register_storage: already registered error");
- break;
- case EVOLUTION_STORAGE_ERROR_EXISTS :
- g_warning("register_storage: already exists error");
- break;
- default:
- g_warning("register_storage: other error");
- break;
- }
- }
-#endif
-
- return storage;
-}
-
-static void
-deregister_storage (void)
-{
- if (evolution_storage_deregister_on_shell (storage, corba_shell) !=
- EVOLUTION_STORAGE_OK) {
- g_warning("couldn't deregister storage");
- }
-
- storage = NULL;
-}
-
-#ifdef HAVE_LDAP
-static char *
-get_string_value (xmlNode *node,
- const char *name)
-{
- xmlNode *p;
- xmlChar *xml_string;
- char *retval;
-
- p = e_xml_get_child_by_name (node, (xmlChar *) name);
- if (p == NULL)
- return NULL;
-
- p = e_xml_get_child_by_name (p, (xmlChar *) "text");
- if (p == NULL) /* there's no text between the tags, return the empty string */
- return g_strdup("");
-
- xml_string = xmlNodeListGetString (node->doc, p, 1);
- retval = g_strdup ((char *) xml_string);
- xmlFree (xml_string);
-
- return retval;
-}
-
-static int
-get_integer_value (xmlNode *node,
- const char *name,
- int defval)
-{
- xmlNode *p;
- xmlChar *xml_string;
- int retval;
-
- p = e_xml_get_child_by_name (node, (xmlChar *) name);
- if (p == NULL)
- return defval;
-
- p = e_xml_get_child_by_name (p, (xmlChar *) "text");
- if (p == NULL) /* there's no text between the tags, return the default */
- return defval;
-
- xml_string = xmlNodeListGetString (node->doc, p, 1);
- retval = atoi (xml_string);
- xmlFree (xml_string);
-
- return retval;
-}
-#endif
-
-static char *
-ldap_unparse_auth (AddressbookLDAPAuthType auth_type)
-{
- switch (auth_type) {
- case ADDRESSBOOK_LDAP_AUTH_NONE:
- return "none";
- case ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL:
- return "ldap/simple-email";
- case ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN:
- return "ldap/simple-binddn";
- default:
- g_assert(0);
- return "none";
- }
-}
-
-#ifdef HAVE_LDAP
-static AddressbookLDAPAuthType
-ldap_parse_auth (const char *auth)
-{
- if (!auth)
- return ADDRESSBOOK_LDAP_AUTH_NONE;
-
- if (!strcmp (auth, "ldap/simple-email") || !strcmp (auth, "simple"))
- return ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL;
- else if (!strcmp (auth, "ldap/simple-binddn"))
- return ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN;
- else
- return ADDRESSBOOK_LDAP_AUTH_NONE;
-}
-#endif
-
-static char *
-ldap_unparse_scope (AddressbookLDAPScopeType scope_type)
-{
- switch (scope_type) {
- case ADDRESSBOOK_LDAP_SCOPE_BASE:
- return "base";
- case ADDRESSBOOK_LDAP_SCOPE_ONELEVEL:
- return "one";
- case ADDRESSBOOK_LDAP_SCOPE_SUBTREE:
- return "sub";
- default:
- g_assert(0);
- return "";
- }
-}
-
-#ifdef HAVE_LDAP
-static AddressbookLDAPScopeType
-ldap_parse_scope (const char *scope)
-{
- if (!scope)
- return ADDRESSBOOK_LDAP_SCOPE_SUBTREE; /* XXX good default? */
-
- if (!strcmp (scope, "base"))
- return ADDRESSBOOK_LDAP_SCOPE_BASE;
- else if (!strcmp (scope, "one"))
- return ADDRESSBOOK_LDAP_SCOPE_ONELEVEL;
- else
- return ADDRESSBOOK_LDAP_SCOPE_SUBTREE;
-}
-#endif
-
-static char *
-ldap_unparse_ssl (AddressbookLDAPSSLType ssl_type)
-{
- switch (ssl_type) {
- case ADDRESSBOOK_LDAP_SSL_NEVER:
- return "never";
- case ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE:
- return "whenever_possible";
- case ADDRESSBOOK_LDAP_SSL_ALWAYS:
- return "always";
- default:
- g_assert(0);
- return "";
- }
-}
-
-#ifdef HAVE_LDAP
-static AddressbookLDAPSSLType
-ldap_parse_ssl (const char *ssl)
-{
- if (!ssl)
- return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; /* XXX good default? */
-
- if (!strcmp (ssl, "always"))
- return ADDRESSBOOK_LDAP_SSL_ALWAYS;
- else if (!strcmp (ssl, "never"))
- return ADDRESSBOOK_LDAP_SSL_NEVER;
- else
- return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE;
-}
-#endif
-
-const char*
-addressbook_storage_auth_type_to_string (AddressbookLDAPAuthType auth_type)
-{
- return ldap_unparse_auth (auth_type);
-}
-
-void
-addressbook_storage_init_source_uri (AddressbookSource *source)
-{
- GString *str;
-
- if (source->uri)
- g_free (source->uri);
-
- str = g_string_new ("ldap://");
-
- g_string_append_printf (str, "%s:%s/%s?"/*trigraph prevention*/"?%s",
- source->host,
- source->port,
- source->rootdn,
- ldap_unparse_scope (source->scope));
-
- g_string_append_printf (str, ";limit=%d", source->limit);
-
- g_string_append_printf (str, ";ssl=%s", ldap_unparse_ssl (source->ssl));
-
-#if 0
- g_string_append_printf (str, ";timeout=%d", source->timeout);
-#endif
-
- source->uri = str->str;
-
- g_string_free (str, FALSE);
-}
-
-#ifdef HAVE_LDAP
-static gboolean
-load_source_data (const char *file_path)
-{
- xmlDoc *doc;
- xmlNode *root;
- xmlNode *child;
-
- addressbook_get_other_contact_storage();
-
- tryagain:
- doc = xmlParseFile (file_path);
- if (doc == NULL) {
- /* Check to see if a addressbook-sources.xml.new file
- exists. If it does, rename it and try loading it */
- char *new_path = g_strdup_printf ("%s.new", file_path);
- struct stat sb;
-
- if (stat (new_path, &sb) == 0) {
- int rv;
-
- rv = rename (new_path, file_path);
- g_free (new_path);
-
- if (rv < 0) {
- g_error ("Failed to rename %s: %s\n",
- file_path,
- strerror(errno));
- return FALSE;
- } else
- goto tryagain;
- }
-
- g_free (new_path);
- return FALSE;
- }
-
- root = xmlDocGetRootElement (doc);
- if (root == NULL || strcmp (root->name, "addressbooks") != 0) {
- xmlFreeDoc (doc);
- return FALSE;
- }
-
- for (child = root->children; child; child = child->next) {
- char *path;
- AddressbookSource *source;
-
- source = g_new0 (AddressbookSource, 1);
-
- if (!strcmp (child->name, "contactserver")) {
- source->port = get_string_value (child, "port");
- source->host = get_string_value (child, "host");
- source->rootdn = get_string_value (child, "rootdn");
- source->scope = ldap_parse_scope (get_string_value (child, "scope"));
- source->auth = ldap_parse_auth (get_string_value (child, "authmethod"));
- source->ssl = ldap_parse_ssl (get_string_value (child, "ssl"));
- source->email_addr = get_string_value (child, "emailaddr");
- source->binddn = get_string_value (child, "binddn");
- source->limit = get_integer_value (child, "limit", 100);
- }
- else if (!strcmp (child->name, "text")) {
- if (child->content) {
- int i;
- for (i = 0; i < strlen (child->content); i++) {
- if (!isspace (child->content[i])) {
- g_warning ("illegal text in contactserver list.");
- break;
- }
- }
- }
- g_free (source);
- continue;
- }
- else {
- g_warning ("unknown node '%s' in %s", child->name, file_path);
- g_free (source);
- continue;
- }
-
- addressbook_storage_init_source_uri (source);
-
- source->name = get_string_value (child, "name");
- source->description = get_string_value (child, "description");
-
- path = g_strdup_printf ("/%s", source->name);
- evolution_storage_new_folder (storage, path, source->name,
- "contacts/ldap", source->uri,
- source->description, NULL, 0, FALSE, 0);
-
- sources = g_list_append (sources, source);
-
- g_free (path);
- }
-
- if (g_list_length (sources) == 0)
- deregister_storage();
-
- xmlFreeDoc (doc);
- return TRUE;
-}
-#endif
-
-static void
-ldap_source_foreach(AddressbookSource *source, xmlNode *root)
-{
- xmlNode *source_root = xmlNewNode (NULL,
- (xmlChar *) "contactserver");
-
- xmlAddChild (root, source_root);
-
- xmlNewChild (source_root, NULL, (xmlChar *) "name",
- (xmlChar *) source->name);
- xmlNewChild (source_root, NULL, (xmlChar *) "description",
- (xmlChar *) source->description);
-
- xmlNewChild (source_root, NULL, (xmlChar *) "port",
- (xmlChar *) source->port);
- xmlNewChild (source_root, NULL, (xmlChar *) "host",
- (xmlChar *) source->host);
- xmlNewChild (source_root, NULL, (xmlChar *) "rootdn",
- (xmlChar *) source->rootdn);
- xmlNewChild (source_root, NULL, (xmlChar *) "scope",
- (xmlChar *) ldap_unparse_scope(source->scope));
- xmlNewChild (source_root, NULL, (xmlChar *) "authmethod",
- (xmlChar *) ldap_unparse_auth(source->auth));
- xmlNewChild (source_root, NULL, (xmlChar *) "ssl",
- (xmlChar *) ldap_unparse_ssl(source->ssl));
-
- if (source->limit != 100) {
- char *string;
- string = g_strdup_printf ("%d", source->limit);
- xmlNewChild (source_root, NULL, (xmlChar *) "limit",
- (xmlChar *) string);
- g_free (string);
- }
-
- if (source->auth != ADDRESSBOOK_LDAP_AUTH_NONE) {
- if (source->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN)
- xmlNewChild (source_root, NULL, (xmlChar *) "binddn",
- (xmlChar *) source->binddn);
- else
- xmlNewChild (source_root, NULL, (xmlChar *) "emailaddr",
- (xmlChar *) source->email_addr);
-
- if (source->remember_passwd)
- xmlNewChild (source_root, NULL, (xmlChar *) "rememberpass",
- NULL);
- }
-}
-
-static gboolean
-save_source_data (const char *file_path)
-{
- xmlDoc *doc;
- xmlNode *root;
- int fd, rv;
- xmlChar *buf;
- int buf_size;
- char *new_path = g_strdup_printf ("%s.new", file_path);
-
- doc = xmlNewDoc ((xmlChar *) "1.0");
- root = xmlNewDocNode (doc, NULL, (xmlChar *) "addressbooks", NULL);
- xmlDocSetRootElement (doc, root);
-
- g_list_foreach (sources, (GFunc)ldap_source_foreach, root);
-
- fd = open (new_path, O_CREAT | O_TRUNC | O_WRONLY, 0600);
- fchmod (fd, 0600);
-
- xmlDocDumpMemory (doc, &buf, &buf_size);
-
- if (buf == NULL) {
- g_error ("Failed to write %s: xmlBufferCreate() == NULL", file_path);
- return FALSE;
- }
-
- rv = write (fd, buf, buf_size);
- xmlFree (buf);
- close (fd);
-
- if (0 > rv) {
- g_error ("Failed to write new %s: %s\n", file_path, strerror(errno));
- unlink (new_path);
- return FALSE;
- }
- else {
- if (0 > rename (new_path, file_path)) {
- g_error ("Failed to rename %s: %s\n", file_path, strerror(errno));
- unlink (new_path);
- return FALSE;
- }
- return TRUE;
- }
-}
-
-void
-addressbook_storage_add_source (AddressbookSource *source)
-{
- char *path;
-
- sources = g_list_append (sources, source);
-
- /* And then to the ui */
- addressbook_get_other_contact_storage();
- path = g_strdup_printf ("/%s", source->name);
- evolution_storage_new_folder (storage, path, source->name, "contacts/ldap",
- source->uri, source->description, NULL, 0, FALSE, 0);
-
- g_free (path);
-}
-
-void
-addressbook_storage_remove_source (const char *name)
-{
- char *path;
- AddressbookSource *source = NULL;
- GList *l;
-
- /* remove it from our hashtable */
- for (l = sources; l; l = l->next) {
- AddressbookSource *s = l->data;
- if (!strcmp (s->name, name)) {
- source = s;
- break;
- }
- }
-
- if (!source)
- return;
-
- sources = g_list_remove_link (sources, l);
- g_list_free_1 (l);
-
- addressbook_source_free (source);
-
- /* and then from the ui */
- path = g_strdup_printf ("/%s", name);
- evolution_storage_removed_folder (storage, path);
-
- if (g_list_length (sources) == 0)
- deregister_storage ();
-
- g_free (path);
-}
-
-GList *
-addressbook_storage_get_sources ()
-{
- return sources;
-}
-
-AddressbookSource *
-addressbook_storage_get_source_by_uri (const char *uri)
-{
- GList *l;
-
- for (l = sources; l ; l = l->next) {
- AddressbookSource *source = l->data;
- if (!strcmp (uri, source->uri))
- return source;
- }
-
- return NULL;
-}
-
-void
-addressbook_source_free (AddressbookSource *source)
-{
- g_free (source->name);
- g_free (source->description);
- g_free (source->uri);
- g_free (source->host);
- g_free (source->port);
- g_free (source->rootdn);
- g_free (source->email_addr);
- g_free (source->binddn);
-
- g_free (source);
-}
-
-static void
-addressbook_source_foreach (AddressbookSource *source, gpointer data)
-{
- char *path = g_strdup_printf ("/%s", source->name);
-
- evolution_storage_removed_folder (storage, path);
-
- g_free (path);
-
- addressbook_source_free (source);
-}
-
-void
-addressbook_storage_clear_sources (void)
-{
- g_list_foreach (sources, (GFunc)addressbook_source_foreach, NULL);
- g_list_free (sources);
- deregister_storage ();
- sources = NULL;
-}
-
-void
-addressbook_storage_write_sources (void)
-{
- save_source_data (storage_path);
-}
-
-AddressbookSource *
-addressbook_source_copy (const AddressbookSource *source)
-{
- AddressbookSource *copy;
-
- copy = g_new0 (AddressbookSource, 1);
- copy->name = g_strdup (source->name);
- copy->description = g_strdup (source->description);
- copy->uri = g_strdup (source->uri);
-
- copy->host = g_strdup (source->host);
- copy->port = g_strdup (source->port);
- copy->rootdn = g_strdup (source->rootdn);
- copy->scope = source->scope;
- copy->auth = source->auth;
- copy->ssl = source->ssl;
- copy->email_addr = g_strdup (source->email_addr);
- copy->binddn = g_strdup (source->binddn);
- copy->remember_passwd = source->remember_passwd;
- copy->limit = source->limit;
-
- return copy;
-}
diff --git a/addressbook/gui/component/addressbook-storage.h b/addressbook/gui/component/addressbook-storage.h
deleted file mode 100644
index 9a26abebd6..0000000000
--- a/addressbook/gui/component/addressbook-storage.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* addressbook-storage.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Toshok
- */
-
-#ifndef __ADDRESSBOOK_STORAGE_H__
-#define __ADDRESSBOOK_STORAGE_H__
-
-#include "evolution-shell-component.h"
-#include "evolution-storage.h"
-
-typedef enum {
- ADDRESSBOOK_LDAP_AUTH_NONE,
- ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL,
- ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN,
-} AddressbookLDAPAuthType;
-
-typedef enum {
- ADDRESSBOOK_LDAP_SCOPE_ONELEVEL,
- ADDRESSBOOK_LDAP_SCOPE_SUBTREE,
- ADDRESSBOOK_LDAP_SCOPE_BASE,
- ADDRESSBOOK_LDAP_SCOPE_LAST
-} AddressbookLDAPScopeType;
-
-typedef enum {
- ADDRESSBOOK_LDAP_SSL_ALWAYS,
- ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE,
- ADDRESSBOOK_LDAP_SSL_NEVER
-} AddressbookLDAPSSLType;
-
-typedef struct {
- char *name;
- char *description;
- char *host;
- char *port;
- char *rootdn;
- AddressbookLDAPScopeType scope;
- AddressbookLDAPAuthType auth;
- AddressbookLDAPSSLType ssl;
- char *email_addr; /* used in AUTH_SIMPLE_EMAIL */
- char *binddn; /* used in AUTH_SIMPLE_BINDDN */
- gboolean remember_passwd;
- int limit;
-
- char *uri; /* filled in from the above */
-} AddressbookSource;
-
-void addressbook_storage_setup (EvolutionShellComponent *shell_component,
- const char *evolution_homedir);
-void addressbook_storage_cleanup (void);
-
-EvolutionStorage *addressbook_get_other_contact_storage (void);
-GList *addressbook_storage_get_sources (void);
-AddressbookSource *addressbook_storage_get_source_by_uri (const char *uri);
-void addressbook_storage_clear_sources (void);
-void addressbook_storage_write_sources (void);
-AddressbookSource *addressbook_source_copy (const AddressbookSource *source);
-void addressbook_source_free (AddressbookSource *source);
-void addressbook_storage_init_source_uri (AddressbookSource *source);
-
-void addressbook_storage_add_source (AddressbookSource *source);
-void addressbook_storage_remove_source (const char *name);
-const char* addressbook_storage_auth_type_to_string (AddressbookLDAPAuthType auth_type);
-
-#endif /* __ADDRESSBOOK_STORAGE_H__ */
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
deleted file mode 100644
index b21c70a83d..0000000000
--- a/addressbook/gui/component/addressbook.c
+++ /dev/null
@@ -1,1182 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* addressbook.c
- *
- * Copyright (C) 2000, 2001, 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Chris Lahey (clahey@ximian.com)
- */
-
-#include <config.h>
-
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkframe.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkmessagedialog.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-href.h>
-#include <libgnomeui/gnome-uidefs.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <gal/util/e-util.h>
-
-#include "e-util/e-categories-master-list-wombat.h"
-#include "e-util/e-sexp.h"
-#include "e-util/e-passwords.h"
-#include "select-names/e-select-names.h"
-#include "select-names/e-select-names-manager.h"
-
-#include "evolution-shell-component-utils.h"
-#include "evolution-activity-client.h"
-#include "e-contact-editor.h"
-#include "e-contact-save-as.h"
-#include "addressbook-config.h"
-#include "addressbook.h"
-#include "addressbook-component.h"
-#include "addressbook/gui/search/e-addressbook-search-dialog.h"
-#include "addressbook/gui/widgets/e-addressbook-view.h"
-#include "addressbook/gui/widgets/e-addressbook-util.h"
-#include "addressbook/printing/e-contact-print.h"
-
-#include <ebook/e-book.h>
-#include <ebook/e-book-util.h>
-#include <widgets/misc/e-search-bar.h>
-#include <widgets/misc/e-filter-bar.h>
-
-/* This is used for the addressbook status bar */
-#define EVOLUTION_CONTACTS_PROGRESS_IMAGE "evolution-contacts-mini.png"
-static GdkPixbuf *progress_icon[2] = { NULL, NULL };
-
-#define d(x)
-
-#define PROPERTY_FOLDER_URI "folder_uri"
-
-#define PROPERTY_FOLDER_URI_IDX 1
-
-typedef struct {
- gint refs;
- EAddressbookView *view;
- ESearchBar *search;
- gint ecml_changed_id;
- GtkWidget *vbox;
- EBook *book;
- EvolutionActivityClient *activity;
- BonoboControl *control;
- BonoboPropertyBag *properties;
- char *uri;
- char *passwd;
- gboolean ignore_search_changes;
- gboolean failed_to_load;
-} AddressbookView;
-
-static void addressbook_view_ref (AddressbookView *);
-static void addressbook_view_unref (AddressbookView *);
-
-static void addressbook_authenticate (EBook *book, gboolean previous_failure,
- AddressbookSource *source, EBookCallback cb, gpointer closure);
-
-static void book_open_cb (EBook *book, EBookStatus status, gpointer closure);
-
-static void
-save_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_save_as(view->view);
-}
-
-static void
-view_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_view(view->view);
-}
-
-static void
-search_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
-
- if (view->view)
- gtk_widget_show(e_addressbook_search_dialog_new(view->view));
-}
-
-static void
-delete_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view) {
- e_addressbook_view_delete_selection(view->view);
- }
-}
-
-static void
-print_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_print(view->view);
-}
-
-static void
-print_preview_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_print_preview(view->view);
-}
-
-static void
-stop_loading_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_stop(view->view);
-}
-
-static void
-cut_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_cut(view->view);
-}
-
-static void
-copy_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_copy(view->view);
-}
-
-static void
-paste_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_paste(view->view);
-}
-
-static void
-select_all_contacts_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_select_all (view->view);
-}
-
-static void
-send_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_send (view->view);
-}
-
-static void
-send_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_send_to (view->view);
-}
-
-static void
-copy_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_copy_to_folder (view->view);
-}
-
-static void
-move_contact_to_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- AddressbookView *view = (AddressbookView *) user_data;
- if (view->view)
- e_addressbook_view_move_to_folder (view->view);
-}
-
-static void
-forget_passwords_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- e_passwords_forget_passwords();
-}
-
-static void
-update_command_state (EAddressbookView *eav, AddressbookView *view)
-{
- BonoboUIComponent *uic;
-
- if (view->view == NULL)
- return;
-
- addressbook_view_ref (view);
-
- uic = bonobo_control_get_ui_component (view->control);
-
- if (bonobo_ui_component_get_container (uic) != CORBA_OBJECT_NIL) {
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSaveAsVCard",
- "sensitive",
- e_addressbook_view_can_save_as (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsView",
- "sensitive",
- e_addressbook_view_can_view (view->view) ? "1" : "0", NULL);
-
- /* Print Contact */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsPrint",
- "sensitive",
- e_addressbook_view_can_print (view->view) ? "1" : "0", NULL);
-
- /* Print Contact */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsPrintPreview",
- "sensitive",
- e_addressbook_view_can_print (view->view) ? "1" : "0", NULL);
-
- /* Delete Contact */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactDelete",
- "sensitive",
- e_addressbook_view_can_delete (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsCut",
- "sensitive",
- e_addressbook_view_can_cut (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsCopy",
- "sensitive",
- e_addressbook_view_can_copy (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsPaste",
- "sensitive",
- e_addressbook_view_can_paste (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSelectAll",
- "sensitive",
- e_addressbook_view_can_select_all (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSendContactToOther",
- "sensitive",
- e_addressbook_view_can_send (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsSendMessageToContact",
- "sensitive",
- e_addressbook_view_can_send_to (view->view) ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsMoveToFolder",
- "sensitive",
- e_addressbook_view_can_move_to_folder (view->view) ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactsCopyToFolder",
- "sensitive",
- e_addressbook_view_can_copy_to_folder (view->view) ? "1" : "0", NULL);
-
- /* Stop */
- bonobo_ui_component_set_prop (uic,
- "/commands/ContactStop",
- "sensitive",
- e_addressbook_view_can_stop (view->view) ? "1" : "0", NULL);
- }
-
- addressbook_view_unref (view);
-}
-
-static void
-change_view_type (AddressbookView *view, EAddressbookViewType view_type)
-{
- g_object_set (view->view, "type", view_type, NULL);
-}
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ContactsPrint", print_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsPrintPreview", print_preview_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsSaveAsVCard", save_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsView", view_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ToolSearch", search_cb),
-
- BONOBO_UI_UNSAFE_VERB ("ContactDelete", delete_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactStop", stop_loading_cb),
-
- BONOBO_UI_UNSAFE_VERB ("ContactsCut", cut_contacts_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsCopy", copy_contacts_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsPaste", paste_contacts_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsSelectAll", select_all_contacts_cb),
-
- BONOBO_UI_UNSAFE_VERB ("ContactsSendContactToOther", send_contact_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsSendMessageToContact", send_contact_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsMoveToFolder", move_contact_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsCopyToFolder", copy_contact_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactsForgetPasswords", forget_passwords_cb),
-
- BONOBO_UI_VERB_END
-};
-
-static EPixmap pixmaps [] = {
- E_PIXMAP ("/menu/File/FileOps/ContactsSaveAsVCard", "save-as-16.png"),
- E_PIXMAP ("/menu/File/Print/ContactsPrint", "print.xpm"),
- E_PIXMAP ("/menu/File/Print/ContactsPrintPreview", "print-preview.xpm"),
-
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactsCut", "16_cut.png"),
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactsCopy", "16_copy.png"),
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactsPaste", "16_paste.png"),
- E_PIXMAP ("/menu/EditPlaceholder/Edit/ContactDelete", "evolution-trash-mini.png"),
-
- E_PIXMAP ("/menu/Tools/ComponentPlaceholder/ToolSearch", "search-16.png"),
-
- E_PIXMAP ("/Toolbar/ContactsPrint", "buttons/print.png"),
- E_PIXMAP ("/Toolbar/ContactDelete", "buttons/delete-message.png"),
-
- E_PIXMAP_END
-};
-
-static void
-control_activate (BonoboControl *control,
- BonoboUIComponent *uic,
- AddressbookView *view)
-{
- Bonobo_UIContainer remote_ui_container;
-
- remote_ui_container = bonobo_control_get_remote_ui_container (control, NULL);
- bonobo_ui_component_set_container (uic, remote_ui_container, NULL);
- bonobo_object_release_unref (remote_ui_container, NULL);
-
- e_search_bar_set_ui_component (view->search, uic);
-
- bonobo_ui_component_add_verb_list_with_data (
- uic, verbs, view);
-
- bonobo_ui_component_freeze (uic, NULL);
-
- bonobo_ui_util_set_ui (uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-addressbook.xml",
- "evolution-addressbook", NULL);
-
- e_addressbook_view_setup_menus (view->view, uic);
-
- e_pixmaps_update (uic, pixmaps);
-
- bonobo_ui_component_thaw (uic, NULL);
-
- update_command_state (view->view, view);
-}
-
-static void
-control_activate_cb (BonoboControl *control,
- gboolean activate,
- AddressbookView *view)
-{
- BonoboUIComponent *uic;
-
- uic = bonobo_control_get_ui_component (control);
- g_assert (uic != NULL);
-
- if (activate) {
- control_activate (control, uic, view);
- if (activate && view->view && view->view->model)
- e_addressbook_model_force_folder_bar_message (view->view->model);
-
- /* if the book failed to load, we kick off another
- load here */
-
- if (view->failed_to_load && view->uri) {
- EBook *book;
- char *uri_data;
-
- book = e_book_new ();
- uri_data = e_book_expand_uri (view->uri);
-
- addressbook_load_uri (book, uri_data, book_open_cb, view);
-
- g_free(uri_data);
- }
- } else {
- bonobo_ui_component_unset_container (uic, NULL);
- e_addressbook_view_discard_menus (view->view);
- }
-}
-
-static ECategoriesMasterList *
-get_master_list (void)
-{
- static ECategoriesMasterList *category_list = NULL;
-
- if (category_list == NULL)
- category_list = e_categories_master_list_wombat_new ();
- return category_list;
-}
-
-static void
-addressbook_view_clear (AddressbookView *view)
-{
- if (view->book) {
- g_object_unref (view->book);
- view->book = NULL;
- }
-
- if (view->properties) {
- bonobo_object_unref (BONOBO_OBJECT(view->properties));
- view->properties = NULL;
- }
-
- g_free(view->passwd);
- view->passwd = NULL;
-
- g_free(view->uri);
- view->uri = NULL;
-
- if (view->ecml_changed_id != 0) {
- g_signal_handler_disconnect (get_master_list(),
- view->ecml_changed_id);
- view->ecml_changed_id = 0;
- }
-}
-
-static void
-addressbook_view_ref (AddressbookView *view)
-{
- g_assert (view->refs > 0);
- ++view->refs;
-}
-
-static void
-addressbook_view_unref (AddressbookView *view)
-{
- g_assert (view->refs > 0);
- --view->refs;
- if (view->refs == 0) {
- addressbook_view_clear (view);
- g_free (view);
- }
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- AddressbookView *view = closure;
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- view->failed_to_load = FALSE;
- g_object_set(view->view,
- "book", book,
- NULL);
- view->book = book;
- }
- else {
- char *label_string;
- GtkWidget *warning_dialog;
- GtkWidget *href = NULL;
- AddressbookSource *source = NULL;
-
- view->failed_to_load = TRUE;
-
- if (!strncmp (view->uri, "file:", 5)) {
- label_string =
- _("We were unable to open this addressbook. Please check that the\n"
- "path exists and that you have permission to access it.");
- }
- else {
- source = addressbook_storage_get_source_by_uri (view->uri);
-
- if (source) {
- /* special case for ldap: contact folders so we can tell the user about openldap */
-#if HAVE_LDAP
- label_string =
- _("We were unable to open this addressbook. This either\n"
- "means you have entered an incorrect URI, or the LDAP server\n"
- "is unreachable.");
-#else
- label_string =
- _("This version of Evolution does not have LDAP support\n"
- "compiled in to it. If you want to use LDAP in Evolution\n"
- "you must compile the program from the CVS sources after\n"
- "retrieving OpenLDAP from the link below.\n");
- href = gnome_href_new ("http://www.openldap.org/", "OpenLDAP at http://www.openldap.org/");
-#endif
- }
- else {
- /* other network folders */
- label_string =
- _("We were unable to open this addressbook. This either\n"
- "means you have entered an incorrect URI, or the server\n"
- "is unreachable.");
- }
- }
-
-
- warning_dialog = gtk_message_dialog_new (
- NULL /* XXX */,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CLOSE,
- label_string,
- NULL);
-
- g_signal_connect (warning_dialog,
- "response",
- G_CALLBACK (gtk_widget_destroy),
- warning_dialog);
-
- gtk_window_set_title (GTK_WINDOW (warning_dialog), _("Unable to open addressbook"));
-
- if (href)
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (warning_dialog)->vbox),
- href, FALSE, FALSE, 0);
-
- gtk_widget_show_all (warning_dialog);
- }
-}
-
-static void
-destroy_callback(gpointer data, GObject *where_object_was)
-{
- AddressbookView *view = data;
- addressbook_view_unref (view);
-}
-
-static void
-get_prop (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- AddressbookView *view = user_data;
-
- switch (arg_id) {
-
- case PROPERTY_FOLDER_URI_IDX:
- if (view && view->uri)
- BONOBO_ARG_SET_STRING (arg, view->uri);
- else
- BONOBO_ARG_SET_STRING (arg, "");
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- }
-}
-
-typedef struct {
- EBookCallback cb;
- char *clean_uri;
- AddressbookSource *source;
- gpointer closure;
-} LoadUriData;
-
-static void
-load_uri_auth_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- LoadUriData *data = closure;
-
- if (status != E_BOOK_STATUS_SUCCESS) {
- if (status == E_BOOK_STATUS_CANCELLED) {
- /* the user clicked cancel in the password dialog */
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("Accessing LDAP Server anonymously"));
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- data->cb (book, E_BOOK_STATUS_SUCCESS, data->closure);
- g_free (data->clean_uri);
- g_free (data);
- return;
- }
- else {
- e_passwords_forget_password ("Addressbook", data->clean_uri);
- addressbook_authenticate (book, TRUE, data->source, load_uri_auth_cb, closure);
- return;
- }
- }
-
- data->cb (book, status, data->closure);
-
- g_free (data->clean_uri);
- g_free (data);
-}
-
-static void
-addressbook_authenticate (EBook *book, gboolean previous_failure, AddressbookSource *source,
- EBookCallback cb, gpointer closure)
-{
- LoadUriData *load_uri_data = closure;
- const char *password = NULL;
- char *pass_dup = NULL;
- char *semicolon;
-
- load_uri_data->clean_uri = g_strdup (e_book_get_uri (book));
-
- semicolon = strchr (load_uri_data->clean_uri, ';');
-
- if (semicolon)
- *semicolon = '\0';
-
- password = e_passwords_get_password ("Addressbook", load_uri_data->clean_uri);
-
- if (!password) {
- char *prompt;
- gboolean remember;
- char *failed_auth;
-
- if (previous_failure) {
- failed_auth = _("Failed to authenticate.\n");
- }
- else {
- failed_auth = "";
- }
-
-
- if (source->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN)
- prompt = g_strdup_printf (_("%sEnter password for %s (user %s)"),
- failed_auth, source->name, source->binddn);
- else
- prompt = g_strdup_printf (_("%sEnter password for %s (user %s)"),
- failed_auth, source->name, source->email_addr);
- remember = source->remember_passwd;
- pass_dup = e_passwords_ask_password (prompt, "Addressbook", load_uri_data->clean_uri, prompt, TRUE,
- E_PASSWORDS_REMEMBER_FOREVER, &remember,
- NULL);
- if (remember != source->remember_passwd) {
- source->remember_passwd = remember;
- addressbook_storage_write_sources ();
- }
- g_free (prompt);
- }
-
- if (password || pass_dup) {
- char *user;
-
- if (source->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN)
- user = source->binddn;
- else
- user = source->email_addr;
- if (!user)
- user = "";
- e_book_authenticate_user (book, user, password ? password : pass_dup,
- addressbook_storage_auth_type_to_string (source->auth),
- cb, closure);
- g_free (pass_dup);
- return;
- }
- else {
- /* they hit cancel */
- cb (book, E_BOOK_STATUS_CANCELLED, closure);
- }
-}
-
-static void
-load_uri_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- LoadUriData *load_uri_data = closure;
-
- if (status == E_BOOK_STATUS_SUCCESS && book != NULL) {
-
- /* check if the addressbook needs authentication */
-
- load_uri_data->source = addressbook_storage_get_source_by_uri (e_book_get_uri (book));
-
- if (load_uri_data->source &&
- load_uri_data->source->auth != ADDRESSBOOK_LDAP_AUTH_NONE) {
-
- addressbook_authenticate (book, FALSE, load_uri_data->source,
- load_uri_auth_cb, closure);
-
- return;
- }
- }
-
- load_uri_data->cb (book, status, load_uri_data->closure);
- g_free (load_uri_data);
-}
-
-void
-addressbook_load_uri (EBook *book, const char *uri,
- EBookCallback cb, gpointer closure)
-{
- LoadUriData *load_uri_data = g_new0 (LoadUriData, 1);
-
- load_uri_data->cb = cb;
- load_uri_data->closure = closure;
-
- e_book_load_uri (book, uri, load_uri_cb, load_uri_data);
-}
-
-void
-addressbook_load_default_book (EBook *book, EBookCallback cb, gpointer closure)
-{
- LoadUriData *load_uri_data = g_new (LoadUriData, 1);
-
- load_uri_data->cb = cb;
- load_uri_data->closure = closure;
-
- e_book_load_default_book (book, load_uri_cb, load_uri_data);
-}
-
-static void
-set_prop (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- AddressbookView *view = user_data;
-
- char *uri_data;
-
- switch (arg_id) {
-
- case PROPERTY_FOLDER_URI_IDX:
- if (view->uri) {
- /* we've already had a uri set on this view, so unload it */
- e_book_unload_uri (view->book);
- g_free (view->uri);
- } else {
- view->book = e_book_new ();
- }
-
- view->failed_to_load = FALSE;
-
- view->uri = g_strdup(BONOBO_ARG_GET_STRING (arg));
-
- uri_data = e_book_expand_uri (view->uri);
-
- addressbook_load_uri (view->book, uri_data, book_open_cb, view);
-
- g_free(uri_data);
-
- break;
-
- default:
- g_warning ("Unhandled arg %d\n", arg_id);
- break;
- }
-}
-
-enum {
- ESB_FULL_NAME,
- ESB_EMAIL,
- ESB_CATEGORY,
- ESB_ANY,
- ESB_ADVANCED
-};
-
-static ESearchBarItem addressbook_search_option_items[] = {
- { N_("Name begins with"), ESB_FULL_NAME, NULL },
- { N_("Email begins with"), ESB_EMAIL, NULL },
- { N_("Category is"), ESB_CATEGORY, NULL }, /* We attach subitems below */
- { N_("Any field contains"), ESB_ANY, NULL },
- { N_("Advanced..."), ESB_ADVANCED, NULL },
- { NULL, -1, NULL }
-};
-
-static void
-alphabet_state_changed (EAddressbookView *eav, gunichar letter, AddressbookView *view)
-{
- view->ignore_search_changes = TRUE;
- if (letter == 0) {
- e_search_bar_set_item_id (view->search, ESB_FULL_NAME);
- e_search_bar_set_text (view->search, "");
- } else {
- e_search_bar_set_item_id (view->search, ESB_FULL_NAME);
- }
- view->ignore_search_changes = FALSE;
-}
-
-static void
-addressbook_search_activated (ESearchBar *esb, AddressbookView *view)
-{
- ECategoriesMasterList *master_list;
- char *search_word, *search_query;
- const char *category_name;
- int search_type, subid;
-
- if (view->ignore_search_changes) {
- return;
- }
-
- g_object_get(esb,
- "text", &search_word,
- "item_id", &search_type,
- NULL);
-
- if (search_type == ESB_ADVANCED) {
- gtk_widget_show(e_addressbook_search_dialog_new(view->view));
- }
- else {
- if ((search_word && strlen (search_word)) || search_type == ESB_CATEGORY) {
- GString *s = g_string_new ("");
- e_sexp_encode_string (s, search_word);
- switch (search_type) {
- case ESB_ANY:
- search_query = g_strdup_printf ("(contains \"x-evolution-any-field\" %s)",
- s->str);
- break;
- case ESB_FULL_NAME:
- search_query = g_strdup_printf ("(beginswith \"full_name\" %s)",
- s->str);
- break;
- case ESB_EMAIL:
- search_query = g_strdup_printf ("(beginswith \"email\" %s)",
- s->str);
- break;
- case ESB_CATEGORY:
- subid = e_search_bar_get_subitem_id (esb);
-
- if (subid < 0 || subid == G_MAXINT) {
- /* match everything */
- search_query = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
- } else {
- master_list = get_master_list ();
- category_name = e_categories_master_list_nth (master_list, subid);
- search_query = g_strdup_printf ("(is \"category\" \"%s\")", category_name);
- }
- break;
- default:
- search_query = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
- break;
- }
- g_string_free (s, TRUE);
- } else
- search_query = g_strdup ("(contains \"x-evolution-any-field\" \"\")");
-
- if (search_query)
- g_object_set (view->view,
- "query", search_query,
- NULL);
-
- g_free (search_query);
- }
-
- g_free (search_word);
-}
-
-static void
-addressbook_query_changed (ESearchBar *esb, AddressbookView *view)
-{
- int search_type;
-
- g_object_get(esb,
- "item_id", &search_type,
- NULL);
-
- if (search_type == ESB_ADVANCED) {
- gtk_widget_show(e_addressbook_search_dialog_new(view->view));
- }
-}
-
-static GNOME_Evolution_ShellView
-retrieve_shell_view_interface_from_control (BonoboControl *control)
-{
- Bonobo_ControlFrame control_frame;
- GNOME_Evolution_ShellView shell_view_interface;
- CORBA_Environment ev;
-
- control_frame = bonobo_control_get_control_frame (control, NULL);
-
- if (control_frame == NULL)
- return CORBA_OBJECT_NIL;
-
- CORBA_exception_init (&ev);
- shell_view_interface = Bonobo_Unknown_queryInterface (control_frame,
- "IDL:GNOME/Evolution/ShellView:1.0",
- &ev);
- CORBA_exception_free (&ev);
-
- return shell_view_interface;
-}
-
-static void
-set_status_message (EAddressbookView *eav, const char *message, AddressbookView *view)
-{
-
- if (!message || !*message) {
- if (view->activity) {
- g_object_unref (view->activity);
- view->activity = NULL;
- }
- }
- else if (!view->activity) {
- int display;
- char *clientid = g_strdup_printf ("%p", view);
-
- if (progress_icon[0] == NULL)
- progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_CONTACTS_PROGRESS_IMAGE, NULL);
-
- view->activity = evolution_activity_client_new (addressbook_component_get_shell_client(), clientid,
- progress_icon, message, TRUE, &display);
-
- g_free (clientid);
- }
- else {
- evolution_activity_client_update (view->activity, message, -1.0);
- }
-
-}
-
-static void
-search_result (EAddressbookView *eav, EBookViewStatus status, AddressbookView *view)
-{
- char *str = NULL;
-
- switch (status) {
- case E_BOOK_VIEW_STATUS_SUCCESS:
- return;
- case E_BOOK_VIEW_STATUS_SIZE_LIMIT_EXCEEDED:
- str = _("More cards matched this query than either the server is \n"
- "configured to return or Evolution is configured to display.\n"
- "Please make your search more specific or raise the result limit in\n"
- "the directory server preferences for this addressbook.");
- break;
- case E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED:
- str = _("The time to execute this query exceeded the server limit or the limit\n"
- "you have configured for this addressbook. Please make your search\n"
- "more specific or raise the time limit in the directory server\n"
- "preferences for this addressbook.");
- break;
- case E_BOOK_VIEW_STATUS_INVALID_QUERY:
- str = _("The backend for this addressbook was unable to parse this query.");
- break;
- case E_BOOK_VIEW_STATUS_QUERY_REFUSED:
- str = _("The backend for this addressbook refused to perform this query.");
- break;
- case E_BOOK_VIEW_STATUS_OTHER_ERROR:
- case E_BOOK_VIEW_STATUS_UNKNOWN:
- str = _("This query did not complete successfully.");
- break;
- }
-
- if (str) {
- GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- str);
- g_signal_connect (dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- }
-}
-
-static void
-set_folder_bar_label (EAddressbookView *eav, const char *message, AddressbookView *view)
-{
- CORBA_Environment ev;
- GNOME_Evolution_ShellView shell_view_interface;
-
- CORBA_exception_init (&ev);
-
- shell_view_interface = retrieve_shell_view_interface_from_control (view->control);
- if (!shell_view_interface) {
- CORBA_exception_free (&ev);
- return;
- }
-
- d(g_message("Updating via ShellView"));
-
- if (message == NULL || message[0] == 0) {
- GNOME_Evolution_ShellView_setFolderBarLabel (shell_view_interface,
- "",
- &ev);
- }
- else {
- GNOME_Evolution_ShellView_setFolderBarLabel (shell_view_interface,
- message,
- &ev);
- }
-
- if (BONOBO_EX (&ev))
- g_warning ("Exception in label update: %s",
- bonobo_exception_get_text (&ev));
-
- CORBA_exception_free (&ev);
-
- bonobo_object_release_unref (shell_view_interface, NULL);
-}
-
-/* Our global singleton config database */
-static Bonobo_ConfigDatabase config_db = NULL;
-
-Bonobo_ConfigDatabase
-addressbook_config_database (CORBA_Environment *ev)
-{
- if (config_db == NULL)
- config_db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", ev);
-
- return config_db;
-}
-
-static int
-compare_subitems (const void *a, const void *b)
-{
- const ESearchBarSubitem *subitem_a = a;
- const ESearchBarSubitem *subitem_b = b;
-
- return strcoll (subitem_a->text, subitem_b->text);
-}
-
-static void
-make_suboptions (AddressbookView *view)
-{
- ESearchBarSubitem *subitems, *s;
- ECategoriesMasterList *master_list;
- gint i, N;
-
- master_list = get_master_list ();
- N = e_categories_master_list_count (master_list);
- subitems = g_new (ESearchBarSubitem, N+2);
-
- subitems[0].id = G_MAXINT;
- subitems[0].text = g_strdup (_("Any Category"));
- subitems[0].translate = FALSE;
-
- for (i=0; i<N; ++i) {
- const char *category = e_categories_master_list_nth (master_list, i);
-
- subitems[i+1].id = i;
- subitems[i+1].text = g_strdup (category);
- subitems[i+1].translate = FALSE;
- }
- subitems[N+1].id = -1;
- subitems[N+1].text = NULL;
-
- qsort (subitems + 1, N, sizeof (subitems[0]), compare_subitems);
-
- e_search_bar_set_suboption (view->search, ESB_CATEGORY, subitems);
-
- for (s = subitems; s->id != -1; s++) {
- if (s->text)
- g_free (s->text);
- }
- g_free (subitems);
-}
-
-static void
-ecml_changed (ECategoriesMasterList *ecml, AddressbookView *view)
-{
- make_suboptions (view);
-}
-
-static void
-connect_master_list_changed (AddressbookView *view)
-{
- view->ecml_changed_id =
- g_signal_connect (get_master_list(), "changed",
- G_CALLBACK (ecml_changed), view);
-}
-
-BonoboControl *
-addressbook_new_control (void)
-{
- AddressbookView *view;
- GtkWidget *frame;
-
- frame = gtk_frame_new (NULL);
- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
-
- view = g_new0 (AddressbookView, 1);
- view->refs = 1;
- view->ignore_search_changes = FALSE;
-
- view->vbox = gtk_vbox_new (FALSE, 0);
-
- g_object_weak_ref (G_OBJECT (view->vbox), destroy_callback, view);
-
- /* Create the control. */
- view->control = bonobo_control_new (view->vbox);
-
- view->search = E_SEARCH_BAR (e_search_bar_new (NULL, addressbook_search_option_items));
- make_suboptions (view);
- connect_master_list_changed (view);
-
- gtk_box_pack_start (GTK_BOX (view->vbox), GTK_WIDGET (view->search),
- FALSE, FALSE, 0);
- g_signal_connect (view->search, "query_changed",
- G_CALLBACK (addressbook_query_changed), view);
- g_signal_connect (view->search, "search_activated",
- G_CALLBACK (addressbook_search_activated), view);
-
- view->view = E_ADDRESSBOOK_VIEW(e_addressbook_view_new());
- gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (view->view));
- gtk_box_pack_start (GTK_BOX (view->vbox), frame,
- TRUE, TRUE, 0);
-
- /* create the initial view */
- change_view_type (view, E_ADDRESSBOOK_VIEW_MINICARD);
-
- gtk_widget_show (frame);
- gtk_widget_show (view->vbox);
- gtk_widget_show (GTK_WIDGET(view->view));
- gtk_widget_show (GTK_WIDGET(view->search));
-
- view->properties = bonobo_property_bag_new (get_prop, set_prop, view);
-
- bonobo_property_bag_add (view->properties,
- PROPERTY_FOLDER_URI, PROPERTY_FOLDER_URI_IDX,
- BONOBO_ARG_STRING, NULL, _("The URI that the Folder Browser will display"), 0);
-
- bonobo_control_set_properties (view->control,
- bonobo_object_corba_objref (BONOBO_OBJECT (view->properties)),
- NULL);
-
- g_signal_connect (view->view,
- "status_message",
- G_CALLBACK(set_status_message),
- view);
-
- g_signal_connect (view->view,
- "search_result",
- G_CALLBACK(search_result),
- view);
-
- g_signal_connect (view->view,
- "folder_bar_message",
- G_CALLBACK(set_folder_bar_label),
- view);
-
- g_signal_connect (view->view,
- "command_state_change",
- G_CALLBACK(update_command_state),
- view);
-
- g_signal_connect (view->view,
- "alphabet_state_change",
- G_CALLBACK(alphabet_state_changed),
- view);
-
- view->uri = NULL;
-
- g_signal_connect (view->control, "activate",
- G_CALLBACK (control_activate_cb), view);
-
- return view->control;
-}
diff --git a/addressbook/gui/component/addressbook.h b/addressbook/gui/component/addressbook.h
deleted file mode 100644
index 3d4bba5187..0000000000
--- a/addressbook/gui/component/addressbook.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef __ADDRESSBOOK_H__
-#define __ADDRESSBOOK_H__
-
-#include <bonobo/bonobo-control.h>
-#include <e-util/e-config-listener.h>
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-moniker-util.h>
-#include <ebook/e-book.h>
-
-/* use this instead of e_book_load_uri everywhere where you want the
- authentication to be handled for you. */
-void addressbook_load_uri (EBook *book, const char *uri, EBookCallback cb, gpointer closure);
-void addressbook_load_default_book (EBook *book, EBookCallback open_response, gpointer closure);
-
-BonoboControl *addressbook_new_control (void);
-
-#endif /* __ADDRESSBOOK_H__ */
diff --git a/addressbook/gui/component/apps_evolution_addressbook.schemas b/addressbook/gui/component/apps_evolution_addressbook.schemas
deleted file mode 100644
index 82af9d0843..0000000000
--- a/addressbook/gui/component/apps_evolution_addressbook.schemas
+++ /dev/null
@@ -1,42 +0,0 @@
-<gconfschemafile>
- <schemalist>
-
- <!-- Completion uris -->
-
- <schema>
- <key>/schemas/apps/evolution/addressbook/completion/uris</key>
- <applyto>/apps/evolution/addressbook/completion/uris</applyto>
- <owner>evolution-addressbook</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>EFolderList xml for the list of completion uris</short>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/evolution/addressbook/completion/minimum_query_length</key>
- <applyto>/apps/evolution/addressbook/completion/minimum_query_length</applyto>
- <owner>evolution-addressbook</owner>
- <type>int</type>
- <default>3</default>
- <locale name="C">
- <short>The number of characters that must be typed before evolution will attempt to autocomplete</short>
- </locale>
- </schema>
-
- <!-- Select names last used uri -->
-
- <schema>
- <key>/schemas/apps/evolution/addressbook/select_names/last_used_uri</key>
- <applyto>/apps/evolution/addressbook/select_names/last_used_uri</applyto>
- <owner>evolution-addressbook</owner>
- <type>string</type>
- <default></default>
- <locale name="C">
- <short>URI for the folder last used in the select names dialog</short>
- </locale>
- </schema>
-
- </schemalist>
-</gconfschemafile> \ No newline at end of file
diff --git a/addressbook/gui/component/component-factory.c b/addressbook/gui/component/component-factory.c
deleted file mode 100644
index 9d5e946dc0..0000000000
--- a/addressbook/gui/component/component-factory.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* component-factory.c - Factory for Evolution's Addressbook component.
- *
- * Copyright (C) 2002 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli <ettore@ximian.com>
- */
-
-#include <config.h>
-
-#include <string.h>
-#include "addressbook.h"
-#include "addressbook-component.h"
-#include "addressbook-config.h"
-#include "e-address-popup.h"
-#include "e-address-widget.h"
-#include "e-minicard-control.h"
-#include "select-names/e-select-names-bonobo.h"
-
-#include <bonobo/bonobo-shlib-factory.h>
-
-
-#define FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_Factory"
-
-#define MINICARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_MiniCard_Control"
-#define ADDRESSBOOK_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_Control"
-#define SHELL_COMPONENT_ID "OAFIID:GNOME_Evolution_Addressbook_ShellComponent"
-#define ADDRESS_WIDGET_ID "OAFIID:GNOME_Evolution_Addressbook_AddressWidget"
-#define ADDRESS_POPUP_ID "OAFIID:GNOME_Evolution_Addressbook_AddressPopup"
-#define SELECT_NAMES_ID "OAFIID:GNOME_Evolution_Addressbook_SelectNames"
-#define LDAP_STORAGE_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl"
-
-
-static BonoboObject *
-factory (BonoboGenericFactory *factory,
- const char *component_id,
- void *closure)
-{
- if (strcmp (component_id, MINICARD_CONTROL_ID) == 0)
- return BONOBO_OBJECT (e_minicard_control_new ());
- if (strcmp (component_id, ADDRESSBOOK_CONTROL_ID) == 0)
- return BONOBO_OBJECT (addressbook_new_control ());
- if (strcmp (component_id, SHELL_COMPONENT_ID) == 0)
- return addressbook_component_init ();
- if (strcmp (component_id, ADDRESS_WIDGET_ID) == 0)
- return BONOBO_OBJECT (e_address_widget_new_control ());
- if (strcmp (component_id, ADDRESS_POPUP_ID) == 0)
- return BONOBO_OBJECT (e_address_popup_new_control ());
- if (strcmp (component_id, LDAP_STORAGE_CONFIG_CONTROL_ID) == 0)
- return BONOBO_OBJECT (addressbook_config_control_new ());
- if (strcmp (component_id, SELECT_NAMES_ID) == 0)
- return BONOBO_OBJECT (e_select_names_bonobo_new ());
-
- g_warning (FACTORY_ID ": Don't know what to do with %s", component_id);
- return NULL;
-}
-
-BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Addressbook component factory", factory, NULL)
diff --git a/addressbook/gui/component/e-address-popup.c b/addressbook/gui/component/e-address-popup.c
deleted file mode 100644
index 0b5ec97185..0000000000
--- a/addressbook/gui/component/e-address-popup.c
+++ /dev/null
@@ -1,1258 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-address-popup.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-/*
- * This file is too big and this widget is too complicated. Forgive me.
- */
-
-#include <config.h>
-#include <string.h>
-#include "addressbook.h"
-#include "e-address-popup.h"
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/gui/contact-editor/e-contact-editor.h>
-#include <addressbook/gui/contact-editor/e-contact-quick-add.h>
-#include <addressbook/gui/widgets/e-minicard-widget.h>
-#include <addressbook/gui/widgets/e-addressbook-util.h>
-#include "e-util/e-gui-utils.h"
-
-/*
- * Some general scaffolding for our widgets. Think of this as a really, really
- * lame implementation of a wizard (...which is still somewhat more general that
- * we really need it to be).
- */
-
-typedef struct _MiniWizard MiniWizard;
-struct _MiniWizard {
- GtkWidget *body;
-
- GtkWidget *vbox;
- GtkWidget *ok_button;
- GtkWidget *cancel_button;
-
- void (*ok_cb) (MiniWizard *, gpointer);
- void (*cleanup_cb) (gpointer);
- gpointer closure;
-
- void (*destroy_cb) (MiniWizard *, gpointer);
- gpointer destroy_closure;
-};
-
-static void
-mini_wizard_container_add (MiniWizard *wiz, GtkWidget *w)
-{
- GList *iter = gtk_container_get_children (GTK_CONTAINER (wiz->vbox));
- while (iter != NULL) {
- GtkWidget *oldw = (GtkWidget *) iter->data;
- iter = g_list_next (iter);
- gtk_container_remove (GTK_CONTAINER (wiz->vbox), oldw);
- }
- gtk_container_add (GTK_CONTAINER (wiz->vbox), w);
-}
-
-static void
-mini_wizard_destroy (MiniWizard *wiz)
-{
- if (wiz->cleanup_cb)
- wiz->cleanup_cb (wiz->closure);
- wiz->cleanup_cb = NULL;
-
- if (wiz->destroy_cb)
- wiz->destroy_cb (wiz, wiz->destroy_closure);
-}
-
-static void
-mini_wizard_ok_cb (GtkWidget *b, gpointer closure)
-{
- MiniWizard *wiz = (MiniWizard *) closure;
-
- gpointer old_closure = wiz->closure;
- void (*old_cleanup) (gpointer) = wiz->cleanup_cb;
-
- wiz->cleanup_cb = NULL;
-
- if (wiz->ok_cb)
- wiz->ok_cb (wiz, wiz->closure);
-
- if (old_cleanup)
- old_cleanup (old_closure);
-
-}
-
-static void
-mini_wizard_cancel_cb (GtkWidget *b, gpointer closure)
-{
- mini_wizard_destroy ((MiniWizard *) closure);
-}
-
-static void
-mini_wizard_destroy_cb (gpointer closure, GObject *where_object_was)
-{
- MiniWizard *wiz = (MiniWizard *) closure;
- if (wiz->cleanup_cb)
- wiz->cleanup_cb (wiz->closure);
- g_free (wiz);
-}
-
-static MiniWizard *
-mini_wizard_new (void)
-{
- MiniWizard *wiz = g_new (MiniWizard, 1);
- GtkWidget *bbox;
-
- wiz->body = gtk_vbox_new (FALSE, 2);
- wiz->vbox = gtk_vbox_new (FALSE, 2);
- wiz->ok_button = gtk_button_new_from_stock (GTK_STOCK_OK);
- wiz->cancel_button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
-
- wiz->ok_cb = NULL;
- wiz->cleanup_cb = NULL;
- wiz->closure = NULL;
-
- wiz->destroy_cb = NULL;
- wiz->destroy_closure = NULL;
-
- bbox = gtk_hbutton_box_new ();
- gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox),
- GTK_BUTTONBOX_END);
-
- gtk_box_pack_start (GTK_BOX (bbox), wiz->cancel_button, FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (bbox), wiz->ok_button, FALSE, TRUE, 0);
-
- gtk_box_set_spacing (GTK_BOX (bbox),
- 10 /* ugh */);
-
- gtk_box_pack_start (GTK_BOX (wiz->body), wiz->vbox, TRUE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (wiz->body), gtk_hseparator_new (), FALSE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (wiz->body), bbox, FALSE, TRUE, 2);
-
- gtk_widget_show_all (wiz->body);
-
- g_signal_connect (wiz->ok_button,
- "clicked",
- G_CALLBACK (mini_wizard_ok_cb),
- wiz);
- g_signal_connect (wiz->cancel_button,
- "clicked",
- G_CALLBACK (mini_wizard_cancel_cb),
- wiz);
-
- g_object_weak_ref (G_OBJECT (wiz->body),
- mini_wizard_destroy_cb,
- wiz);
-
- return wiz;
-
-}
-
-
-
-/*
- * This is the code for the UI thingie that lets you manipulate the e-mail
- * addresses (and *only* the e-mail addresses) associated with an existing
- * card.
- */
-
-#define EMPTY_ENTRY N_("(none)")
-
-typedef struct _EMailMenu EMailMenu;
-struct _EMailMenu {
- GtkWidget *option_menu;
- GList *options;
- gchar *current_selection;
-};
-
-static void
-email_menu_free (EMailMenu *menu)
-{
- if (menu == NULL)
- return;
-
- g_list_foreach (menu->options, (GFunc) g_free, NULL);
- g_list_free (menu->options);
- g_free (menu);
-}
-
-static EMailMenu *
-email_menu_new (void)
-{
- EMailMenu *menu = g_new (EMailMenu, 1);
-
- menu->option_menu = gtk_option_menu_new ();
- menu->options = NULL;
- menu->current_selection = NULL;
-
- gtk_option_menu_set_menu (GTK_OPTION_MENU (menu->option_menu), gtk_menu_new ());
-
- return menu;
-}
-
-static void
-menu_activate_cb (GtkWidget *w, gpointer closure)
-{
- EMailMenu *menu = (EMailMenu *) closure;
- gchar *addr = (gchar *) g_object_get_data (G_OBJECT (w), "addr");
-
- menu->current_selection = addr;
-}
-
-static void
-email_menu_add_option (EMailMenu *menu, const gchar *addr)
-{
- GtkWidget *menu_item;
- gchar *addr_cpy;
-
- g_return_if_fail (menu != NULL);
- if (addr == NULL)
- return;
-
- addr_cpy = g_strdup (addr);
- menu->options = g_list_append (menu->options, addr_cpy);
-
- menu_item = gtk_menu_item_new_with_label (addr);
- g_object_set_data (G_OBJECT (menu_item), "addr", addr_cpy);
- gtk_widget_show_all (menu_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (gtk_option_menu_get_menu (GTK_OPTION_MENU (menu->option_menu))), menu_item);
-
- g_signal_connect (menu_item,
- "activate",
- G_CALLBACK (menu_activate_cb),
- menu);
-}
-
-static void
-email_menu_add_options_from_card (EMailMenu *menu, ECard *card, const gchar *extra_addr)
-{
- ECardSimple *simple;
-
- g_return_if_fail (card && E_IS_CARD (card));
-
- simple = e_card_simple_new (card);
-
- /* If any of these three e-mail fields are NULL, email_menu_add_option will just
- return without doing anything. */
- email_menu_add_option (menu, e_card_simple_get_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL));
- email_menu_add_option (menu, e_card_simple_get_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_2));
- email_menu_add_option (menu, e_card_simple_get_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_3));
- email_menu_add_option (menu, extra_addr);
- email_menu_add_option (menu, EMPTY_ENTRY);
-
- g_object_unref (simple);
-}
-
-static void
-email_menu_set_option (EMailMenu *menu, const gchar *addr)
-{
- guint count = 0;
- GList *iter;
-
- g_return_if_fail (menu != NULL);
-
- if (addr == NULL) {
- email_menu_set_option (menu, EMPTY_ENTRY);
- return;
- }
-
- iter = menu->options;
- while (iter && strcmp (addr, (gchar *) iter->data)) {
- ++count;
- iter = g_list_next (iter);
- }
-
- if (iter) {
- gtk_option_menu_set_history (GTK_OPTION_MENU (menu->option_menu), count);
- menu->current_selection = (gchar *) iter->data;
- }
-}
-
-#ifdef UNDEFINED_FUNCTIONS_SHOULD_PLEASE_BE_INCLUDED
-static void
-email_menu_unset_option (EMailMenu *menu, const gchar *addr)
-{
- GList *iter;
-
- g_return_if_fail (menu != NULL);
- g_return_if_fail (addr != NULL);
-
- if (menu->current_selection == NULL || strcmp (addr, menu->current_selection))
- return;
-
- iter = menu->options;
- while (iter && strcmp (addr, (gchar *) iter->data)) {
- iter = g_list_next (iter);
- }
- if (iter) {
- iter = g_list_next (iter);
- if (iter) {
- email_menu_set_option (menu, (gchar *) iter->data);
- } else {
- email_menu_set_option (menu, EMPTY_ENTRY);
- }
- }
-}
-#endif
-
-
-
-typedef struct _EMailTable EMailTable;
-struct _EMailTable {
- GtkWidget *table;
- ECard *card;
- EMailMenu *primary;
- EMailMenu *email2;
- EMailMenu *email3;
-};
-
-static void
-email_table_cleanup_cb (gpointer closure)
-{
- EMailTable *et = (EMailTable *) closure;
-
- if (et == NULL)
- return;
-
- g_object_unref (et->card);
- email_menu_free (et->primary);
- email_menu_free (et->email2);
- email_menu_free (et->email3);
-
- g_free (et);
-}
-
-static void
-email_table_from_card (EMailTable *et)
-{
- ECardSimple *simple;
-
- g_return_if_fail (et != NULL);
-
- simple = e_card_simple_new (et->card);
- email_menu_set_option (et->primary, e_card_simple_get_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL));
- email_menu_set_option (et->email2, e_card_simple_get_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_2));
- email_menu_set_option (et->email3, e_card_simple_get_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_3));
- g_object_unref (simple);
-}
-
-static void
-email_table_to_card (EMailTable *et)
-{
- ECardSimple *simple;
- gchar *curr;
-
- g_return_if_fail (et != NULL);
-
- simple = e_card_simple_new (et->card);
-
- curr = et->primary->current_selection;
- if (curr && !strcmp (curr, _(EMPTY_ENTRY)))
- curr = NULL;
- e_card_simple_set_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL, curr);
-
- curr = et->email2->current_selection;
- if (curr && !strcmp (curr, _(EMPTY_ENTRY)))
- curr = NULL;
- e_card_simple_set_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_2, curr);
-
- curr = et->email3->current_selection;
- if (curr && !strcmp (curr, _(EMPTY_ENTRY)))
- curr = NULL;
- e_card_simple_set_email (simple, E_CARD_SIMPLE_EMAIL_ID_EMAIL_3, curr);
-
- e_card_simple_sync_card (simple);
- g_object_unref (simple);
-}
-
-static void
-email_table_save_card_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- ECard *card = E_CARD (closure);
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- e_book_commit_card (book, card, NULL, NULL);
- }
- if (book)
- g_object_unref (book);
- g_object_unref (card);
-}
-
-/*
- * We have to do this in an idle function because of what might be a
- * re-entrancy problems with EBook.
- */
-static gint
-add_card_idle_cb (gpointer closure)
-{
- EBook *book;
-
- book = e_book_new ();
- addressbook_load_default_book (book, email_table_save_card_cb, closure);
-
- return 0;
-}
-
-static void
-email_table_ok_cb (MiniWizard *wiz, gpointer closure)
-{
- EMailTable *et = (EMailTable *) closure;
-
- email_table_to_card (et);
-
- g_object_ref (et->card);
- gtk_idle_add (add_card_idle_cb, et->card);
-
- mini_wizard_destroy (wiz);
-}
-
-static void
-email_table_init (MiniWizard *wiz, ECard *card, const gchar *extra_address)
-{
- EMailTable *et;
-
- gchar *name_str;
- gint xpad, ypad;
- GtkAttachOptions label_x_opts, label_y_opts;
- GtkAttachOptions menu_x_opts, menu_y_opts;
-
- g_return_if_fail (card && E_IS_CARD (card));
-
- et = g_new (EMailTable, 1);
-
- et->card = card;
- g_object_ref (et->card);
-
- et->table = gtk_table_new (4, 2, FALSE);
-
- et->primary = email_menu_new ();
- et->email2 = email_menu_new ();
- et->email3 = email_menu_new ();
-
- email_menu_add_options_from_card (et->primary, et->card, extra_address);
- email_menu_add_options_from_card (et->email2, et->card, extra_address);
- email_menu_add_options_from_card (et->email3, et->card, extra_address);
-
- email_table_from_card (et);
-
- label_x_opts = GTK_FILL;
- label_y_opts = GTK_FILL;
- menu_x_opts = GTK_EXPAND | GTK_FILL;
- menu_y_opts = GTK_EXPAND | GTK_FILL;
- xpad = 3;
- ypad = 3;
-
- name_str = e_card_name_to_string (et->card->name);
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (name_str),
- 0, 2, 0, 1,
- label_x_opts, label_y_opts, xpad, ypad);
- g_free (name_str);
-
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (_("Primary Email")),
- 0, 1, 1, 2,
- label_x_opts, label_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- et->primary->option_menu,
- 1, 2, 1, 2,
- menu_x_opts, menu_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (_("Email 2")),
- 0, 1, 2, 3,
- label_x_opts, label_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- et->email2->option_menu,
- 1, 2, 2, 3,
- menu_x_opts, menu_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- gtk_label_new (_("Email 3")),
- 0, 1, 3, 4,
- label_x_opts, label_y_opts, xpad, ypad);
-
- gtk_table_attach (GTK_TABLE (et->table),
- et->email3->option_menu,
- 1, 2, 3, 4,
- menu_x_opts, menu_y_opts, xpad, ypad);
-
- gtk_widget_show_all (et->primary->option_menu);
- gtk_widget_show_all (et->email2->option_menu);
- gtk_widget_show_all (et->email3->option_menu);
-
- gtk_widget_show_all (et->table);
- mini_wizard_container_add (wiz, et->table);
- wiz->ok_cb = email_table_ok_cb;
- wiz->cleanup_cb = email_table_cleanup_cb;
- wiz->closure = et;
-}
-
-/*
- * This code is for the little UI thing that lets you pick from a set of cards
- * and decide which one you want to add the e-mail address to.
- */
-
-typedef struct _CardPicker CardPicker;
-struct _CardPicker {
- GtkWidget *body;
- GtkWidget *list;
- GtkListStore *model;
- GList *cards;
- gchar *new_name;
- gchar *new_email;
-
- ECard *current_card;
-};
-
-enum {
- COLUMN_ACTION,
- COLUMN_CARD
-};
-
-static void
-card_picker_selection_changed (GtkTreeSelection *selection, gpointer closure)
-{
- MiniWizard *wiz = (MiniWizard *) closure;
- CardPicker *pick = (CardPicker *) wiz->closure;
- gboolean selected;
- GtkTreeIter iter;
-
- selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
-
- gtk_widget_set_sensitive (wiz->ok_button, selected);
-
- if (selected) {
- gtk_tree_model_get (GTK_TREE_MODEL (pick->model), &iter,
- COLUMN_CARD, &pick->current_card,
- -1);
- }
- else {
- pick->current_card = NULL;
- }
-}
-
-static void
-card_picker_ok_cb (MiniWizard *wiz, gpointer closure)
-{
- CardPicker *pick = (CardPicker *) closure;
-
- if (pick->current_card == NULL) {
- e_contact_quick_add (pick->new_name, pick->new_email, NULL, NULL);
- mini_wizard_destroy (wiz);
- } else {
- email_table_init (wiz, pick->current_card, pick->new_email);
- }
-}
-
-static void
-card_picker_cleanup_cb (gpointer closure)
-{
- CardPicker *pick = (CardPicker *) closure;
-
- g_list_foreach (pick->cards, (GFunc) g_object_unref, NULL);
- g_list_free (pick->cards);
-
- g_free (pick->new_name);
- g_free (pick->new_email);
-}
-
-static void
-free_str (gpointer data,
- GObject *where_the_object_was)
-{
- g_free (data);
-}
-
-static void
-card_picker_init (MiniWizard *wiz, const GList *cards, const gchar *new_name, const gchar *new_email)
-{
- CardPicker *pick;
- gchar *str;
- GtkWidget *w;
- GtkTreeIter iter;
-
- pick = g_new (CardPicker, 1);
-
- pick->body = gtk_vbox_new (FALSE, 2);
-
- pick->model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
-
- pick->list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (pick->model));
-
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (pick->list), TRUE);
-
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (pick->list),
- COLUMN_ACTION,
- _("Select an Action"),
- gtk_cell_renderer_text_new (),
- "text", COLUMN_ACTION,
- NULL);
-
- gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (pick->list)),
- GTK_SELECTION_SINGLE);
-
- str = g_strdup_printf (_("Create a new contact \"%s\""), new_name);
- gtk_list_store_append (pick->model, &iter);
- gtk_list_store_set (pick->model, &iter,
- COLUMN_ACTION, str,
- COLUMN_CARD, NULL,
- -1);
- g_object_weak_ref (G_OBJECT (pick->model), free_str, str);
-
- pick->cards = NULL;
- while (cards) {
- ECard *card = (ECard *) cards->data;
- gchar *name_str = e_card_name_to_string (card->name);
-
- pick->cards = g_list_append (pick->cards, card);
- g_object_ref (card);
-
- str = g_strdup_printf (_("Add address to existing contact \"%s\""), name_str);
- gtk_list_store_append (pick->model, &iter);
- gtk_list_store_set (pick->model, &iter,
- COLUMN_ACTION, str,
- COLUMN_CARD, card,
- -1);
- g_free (name_str);
-
- g_object_weak_ref (G_OBJECT (pick->model), free_str, str);
-
- cards = g_list_next (cards);
- }
-
- pick->new_name = g_strdup (new_name);
- pick->new_email = g_strdup (new_email);
-
- pick->current_card = NULL;
- gtk_widget_set_sensitive (wiz->ok_button, FALSE);
-
- /* Connect some signals & callbacks */
-
- wiz->ok_cb = card_picker_ok_cb;
- wiz->cleanup_cb = card_picker_cleanup_cb;
-
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (pick->list)),
- "changed", G_CALLBACK (card_picker_selection_changed),
- wiz);
-
- /* Build our widget */
-
- w = gtk_label_new (new_email);
- gtk_box_pack_start (GTK_BOX (pick->body), w, FALSE, TRUE, 3);
-
- gtk_box_pack_start (GTK_BOX (pick->body), pick->list, TRUE, TRUE, 2);
- gtk_widget_show_all (pick->body);
-
-
- /* Put it in our mini-wizard */
-
- wiz->closure = pick;
- mini_wizard_container_add (wiz, pick->body);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-/*
- * The code for the actual EAddressPopup widget begins here.
- */
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-
-static GtkObjectClass *parent_class;
-
-static void e_address_popup_dispose (GObject *);
-static void e_address_popup_query (EAddressPopup *);
-
-
-static void
-e_address_popup_class_init (EAddressPopupClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_address_popup_dispose;
-}
-
-static void
-e_address_popup_init (EAddressPopup *pop)
-{
- pop->transitory = TRUE;
-}
-
-static void
-e_address_popup_cleanup (EAddressPopup *pop)
-{
- if (pop->card) {
- g_object_unref (pop->card);
- pop->card = NULL;
- }
-
- if (pop->scheduled_refresh) {
- gtk_timeout_remove (pop->scheduled_refresh);
- pop->scheduled_refresh = 0;
- }
-
- if (pop->query_tag) {
- e_book_simple_query_cancel (pop->book, pop->query_tag);
- pop->query_tag = 0;
- }
-
- if (pop->book) {
- g_object_unref (pop->book);
- pop->book = NULL;
- }
-
- g_free (pop->name);
- pop->name = NULL;
-
- g_free (pop->email);
- pop->email = NULL;
-}
-
-static void
-e_address_popup_dispose (GObject *obj)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (obj);
-
- e_address_popup_cleanup (pop);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (obj);
-}
-
-GType
-e_address_popup_get_type (void)
-{
- static GType pop_type = 0;
-
- if (!pop_type) {
- static const GTypeInfo pop_info = {
- sizeof (EAddressPopupClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_address_popup_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressPopup),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_address_popup_init,
- };
-
- pop_type = g_type_register_static (gtk_event_box_get_type (), "EAddressPopup", &pop_info, 0);
- }
-
- return pop_type;
-}
-
-static void
-e_address_popup_refresh_names (EAddressPopup *pop)
-{
- if (pop->name_widget) {
- if (pop->name && *pop->name) {
- gtk_label_set_text (GTK_LABEL (pop->name_widget), pop->name);
- gtk_widget_show (pop->name_widget);
- } else {
- gtk_widget_hide (pop->name_widget);
- }
- }
-
- if (pop->email_widget) {
- if (pop->email && *pop->email) {
- gtk_label_set_text (GTK_LABEL (pop->email_widget), pop->email);
- gtk_widget_show (pop->email_widget);
- } else {
- gtk_widget_hide (pop->email_widget);
- }
- }
-
- e_address_popup_query (pop);
-}
-
-static gint
-refresh_timeout_cb (gpointer ptr)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (ptr);
- e_address_popup_refresh_names (pop);
- pop->scheduled_refresh = 0;
- return 0;
-}
-
-static void
-e_address_popup_schedule_refresh (EAddressPopup *pop)
-{
- if (pop->scheduled_refresh == 0)
- pop->scheduled_refresh = gtk_timeout_add (20, refresh_timeout_cb, pop);
-}
-
-/* If we are handed something of the form "Foo <bar@bar.com>",
- do the right thing. */
-static gboolean
-e_address_popup_set_free_form (EAddressPopup *pop, const gchar *txt)
-{
- gchar *lt, *gt = NULL;
-
- g_return_val_if_fail (pop && E_IS_ADDRESS_POPUP (pop), FALSE);
-
- if (txt == NULL)
- return FALSE;
-
- lt = strchr (txt, '<');
- if (lt)
- gt = strchr (txt, '>');
-
- if (lt && gt && lt+1 < gt) {
- gchar *name = g_strndup (txt, lt-txt);
- gchar *email = g_strndup (lt+1, gt-lt-1);
- e_address_popup_set_name (pop, name);
- e_address_popup_set_email (pop, email);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-void
-e_address_popup_set_name (EAddressPopup *pop, const gchar *name)
-{
- g_return_if_fail (pop && E_IS_ADDRESS_POPUP (pop));
-
- /* We only allow the name to be set once. */
- if (pop->name)
- return;
-
- if (!e_address_popup_set_free_form (pop, name)) {
- pop->name = g_strdup (name);
- if (pop->name)
- g_strstrip (pop->name);
- }
-
- e_address_popup_schedule_refresh (pop);
-}
-
-void
-e_address_popup_set_email (EAddressPopup *pop, const gchar *email)
-{
- g_return_if_fail (pop && E_IS_ADDRESS_POPUP (pop));
-
- /* We only allow the e-mail to be set once. */
- if (pop->email)
- return;
-
- if (!e_address_popup_set_free_form (pop, email)) {
- pop->email = g_strdup (email);
- if (pop->email)
- g_strstrip (pop->email);
- }
-
- e_address_popup_schedule_refresh (pop);
-}
-
-void
-e_address_popup_construct (EAddressPopup *pop)
-{
- GtkWidget *vbox, *name_holder;
- GdkColor color = { 0x0, 0xffff, 0xffff, 0xffff };
-
- g_return_if_fail (pop && E_IS_ADDRESS_POPUP (pop));
-
- pop->main_vbox = gtk_vbox_new (FALSE, 0);
-
- /* Build Generic View */
-
- name_holder = gtk_event_box_new ();
- vbox = gtk_vbox_new (FALSE, 2);
- pop->name_widget = gtk_label_new ("");
- pop->email_widget = gtk_label_new ("");
-
- gtk_box_pack_start (GTK_BOX (vbox), pop->name_widget, TRUE, TRUE, 2);
- gtk_box_pack_start (GTK_BOX (vbox), pop->email_widget, TRUE, TRUE, 2);
- gtk_container_add (GTK_CONTAINER (name_holder), GTK_WIDGET (vbox));
-
- if (gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (name_holder)), &color, FALSE, TRUE)) {
- GtkStyle *style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (name_holder)));
- style->bg[0] = color;
- gtk_widget_set_style (GTK_WIDGET (name_holder), style);
- g_object_unref (style);
- }
-
- pop->generic_view = gtk_frame_new (NULL);
- gtk_container_add (GTK_CONTAINER (pop->generic_view), name_holder);
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), pop->generic_view, TRUE, TRUE, 0);
- gtk_widget_show_all (pop->generic_view);
-
- pop->query_msg = gtk_label_new (_("Querying Addressbook..."));
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), pop->query_msg, TRUE, TRUE, 0);
- gtk_widget_show (pop->query_msg);
-
- /* Build Minicard View */
- pop->minicard_view = e_minicard_widget_new ();
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), pop->minicard_view, TRUE, TRUE, 0);
-
-
- /* Final assembly */
-
- gtk_container_add (GTK_CONTAINER (pop), pop->main_vbox);
- gtk_widget_show (pop->main_vbox);
-
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
- gtk_container_set_border_width (GTK_CONTAINER (pop), 2);
-}
-
-GtkWidget *
-e_address_popup_new (void)
-{
- EAddressPopup *pop = g_object_new (E_TYPE_ADDRESS_POPUP, NULL);
- e_address_popup_construct (pop);
- return GTK_WIDGET (pop);
-}
-
-static void
-emit_event (EAddressPopup *pop, const char *event)
-{
- if (pop->es) {
- BonoboArg *arg;
-
- arg = bonobo_arg_new (BONOBO_ARG_BOOLEAN);
- BONOBO_ARG_SET_BOOLEAN (arg, TRUE);
- bonobo_event_source_notify_listeners_full (pop->es,
- "GNOME/Evolution/Addressbook/AddressPopup",
- "Event",
- event,
- arg, NULL);
- bonobo_arg_release (arg);
- }
-}
-
-static void
-contact_editor_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- if (status == E_BOOK_STATUS_SUCCESS) {
- EAddressPopup *pop = E_ADDRESS_POPUP (closure);
- EContactEditor *ce = e_addressbook_show_contact_editor (book, pop->card, FALSE, TRUE);
- e_address_popup_cleanup (pop);
- emit_event (pop, "Destroy");
- e_contact_editor_raise (ce);
- }
-
- if (book)
- g_object_unref (book);
-}
-
-static void
-edit_contact_info_cb (GtkWidget *button, EAddressPopup *pop)
-{
- EBook *book;
- emit_event (pop, "Hide");
-
- book = e_book_new ();
- addressbook_load_default_book (book, contact_editor_cb, pop);
-}
-
-static void
-e_address_popup_cardify (EAddressPopup *pop, ECard *card)
-{
- GtkWidget *b;
-
- g_return_if_fail (pop && E_IS_ADDRESS_POPUP (pop));
- g_return_if_fail (card && E_IS_CARD (card));
- g_return_if_fail (pop->card == NULL);
-
- pop->card = card;
- g_object_ref (pop->card);
-
- e_minicard_widget_set_card (E_MINICARD_WIDGET (pop->minicard_view), card);
- gtk_widget_show (pop->minicard_view);
- gtk_widget_hide (pop->generic_view);
-
- b = gtk_button_new_with_label (_("Edit Contact Info"));
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), b, TRUE, TRUE, 0);
- g_signal_connect (b,
- "clicked",
- G_CALLBACK (edit_contact_info_cb),
- pop);
- gtk_widget_show (b);
-}
-
-static void
-add_contacts_cb (GtkWidget *button, EAddressPopup *pop)
-{
- if (pop->email && *pop->email) {
- if (pop->name && *pop->name)
- e_contact_quick_add (pop->name, pop->email, NULL, NULL);
- else
- e_contact_quick_add_free_form (pop->email, NULL, NULL);
-
- }
- e_address_popup_cleanup (pop);
- emit_event (pop, "Destroy");
-}
-
-static void
-e_address_popup_no_matches (EAddressPopup *pop)
-{
- GtkWidget *b;
-
- g_return_if_fail (pop && E_IS_ADDRESS_POPUP (pop));
-
- b = e_button_new_with_stock_icon (_("Add to Contacts"), "gtk-add");
-
- gtk_box_pack_start (GTK_BOX (pop->main_vbox), b, TRUE, TRUE, 0);
- g_signal_connect (b,
- "clicked",
- G_CALLBACK (add_contacts_cb),
- pop);
- gtk_widget_show (b);
-}
-
-static void
-wizard_destroy_cb (MiniWizard *wiz, gpointer closure)
-{
- gtk_widget_destroy (GTK_WIDGET (closure));
-}
-
-static void
-e_address_popup_ambiguous_email_add (EAddressPopup *pop, const GList *cards)
-{
- MiniWizard *wiz = mini_wizard_new ();
- GtkWidget *win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- wiz->destroy_cb = wizard_destroy_cb;
- wiz->destroy_closure = win;
-
- gtk_window_set_title (GTK_WINDOW (win), _("Merge E-Mail Address"));
- gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_MOUSE);
-
- card_picker_init (wiz, cards, pop->name, pop->email);
-
- e_address_popup_cleanup (pop);
- emit_event (pop, "Destroy");
-
- gtk_container_add (GTK_CONTAINER (win), wiz->body);
- gtk_widget_show_all (win);
-}
-
-static void
-e_address_popup_multiple_matches (EAddressPopup *pop, const GList *cards)
-{
- pop->multiple_matches = TRUE;
-
- e_address_popup_ambiguous_email_add (pop, cards);
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-/*
- * Addressbook Query Fun
- */
-
-static void
-name_only_query_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- EAddressPopup *pop;
-
- if (status != E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS)
- return;
-
- pop = E_ADDRESS_POPUP (closure);
-
- pop->query_tag = 0;
-
- if (cards == NULL) {
- e_address_popup_no_matches (pop);
- } else {
- e_address_popup_ambiguous_email_add (pop, cards);
- }
-}
-
-static void
-query_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer closure)
-{
- EAddressPopup *pop;
-
- if (status != E_BOOK_SIMPLE_QUERY_STATUS_SUCCESS)
- return;
-
- pop = E_ADDRESS_POPUP (closure);
-
- pop->query_tag = 0;
- gtk_widget_hide (pop->query_msg);
-
- if (cards == NULL) {
-
- /* Do a name-only query if:
- (1) The name is non-empty.
- (2) The e-mail is also non-empty (so that the query we just did wasn't actually a name-only query.
- */
- if (pop->name && *pop->name && pop->email && *pop->email) {
- pop->query_tag = e_book_name_and_email_query (book, pop->name, NULL, name_only_query_cb, pop);
- } else {
- e_address_popup_no_matches (pop);
- }
-
- } else {
- if (g_list_length ((GList *) cards) == 1)
- e_address_popup_cardify (pop, E_CARD (cards->data));
- else
- e_address_popup_multiple_matches (pop, cards);
- }
-}
-
-static void
-start_query (EBook *book, EBookStatus status, gpointer closure)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (closure);
-
- if (status != E_BOOK_STATUS_SUCCESS) {
- e_address_popup_no_matches (pop);
- if (book)
- g_object_unref (book);
- return;
- }
-
- if (pop->query_tag)
- e_book_simple_query_cancel (book, pop->query_tag);
-
- if (pop->book != book) {
- g_object_ref (book);
- if (pop->book)
- g_object_unref (pop->book);
- pop->book = book;
- }
-
- pop->query_tag = e_book_name_and_email_query (book, pop->name, pop->email, query_cb, pop);
-
- g_object_unref (pop);
-}
-
-static void
-e_address_popup_query (EAddressPopup *pop)
-{
- EBook *book;
-
- g_return_if_fail (pop && E_IS_ADDRESS_POPUP (pop));
-
- book = e_book_new ();
- g_object_ref (pop);
-
- addressbook_load_default_book (book, start_query, pop);
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-enum {
- PROPERTY_NAME,
- PROPERTY_EMAIL,
- PROPERTY_TRANSITORY
-};
-
-static void
-set_prop (BonoboPropertyBag *bag, const BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (user_data);
-
- switch (arg_id) {
-
- case PROPERTY_NAME:
- e_address_popup_set_name (pop, BONOBO_ARG_GET_STRING (arg));
- break;
-
- case PROPERTY_EMAIL:
- e_address_popup_set_email (pop, BONOBO_ARG_GET_STRING (arg));
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-static void
-get_prop (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
-{
- EAddressPopup *pop = E_ADDRESS_POPUP (user_data);
-
- switch (arg_id) {
-
- case PROPERTY_NAME:
- BONOBO_ARG_SET_STRING (arg, pop->name);
- break;
-
- case PROPERTY_EMAIL:
- BONOBO_ARG_SET_STRING (arg, pop->email);
- break;
-
- case PROPERTY_TRANSITORY:
- BONOBO_ARG_SET_BOOLEAN (arg, pop->transitory);
- break;
-
- default:
- g_assert_not_reached ();
- }
-}
-
-BonoboControl *
-e_address_popup_new_control (void)
-{
- BonoboControl *control;
- BonoboPropertyBag *bag;
- EAddressPopup *addy;
- GtkWidget *w;
-
- w = e_address_popup_new ();
- addy = E_ADDRESS_POPUP (w);
-
- control = bonobo_control_new (w);
- gtk_widget_show (w);
-
- bag = bonobo_property_bag_new (get_prop, set_prop, w);
- bonobo_property_bag_add (bag, "name", PROPERTY_NAME,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_WRITEABLE | BONOBO_PROPERTY_READABLE);
-
- bonobo_property_bag_add (bag, "email", PROPERTY_EMAIL,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_WRITEABLE | BONOBO_PROPERTY_READABLE);
-
- bonobo_property_bag_add (bag, "transitory", PROPERTY_TRANSITORY,
- BONOBO_ARG_BOOLEAN, NULL, NULL,
- BONOBO_PROPERTY_READABLE);
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (bag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (bag));
-
- addy->es = bonobo_event_source_new ();
- bonobo_object_add_interface (BONOBO_OBJECT (control),
- BONOBO_OBJECT (addy->es));
-
- return control;
-}
diff --git a/addressbook/gui/component/e-address-popup.h b/addressbook/gui/component/e-address-popup.h
deleted file mode 100644
index b2519b0ee6..0000000000
--- a/addressbook/gui/component/e-address-popup.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-address-popup.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_ADDRESS_POPUP_H__
-#define __E_ADDRESS_POPUP_H__
-
-#include <gtk/gtk.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include <addressbook/backend/ebook/e-card.h>
-#include <bonobo/bonobo-event-source.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_ADDRESS_POPUP (e_address_popup_get_type ())
-#define E_ADDRESS_POPUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESS_POPUP, EAddressPopup))
-#define E_ADDRESS_POPUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_ADDRESS_POPUP, EAddressPopupClass))
-#define E_IS_ADDRESS_POPUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESS_POPUP))
-#define E_IS_ADDRESS_POPUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESS_POPUP))
-
-typedef struct _EAddressPopup EAddressPopup;
-typedef struct _EAddressPopupClass EAddressPopupClass;
-
-struct _EAddressPopup {
- GtkEventBox parent;
-
- gchar *name;
- gchar *email;
-
- GtkWidget *name_widget;
- GtkWidget *email_widget;
- GtkWidget *query_msg;
-
- GtkWidget *main_vbox;
- GtkWidget *generic_view;
- GtkWidget *minicard_view;
-
- gboolean transitory;
-
- guint scheduled_refresh;
- EBook *book;
- guint query_tag;
- gboolean multiple_matches;
- ECard *card;
-
- BonoboEventSource *es;
-};
-
-struct _EAddressPopupClass {
- GtkEventBoxClass parent_class;
-};
-
-GType e_address_popup_get_type (void);
-
-void e_address_popup_set_name (EAddressPopup *, const gchar *name);
-void e_address_popup_set_email (EAddressPopup *, const gchar *email);
-
-void e_address_popup_construct (EAddressPopup *);
-GtkWidget *e_address_popup_new (void);
-
-BonoboControl *e_address_popup_new_control (void);
-
-G_END_DECLS
-
-#endif /* __E_ADDRESS_POPUP_H__ */
-
diff --git a/addressbook/gui/component/e-address-widget.c b/addressbook/gui/component/e-address-widget.c
deleted file mode 100644
index e9698d5b1d..0000000000
--- a/addressbook/gui/component/e-address-widget.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-address-widget.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include <ctype.h>
-#include <string.h>
-#include <gtk/gtklabel.h>
-#include <libgnomeui/gnome-popup-menu.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-property-bag.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <addressbook/gui/contact-editor/e-contact-quick-add.h>
-#include "e-address-widget.h"
-
-static void e_address_widget_class_init (EAddressWidgetClass *klass);
-static void e_address_widget_init (EAddressWidget *obj);
-static void e_address_widget_destroy (GtkObject *obj);
-
-static gint e_address_widget_button_press_handler (GtkWidget *w, GdkEventButton *ev);
-static void e_address_widget_popup (EAddressWidget *, GdkEventButton *ev);
-static void e_address_widget_schedule_query (EAddressWidget *);
-
-static GtkObjectClass *parent_class;
-
-static EBook *common_book = NULL; /* sort of lame */
-
-static gboolean doing_queries = FALSE;
-
-static void
-e_address_widget_class_init (EAddressWidgetClass *klass)
-{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->destroy = e_address_widget_destroy;
-
- widget_class->button_press_event = e_address_widget_button_press_handler;
-}
-
-static void
-e_address_widget_init (EAddressWidget *addr)
-{
-
-}
-
-static void
-e_address_widget_destroy (GtkObject *obj)
-{
- EAddressWidget *addr = E_ADDRESS_WIDGET (obj);
-
- g_free (addr->name);
- g_free (addr->email);
-
- if (addr->query_tag)
- e_book_simple_query_cancel (common_book, addr->query_tag);
-
- if (addr->query_idle_tag)
- g_source_remove (addr->query_idle_tag);
-}
-
-static gint
-e_address_widget_button_press_handler (GtkWidget *w, GdkEventButton *ev)
-{
- EAddressWidget *addr = E_ADDRESS_WIDGET (w);
- if (ev->button == 3 && ev->state == 0) {
- e_address_widget_popup (addr, ev);
- return TRUE;
- }
-
- return FALSE;
-}
-
-GType
-e_address_widget_get_type (void)
-{
- static GType aw_type = 0;
-
- if (!aw_type) {
- static const GTypeInfo aw_info = {
- sizeof (EAddressWidgetClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_address_widget_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressWidget),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_address_widget_init,
- };
-
- aw_type = g_type_register_static (gtk_event_box_get_type (), "EAddressWidget", &aw_info, 0);
- }
-
- return aw_type;
-}
-
-static void
-gtk_widget_visible (GtkWidget *w, gboolean x)
-{
- if (x)
- gtk_widget_show (w);
- else
- gtk_widget_hide (w);
-}
-
-static void
-e_address_widget_refresh (EAddressWidget *addr)
-{
- gchar *str;
- gboolean have_name, have_email;
-
- g_return_if_fail (addr && E_IS_ADDRESS_WIDGET (addr));
-
- have_name = addr->name && *addr->name;
- have_email = addr->email && *addr->email && (addr->card == NULL || !addr->known_email);
-
- gtk_label_set_text (GTK_LABEL (addr->name_widget), have_name ? addr->name : "");
- gtk_widget_visible (addr->name_widget, have_name);
- if (addr->card) {
- gint i, N = strlen (addr->name);
- gchar *pattern = g_malloc (N+1);
- for (i=0; i<N; ++i)
- pattern[i] = '_';
- pattern[i] = '\0';
- gtk_label_set_pattern (GTK_LABEL (addr->name_widget), pattern);
- g_free (pattern);
- } else {
- gtk_label_set_pattern (GTK_LABEL (addr->name_widget), "");
- }
-
- if (have_email) {
- str = g_strdup_printf (have_name ? "<%s>" : "%s", addr->email);
- gtk_label_set_text (GTK_LABEL (addr->email_widget), str);
- g_free (str);
- } else {
- gtk_label_set_text (GTK_LABEL (addr->email_widget), "");
- }
- gtk_widget_visible (addr->email_widget, have_email);
-
- gtk_widget_visible (addr->spacer, have_name && have_email);
-
- /* Launch a query to find the appropriate card, if necessary. */
- if (addr->card == NULL)
- e_address_widget_schedule_query (addr);
-}
-
-void
-e_address_widget_set_name (EAddressWidget *addr, const gchar *name)
-{
- g_return_if_fail (addr && E_IS_ADDRESS_WIDGET (addr));
-
- g_free (addr->name);
- addr->name = g_strdup (name);
-
- e_address_widget_refresh (addr);
-}
-
-void
-e_address_widget_set_email (EAddressWidget *addr, const gchar *email)
-{
- g_return_if_fail (addr && E_IS_ADDRESS_WIDGET (addr));
-
- g_free (addr->email);
- addr->email = g_strdup (email);
-
- e_address_widget_refresh (addr);
-}
-
-
-void
-e_address_widget_set_text (EAddressWidget *addr, const gchar *text)
-{
- g_return_if_fail (addr && E_IS_ADDRESS_WIDGET (addr));
-
- e_address_widget_set_email (addr, text); /* CRAP */
-}
-
-void
-e_address_widget_construct (EAddressWidget *addr)
-{
- GtkWidget *box;
-
- g_return_if_fail (addr && E_IS_ADDRESS_WIDGET (addr));
-
- box = gtk_hbox_new (FALSE, 2);
-
- addr->name_widget = gtk_label_new ("");
- addr->spacer = gtk_label_new (" ");
- addr->email_widget = gtk_label_new ("");
-
- gtk_box_pack_start (GTK_BOX (box), addr->name_widget, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box), addr->spacer, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box), addr->email_widget, FALSE, FALSE, 0);
-
- gtk_container_add (GTK_CONTAINER (addr), box);
-
- gtk_widget_show (box);
- gtk_widget_show (addr->name_widget);
- gtk_widget_show (addr->email_widget);
-}
-
-GtkWidget *
-e_address_widget_new (void)
-{
- EAddressWidget *addr = g_object_new (E_TYPE_ADDRESS_WIDGET, NULL);
- e_address_widget_construct (addr);
- return GTK_WIDGET (addr);
-}
-
-/*
- *
- * Cardification
- *
- */
-
-static void
-e_address_widget_cardify (EAddressWidget *addr, ECard *card, gboolean known_email)
-{
- if (addr->card != card || addr->known_email != known_email) {
-
- if (addr->card != card) {
- if (addr->card)
- g_object_unref (addr->card);
- addr->card = card;
- g_object_ref (addr->card);
- }
-
- addr->known_email = known_email;
-
- if (!(addr->name && *addr->name)) {
- gchar *s = e_card_name_to_string (card->name);
- e_address_widget_set_name (addr, s);
- g_free (s);
- }
-
- e_address_widget_refresh (addr);
- }
-}
-
-static void
-query_results_cb (EBook *book, EBookSimpleQueryStatus status, const GList *cards, gpointer user_data)
-{
- EAddressWidget *addr = user_data;
-
- if (g_list_length ((GList *) cards) == 1) {
- ECard *card = E_CARD (cards->data);
- e_address_widget_cardify (addr, card, TRUE);
- }
-
- addr->query_tag = 0;
-}
-
-static void
-e_address_widget_do_query (EAddressWidget *addr)
-{
- e_book_name_and_email_query (common_book, addr->name, addr->email, query_results_cb, addr);
-}
-
-static void
-book_ready_cb (EBook *book, EBookStatus status, gpointer user_data)
-{
- EAddressWidget *addr = E_ADDRESS_WIDGET (user_data);
-
- if (common_book == NULL) {
- common_book = book;
- g_object_ref (common_book);
- } else
- g_object_unref (book);
-
- e_address_widget_do_query (addr);
-}
-
-static gint
-query_idle_fn (gpointer ptr)
-{
- EAddressWidget *addr = E_ADDRESS_WIDGET (ptr);
-
- if (common_book) {
- e_address_widget_do_query (addr);
- } else {
- e_book_load_default_book (e_book_new (), book_ready_cb, addr);
- }
-
- addr->query_idle_tag = 0;
- return FALSE;
-}
-
-static void
-e_address_widget_schedule_query (EAddressWidget *addr)
-{
- if (addr->query_idle_tag || !doing_queries)
- return;
- addr->query_idle_tag = g_idle_add (query_idle_fn, addr);
-}
-
-/*
- *
- * Popup Menu
- *
- */
-
-#define ARBITRARY_UIINFO_LIMIT 64
-
-static gint
-popup_add_name_and_address (EAddressWidget *addr, GnomeUIInfo *uiinfo, gint i)
-{
- gboolean flag = FALSE;
-
- if (addr->name && *addr->name) {
- uiinfo[i].type = GNOME_APP_UI_ITEM;
- uiinfo[i].label = addr->name;
- ++i;
- flag = TRUE;
- }
-
- if (addr->email && *addr->email) {
- uiinfo[i].type = GNOME_APP_UI_ITEM;
- uiinfo[i].label = addr->email;
- ++i;
- flag = TRUE;
- }
-
- if (flag) {
- uiinfo[i].type = GNOME_APP_UI_SEPARATOR;
- ++i;
- }
-
- return i;
-}
-
-static void
-flip_queries_flag_cb (GtkWidget *w, gpointer user_data)
-{
- doing_queries = !doing_queries;
-}
-
-static gint
-popup_add_query_change (EAddressWidget *addr, GnomeUIInfo *uiinfo, gint i)
-{
- uiinfo[i].type = GNOME_APP_UI_SEPARATOR;
- ++i;
-
- uiinfo[i].type = GNOME_APP_UI_ITEM;
- uiinfo[i].label = doing_queries ? _("Disable Queries") : _("Enable Queries (Dangerous!)");
- uiinfo[i].moreinfo = flip_queries_flag_cb;
- ++i;
-
- return i;
-}
-
-
-static GtkWidget *
-popup_menu_card (EAddressWidget *addr)
-{
- GnomeUIInfo uiinfo[ARBITRARY_UIINFO_LIMIT];
- GtkWidget *pop;
- gint i=0;
- ECard *card = E_CARD (addr->card);
-
- g_return_val_if_fail (card != NULL, NULL);
-
- memset (uiinfo, 0, sizeof (uiinfo));
-
- i = popup_add_name_and_address (addr, uiinfo, i);
-
- uiinfo[i].type = GNOME_APP_UI_ITEM;
- uiinfo[i].label = _("Edit Contact Info");
- ++i;
-
- i = popup_add_query_change (addr, uiinfo, i);
-
- uiinfo[i].type = GNOME_APP_UI_ENDOFINFO;
- pop = gnome_popup_menu_new (uiinfo);
- return pop;
-}
-
-static void
-post_quick_add_cb (ECard *card, gpointer user_data)
-{
- e_address_widget_cardify (E_ADDRESS_WIDGET (user_data), card, TRUE);
-}
-
-static void
-add_contacts_cb (GtkWidget *w, gpointer user_data)
-{
- EAddressWidget *addr = E_ADDRESS_WIDGET (user_data);
-
- e_contact_quick_add (addr->name, addr->email, post_quick_add_cb, addr);
-}
-
-static GtkWidget *
-popup_menu_nocard (EAddressWidget *addr)
-{
- GnomeUIInfo uiinfo[ARBITRARY_UIINFO_LIMIT];
- GtkWidget *pop;
- gint i=0;
-
- memset (uiinfo, 0, sizeof (uiinfo));
-
- i = popup_add_name_and_address (addr, uiinfo, i);
-
- uiinfo[i].type = GNOME_APP_UI_ITEM;
- uiinfo[i].label = _("Add to Contacts");
- uiinfo[i].moreinfo = add_contacts_cb;
- ++i;
-
- i = popup_add_query_change (addr, uiinfo, i);
-
- uiinfo[i].type = GNOME_APP_UI_ENDOFINFO;
- pop = gnome_popup_menu_new (uiinfo);
- return pop;
-}
-
-static void
-e_address_widget_popup (EAddressWidget *addr, GdkEventButton *ev)
-{
- GtkWidget *pop;
-
- g_return_if_fail (addr && E_IS_ADDRESS_WIDGET (addr));
-
- pop = addr->card ? popup_menu_card (addr) : popup_menu_nocard (addr);
-
- if (pop)
- gnome_popup_menu_do_popup (pop, NULL, NULL, ev, addr, GTK_WIDGET (addr));
-}
-
-/*
- *
- * Bonobo Control Magic
- *
- */
-
-enum {
- ADDRESS_PROPERTY_NAME,
- ADDRESS_PROPERTY_EMAIL,
- ADDRESS_PROPERTY_TEXT,
- ADDRESS_PROPERTY_BACKGROUND_RGB
-};
-
-
-static void
-get_prop (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
-{
- EAddressWidget *addr = E_ADDRESS_WIDGET (user_data);
-
- switch (arg_id) {
-
- case ADDRESS_PROPERTY_NAME:
- BONOBO_ARG_SET_STRING (arg, addr->name ? addr->name :"");
- break;
-
- case ADDRESS_PROPERTY_EMAIL:
- BONOBO_ARG_SET_STRING (arg, addr->email ? addr->email : "");
- break;
-
- case ADDRESS_PROPERTY_TEXT:
- BONOBO_ARG_SET_STRING (arg, "?");
- break;
- }
-}
-
-static void
-set_prop (BonoboPropertyBag *bag, const BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data)
-{
- EAddressWidget *addr = E_ADDRESS_WIDGET (user_data);
-
- switch (arg_id) {
- case ADDRESS_PROPERTY_NAME:
- e_address_widget_set_name (addr, BONOBO_ARG_GET_STRING (arg));
- break;
-
- case ADDRESS_PROPERTY_EMAIL:
- e_address_widget_set_email (addr, BONOBO_ARG_GET_STRING (arg));
- break;
-
- case ADDRESS_PROPERTY_TEXT:
- e_address_widget_set_text (addr, BONOBO_ARG_GET_STRING (arg));
- break;
-
-
- case ADDRESS_PROPERTY_BACKGROUND_RGB:
- {
- gint bg = BONOBO_ARG_GET_INT (arg);
- GdkColor color;
-
- color.red = (bg & 0xff0000) >> 8;
- color.green = (bg & 0x00ff00);
- color.blue = (bg & 0x0000ff) << 8;
-
- if (gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (addr)), &color, FALSE, TRUE)) {
- GtkStyle *style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (addr)));
- style->bg[0] = color;
- gtk_widget_set_style (GTK_WIDGET (addr), style);
- }
- }
-
- break;
- }
-}
-
-BonoboControl *
-e_address_widget_factory_new_control (void)
-{
- BonoboControl *control;
- BonoboPropertyBag *bag;
- GtkWidget *w;
-
- w = e_address_widget_new ();
- gtk_widget_show (w);
-
- control = bonobo_control_new (w);
-
- bag = bonobo_property_bag_new (get_prop, set_prop, w);
- bonobo_property_bag_add (bag, "name", ADDRESS_PROPERTY_NAME,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
-
- bonobo_property_bag_add (bag, "email", ADDRESS_PROPERTY_EMAIL,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
-
- bonobo_property_bag_add (bag, "text", ADDRESS_PROPERTY_TEXT,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
-
- bonobo_property_bag_add (bag, "background_rgb", ADDRESS_PROPERTY_BACKGROUND_RGB,
- BONOBO_ARG_INT, NULL, NULL,
- BONOBO_PROPERTY_WRITEABLE);
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (bag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (bag));
-
- return control;
-}
diff --git a/addressbook/gui/component/e-address-widget.h b/addressbook/gui/component/e-address-widget.h
deleted file mode 100644
index 13e4a417d0..0000000000
--- a/addressbook/gui/component/e-address-widget.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-address-widget.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_ADDRESS_WIDGET_H__
-#define __E_ADDRESS_WIDGET_H__
-
-#include <gtk/gtkeventbox.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkobject.h>
-#include <gtk/gtkwidget.h>
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/backend/ebook/e-card.h>
-
-G_BEGIN_DECLS
-
-#define E_TYPE_ADDRESS_WIDGET (e_address_widget_get_type ())
-#define E_ADDRESS_WIDGET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESS_WIDGET, EAddressWidget))
-#define E_ADDRESS_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_ADDRESS_WIDGET, EAddressWidgetClass))
-#define E_IS_ADDRESS_WIDGET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESS_WIDGET))
-#define E_IS_ADDRESS_WIDGET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESS_WIDGET))
-
-typedef struct _EAddressWidget EAddressWidget;
-typedef struct _EAddressWidgetClass EAddressWidgetClass;
-
-struct _EAddressWidget {
- GtkEventBox parent;
-
- gchar *name;
- gchar *email;
-
- GtkWidget *name_widget;
- GtkWidget *email_widget;
- GtkWidget *spacer;
-
- guint query_idle_tag;
- guint query_tag;
-
- ECard *card;
- gboolean known_email;
-};
-
-struct _EAddressWidgetClass {
- GtkEventBoxClass parent_class;
-};
-
-GType e_address_widget_get_type (void);
-
-void e_address_widget_set_name (EAddressWidget *, const gchar *name);
-void e_address_widget_set_email (EAddressWidget *, const gchar *email);
-void e_address_widget_set_text (EAddressWidget *, const gchar *text);
-
-void e_address_widget_construct (EAddressWidget *);
-GtkWidget *e_address_widget_new (void);
-
-BonoboControl *e_address_widget_new_control (void);
-
-G_END_DECLS
-
-#endif /* __E_ADDRESS_WIDGET_H__ */
diff --git a/addressbook/gui/component/e-cardlist-model.c b/addressbook/gui/component/e-cardlist-model.c
deleted file mode 100644
index aca0bac22f..0000000000
--- a/addressbook/gui/component/e-cardlist-model.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * (C) 1999 Ximian, Inc.
- */
-
-#include <config.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-#include <string.h>
-
-#include "e-cardlist-model.h"
-
-#define PARENT_TYPE e_table_model_get_type()
-
-static void
-e_cardlist_model_dispose(GObject *object)
-{
- ECardlistModel *model = E_CARDLIST_MODEL(object);
- int i;
-
- for ( i = 0; i < model->data_count; i++ ) {
- g_object_unref(model->data[i]);
- }
- g_free(model->data);
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-e_cardlist_model_col_count (ETableModel *etc)
-{
- return E_CARD_SIMPLE_FIELD_LAST;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-e_cardlist_model_row_count (ETableModel *etc)
-{
- ECardlistModel *e_cardlist_model = E_CARDLIST_MODEL(etc);
- return e_cardlist_model->data_count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-e_cardlist_model_value_at (ETableModel *etc, int col, int row)
-{
- ECardlistModel *e_cardlist_model = E_CARDLIST_MODEL(etc);
- const char *value;
- if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1|| row >= e_cardlist_model->data_count )
- return NULL;
- value = e_card_simple_get_const(e_cardlist_model->data[row],
- col + 1);
- return (void *)(value ? value : "");
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-e_cardlist_model_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- ECardlistModel *e_cardlist_model = E_CARDLIST_MODEL(etc);
-
- if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1|| row >= e_cardlist_model->data_count )
- return;
- e_table_model_pre_change(etc);
- e_card_simple_set(e_cardlist_model->data[row],
- col + 1,
- val);
-
- e_table_model_cell_changed(etc, col, row);
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-e_cardlist_model_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return TRUE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-e_cardlist_model_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-e_cardlist_model_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-e_cardlist_model_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-e_cardlist_model_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-e_cardlist_model_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-void
-e_cardlist_model_add(ECardlistModel *model,
- ECard **cards,
- int count)
-{
- int i;
- model->data = g_realloc(model->data, model->data_count + count * sizeof(ECard *));
- for (i = 0; i < count; i++) {
- gboolean found = FALSE;
- const gchar *id = e_card_get_id(cards[i]);
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_simple_get_id(model->data[i]), id) ) {
- found = TRUE;
- break;
- }
- }
- if (!found) {
- e_table_model_pre_change(E_TABLE_MODEL(model));
- g_object_ref(cards[i]);
- model->data[model->data_count++] = e_card_simple_new (cards[i]);
- e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
- }
- }
-}
-
-void
-e_cardlist_model_remove(ECardlistModel *model,
- const char *id)
-{
- int i;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_simple_get_id(model->data[i]), id) ) {
- e_table_model_pre_change(E_TABLE_MODEL(model));
- g_object_unref(model->data[i]);
- memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (ECard *));
- e_table_model_row_deleted(E_TABLE_MODEL(model), i);
- }
- }
-}
-
-static void
-e_cardlist_model_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- object_class->dispose = e_cardlist_model_dispose;
-
- model_class->column_count = e_cardlist_model_col_count;
- model_class->row_count = e_cardlist_model_row_count;
- model_class->value_at = e_cardlist_model_value_at;
- model_class->set_value_at = e_cardlist_model_set_value_at;
- model_class->is_cell_editable = e_cardlist_model_is_cell_editable;
- model_class->duplicate_value = e_cardlist_model_duplicate_value;
- model_class->free_value = e_cardlist_model_free_value;
- model_class->initialize_value = e_cardlist_model_initialize_value;
- model_class->value_is_empty = e_cardlist_model_value_is_empty;
- model_class->value_to_string = e_cardlist_model_value_to_string;
-}
-
-static void
-e_cardlist_model_init (GObject *object)
-{
- ECardlistModel *model = E_CARDLIST_MODEL(object);
- model->data = NULL;
- model->data_count = 0;
-}
-
-ECard *
-e_cardlist_model_get(ECardlistModel *model,
- int row)
-{
- if (model->data && row < model->data_count) {
- ECard *card;
- g_object_get(model->data[row],
- "card", &card,
- NULL);
- return card;
- }
- return NULL;
-}
-
-GType
-e_cardlist_model_get_type (void)
-{
- static GType aw_type = 0;
-
- if (!aw_type) {
- static const GTypeInfo aw_info = {
- sizeof (ECardlistModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_cardlist_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ECardlistModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_cardlist_model_init,
- };
-
- aw_type = g_type_register_static (PARENT_TYPE, "ECardlistModel", &aw_info, 0);
- }
-
- return aw_type;
-}
-
-ETableModel *
-e_cardlist_model_new (void)
-{
- ECardlistModel *et;
-
- et = g_object_new (E_TYPE_CARDLIST_MODEL, NULL);
-
- return E_TABLE_MODEL(et);
-}
diff --git a/addressbook/gui/component/e-cardlist-model.h b/addressbook/gui/component/e-cardlist-model.h
deleted file mode 100644
index 0968e936fc..0000000000
--- a/addressbook/gui/component/e-cardlist-model.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_CARDLIST_MODEL_H_
-#define _E_CARDLIST_MODEL_H_
-
-#include <gal/e-table/e-table-model.h>
-#include <ebook/e-book.h>
-#include <ebook/e-book-view.h>
-#include <ebook/e-card-simple.h>
-
-#define E_TYPE_CARDLIST_MODEL (e_cardlist_model_get_type ())
-#define E_CARDLIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CARDLIST_MODEL, ECardlistModel))
-#define E_CARDLIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CARDLIST_MODEL, ECardlistModelClass))
-#define E_IS_CARDLIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CARDLIST_MODEL))
-#define E_IS_CARDLIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CARDLIST_MODEL))
-
-typedef struct {
- ETableModel parent;
-
- /* item specific fields */
- ECardSimple **data;
- int data_count;
-} ECardlistModel;
-
-
-typedef struct {
- ETableModelClass parent_class;
-} ECardlistModelClass;
-
-
-GType e_cardlist_model_get_type (void);
-ETableModel *e_cardlist_model_new (void);
-
-/* Returns object with an extra ref count. */
-ECard *e_cardlist_model_get (ECardlistModel *model,
- int row);
-void e_cardlist_model_add (ECardlistModel *model,
- ECard **card,
- int count);
-void e_cardlist_model_remove (ECardlistModel *model,
- const char *id);
-
-#endif /* _E_CARDLIST_MODEL_H_ */
diff --git a/addressbook/gui/component/ldap-config.glade b/addressbook/gui/component/ldap-config.glade
deleted file mode 100644
index 494c34d3ca..0000000000
--- a/addressbook/gui/component/ldap-config.glade
+++ /dev/null
@@ -1,2664 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkWindow" id="account-editor-window">
- <property name="title" translatable="yes">Edit LDAP Server</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox37">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkNotebook" id="account-editor-notebook">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkVBox" id="account-editor-general-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox100">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label431">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Display name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment45">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0.9</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkEntry" id="account-editor-display-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator12">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label331">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="account-editor-connecting-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label334">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Connecting</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="account-editor-searching-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label344">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Searching</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator10">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox120">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHButtonBox" id="hbuttonbox20">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="account-editor-cancel-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="account-editor-ok-button">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="account-druid-window">
- <property name="title" translatable="yes">Add LDAP Server</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GnomeDruid" id="account-druid">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="show_help">False</property>
-
- <child>
- <widget class="GnomeDruidPageEdge" id="druidpagestart1">
- <property name="visible">True</property>
- <property name="position">GNOME_EDGE_START</property>
- <property name="title" translatable="yes">LDAP Configuration Assistant</property>
- <property name="text" translatable="yes">This assistant will help you to access online directory services
-using LDAP (Lightweight Directory Access Protocol) servers.
-
-Adding a new LDAP server requires some specialized information about the server. Please contact your system administrator if you need help finding this information.</property>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-info-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 1: Server Information</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox1">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkVBox" id="account-druid-general-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label158">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The first step in configuring an LDAP server is to provide its name, and your log in
-information. Please ask your system administrator if you are unsure of this information.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator2">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-connecting-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 2: Connecting to Server</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox2">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkVBox" id="account-druid-connecting-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label174">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Now, you must specify how you want to connect to the LDAP server. The SSL (Secure Sockets Layer)
-and TLS (Transport Layer Security) protocols are used by some servers to cryptographically protect
-your connection. Ask your system administrator if your LDAP server uses these protocols.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator3">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-searching-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 3: Searching the Directory</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox23">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkVBox" id="account-druid-searching-vbox">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label254">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The options on this page control how many entries should be included in your
-searches, and how long a search should take. Ask your system administrator if you
-need to change these options.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator7">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageStandard" id="add-server-druid-display-name-page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Step 4: Display Name</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox5">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkVBox" id="vbox21">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label198">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Specifying a display name is the last required step in configuring an LDAP server.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator5">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table15">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkEntry" id="druid-display-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label199">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Display name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">druid-display-name-entry</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="notebook15">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label207">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the name for this server that will appear in your Evolution folder list.
-It is for display purposes only. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label208">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label215">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option will let you change Evolution's default settings for LDAP
-searches, and for creating and editing contacts. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label210">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GnomeDruidPageEdge" id="add-server-druid-finish-page">
- <property name="visible">True</property>
- <property name="position">GNOME_EDGE_FINISH</property>
- <property name="title" translatable="yes">Finished</property>
- <property name="text" translatable="yes">Congratulations, you are finished setting up this LDAP server. You
-are now ready to access this directory.
-
-Please click the &quot;Finish&quot; button to save the settings you have entered here.</property>
- </widget>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="addressbook-sources-window">
- <property name="title" translatable="yes">Addressbook Sources</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">355</property>
- <property name="default_height">285</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="addressbook-sources-vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox27">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button104">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button105">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button106">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="addressbook-sources">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="Custom" id="sourcesTable">
- <property name="visible">True</property>
- <property name="creation_function">addressbook_dialog_create_sources_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 11 Apr 2002 00:31:02 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox73">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label529">
- <property name="visible">True</property>
- <property name="label" translatable="yes">
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox18">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="addSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="editSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment64">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox121">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="Custom" id="custom1">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">stock-edit-24.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 25 Apr 2003 20:27:48 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label554">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="deleteSource">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="general-tab-window">
- <property name="title" translatable="yes">general-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="general-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table36">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label534">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Server name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">server-name-entry</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label535">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Log in method:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="server-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment63">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkOptionMenu" id="auth-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget28">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget29">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Anonymously</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Using email address</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Using distinguished name (DN)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="auth-label-notebook">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label553">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Email address:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label546">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label546</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label536">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Distinguished _name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label547">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label547</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="auth-entry-notebook">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkEntry" id="email-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label549">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label549</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="dn-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label550">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label550</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="general-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label537">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the full name of your ldap server. For example, &quot;ldap.mycompany.com&quot;.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label538">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label539">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Evolution will use this email address to authenticate you with the server</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label540">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label541">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Evolution will use this DN to authenticate you with the server</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label542">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label165</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label552">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the method evolution will use to authenticate you. Note that setting this to &quot;Email Address&quot; requires anonymous access to your ldap server.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label551">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label551</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label544">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the name for this server that will appear in your Evolution folder list.
-It is for display purposes only. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label545">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label452</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="connecting-tab-window">
- <property name="title" translatable="yes">connecting-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="connecting-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table14">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label175">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Port number:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment21">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkCombo" id="port-combo">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry27">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget32">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget33">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget34">
- <property name="visible">True</property>
- <property name="label" translatable="yes">389</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget35">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget36">
- <property name="visible">True</property>
- <property name="label" translatable="yes">636</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget37">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget38">
- <property name="visible">True</property>
- <property name="label" translatable="yes">3268</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget39">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget40">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label176">
- <property name="visible">True</property>
- <property name="label" translatable="yes">U_se SSL/TLS:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment60">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkOptionMenu" id="ssl-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget41">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget42">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Always</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget43">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Whenever Possible</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget44">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Never</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="connecting-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label178">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the port on the LDAP server that Evolution will try to connect to. A
-list of standard ports has been provided. Ask your system administrator
-what port you should specify.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label179">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label395">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that Evolution will only connect to your LDAP server if
-your LDAP server supports SSL or TLS.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label398">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label398</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label399">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that Evolution will only try to use SSL/TLS if you are in a
-insecure environment. For example, if you and your LDAP server are behind a firewall
-at work, then Evolution doesn't need to use SSL/TLS because your connection is already
-secure.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label396">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label396</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label400">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selecting this option means that your server does not support either SSL or TLS. This
-means that your connection will be insecure, and that you will be vulnerable to security
-exploits. </property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label397">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label397</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="searching-tab-window">
- <property name="title" translatable="yes">searching-tab</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="searching-tab">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table30">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label455">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Search base:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label456">
- <property name="visible">True</property>
- <property name="label" translatable="yes">S_earch scope: </property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment49">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">7.45058e-09</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkOptionMenu" id="scope-optionmenu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget45">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget46">
- <property name="visible">True</property>
- <property name="label" translatable="yes">One</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget47">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sub</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox109">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkEntry" id="rootdn-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="rootdn-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes"> S_how Supported Bases </property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label457">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Timeout (minutes):</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">1</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment50">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkHBox" id="hbox110">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label458">
- <property name="visible">True</property>
- <property name="label" translatable="yes">1:00</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHScale" id="timeout-scale">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="draw_value">False</property>
- <property name="value_pos">GTK_POS_LEFT</property>
- <property name="digits">0</property>
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="inverted">False</property>
- <property name="adjustment">3 1 5 0.5 1 0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label459">
- <property name="visible">True</property>
- <property name="label" translatable="yes">5:00</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">3</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label460">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selected:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label461">
- <property name="visible">True</property>
- <property name="label" translatable="yes">2:30</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label462">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Download limit:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment51">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkHBox" id="hbox111">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkSpinButton" id="download-limit-spinbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">100 0 10000 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label463">
- <property name="visible">True</property>
- <property name="label" translatable="yes">cards</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="searching-tab-help">
- <property name="visible">True</property>
- <property name="show_tabs">False</property>
- <property name="show_border">False</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkLabel" id="label464">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The search base is the distinguished name (DN) of the entry where your searches will
-begin. If you leave this blank, the search will begin at the root of the directory tree.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label465">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label163</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label466">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The search scope defines how deep you would like the search to extend down the
-directory tree. A search scope of &quot;sub&quot; will include all entries below your search base.
-A search scope of &quot;one&quot; will only include the entries one level beneath your base.
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label467">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label164</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label468">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This option controls how long a search will be run.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label469">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label165</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label470">
- <property name="visible">True</property>
- <property name="label" translatable="yes">This is the maximum number of entries to download. Setting this number to be
-too large will slow down your addressbook.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label471">
- <property name="visible">True</property>
- <property name="label" translatable="yes">label166</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="supported-bases-dialog">
- <property name="title" translatable="yes">Supported Search Bases</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">300</property>
- <property name="default_height">200</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button107">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-5</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button109">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="supported-bases-table">
- <property name="visible">True</property>
- <property name="creation_function">supported_bases_create_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 12 Apr 2002 20:06:45 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/component/select-names/.cvsignore b/addressbook/gui/component/select-names/.cvsignore
deleted file mode 100644
index d9b150c040..0000000000
--- a/addressbook/gui/component/select-names/.cvsignore
+++ /dev/null
@@ -1,15 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-Evolution-Addressbook-SelectNames-stubs.c
-Evolution-Addressbook-SelectNames-skels.c
-Evolution-Addressbook-SelectNames-common.c
-Evolution-Addressbook-SelectNames.h
-GNOME_Evolution_Addressbook_SelectNames.server
-GNOME_Evolution_Addressbook_SelectNames.server.in
-e-select-names-marshal.c
-e-select-names-marshal.h
diff --git a/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl b/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
deleted file mode 100644
index 2959597cc5..0000000000
--- a/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * CORBA interface for the SelectNames dialog.
- *
- * Authors:
- * Ettore Perazzoli <ettore@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#include <Bonobo.idl>
-
-module GNOME {
-module Evolution {
-module Addressbook {
-
- interface SimpleCard : Bonobo::Unknown {
- struct Arbitrary {
- string key;
- string type;
- string value;
- };
-
- enum Field {
- FileAs,
- FullName,
- Email,
- PhonePrimary,
- PhoneAssistant,
- PhoneBusiness,
- PhoneCallback,
- PhoneCompany,
- PhoneHome,
- Org,
- AddressBusiness,
- AddressHome,
- PhoneMobile,
- PhoneCar,
- PhoneBusinessFax,
- PhoneHomeFax,
- PhoneBusiness2,
- PhoneHome2,
- PhoneIsdn,
- PhoneOther,
- PhoneOtherFax,
- PhonePager,
- PhoneRadio,
- PhoneTelex,
- PhoneTtytdd,
- AddressOther,
- Email2,
- Email3,
- Url,
- OrgUnit,
- Office,
- Title,
- Role,
- Manager,
- Assistant,
- Nickname,
- Spouse,
- Note,
- Caluri,
- Fburl,
- Icscalendar,
- Anniversary,
- BirthDate,
- Mailer,
- NameOrOrg,
- Categories,
- FamilyName,
- GivenName,
- AdditionalName,
- NameSuffix,
- WantsHtml,
- IsList,
- Last
- };
-
- Arbitrary getArbitrary (in string key);
- void setArbitrary (in string key, in string type, in string value);
-
- string get (in Field field);
- void set (in Field field, in string value);
- };
-
- typedef sequence<SimpleCard> SimpleCardList;
-
- interface SelectNames : Bonobo::Unknown {
- struct Section {
- string id;
- string title;
- };
-
- typedef sequence<Section> SectionList;
-
- exception DuplicateID {};
- exception SectionNotFound {};
-
- void addSection (in string id, in string title)
- raises (DuplicateID);
- void addSectionWithLimit (in string id, in string title, in short limit)
- raises (DuplicateID);
-
- Bonobo::Control getEntryBySection (in string section_id)
- raises (SectionNotFound);
-
- void activateDialog (in string section_id);
- };
-
-
-};
-};
-};
diff --git a/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in b/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in
deleted file mode 100644
index 6e4d156051..0000000000
--- a/addressbook/gui/component/select-names/GNOME_Evolution_Addressbook_SelectNames.server.in.in
+++ /dev/null
@@ -1,31 +0,0 @@
-<oaf_info>
-
-<!--
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_SelectNamesFactory"
- type="shlib"
- location="@COMPONENTDIR@/libevolution-addressbook.so">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook name selection interface"/>
-
-</oaf_server>
--->
-
-<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_SelectNames"
- type="factory"
- location="OAFIID:GNOME_Evolution_Addressbook_Factory">
-
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/Evolution/Addressbook/SelectNames"/>
- </oaf_attribute>
-
- <oaf_attribute name="name" type="string"
- _value="Evolution Addressbook name selection interface"/>
-
-</oaf_server>
-
-</oaf_info> \ No newline at end of file
diff --git a/addressbook/gui/component/select-names/Makefile.am b/addressbook/gui/component/select-names/Makefile.am
deleted file mode 100644
index 72a09715ca..0000000000
--- a/addressbook/gui/component/select-names/Makefile.am
+++ /dev/null
@@ -1,115 +0,0 @@
-# CORBA stuff
-
-idl_DATA = \
- Evolution-Addressbook-SelectNames.idl
-
-IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-IDL_GENERATED_C = \
- Evolution-Addressbook-SelectNames-common.c \
- Evolution-Addressbook-SelectNames-skels.c \
- Evolution-Addressbook-SelectNames-stubs.c
-IDL_GENERATED = $(IDL_GENERATED_C) $(IDL_GENERATED_H)
-
-$(IDL_GENERATED_H): $(idl_DATA)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- $(srcdir)/Evolution-Addressbook-SelectNames.idl
-$(IDL_GENERATED_C): $(IDL_GENERATED_H)
-
-server_in_files = GNOME_Evolution_Addressbook_SelectNames.server.in.in
-
-server_DATA = $(server_in_files:.server.in.in=.server)
-%.server.in: %.server.in.in
- sed -e "s|\@COMPONENTDIR\@|$(componentdir)|" $< > $@
-
-@INTLTOOL_SERVER_RULE@
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-addressbook\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/shell \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/widgets/e-text \
- -I$(top_srcdir)/widgets/e-table \
- -I$(top_srcdir)/addressbook/gui/minicard \
- -I$(top_srcdir)/addressbook/gui/widgets \
- -I$(top_srcdir)/addressbook/contact-editor \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-privlib_LTLIBRARIES = libeselectnames.la
-
-libeselectnames_la_SOURCES = \
- $(IDL_GENERATED) \
- e-select-names-bonobo.c \
- e-select-names-bonobo.h \
- e-select-names-completion.c \
- e-select-names-completion.h \
- e-select-names-manager.c \
- e-select-names-manager.h \
- e-select-names-marshal.c \
- e-select-names-model.c \
- e-select-names-model.h \
- e-select-names-popup.c \
- e-select-names-popup.h \
- e-select-names-table-model.c \
- e-select-names-table-model.h \
- e-select-names-text-model.c \
- e-select-names-text-model.h \
- e-select-names.c \
- e-select-names.h \
- e-simple-card-bonobo.c \
- e-simple-card-bonobo.h
-
-libeselectnames_la_LIBADD = \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-# We'll need these again when we split out the select names control
-# into its own shlib factory, but for now they're redundant.
-#
-# e-select-names-factory.c
-# e-select-names-factory.h
-
-# GLib marshalling cruft
-
-e-select-names-marshal.h: e-select-names-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=e_select_names_marshal e-select-names-marshal.list --header > e-select-names-marshal.tmp \
- && mv e-select-names-marshal.tmp e-select-names-marshal.h ) \
- || ( rm -f e-select-names-marshal.tmp && exit 1 )
-
-e-select-names-marshal.c: e-select-names-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=e_select_names_marshal e-select-names-marshal.list --body > e-select-names-marshal.tmp \
- && mv e-select-names-marshal.tmp e-select-names-marshal.c ) \
- || ( rm -f e-select-names-marshal.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-select-names-marshal.c e-select-names-marshal.h
-
-glade_DATA = select-names.glade
-etspec_DATA = e-select-names.etspec e-select-names-section.etspec
-
-EXTRA_DIST = \
- $(glade_DATA) \
- $(server_in_files) \
- $(server_DATA) \
- $(idl_DATA) \
- $(etspec_DATA) \
- e-select-names-marshal.list
-
-BUILT_SOURCES = $(IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c
deleted file mode 100644
index 10fc9caee7..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.c
+++ /dev/null
@@ -1,651 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-bonobo.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-select-names-bonobo.h"
-#include "e-simple-card-bonobo.h"
-
-#include <bonobo-activation/bonobo-activation-activate.h>
-
-#include <bonobo/bonobo-property-bag.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-event-source.h>
-#include <bonobo/bonobo-ui-util.h>
-
-#include <gal/util/e-util.h>
-#include <gal/e-text/e-entry.h>
-#include <gal/util/e-text-event-processor.h>
-
-#include "evolution-shell-client.h"
-
-#include "Evolution-Addressbook-SelectNames.h"
-
-#include "e-select-names-manager.h"
-#include "e-select-names-model.h"
-#include "e-select-names-text-model.h"
-#include "e-select-names-completion.h"
-
-#include <string.h>
-
-
-#define PARENT_TYPE BONOBO_TYPE_OBJECT
-static BonoboObjectClass *parent_class = NULL;
-
-struct _ESelectNamesBonoboPrivate {
- ESelectNamesManager *manager;
- BonoboEventSource *event_source;
-};
-
-enum _EntryPropertyID {
- ENTRY_PROPERTY_ID_TEXT,
- ENTRY_PROPERTY_ID_ADDRESSES,
- ENTRY_PROPERTY_ID_DESTINATIONS,
- ENTRY_PROPERTY_ID_SIMPLE_CARD_LIST,
- ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS,
- ENTRY_PROPERTY_ID_ENTRY_CHANGED
-};
-typedef enum _EntryPropertyID EntryPropertyID;
-
-
-/* PropertyBag implementation for the entry widgets. */
-
-static void
-entry_get_property_fn (BonoboPropertyBag *bag,
- BonoboArg *arg,
- unsigned int arg_id,
- CORBA_Environment *ev,
- void *user_data)
-{
- GtkWidget *w;
-
- w = GTK_WIDGET (user_data);
-
- switch (arg_id) {
- case ENTRY_PROPERTY_ID_TEXT:
- {
- ETextModel *text_model;
- text_model = E_TEXT_MODEL (g_object_get_data (G_OBJECT (w), "select_names_text_model"));
- g_assert (text_model != NULL);
-
- BONOBO_ARG_SET_STRING (arg, e_text_model_get_text (text_model));
- break;
- }
-
- case ENTRY_PROPERTY_ID_ADDRESSES:
- {
- ESelectNamesModel *model;
- char *text;
-
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- text = e_select_names_model_get_address_text (model, ", ");
- BONOBO_ARG_SET_STRING (arg, text);
- g_free (text);
- }
- break;
-
- case ENTRY_PROPERTY_ID_DESTINATIONS:
- {
- ESelectNamesModel *model;
- char *text;
-
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- text = e_select_names_model_export_destinationv (model);
- BONOBO_ARG_SET_STRING (arg, text);
- g_free (text);
- }
- break;
-
- case ENTRY_PROPERTY_ID_SIMPLE_CARD_LIST:
- {
- ESelectNamesModel *model;
- int count;
- int i;
- GNOME_Evolution_Addressbook_SimpleCardList *card_list;
-
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- count = e_select_names_model_count (model);
-
- card_list = GNOME_Evolution_Addressbook_SimpleCardList__alloc ();
- card_list->_buffer = CORBA_sequence_GNOME_Evolution_Addressbook_SimpleCard_allocbuf (count);
- card_list->_maximum = count;
- card_list->_length = count;
-
- for (i = 0; i < count; i++) {
- const EDestination *destination = e_select_names_model_get_destination (model, i);
- const ECard *card = e_destination_get_card (destination);
- ECardSimple *simple = e_card_simple_new ((ECard *) card);
- ESimpleCardBonobo *simple_card = e_simple_card_bonobo_new (simple);
- g_object_unref (simple);
-
- card_list->_buffer[i] = bonobo_object_corba_objref (BONOBO_OBJECT (simple_card));
- }
-
- CORBA_free (*(GNOME_Evolution_Addressbook_SimpleCardList **)arg->_value);
- BONOBO_ARG_SET_GENERAL (arg, *card_list, TC_GNOME_Evolution_Addressbook_SimpleCardList, GNOME_Evolution_Addressbook_SimpleCardList, NULL);
- }
- break;
-
- case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS:
- {
- ESelectNamesCompletion *comp;
- comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler"));
- g_assert (comp != NULL);
-
- BONOBO_ARG_SET_BOOLEAN (arg, e_select_names_completion_get_match_contact_lists (comp));
- break;
- }
-
- case ENTRY_PROPERTY_ID_ENTRY_CHANGED:
- /* This is a read-only property. */
- g_assert_not_reached ();
- break;
-
- default:
- break;
- }
-}
-
-static void
-entry_set_property_fn (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- GtkWidget *w;
-
- w = GTK_WIDGET (user_data);
-
- switch (arg_id) {
-
- case ENTRY_PROPERTY_ID_TEXT:
- case ENTRY_PROPERTY_ID_ADDRESSES:
- {
- ESelectNamesModel *model;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- e_entry_set_text (E_ENTRY (w), BONOBO_ARG_GET_STRING (arg));
- e_select_names_model_cardify_all (model, NULL, 0);
- break;
- }
-
- case ENTRY_PROPERTY_ID_DESTINATIONS:
- {
- ESelectNamesModel *model;
- model = E_SELECT_NAMES_MODEL (g_object_get_data (G_OBJECT (w), "select_names_model"));
- g_assert (model != NULL);
-
- e_select_names_model_import_destinationv (model, BONOBO_ARG_GET_STRING (arg));
- e_select_names_model_cardify_all (model, NULL, 0);
- break;
- }
-
- case ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS:
- {
- ESelectNamesCompletion *comp;
- comp = E_SELECT_NAMES_COMPLETION (g_object_get_data (G_OBJECT (w), "completion_handler"));
- g_assert (comp != NULL);
-
- e_select_names_completion_set_match_contact_lists (comp, BONOBO_ARG_GET_BOOLEAN (arg));
- break;
- }
-
- case ENTRY_PROPERTY_ID_ENTRY_CHANGED:
- g_object_set_data (G_OBJECT (w), "entry_property_id_changed", GUINT_TO_POINTER (1));
- break;
-
- default:
- break;
- }
-}
-
-static void
-impl_SelectNames_add_section (PortableServer_Servant servant,
- const CORBA_char *id,
- const CORBA_char *title,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- e_select_names_manager_add_section (priv->manager, id, title);
-}
-
-static void
-impl_SelectNames_add_section_with_limit (PortableServer_Servant servant,
- const CORBA_char *id,
- const CORBA_char *title,
- CORBA_short limit,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- e_select_names_manager_add_section_with_limit (priv->manager, id, title, limit);
-}
-
-static void
-entry_changed (GtkWidget *widget, BonoboControl *control)
-{
- gboolean changed = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), "entry_property_id_changed"));
-
- if (!changed)
- bonobo_control_set_property (control, NULL, "entry_changed", TC_CORBA_boolean, TRUE, NULL);
-}
-
-static void
-manager_changed_cb (ESelectNamesManager *manager, const gchar *section_id, gint changed_working_copy, gpointer closure)
-{
- ESelectNamesBonobo *select_names = E_SELECT_NAMES_BONOBO (closure);
- BonoboArg *arg;
-
- arg = bonobo_arg_new (BONOBO_ARG_STRING);
- BONOBO_ARG_SET_STRING (arg, section_id);
-
- bonobo_event_source_notify_listeners_full (select_names->priv->event_source,
- "GNOME/Evolution",
- "changed",
- changed_working_copy ? "working_copy" : "model",
- arg, NULL);
-
- bonobo_arg_release (arg);
-}
-
-static void
-manager_ok_cb (ESelectNamesManager *manager, gpointer closure)
-{
- ESelectNamesBonobo *select_names = E_SELECT_NAMES_BONOBO (closure);
- BonoboArg *arg;
-
- arg = bonobo_arg_new (BONOBO_ARG_NULL);
-
- bonobo_event_source_notify_listeners_full (select_names->priv->event_source,
- "GNOME/Evolution",
- "ok",
- "dialog",
- arg,
- NULL);
-
- bonobo_arg_release (arg);
-}
-
-static void
-copy_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_copy_clipboard (entry->item);
-}
-
-static void
-cut_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_cut_clipboard (entry->item);
-}
-
-static void
-paste_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_paste_clipboard (entry->item);
-}
-
-static void
-select_all_cb (BonoboUIComponent *ui, gpointer user_data, const char *command)
-{
- EEntry *entry = E_ENTRY (user_data);
-
- e_text_select_all (entry->item);
-}
-
-static BonoboUIVerb verbs [] = {
- BONOBO_UI_VERB ("EditCut", cut_cb),
- BONOBO_UI_VERB ("EditCopy", copy_cb),
- BONOBO_UI_VERB ("EditPaste", paste_cb),
- BONOBO_UI_VERB ("EditSelectAll", select_all_cb),
- BONOBO_UI_VERB_END
-};
-
-typedef struct {
- GtkWidget *widget;
- BonoboControl *control;
- Bonobo_UIContainer remote_ui_container;
- char *ui_xml_path;
- char *app_name;
- BonoboUIVerb *verbs;
- gpointer user_data;
-} ControlUIClosure;
-
-static void
-free_closure (ControlUIClosure *closure,
- GtkObject *where_object_was)
-{
- bonobo_object_release_unref (closure->remote_ui_container, NULL);
- g_free (closure->ui_xml_path);
- g_free (closure->app_name);
- g_free (closure);
-}
-
-static void
-merge_menu_items (BonoboControl *control, BonoboUIComponent *uic, ControlUIClosure *closure)
-{
- if (closure->remote_ui_container) {
- bonobo_ui_component_set_container (uic, closure->remote_ui_container, NULL);
-
- bonobo_ui_component_add_verb_list_with_data (uic, closure->verbs, closure->user_data);
-
- bonobo_ui_component_freeze (uic, NULL);
-
- bonobo_ui_util_set_ui (uic, PREFIX,
- closure->ui_xml_path,
- closure->app_name, NULL);
-
- bonobo_ui_component_thaw (uic, NULL);
- }
-}
-
-static void
-unmerge_menu_items (BonoboControl *control, BonoboUIComponent *uic, ControlUIClosure *closure)
-{
- bonobo_ui_component_unset_container (uic, NULL);
-}
-
-static void
-control_set_frame_cb (BonoboControl *control,
- ControlUIClosure *closure)
-{
- Bonobo_ControlFrame frame = bonobo_control_get_control_frame (control,
- NULL);
- if (!frame)
- return;
- closure->remote_ui_container = bonobo_control_get_remote_ui_container (control, NULL);
-}
-
-static void
-control_activate_cb (BonoboControl *control,
- gboolean activate,
- ControlUIClosure *closure)
-{
- if (activate)
- gtk_widget_grab_focus (closure->widget); /* the ECanvas */
-}
-
-static gboolean
-widget_focus_cb (GtkWidget *w, GdkEventFocus *focus, ControlUIClosure *closure)
-{
- BonoboUIComponent *uic;
-
- uic = bonobo_control_get_ui_component (closure->control);
-
- if (GTK_WIDGET_HAS_FOCUS (w)) {
- merge_menu_items (closure->control, uic, closure);
- } else {
- unmerge_menu_items (closure->control, uic, closure);
- }
-
- return FALSE;
-}
-
-static void
-e_bonobo_control_automerge_ui (GtkWidget *w,
- BonoboControl *control,
- const char *ui_xml_path,
- const char *app_name,
- BonoboUIVerb *verbs,
- gpointer data)
-{
- ControlUIClosure *closure;
-
- g_return_if_fail (GTK_IS_WIDGET (w));
- g_return_if_fail (BONOBO_IS_CONTROL (control));
- g_return_if_fail (ui_xml_path != NULL);
- g_return_if_fail (app_name != NULL);
- g_return_if_fail (verbs != NULL);
-
- closure = g_new (ControlUIClosure, 1);
-
- closure->widget = w;
- closure->control = control;
- closure->ui_xml_path = g_strdup (ui_xml_path);
- closure->app_name = g_strdup (app_name);
- closure->verbs = verbs;
- closure->user_data = data;
-
- g_signal_connect (w, "focus_in_event",
- G_CALLBACK (widget_focus_cb), closure);
- g_signal_connect (w, "focus_out_event",
- G_CALLBACK (widget_focus_cb), closure);
- g_signal_connect (control, "activate",
- G_CALLBACK (control_activate_cb), closure);
- g_signal_connect (control, "set_frame",
- G_CALLBACK (control_set_frame_cb), closure);
-
- g_object_weak_ref (G_OBJECT (control), (GWeakNotify)free_closure, closure);
-}
-
-static Bonobo_Control
-impl_SelectNames_get_entry_for_section (PortableServer_Servant servant,
- const CORBA_char *section_id,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
- GtkWidget *entry_widget;
- BonoboControl *control;
- BonoboPropertyBag *property_bag;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- entry_widget = e_select_names_manager_create_entry (priv->manager, section_id);
- gtk_widget_show (entry_widget);
-
- if (entry_widget == NULL) {
- CORBA_exception_set (ev,
- CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Addressbook_SelectNames_SectionNotFound,
- NULL);
- return CORBA_OBJECT_NIL;
- }
-
- control = bonobo_control_new (entry_widget);
-
- property_bag = bonobo_property_bag_new (entry_get_property_fn, entry_set_property_fn, entry_widget);
- bonobo_property_bag_add (property_bag, "text", ENTRY_PROPERTY_ID_TEXT,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "addresses", ENTRY_PROPERTY_ID_ADDRESSES,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "destinations", ENTRY_PROPERTY_ID_DESTINATIONS,
- BONOBO_ARG_STRING, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "simple_card_list", ENTRY_PROPERTY_ID_SIMPLE_CARD_LIST,
- TC_GNOME_Evolution_Addressbook_SimpleCardList, NULL, NULL,
- BONOBO_PROPERTY_READABLE);
- bonobo_property_bag_add (property_bag, "allow_contact_lists", ENTRY_PROPERTY_ID_ALLOW_CONTACT_LISTS,
- BONOBO_ARG_BOOLEAN, NULL, NULL,
- BONOBO_PROPERTY_READABLE | BONOBO_PROPERTY_WRITEABLE);
- bonobo_property_bag_add (property_bag, "entry_changed", ENTRY_PROPERTY_ID_ENTRY_CHANGED,
- BONOBO_ARG_BOOLEAN, NULL, NULL,
- BONOBO_PROPERTY_WRITEABLE);
-
- bonobo_control_set_properties (control, bonobo_object_corba_objref (BONOBO_OBJECT (property_bag)), NULL);
- bonobo_object_unref (BONOBO_OBJECT (property_bag));
-
- g_signal_connect (entry_widget, "changed", G_CALLBACK (entry_changed), control);
-
- e_bonobo_control_automerge_ui (GTK_WIDGET (E_ENTRY (entry_widget)->canvas),
- control,
- EVOLUTION_UIDIR "/evolution-composer-entries.xml",
- "evolution-addressbook",
- verbs, entry_widget);
-
- return CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (control)), ev);
-}
-
-static void
-impl_SelectNames_activate_dialog (PortableServer_Servant servant,
- const CORBA_char *section_id,
- CORBA_Environment *ev)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
- EvolutionShellClient *shell_client;
- GNOME_Evolution_Shell shell;
-
- select_names = E_SELECT_NAMES_BONOBO (bonobo_object (servant));
- priv = select_names->priv;
-
- shell = bonobo_activation_activate_from_id (
- "OAFIID:GNOME_Evolution_Shell",
- Bonobo_ACTIVATION_FLAG_EXISTING_ONLY,
- NULL, ev);
- if (BONOBO_EX (ev))
- return;
-
- shell_client = evolution_shell_client_new (shell);
- e_select_names_manager_activate_dialog (priv->manager, shell_client,
- section_id);
- g_object_unref (shell_client);
-}
-
-
-/* GtkObject methods. */
-
-static void
-impl_dispose (GObject *object)
-{
- ESelectNamesBonobo *select_names;
- ESelectNamesBonoboPrivate *priv;
-
- select_names = E_SELECT_NAMES_BONOBO (object);
- priv = select_names->priv;
-
- if (priv) {
- if (priv->manager->names) {
- gtk_widget_destroy (GTK_WIDGET (priv->manager->names));
- priv->manager->names = NULL;
- }
-
- g_object_unref (priv->manager);
-
- g_free (priv);
- select_names->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-static void
-e_select_names_bonobo_class_init (ESelectNamesBonoboClass *klass)
-{
- GObjectClass *object_class;
- POA_GNOME_Evolution_Addressbook_SelectNames__epv *epv;
-
- object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = impl_dispose;
-
- epv = &klass->epv;
- epv->addSection = impl_SelectNames_add_section;
- epv->addSectionWithLimit = impl_SelectNames_add_section_with_limit;
- epv->getEntryBySection = impl_SelectNames_get_entry_for_section;
- epv->activateDialog = impl_SelectNames_activate_dialog;
-}
-
-static void
-e_select_names_bonobo_init (ESelectNamesBonobo *select_names)
-{
- ESelectNamesBonoboPrivate *priv;
-
- priv = g_new (ESelectNamesBonoboPrivate, 1);
-
- priv->manager = e_select_names_manager_new ();
- priv->event_source = NULL;
-
- g_signal_connect (priv->manager,
- "changed",
- G_CALLBACK (manager_changed_cb),
- select_names);
-
- g_signal_connect (priv->manager,
- "ok",
- G_CALLBACK (manager_ok_cb),
- select_names);
-
- select_names->priv = priv;
-}
-
-
-static void
-e_select_names_bonobo_construct (ESelectNamesBonobo *select_names)
-{
- g_return_if_fail (select_names != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_BONOBO (select_names));
-
- g_assert (select_names->priv->event_source == NULL);
- select_names->priv->event_source = bonobo_event_source_new ();
- bonobo_object_add_interface (BONOBO_OBJECT (select_names), BONOBO_OBJECT (select_names->priv->event_source));
-}
-
-ESelectNamesBonobo *
-e_select_names_bonobo_new (void)
-{
- ESelectNamesBonobo *select_names;
-
- select_names = g_object_new (E_TYPE_SELECT_NAMES_BONOBO, NULL);
-
- e_select_names_bonobo_construct (select_names);
-
- return select_names;
-}
-
-
-BONOBO_TYPE_FUNC_FULL (
- ESelectNamesBonobo,
- GNOME_Evolution_Addressbook_SelectNames,
- PARENT_TYPE,
- e_select_names_bonobo);
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.h b/addressbook/gui/component/select-names/e-select-names-bonobo.h
deleted file mode 100644
index 5b04ed5b2e..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-bonobo.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifndef __E_SELECT_NAMES_BONOBO_H__
-#define __E_SELECT_NAMES_BONOBO_H__
-
-#include <bonobo/bonobo-object.h>
-
-#include "Evolution-Addressbook-SelectNames.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_SELECT_NAMES_BONOBO (e_select_names_bonobo_get_type ())
-#define E_SELECT_NAMES_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonobo))
-#define E_SELECT_NAMES_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_BONOBO, ESelectNamesBonoboClass))
-#define E_IS_SELECT_NAMES_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_BONOBO))
-#define E_IS_SELECT_NAMES_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_BONOBO))
-
-
-typedef struct _ESelectNamesBonobo ESelectNamesBonobo;
-typedef struct _ESelectNamesBonoboPrivate ESelectNamesBonoboPrivate;
-typedef struct _ESelectNamesBonoboClass ESelectNamesBonoboClass;
-
-struct _ESelectNamesBonobo {
- BonoboObject parent;
-
- ESelectNamesBonoboPrivate *priv;
-};
-
-struct _ESelectNamesBonoboClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Addressbook_SelectNames__epv epv;
-};
-
-
-GType e_select_names_bonobo_get_type (void);
-ESelectNamesBonobo *e_select_names_bonobo_new (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __E_SELECT_NAMES_BONOBO_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
deleted file mode 100644
index 5a9fc2deb4..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ /dev/null
@@ -1,1207 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-completion.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include "e-select-names-completion.h"
-
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#include <gtk/gtksignal.h>
-
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/backend/ebook/e-destination.h>
-#include <addressbook/backend/ebook/e-card-simple.h>
-#include <addressbook/backend/ebook/e-card-compare.h>
-
-typedef struct {
- EBook *book;
- guint book_view_tag;
- EBookView *book_view;
- ESelectNamesCompletion *comp;
- guint card_added_tag;
- guint seq_complete_tag;
- gboolean sequence_complete_received;
-
- gchar *cached_query_text;
- GList *cached_cards;
- gboolean cache_complete;
-
-} ESelectNamesCompletionBookData;
-
-struct _ESelectNamesCompletionPrivate {
-
- ESelectNamesTextModel *text_model;
-
- GList *book_data;
- gint books_not_ready;
- gint pending_completion_seq;
-
- gchar *waiting_query;
- gint waiting_pos, waiting_limit;
- gchar *query_text;
-
- gboolean match_contact_lists;
-
- gint minimum_query_length;
-};
-
-static void e_select_names_completion_class_init (ESelectNamesCompletionClass *);
-static void e_select_names_completion_init (ESelectNamesCompletion *);
-static void e_select_names_completion_dispose (GObject *object);
-
-static void e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBookView *view, gpointer user_data);
-static void e_select_names_completion_card_added_cb (EBookView *, const GList *cards, gpointer user_data);
-static void e_select_names_completion_seq_complete_cb (EBookView *, EBookViewStatus status, gpointer user_data);
-
-static void e_select_names_completion_do_query (ESelectNamesCompletion *, const gchar *query_text, gint pos, gint limit);
-
-static void e_select_names_completion_handle_request (ECompletion *, const gchar *txt, gint pos, gint limit);
-static void e_select_names_completion_end (ECompletion *);
-
-static GObjectClass *parent_class;
-
-static FILE *out;
-
-/*
- *
- * Query builders
- *
- */
-
-typedef gchar *(*BookQuerySExp) (ESelectNamesCompletion *);
-typedef ECompletionMatch *(*BookQueryMatchTester) (ESelectNamesCompletion *, EDestination *);
-
-static int
-utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
-{
- gchar *s1 = g_utf8_casefold(str1, len);
- gchar *s2 = g_utf8_casefold(str2, len);
- int rv;
-
- rv = g_utf8_collate (s1, s2);
-
- g_free (s1);
- g_free (s2);
-
- return rv;
-}
-
-static int
-utf8_casefold_collate (const gchar *str1, const gchar *str2)
-{
- return utf8_casefold_collate_len (str1, str2, -1);
-}
-
-static void
-our_match_destroy (ECompletionMatch *match)
-{
- g_object_unref (match->user_data);
-}
-
-static ECompletionMatch *
-make_match (EDestination *dest, const gchar *menu_form, double score)
-{
- ECompletionMatch *match;
- ECard *card = e_destination_get_card (dest);
-
- match = e_completion_match_new (e_destination_get_name (dest), menu_form, score);
-
- e_completion_match_set_text (match, e_destination_get_name (dest), menu_form);
-
- /* Reject any match that has null text fields. */
- if (! (e_completion_match_get_match_text (match) && e_completion_match_get_menu_text (match))) {
- g_object_unref (match);
- return NULL;
- }
-
- /* Since we sort low to high, we negate so that larger use scores will come first */
- match->sort_major = card ? -floor (e_card_get_use_score (card)) : 0;
-
- match->sort_minor = e_destination_get_email_num (dest);
-
- match->user_data = dest;
- g_object_ref (dest);
-
- match->destroy = our_match_destroy;
-
- return match;
-}
-
-/*
- * Nickname query
- */
-
-static gchar *
-sexp_nickname (ESelectNamesCompletion *comp)
-{
- gchar *query = g_strdup_printf ("(beginswith \"nickname\" \"%s\")", comp->priv->query_text);
-
- return query;
-}
-
-static ECompletionMatch *
-match_nickname (ESelectNamesCompletion *comp, EDestination *dest)
-{
- ECompletionMatch *match = NULL;
- gint len;
- ECard *card = e_destination_get_card (dest);
- double score;
-
- if (card->nickname == NULL)
- return NULL;
-
- len = g_utf8_strlen (comp->priv->query_text, -1);
- if (card->nickname && !utf8_casefold_collate_len (comp->priv->query_text, card->nickname, len)) {
- const gchar *name;
- gchar *str;
-
- score = len * 2; /* nickname gives 2 points per matching character */
-
- if (len == g_utf8_strlen (card->nickname, -1)) /* boost score on an exact match */
- score *= 10;
-
- name = e_destination_get_name (dest);
- if (name && *name)
- str = g_strdup_printf ("'%s' %s <%s>", card->nickname, name, e_destination_get_email (dest));
- else
- str = g_strdup_printf ("'%s' <%s>", card->nickname, e_destination_get_email (dest));
-
- match = make_match (dest, str, score);
- g_free (str);
- }
-
- return match;
-}
-
-/*
- * E-Mail Query
- */
-
-static gchar *
-sexp_email (ESelectNamesCompletion *comp)
-{
- return g_strdup_printf ("(beginswith \"email\" \"%s\")", comp->priv->query_text);
-}
-
-static ECompletionMatch *
-match_email (ESelectNamesCompletion *comp, EDestination *dest)
-{
- ECompletionMatch *match;
- gint len = strlen (comp->priv->query_text);
- const gchar *name = e_destination_get_name (dest);
- const gchar *email = e_destination_get_email (dest);
- double score;
-
- if (email
- && !utf8_casefold_collate_len (comp->priv->query_text, email, len)
- && !e_destination_is_evolution_list (dest)) {
-
- gchar *str;
-
- score = len * 2; /* 2 points for each matching character */
-
- if (name && *name)
- str = g_strdup_printf ("<%s> %s", email, name);
- else
- str = g_strdup (email);
-
- match = make_match (dest, str, score);
-
- g_free (str);
-
- return match;
- }
-
- return NULL;
-}
-
-/*
- * Name Query
- */
-
-static gchar *
-name_style_query (ESelectNamesCompletion *comp, const gchar *field)
-{
- if (comp && comp->priv->query_text && *comp->priv->query_text) {
- gchar *cpy = g_strdup (comp->priv->query_text), *c;
- gchar **strv;
- gchar *query;
- gint i, count=0;
-
- for (c = cpy; *c; ++c) {
- if (*c == ',')
- *c = ' ';
- }
-
- strv = g_strsplit (cpy, " ", 0);
- for (i=0; strv[i]; ++i) {
- gchar *old;
- ++count;
- g_strstrip (strv[i]);
- old = strv[i];
- strv[i] = g_strdup_printf ("(beginswith \"%s\" \"%s\")", field, old);
- g_free (old);
- }
-
- if (count == 1) {
- query = strv[0];
- strv[0] = NULL;
- } else {
- gchar *joined = g_strjoinv (" ", strv);
- query = g_strdup_printf ("(and %s)", joined);
- g_free (joined);
- }
-
- g_free (cpy);
- g_strfreev (strv);
-
- return query;
- }
-
- return NULL;
-}
-
-static gchar *
-sexp_name (ESelectNamesCompletion *comp)
-{
- return name_style_query (comp, "full_name");
-}
-
-static ECompletionMatch *
-match_name (ESelectNamesCompletion *comp, EDestination *dest)
-{
- ECompletionMatch *final_match = NULL;
- gchar *menu_text = NULL;
- ECard *card;
- const gchar *email;
- gint match_len = 0;
- ECardMatchType match;
- ECardMatchPart first_match;
- double score = 0;
- gboolean have_given, have_additional, have_family;
-
- card = e_destination_get_card (dest);
-
- if (card->name == NULL)
- return NULL;
-
- email = e_destination_get_email (dest);
-
- match = e_card_compare_name_to_string_full (card, comp->priv->query_text, TRUE /* yes, allow partial matches */,
- NULL, &first_match, &match_len);
-
- if (match <= E_CARD_MATCH_NONE)
- return NULL;
-
- score = match_len * 3; /* three points per match character */
-
- have_given = card->name->given && *card->name->given;
- have_additional = card->name->additional && *card->name->additional;
- have_family = card->name->family && *card->name->family;
-
- if (e_card_evolution_list (card)) {
-
- menu_text = e_card_name_to_string (card->name);
-
- } else if (first_match == E_CARD_MATCH_PART_GIVEN_NAME) {
-
- if (have_family)
- menu_text = g_strdup_printf ("%s %s <%s>", card->name->given, card->name->family, email);
- else
- menu_text = g_strdup_printf ("%s <%s>", card->name->given, email);
-
- } else if (first_match == E_CARD_MATCH_PART_ADDITIONAL_NAME) {
-
- if (have_given) {
-
- menu_text = g_strdup_printf ("%s%s%s, %s <%s>",
- card->name->additional,
- have_family ? " " : "",
- have_family ? card->name->family : "",
- card->name->given,
- email);
- } else {
-
- menu_text = g_strdup_printf ("%s%s%s <%s>",
- card->name->additional,
- have_family ? " " : "",
- have_family ? card->name->family : "",
- email);
- }
-
- } else if (first_match == E_CARD_MATCH_PART_FAMILY_NAME) {
-
- if (have_given)
- menu_text = g_strdup_printf ("%s, %s%s%s <%s>",
- card->name->family,
- card->name->given,
- have_additional ? " " : "",
- have_additional ? card->name->additional : "",
- email);
- else
- menu_text = g_strdup_printf ("%s <%s>", card->name->family, email);
-
- } else { /* something funny happened */
-
- menu_text = g_strdup_printf ("<%s> ???", email);
-
- }
-
- if (menu_text) {
- g_strstrip (menu_text);
- final_match = make_match (dest, menu_text, score);
- g_free (menu_text);
- }
-
- return final_match;
-}
-
-/*
- * File As Query
- */
-
-static gchar *
-sexp_file_as (ESelectNamesCompletion *comp)
-{
- return name_style_query (comp, "file_as");
-}
-
-static ECompletionMatch *
-match_file_as (ESelectNamesCompletion *comp, EDestination *dest)
-{
- const gchar *name;
- const gchar *email;
- gchar *cpy, **strv, *menu_text;
- gint i, len;
- double score = 0.00001;
- ECompletionMatch *match;
-
- name = e_destination_get_name (dest);
- email = e_destination_get_email (dest);
-
- if (!(name && *name))
- return NULL;
-
- cpy = g_strdup (comp->priv->query_text);
- strv = g_strsplit (cpy, " ", 0);
-
- for (i=0; strv[i] && score > 0; ++i) {
- len = g_utf8_strlen (strv[i], -1);
- if (!utf8_casefold_collate_len (name, strv[i], len))
- score += len; /* one point per character of the match */
- else
- score = 0;
- }
-
- g_free (cpy);
- g_strfreev (strv);
-
- if (score <= 0)
- return NULL;
-
- menu_text = g_strdup_printf ("%s <%s>", name, email);
- g_strstrip (menu_text);
- match = make_match (dest, menu_text, score);
- g_free (menu_text);
-
- return match;
-}
-
-typedef struct _BookQuery BookQuery;
-struct _BookQuery {
- BookQuerySExp builder;
- BookQueryMatchTester tester;
-};
-
-static BookQuery book_queries[] = {
- { sexp_nickname, match_nickname},
- { sexp_email, match_email },
- { sexp_name, match_name },
- { sexp_file_as, match_file_as },
-};
-static gint book_query_count = sizeof (book_queries) / sizeof (BookQuery);
-
-/*
- * Build up a big compound sexp corresponding to all of our queries.
- */
-static gchar *
-book_query_sexp (ESelectNamesCompletion *comp)
-{
- gint i, j;
- gchar **queryv, *query;
-
- g_return_val_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
-
- if (! (comp->priv->query_text && *comp->priv->query_text))
- return NULL;
-
- queryv = g_new0 (gchar *, book_query_count+1);
- for (i=0, j=0; i<book_query_count; ++i) {
- queryv[j] = book_queries[i].builder (comp);
- if (queryv[j])
- ++j;
- }
-
- if (j == 0) {
- query = NULL;
- } else if (j == 1) {
- query = queryv[0];
- queryv[0] = NULL;
- } else {
- gchar *tmp = g_strjoinv (" ", queryv);
- query = g_strdup_printf ("(or %s)", tmp);
- g_free (tmp);
- }
-
- for (i=0; i<book_query_count; ++i)
- g_free (queryv[i]);
- g_free (queryv);
-
- return query;
-}
-
-/*
- * Sweep across all of our query rules and find the best score/match
- * string that applies to a given destination.
- */
-static ECompletionMatch *
-book_query_score (ESelectNamesCompletion *comp, EDestination *dest)
-{
- ECompletionMatch *best_match = NULL;
- gint i;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
- g_return_val_if_fail (E_IS_DESTINATION (dest), NULL);
-
- if (! (comp->priv->query_text && *comp->priv->query_text))
- return NULL;
-
- for (i=0; i<book_query_count; ++i) {
-
- ECompletionMatch *this_match = NULL;
-
- if (book_queries[i].tester && e_destination_get_card (dest)) {
- this_match = book_queries[i].tester (comp, dest);
- }
-
- if (this_match) {
- if (best_match == NULL || this_match->score > best_match->score) {
- e_completion_match_unref (best_match);
- best_match = this_match;
- } else {
- e_completion_match_unref (this_match);
- }
- }
- }
-
- return best_match;
-}
-
-static void
-book_query_process_card_list (ESelectNamesCompletion *comp, const GList *cards)
-{
- while (cards) {
- ECard *card = E_CARD (cards->data);
-
- if (e_card_evolution_list (card)) {
-
- if (comp->priv->match_contact_lists) {
-
- EDestination *dest = e_destination_new ();
- ECompletionMatch *match;
- e_destination_set_card (dest, card, 0);
- match = book_query_score (comp, dest);
- if (match && match->score > 0) {
- e_completion_found_match (E_COMPLETION (comp), match);
- } else {
- e_completion_match_unref (match);
- }
- g_object_unref (dest);
-
- }
-
- } else if (card->email) {
- gint i;
- for (i=0; i<e_list_length (card->email); ++i) {
- EDestination *dest = e_destination_new ();
- const gchar *email;
- ECompletionMatch *match;
-
- e_destination_set_card (dest, card, i);
- email = e_destination_get_email (dest);
-
- if (email && *email) {
-
- match = book_query_score (comp, dest);
- if (match && match->score > 0) {
- e_completion_found_match (E_COMPLETION (comp), match);
- } else {
- e_completion_match_unref (match);
- }
- }
-
- g_object_unref (dest);
- }
- }
-
- cards = g_list_next (cards);
- }
-}
-
-/*
- *
- * ESelectNamesCompletion code
- *
- */
-
-
-GType
-e_select_names_completion_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesCompletionClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_completion_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesCompletion),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_completion_init,
- };
-
- type = g_type_register_static (e_completion_get_type (), "ESelectNamesCompletion", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_completion_class_init (ESelectNamesCompletionClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- ECompletionClass *completion_class = E_COMPLETION_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_completion_dispose;
-
- completion_class->request_completion = e_select_names_completion_handle_request;
- completion_class->end_completion = e_select_names_completion_end;
-
- if (getenv ("EVO_DEBUG_SELECT_NAMES_COMPLETION")) {
- out = fopen ("/tmp/evo-debug-select-names-completion", "w");
- if (out)
- setvbuf (out, NULL, _IONBF, 0);
- }
-}
-
-static void
-e_select_names_completion_init (ESelectNamesCompletion *comp)
-{
- comp->priv = g_new0 (struct _ESelectNamesCompletionPrivate, 1);
- comp->priv->match_contact_lists = TRUE;
-}
-
-static void
-e_select_names_completion_clear_book_data (ESelectNamesCompletion *comp)
-{
- GList *l;
-
- for (l = comp->priv->book_data; l; l = l->next) {
- ESelectNamesCompletionBookData *book_data = l->data;
-
- if (book_data->card_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->card_added_tag);
- book_data->card_added_tag = 0;
- }
-
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- g_object_unref (book_data->book);
-
- if (book_data->book_view) {
- e_book_view_stop (book_data->book_view);
- g_object_unref (book_data->book_view);
- }
-
- g_free (book_data->cached_query_text);
- g_list_foreach (book_data->cached_cards, (GFunc)g_object_unref, NULL);
- g_list_free (book_data->cached_cards);
-
- g_free (book_data);
- }
- g_list_free (comp->priv->book_data);
- comp->priv->book_data = NULL;
-}
-
-static void
-e_select_names_completion_dispose (GObject *object)
-{
- ESelectNamesCompletion *comp = E_SELECT_NAMES_COMPLETION (object);
-
- if (comp->priv) {
- if (comp->priv->text_model)
- g_object_unref (comp->priv->text_model);
-
- e_select_names_completion_clear_book_data (comp);
-
- g_free (comp->priv->waiting_query);
- g_free (comp->priv->query_text);
-
- g_free (comp->priv);
- comp->priv = NULL;
- }
-
- if (parent_class->dispose)
- parent_class->dispose (object);
-}
-
-
-/*
- *
- * EBook/EBookView Callbacks & Query Stuff
- *
- */
-
-static gchar *
-clean_query_text (const gchar *s)
-{
- gchar *q = g_new (gchar, strlen(s)+1), *t;
-
- t = q;
- while (*s) {
- if (*s != ',' && *s != '"') {
- *t = *s;
- ++t;
- }
- ++s;
- }
- *t = '\0';
-
- g_strstrip (q);
-
- return q;
-}
-
-static void
-e_select_names_completion_clear_cache (ESelectNamesCompletionBookData *book_data)
-{
- if (out)
- fprintf (out, "** clearing cache on book %s\n", e_book_get_uri (book_data->book));
-
- g_free (book_data->cached_query_text);
- g_list_foreach (book_data->cached_cards, (GFunc)g_object_unref, NULL);
- g_list_free (book_data->cached_cards);
-
- book_data->cached_query_text = NULL;
- book_data->cached_cards = NULL;
-}
-
-static void
-e_select_names_completion_done (ESelectNamesCompletion *comp)
-{
- g_free (comp->priv->query_text);
- comp->priv->query_text = NULL;
-
- e_completion_end_search (E_COMPLETION (comp)); /* That's all folks! */
-
- /* Need to launch a new completion if another one is pending. */
- if (comp->priv->waiting_query) {
- gchar *s = comp->priv->waiting_query;
- comp->priv->waiting_query = NULL;
- e_completion_begin_search (E_COMPLETION (comp), s, comp->priv->waiting_pos, comp->priv->waiting_limit);
- g_free (s);
- }
-}
-
-static void
-e_select_names_completion_got_book_view_cb (EBook *book, EBookStatus status, EBookView *view, gpointer user_data)
-{
- ESelectNamesCompletion *comp;
- ESelectNamesCompletionBookData *book_data;
-
- book_data = (ESelectNamesCompletionBookData*)user_data;
- comp = book_data->comp;
-
- if (status != E_BOOK_STATUS_SUCCESS) {
- comp->priv->pending_completion_seq--;
- if (!comp->priv->pending_completion_seq)
- e_select_names_completion_done (comp);
- return;
- }
-
- book_data->book_view_tag = 0;
-
- if (book_data->card_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->card_added_tag);
- book_data->card_added_tag = 0;
- }
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- g_object_ref (view);
- if (book_data->book_view) {
- e_book_view_stop (book_data->book_view);
- g_object_unref (book_data->book_view);
- }
- book_data->book_view = view;
-
- book_data->card_added_tag =
- g_signal_connect (view,
- "card_added",
- G_CALLBACK (e_select_names_completion_card_added_cb),
- book_data);
-
- book_data->seq_complete_tag =
- g_signal_connect (view,
- "sequence_complete",
- G_CALLBACK (e_select_names_completion_seq_complete_cb),
- book_data);
- book_data->sequence_complete_received = FALSE;
-}
-
-static void
-e_select_names_completion_card_added_cb (EBookView *book_view, const GList *cards, gpointer user_data)
-{
- ESelectNamesCompletionBookData *book_data = user_data;
- ESelectNamesCompletion *comp = book_data->comp;
-
- if (e_completion_searching (E_COMPLETION (comp))) {
- book_query_process_card_list (comp, cards);
-
- /* Save the list of matching cards. */
- while (cards) {
- book_data->cached_cards = g_list_prepend (book_data->cached_cards, cards->data);
- g_object_ref (cards->data);
- cards = g_list_next (cards);
- }
- }
-}
-
-static void
-e_select_names_completion_seq_complete_cb (EBookView *book_view, EBookViewStatus status, gpointer user_data)
-{
- ESelectNamesCompletionBookData *book_data = user_data;
- ESelectNamesCompletion *comp = book_data->comp;
-
- if (out)
- fprintf (out, "** got sequence_complete (status = %d) on book %s\n", status, e_book_get_uri (book_data->book));
-
- /*
- * We aren't searching, but the addressbook has changed -- clear our card cache so that
- * future completion requests will take the changes into account.
- */
- if (! e_completion_searching (E_COMPLETION (comp))) {
- if (out)
- fprintf (out, "\t we weren't searching, clearing the cache\n");
- e_select_names_completion_clear_cache (book_data);
- return;
- }
-
- if (book_data->cached_query_text
- && status == E_BOOK_STATUS_SUCCESS
- && !book_data->cache_complete
- && !strcmp (book_data->cached_query_text, comp->priv->query_text))
- book_data->cache_complete = TRUE;
-
- if (out)
- fprintf (out, "\tending search, book_data->cache_complete == %d\n", book_data->cache_complete);
-
- if (!book_data->sequence_complete_received) {
- book_data->sequence_complete_received = TRUE;
-
- if (book_data->card_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->card_added_tag);
- book_data->card_added_tag = 0;
- }
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- if (out)
- fprintf (out, "\t %d remaining book view's\n", comp->priv->pending_completion_seq - 1);
-
- comp->priv->pending_completion_seq --;
- if (comp->priv->pending_completion_seq > 0)
- return;
- }
-
- e_select_names_completion_done (comp);
-}
-
-static void
-e_select_names_completion_stop_query (ESelectNamesCompletion *comp)
-{
- GList *l;
-
- g_return_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp));
-
- if (out)
- fprintf (out, "stopping query\n");
-
- if (comp->priv->waiting_query) {
- if (out)
- fprintf (out, "stopped waiting query\n");
- g_free (comp->priv->waiting_query);
- comp->priv->waiting_query = NULL;
- }
-
- g_free (comp->priv->query_text);
- comp->priv->query_text = NULL;
-
- for (l = comp->priv->book_data; l; l = l->next) {
- ESelectNamesCompletionBookData *book_data = l->data;
- if (book_data->book_view_tag) {
- e_book_cancel (book_data->book, book_data->book_view_tag);
- book_data->book_view_tag = 0;
- }
- if (book_data->book_view) {
- if (book_data->card_added_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->card_added_tag);
- book_data->card_added_tag = 0;
- }
- if (book_data->seq_complete_tag) {
- g_signal_handler_disconnect (book_data->book_view, book_data->seq_complete_tag);
- book_data->seq_complete_tag = 0;
- }
-
- e_book_view_stop (book_data->book_view);
- g_object_unref (book_data->book_view);
- book_data->book_view = NULL;
- }
- }
-
- comp->priv->pending_completion_seq = 0;
-}
-
-static void
-e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar *query_text)
-{
- g_return_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp));
- g_return_if_fail (query_text);
-
- e_select_names_completion_stop_query (comp); /* Stop any prior queries. */
-
- if (comp->priv->books_not_ready == 0) {
- gchar *sexp;
-
- if (strlen (query_text) < comp->priv->minimum_query_length) {
- e_completion_end_search (E_COMPLETION (comp));
- return;
- }
-
- g_free (comp->priv->query_text);
- comp->priv->query_text = g_strdup (query_text);
-
- sexp = book_query_sexp (comp);
- if (sexp && *sexp) {
- GList *l;
-
- if (out)
- fprintf (out, "\n\n**** starting query: \"%s\"\n", comp->priv->query_text);
-
- for (l = comp->priv->book_data; l; l = l->next) {
- ESelectNamesCompletionBookData *book_data = l->data;
- gboolean can_reuse_cached_cards;
-
- if (out) {
- fprintf (out,
- "book == %s[\n"
- "\tbook_data->cached_query_text == `%s'\n"
- "\tbook_data->cache_complete == %d\n"
- "\tbook_data->cached_cards == %p\n",
- e_book_get_uri (book_data->book),
- book_data->cached_query_text,
- book_data->cache_complete,
- book_data->cached_cards);
- }
-
- /* for lack of a better place, we invalidate the cache here if we
- notice that the text is different. */
- if (book_data->cached_query_text
- && (strlen (book_data->cached_query_text) > strlen (query_text)
- || utf8_casefold_collate_len (book_data->cached_query_text, query_text,
- strlen (book_data->cached_query_text))))
- book_data->cache_complete = FALSE;
-
- can_reuse_cached_cards = (book_data->cached_query_text
- && book_data->cache_complete
- && book_data->cached_cards != NULL);
-
- if (can_reuse_cached_cards) {
-
- if (out)
- fprintf (out, "\t*** can reuse cached cards (%d cards cached)!\n", g_list_length (book_data->cached_cards));
-
- if (out)
- fprintf (out, "\tusing existing query info: %s (vs %s)\n", query_text, book_data->cached_query_text);
- book_query_process_card_list (comp, book_data->cached_cards);
- }
- else {
- e_select_names_completion_clear_cache (book_data);
- book_data->cached_query_text = g_strdup (query_text);
-
- book_data->book_view_tag = e_book_get_completion_view (book_data->book,
- sexp,
- e_select_names_completion_got_book_view_cb, book_data);
- if (! book_data->book_view_tag)
- g_warning ("Exception calling e_book_get_completion_view");
- else
- comp->priv->pending_completion_seq++;
- }
-
- if (out)
- fprintf (out, "]\n");
- }
-
- /* if we looped through all the books
- and were able to complete based
- solely on our cached cards, signal
- that the search is over. */
- if (!comp->priv->pending_completion_seq)
- e_select_names_completion_done (E_SELECT_NAMES_COMPLETION (comp));
- } else {
- g_free (comp->priv->query_text);
- comp->priv->query_text = NULL;
- }
- g_free (sexp);
-
- } else {
-
- comp->priv->waiting_query = g_strdup (query_text);
-
- }
-}
-
-static void
-e_select_names_completion_do_query (ESelectNamesCompletion *comp, const gchar *query_text, gint pos, gint limit)
-{
- gchar *clean;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
-
- clean = clean_query_text (query_text);
- if (! (clean && *clean)) {
- g_free (clean);
- e_completion_end_search (E_COMPLETION (comp));
- return;
- }
-
- if (out)
- fprintf (out, "do_query: %s => %s\n", query_text, clean);
-
- e_select_names_completion_start_query (comp, clean);
- g_free (clean);
-}
-
-
-/*
- *
- * Completion Search Override - a Framework for Christian-Resurrection-Holiday Edible-Chicken-Ova
- *
- */
-
-typedef struct _SearchOverride SearchOverride;
-struct _SearchOverride {
- const gchar *trigger;
- const gchar *text[4];
-};
-static SearchOverride override[] = {
- { "why?", { "\"I must create a system, or be enslaved by another man's.\"",
- " -- Wiliam Blake, \"Jerusalem\"",
- NULL } },
- { "easter-egg?", { "What were you expecting, a flight simulator?", NULL } },
- { NULL, { NULL } } };
-
-static gboolean
-search_override_check (SearchOverride *over, const gchar *text)
-{
- /* The g_utf8_validate is needed because as of 2001-06-11,
- * EText doesn't translate from locale->UTF8 when you paste
- * into it.
- */
- if (over == NULL || text == NULL || !g_utf8_validate (text, -1, NULL))
- return FALSE;
-
- return !utf8_casefold_collate (over->trigger, text);
-}
-
-
-/*
- *
- * Completion Callbacks
- *
- */
-
-static void
-e_select_names_completion_handle_request (ECompletion *comp, const gchar *text, gint pos, gint limit)
-{
- ESelectNamesCompletion *selcomp = E_SELECT_NAMES_COMPLETION (comp);
- const gchar *str;
- gint index, j;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
- g_return_if_fail (text != NULL);
-
- if (out) {
- fprintf (out, "\n\n**** requesting completion\n");
- fprintf (out, "text=\"%s\" pos=%d limit=%d\n", text, pos, limit);
- }
-
- e_select_names_model_text_pos (selcomp->priv->text_model->source,
- selcomp->priv->text_model->seplen,
- pos, &index, NULL, NULL);
- str = index >= 0 ? e_select_names_model_get_string (selcomp->priv->text_model->source, index) : NULL;
-
- if (out)
- fprintf (out, "index=%d str=\"%s\"\n", index, str);
-
- if (str == NULL || *str == '\0') {
- if (out)
- fprintf (out, "aborting empty query\n");
- e_completion_end_search (comp);
- return;
- }
-
- for (j=0; override[j].trigger; ++j) {
- if (search_override_check (&(override[j]), str)) {
- gint k;
-
- for (k=0; override[j].text[k]; ++k) {
- ECompletionMatch *match = g_new (ECompletionMatch, 1);
- e_completion_match_construct (match);
- e_completion_match_set_text (match, text, override[j].text[k]);
- match->score = 1 / (double) (k + 1);
- e_completion_found_match (comp, match);
- }
-
- e_completion_end_search (comp);
- return;
- }
- }
-
- e_select_names_completion_do_query (selcomp, str, pos, limit);
-}
-
-static void
-e_select_names_completion_end (ECompletion *comp)
-{
- g_return_if_fail (comp != NULL);
- g_return_if_fail (E_IS_COMPLETION (comp));
-
- if (out)
- fprintf (out, "completion ended\n");
-}
-
-/*
- *
- * Our Pseudo-Constructor
- *
- */
-
-ECompletion *
-e_select_names_completion_new (ESelectNamesTextModel *text_model)
-{
- ESelectNamesCompletion *comp;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_TEXT_MODEL (text_model), NULL);
-
- comp = g_object_new (E_TYPE_SELECT_NAMES_COMPLETION, NULL);
-
- comp->priv->text_model = text_model;
- g_object_ref (text_model);
-
- return E_COMPLETION (comp);
-}
-
-void
-e_select_names_completion_add_book (ESelectNamesCompletion *comp, EBook *book)
-{
- ESelectNamesCompletionBookData *book_data;
-
- g_return_if_fail (book != NULL);
-
- book_data = g_new0 (ESelectNamesCompletionBookData, 1);
- book_data->book = book;
- book_data->comp = comp;
- g_object_ref (book_data->book);
- comp->priv->book_data = g_list_append (comp->priv->book_data, book_data);
-
- /* XXX toshok - this doesn't work properly. need to rethink this next bit. */
- /* if the user is typing as we're adding books, restart the
- query after the new book has been added */
- if (comp->priv->query_text && *comp->priv->query_text) {
- char *query_text = g_strdup (comp->priv->query_text);
- e_select_names_completion_stop_query (comp);
- e_select_names_completion_start_query (comp, query_text);
- g_free (query_text);
- }
-}
-
-void
-e_select_names_completion_clear_books (ESelectNamesCompletion *comp)
-{
- e_select_names_completion_stop_query (comp);
- e_select_names_completion_clear_book_data (comp);
-}
-
-void
-e_select_names_completion_set_minimum_query_length (ESelectNamesCompletion *comp, int query_length)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
- comp->priv->minimum_query_length = query_length;
-}
-
-gboolean
-e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *comp)
-{
- g_return_val_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp), FALSE);
- return comp->priv->match_contact_lists;
-}
-
-
-void
-e_select_names_completion_set_match_contact_lists (ESelectNamesCompletion *comp, gboolean x)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
- comp->priv->match_contact_lists = x;
-}
-
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.h b/addressbook/gui/component/select-names/e-select-names-completion.h
deleted file mode 100644
index 6565208378..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-completion.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-completion.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef E_SELECT_NAMES_COMPLETION_H
-#define E_SELECT_NAMES_COMPLETION_H
-
-#include <gal/e-text/e-completion.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include "e-select-names-text-model.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_SELECT_NAMES_COMPLETION (e_select_names_completion_get_type ())
-#define E_SELECT_NAMES_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_SELECT_NAMES_COMPLETION, ESelectNamesCompletion))
-#define E_SELECT_NAMES_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), E_TYPE_SELECT_NAMES_COMPLETION, ESelectNamesCompletionClass))
-#define E_IS_SELECT_NAMES_COMPLETION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_SELECT_NAMES_COMPLETION))
-#define E_IS_SELECT_NAMES_COMPLETION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_SELECT_NAMES_COMPLETION))
-
-typedef struct _ESelectNamesCompletion ESelectNamesCompletion;
-typedef struct _ESelectNamesCompletionClass ESelectNamesCompletionClass;
-struct _ESelectNamesCompletionPrivate;
-
-struct _ESelectNamesCompletion {
- ECompletion parent;
-
- struct _ESelectNamesCompletionPrivate *priv;
-};
-
-struct _ESelectNamesCompletionClass {
- ECompletionClass parent_class;
-
-};
-
-GType e_select_names_completion_get_type (void);
-
-ECompletion *e_select_names_completion_new (ESelectNamesTextModel *);
-void e_select_names_completion_add_book (ESelectNamesCompletion *, EBook *);
-void e_select_names_completion_clear_books (ESelectNamesCompletion *);
-void e_select_names_completion_set_minimum_query_length (ESelectNamesCompletion *, int);
-gboolean e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *);
-void e_select_names_completion_set_match_contact_lists (ESelectNamesCompletion *, gboolean);
-
-G_END_DECLS
-
-#endif /* E_SELECT_NAMES_COMPLETION_H */
diff --git a/addressbook/gui/component/select-names/e-select-names-factory.c b/addressbook/gui/component/select-names/e-select-names-factory.c
deleted file mode 100644
index 2416e42750..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-factory.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-factory.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <bonobo/bonobo-generic-factory.h>
-
-#include "e-select-names-bonobo.h"
-#include "e-select-names-factory.h"
-
-
-#define COMPONENT_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_SelectNamesFactory"
-
-static BonoboGenericFactory *factory = NULL;
-
-
-static BonoboObject *
-factory_fn (BonoboGenericFactory *factory,
- const char *component_id,
- void *closure)
-{
- return BONOBO_OBJECT (e_select_names_bonobo_new ());
-}
-
-
-gboolean
-e_select_names_factory_init (void)
-{
- if (factory != NULL)
- return TRUE;
-
- factory = bonobo_generic_factory_new (COMPONENT_FACTORY_ID, factory_fn, NULL);
-
- if (factory == NULL)
- return FALSE;
-
- return TRUE;
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-factory.h b/addressbook/gui/component/select-names/e-select-names-factory.h
deleted file mode 100644
index 0fe85c8361..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-factory.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-select-names-factory.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ettore Perazzoli
- */
-
-#ifndef _E_SECELT_NAMES_FACTORY_H
-#define _E_SECELT_NAMES_FACTORY_H
-
-#include <glib.h>
-
-gboolean e_select_names_factory_init (void);
-
-#endif
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c
deleted file mode 100644
index a3875cea97..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-manager.c
+++ /dev/null
@@ -1,775 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com.
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gal/e-text/e-entry.h>
-
-#include <libgnome/gnome-i18n.h>
-#include "e-select-names-manager.h"
-#include "e-select-names-marshal.h"
-#include "e-select-names-model.h"
-#include "e-select-names-text-model.h"
-#include "e-select-names.h"
-#include "e-select-names-completion.h"
-#include "e-select-names-popup.h"
-#include "e-folder-list.h"
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/backend/ebook/e-destination.h>
-#include "addressbook/gui/component/addressbook.h"
-#include <bonobo/bonobo-object.h>
-
-#define DEFAULT_MINIMUM_QUERY_LENGTH 3
-
-enum {
- CHANGED,
- OK,
- CANCEL,
- LAST_SIGNAL
-};
-
-static guint e_select_names_manager_signals[LAST_SIGNAL] = { 0 };
-
-static GObjectClass *parent_class = NULL;
-
-typedef struct {
- char *id;
- char *title;
- ESelectNamesModel *model;
- ESelectNamesModel *original_model;
- ESelectNamesManager *manager;
- guint changed_tag;
-} ESelectNamesManagerSection;
-
-typedef struct {
- char *id;
- EEntry *entry;
- ESelectNamesManager *manager;
- ESelectNamesModel *model;
- ECompletion *comp;
- guint cleaning_tag;
-} ESelectNamesManagerEntry;
-
-static void e_select_names_manager_init (ESelectNamesManager *manager);
-static void e_select_names_manager_class_init (ESelectNamesManagerClass *klass);
-
-static void e_select_names_manager_dispose (GObject *object);
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-/* ESelectNamesManagerSection routines */
-
-static void
-section_model_changed_cb (ESelectNamesModel *model, gpointer closure)
-{
- ESelectNamesManagerSection *section = closure;
- g_signal_emit (section->manager,
- e_select_names_manager_signals[CHANGED], 0,
- section->id,
- FALSE);
-}
-
-static ESelectNamesManagerSection *
-e_select_names_manager_section_new (ESelectNamesManager *manager,
- const gchar *id,
- const gchar *title,
- ESelectNamesModel *model)
-{
- ESelectNamesManagerSection *section;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
-
- section = g_new0 (ESelectNamesManagerSection, 1);
-
- section->id = g_strdup (id);
- section->title = g_strdup (title);
-
- section->manager = manager;
-
- section->model = model;
- g_object_ref (section->model);
- section->changed_tag =
- g_signal_connect (section->model,
- "changed",
- G_CALLBACK (section_model_changed_cb),
- section);
-
- return section;
-}
-
-static void
-e_select_names_manager_section_free (ESelectNamesManagerSection *section)
-{
- if (section == NULL)
- return;
-
- g_free (section->id);
- g_free (section->title);
-
- if (section->model) {
- g_signal_handler_disconnect (section->model, section->changed_tag);
- g_object_unref (section->model);
- }
-
- if (section->original_model) {
- g_object_unref (section->original_model);
- }
-
- g_free (section);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-/* ESelectNamesManagerEntry routines */
-
-static ESelectNamesManagerEntry *
-get_entry_info (EEntry *entry)
-{
- g_return_val_if_fail (E_IS_ENTRY (entry), NULL);
- return (ESelectNamesManagerEntry *) g_object_get_data (G_OBJECT (entry), "entry_info");
-}
-
-static void
-populate_popup_cb (EEntry *eentry, GdkEventButton *ev, gint pos, GtkWidget *menu, gpointer user_data)
-{
- ESelectNamesTextModel *text_model;
-
- g_object_get (eentry,
- "model", &text_model,
- NULL);
- g_assert (E_IS_SELECT_NAMES_TEXT_MODEL (text_model));
-
- e_select_names_populate_popup (menu, text_model, ev, pos, GTK_WIDGET (eentry));
-}
-
-#if 0
-static gboolean
-clean_cb (gpointer ptr)
-{
- ESelectNamesManagerEntry *entry = ptr;
-
- e_select_names_model_clean (entry->model, TRUE);
- entry->cleaning_tag = 0;
- return FALSE;
-}
-#endif
-
-static gint
-focus_in_cb (GtkWidget *w, GdkEventFocus *ev, gpointer user_data)
-{
- ESelectNamesManagerEntry *entry = user_data;
-
- if (entry->cleaning_tag) {
- g_source_remove (entry->cleaning_tag);
- entry->cleaning_tag = 0;
- }
-
- e_select_names_model_cancel_cardify_all (entry->model);
-
- return FALSE;
-}
-
-static gint
-focus_out_cb (GtkWidget *w, GdkEventFocus *ev, gpointer user_data)
-{
-#if 0
- /* XXX fix me */
- ESelectNamesManagerEntry *entry = user_data;
- gboolean visible = e_entry_completion_popup_is_visible (entry->entry);
-
- if (! visible) {
- e_select_names_model_cardify_all (entry->model, entry->manager->completion_book, 100);
- if (entry->cleaning_tag == 0)
- entry->cleaning_tag = gtk_timeout_add (100, clean_cb, entry);
- }
-#endif
- return FALSE;
-}
-
-static void
-completion_popup_cb (EEntry *w, gint visible, gpointer user_data)
-{
-#if 0
- /* XXX fix me */
- ESelectNamesManagerEntry *entry = user_data;
-
- if (!visible && !GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry->entry->canvas)))
- e_select_names_model_cardify_all (entry->model, entry->manager->completion_book, 0);
-#endif
-}
-
-static void
-completion_handler (EEntry *entry, ECompletionMatch *match)
-{
- ESelectNamesManagerEntry *mgr_entry;
- ESelectNamesTextModel *text_model;
- EDestination *dest;
- gint i, pos, start_pos, len;
-
- if (match == NULL || match->user_data == NULL)
- return;
-
- mgr_entry = get_entry_info (entry);
- dest = E_DESTINATION (match->user_data);
-
- /* Sometimes I really long for garbage collection. Reference
- counting makes you feel 31337, but sometimes it is just a
- bitch. */
- g_object_ref (dest);
-
- g_object_get (entry,
- "model", &text_model,
- NULL);
- g_assert (E_IS_SELECT_NAMES_TEXT_MODEL (text_model));
-
- pos = e_entry_get_position (entry);
- e_select_names_model_text_pos (mgr_entry->model, text_model->seplen, pos, &i, NULL, NULL);
- e_select_names_model_replace (mgr_entry->model, i, dest);
- e_select_names_model_name_pos (mgr_entry->model, text_model->seplen, i, &start_pos, &len);
- e_entry_set_position (entry, start_pos+len);
-}
-
-static ESelectNamesManagerEntry *
-e_select_names_manager_entry_new (ESelectNamesManager *manager, ESelectNamesModel *model, const gchar *id)
-{
- ESelectNamesManagerEntry *entry;
- ETextModel *text_model;
- GList *l;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
-
- entry = g_new0 (ESelectNamesManagerEntry, 1);
-
- entry->id = g_strdup (id);
-
- entry->entry = E_ENTRY (e_entry_new ());
- text_model = e_select_names_text_model_new (model);
- g_object_set(entry->entry,
- "model", text_model, /* The entry takes ownership of the text model */
- "editable", TRUE,
- "use_ellipsis", TRUE,
- "allow_newlines", FALSE,
- NULL);
-
- g_object_ref (entry->entry);
-
- entry->comp = e_select_names_completion_new (E_SELECT_NAMES_TEXT_MODEL (text_model));
-
- for (l = manager->completion_books; l; l = l->next) {
- EBook *book = l->data;
- e_select_names_completion_add_book (E_SELECT_NAMES_COMPLETION(entry->comp), book);
- }
-
- e_select_names_completion_set_minimum_query_length (E_SELECT_NAMES_COMPLETION(entry->comp),
- manager->minimum_query_length);
-
- e_entry_enable_completion_full (entry->entry, entry->comp, 100, completion_handler);
-
- entry->manager = manager;
-
- entry->model = model;
- g_object_ref (model);
-
- g_signal_connect (entry->entry,
- "populate_popup",
- G_CALLBACK (populate_popup_cb),
- entry);
-
- g_signal_connect (entry->entry->canvas,
- "focus_in_event",
- G_CALLBACK (focus_in_cb),
- entry);
-
- g_signal_connect (entry->entry->canvas,
- "focus_out_event",
- G_CALLBACK (focus_out_cb),
- entry);
-
- g_signal_connect (entry->entry,
- "completion_popup",
- G_CALLBACK (completion_popup_cb),
- entry);
-
- g_object_set_data (G_OBJECT (entry->entry), "entry_info", entry);
- g_object_set_data (G_OBJECT (entry->entry), "select_names_model", model);
- g_object_set_data (G_OBJECT (entry->entry), "select_names_text_model", text_model);
- g_object_set_data (G_OBJECT (entry->entry), "completion_handler", entry->comp);
-
- return entry;
-}
-
-static void
-e_select_names_manager_entry_free (ESelectNamesManagerEntry *entry)
-{
- if (entry == NULL)
- return;
-
- g_free (entry->id);
- g_object_unref (entry->model);
- g_object_unref (entry->entry);
-
- if (entry->cleaning_tag)
- g_source_remove (entry->cleaning_tag);
-
- g_free (entry);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-static void
-e_select_names_manager_save_models (ESelectNamesManager *manager)
-{
- GList *iter;
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
-
- if (section->original_model == NULL && section->model != NULL)
- section->original_model = e_select_names_model_duplicate (section->model);
-
- }
-}
-
-static void
-e_select_names_manager_revert_to_saved_models (ESelectNamesManager *manager)
-{
- GList *iter;
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (section->model && section->original_model) {
- e_select_names_model_overwrite_copy (section->model, section->original_model);
- g_object_unref (section->original_model);
- section->original_model = NULL;
- }
- }
-}
-
-static void
-e_select_names_manager_discard_saved_models (ESelectNamesManager *manager)
-{
- GList *iter;
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (section->original_model) {
- g_object_unref (section->original_model);
- section->original_model = NULL;
- }
- }
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-
-static void
-open_book_cb (EBook *book, EBookStatus status, ESelectNamesManager *manager)
-{
- if (status == E_BOOK_STATUS_SUCCESS) {
- GList *l;
- for (l = manager->entries; l; l = l->next) {
- ESelectNamesManagerEntry *entry = l->data;
- e_select_names_completion_add_book (E_SELECT_NAMES_COMPLETION(entry->comp), book);
- }
-
- manager->completion_books = g_list_append (manager->completion_books, book);
- g_object_ref (book);
- }
-
- g_object_unref (manager); /* unref ourself (matches ref before the load_uri call below) */
-}
-
-static void
-load_completion_books (ESelectNamesManager *manager)
-{
- EFolderListItem *folders = e_folder_list_parse_xml (manager->cached_folder_list);
- EFolderListItem *f;
-
- for (f = folders; f && f->physical_uri; f++) {
- char *uri;
- EBook *book = e_book_new ();
- g_object_ref (manager); /* ref ourself before our async call */
-
- uri = e_book_expand_uri (f->physical_uri);
-
- addressbook_load_uri (book, uri, (EBookCallback)open_book_cb, manager);
-
- g_free (uri);
- }
- e_folder_list_free_items (folders);
-}
-
-static void
-read_completion_settings_from_db (ESelectNamesManager *manager, EConfigListener *db)
-{
- char *val;
- long ival;
-
- val = e_config_listener_get_string (db, "/apps/evolution/addressbook/completion/uris");
-
- if (val) {
- g_free (manager->cached_folder_list);
- manager->cached_folder_list = val;
- load_completion_books(manager);
- }
-
- ival = e_config_listener_get_long (db, "/apps/evolution/addressbook/completion/minimum_query_length");
- if (ival <= 0) ival = DEFAULT_MINIMUM_QUERY_LENGTH;
-
- manager->minimum_query_length = ival;
-}
-
-static void
-db_listener (EConfigListener *db, const char *key,
- ESelectNamesManager *manager)
-{
- GList *l;
-
- if (!strcmp (key, "/apps/evolution/addressbook/completion/uris")) {
- char *val = e_config_listener_get_string (db, key);
-
- if (!val)
- return;
-
- if (!manager->cached_folder_list || strcmp (val, manager->cached_folder_list)) {
- for (l = manager->entries; l; l = l->next) {
- ESelectNamesManagerEntry *entry = l->data;
- e_select_names_completion_clear_books (E_SELECT_NAMES_COMPLETION (entry->comp));
- }
-
- g_list_foreach (manager->completion_books, (GFunc)g_object_unref, NULL);
- g_list_free (manager->completion_books);
- manager->completion_books = NULL;
-
- g_free (manager->cached_folder_list);
- manager->cached_folder_list = val;
- load_completion_books (manager);
- }
- }
- else if (!strcmp (key, "/apps/evolution/addressbook/completion/minimum_query_length")) {
- long ival = e_config_listener_get_long (db, key);
-
- if (ival <= 0)
- ival = DEFAULT_MINIMUM_QUERY_LENGTH;
-
- manager->minimum_query_length = ival;
-
- for (l = manager->entries; l; l = l->next) {
- ESelectNamesManagerEntry *entry = l->data;
- e_select_names_completion_set_minimum_query_length (E_SELECT_NAMES_COMPLETION(entry->comp),
- manager->minimum_query_length);
- }
- }
-}
-
-/**
- * e_select_names_manager_new:
- *
- * Returns: a new #ESelectNamesManager
- */
-ESelectNamesManager *
-e_select_names_manager_new (void)
-{
- ESelectNamesManager *manager = g_object_new (E_TYPE_SELECT_NAMES_MANAGER, NULL);
- EConfigListener *db;
-
- db = e_book_get_config_database();
-
- manager->listener_id = g_signal_connect (db,
- "key_changed",
- G_CALLBACK (db_listener), manager);
-
- read_completion_settings_from_db (manager, db);
-
- return manager;
-}
-
-
-/*
- * ESelectNamesManager lifecycle management and vcard loading/saving.
- */
-
-
-void
-e_select_names_manager_add_section (ESelectNamesManager *manager,
- const char *id,
- const char *title)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MANAGER (manager));
- g_return_if_fail (id != NULL);
- g_return_if_fail (title != NULL);
-
- e_select_names_manager_add_section_with_limit (manager, id, title, -1);
-}
-
-void
-e_select_names_manager_add_section_with_limit (ESelectNamesManager *manager,
- const char *id,
- const char *title,
- gint limit)
-{
- ESelectNamesManagerSection *section;
- ESelectNamesModel *model;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MANAGER (manager));
- g_return_if_fail (id != NULL);
- g_return_if_fail (title != NULL);
-
- model = e_select_names_model_new ();
- e_select_names_model_set_limit (model, limit);
-
- section = e_select_names_manager_section_new (manager, id, title, model);
-
- manager->sections = g_list_append (manager->sections, section);
-
- g_object_unref (model);
-}
-
-ESelectNamesModel *
-e_select_names_manager_get_source (ESelectNamesManager *manager,
- const char *id)
-{
- GList *iter;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (id != NULL, NULL);
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (!strcmp (section->id, id))
- return section->model;
- }
- return NULL;
-}
-
-GtkWidget *
-e_select_names_manager_create_entry (ESelectNamesManager *manager, const char *id)
-{
- GList *iter;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MANAGER (manager), NULL);
- g_return_val_if_fail (id != NULL, NULL);
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- if (!strcmp(section->id, id)) {
- ESelectNamesManagerEntry *entry;
-
- entry = e_select_names_manager_entry_new (manager, section->model, section->id);
- manager->entries = g_list_append (manager->entries, entry);
-
- return GTK_WIDGET(entry->entry);
- }
- }
-
- return NULL;
-}
-
-static void
-e_select_names_response(ESelectNames *dialog, gint response_id, ESelectNamesManager *manager)
-{
- gtk_widget_destroy (GTK_WIDGET (dialog));
-
- switch(response_id) {
- case GTK_RESPONSE_OK:
- e_select_names_manager_discard_saved_models (manager);
- g_signal_emit (manager, e_select_names_manager_signals[OK], 0);
- break;
-
- case GTK_RESPONSE_CANCEL:
- e_select_names_manager_revert_to_saved_models (manager);
- g_signal_emit (manager, e_select_names_manager_signals[CANCEL], 0);
- break;
- }
-}
-
-static void
-clear_widget (gpointer data, GObject *where_object_was)
-{
- GtkWidget **widget_ref = data;
- *widget_ref = NULL;
-}
-
-void
-e_select_names_manager_activate_dialog (ESelectNamesManager *manager,
- EvolutionShellClient *shell_client,
- const char *id)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MANAGER (manager));
- g_return_if_fail (id != NULL);
-
- if (manager->names) {
-
- g_assert (GTK_WIDGET_REALIZED (GTK_WIDGET (manager->names)));
- e_select_names_set_default (manager->names, id);
- gdk_window_show (GTK_WIDGET (manager->names)->window);
- gdk_window_raise (GTK_WIDGET (manager->names)->window);
-
- } else {
-
- GList *iter;
-
- manager->names = E_SELECT_NAMES (e_select_names_new (shell_client));
-
- for (iter = manager->sections; iter != NULL; iter = g_list_next (iter)) {
- ESelectNamesManagerSection *section = iter->data;
- e_select_names_add_section (manager->names, section->id, section->title, section->model);
- }
-
- e_select_names_set_default (manager->names, id);
-
- g_signal_connect(manager->names,
- "response",
- G_CALLBACK(e_select_names_response),
- manager);
-
- g_object_weak_ref (G_OBJECT (manager->names), clear_widget, &manager->names);
-
- gtk_widget_show(GTK_WIDGET(manager->names));
- }
-
- e_select_names_manager_save_models (manager);
-}
-
-/* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** */
-
-static void
-e_select_names_manager_init (ESelectNamesManager *manager)
-{
- manager->sections = NULL;
- manager->entries = NULL;
- manager->completion_books = NULL;
- manager->cached_folder_list = NULL;
-}
-
-static void
-e_select_names_manager_dispose (GObject *object)
-{
- ESelectNamesManager *manager;
-
- manager = E_SELECT_NAMES_MANAGER (object);
-
- if (manager->names) {
- gtk_widget_destroy (GTK_WIDGET (manager->names));
- manager->names = NULL;
- }
-
- if (manager->sections) {
- g_list_foreach (manager->sections, (GFunc) e_select_names_manager_section_free, NULL);
- g_list_free (manager->sections);
- manager->sections = NULL;
- }
-
- if (manager->entries) {
- g_list_foreach (manager->entries, (GFunc) e_select_names_manager_entry_free, NULL);
- g_list_free (manager->entries);
- manager->entries = NULL;
- }
-
- if (manager->completion_books) {
- g_list_foreach (manager->completion_books, (GFunc) g_object_unref, NULL);
- g_list_free (manager->completion_books);
- manager->completion_books = NULL;
- }
-
- if (manager->listener_id) {
- g_signal_handler_disconnect (e_book_get_config_database(), manager->listener_id);
- manager->listener_id = 0;
- }
-
- if (manager->cached_folder_list) {
- g_free (manager->cached_folder_list);
- manager->cached_folder_list = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-static void
-e_select_names_manager_class_init (ESelectNamesManagerClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_manager_dispose;
-
- e_select_names_manager_signals[CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesManagerClass, changed),
- NULL, NULL,
- e_select_names_marshal_NONE__POINTER_INT,
- G_TYPE_NONE, 2,
- G_TYPE_POINTER,
- G_TYPE_INT);
-
- e_select_names_manager_signals[OK] =
- g_signal_new ("ok",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesManagerClass, ok),
- NULL, NULL,
- e_select_names_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_select_names_manager_signals[CANCEL] =
- g_signal_new ("cancel",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesManagerClass, cancel),
- NULL, NULL,
- e_select_names_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-/**
- * e_select_names_manager_get_type:
- * @void:
- *
- * Registers the &ESelectNamesManager class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ESelectNamesManager class.
- **/
-GType
-e_select_names_manager_get_type (void)
-{
- static GType manager_type = 0;
-
- if (!manager_type) {
- static const GTypeInfo manager_info = {
- sizeof (ESelectNamesManagerClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_manager_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesManager),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_manager_init,
- };
-
- manager_type = g_type_register_static (G_TYPE_OBJECT, "ESelectNamesManager", &manager_info, 0);
- }
-
- return manager_type;
-}
-
-
-
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.h b/addressbook/gui/component/select-names/e-select-names-manager.h
deleted file mode 100644
index b48f597cb3..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-manager.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_MANAGER_H__
-#define __E_SELECT_NAMES_MANAGER_H__
-
-#include <stdio.h>
-#include <time.h>
-#include <gtk/gtkobject.h>
-#include <e-util/e-list.h>
-#include "e-select-names.h"
-
-#define E_TYPE_SELECT_NAMES_MANAGER (e_select_names_manager_get_type ())
-#define E_SELECT_NAMES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManager))
-#define E_SELECT_NAMES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MANAGER, ESelectNamesManagerClass))
-#define E_IS_SELECT_NAMES_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_MANAGER))
-#define E_IS_SELECT_NAMES_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MANAGER))
-
-typedef struct _ESelectNamesManager ESelectNamesManager;
-typedef struct _ESelectNamesManagerClass ESelectNamesManagerClass;
-
-struct _ESelectNamesManager {
- GObject object;
-
- GList *sections;
- GList *entries;
-
- ESelectNames *names;
-
- GList *completion_books;
-
- int minimum_query_length;
-
- gulong listener_id;
-
- char *cached_folder_list;
-};
-
-struct _ESelectNamesManagerClass {
- GObjectClass parent_class;
-
- void (*changed) (ESelectNamesManager *, const gchar *section_id, gint changed_working_copy);
- void (*ok) (ESelectNamesManager *);
- void (*cancel) (ESelectNamesManager *);
-};
-
-ESelectNamesManager *e_select_names_manager_new (void);
-void e_select_names_manager_add_section (ESelectNamesManager *manager,
- const char *id,
- const char *title);
-void e_select_names_manager_add_section_with_limit (ESelectNamesManager *manager,
- const char *id,
- const char *title,
- gint limit);
-ESelectNamesModel *e_select_names_manager_get_source (ESelectNamesManager *manager,
- const char *id);
-GtkWidget *e_select_names_manager_create_entry (ESelectNamesManager *manager,
- const char *id);
-void e_select_names_manager_activate_dialog (ESelectNamesManager *manager,
- EvolutionShellClient *shell_client,
- const char *id);
-/* Standard Gtk function */
-GType e_select_names_manager_get_type (void);
-
-#endif /* ! __E_SELECT_NAMES_MANAGER_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-marshal.list b/addressbook/gui/component/select-names/e-select-names-marshal.list
deleted file mode 100644
index 8e751dc27d..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-marshal.list
+++ /dev/null
@@ -1,3 +0,0 @@
-NONE:POINTER,INT
-NONE:NONE
-NONE:INT,INT,INT
diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c
deleted file mode 100644
index 6c3cb0f9c6..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-model.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbidge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <gtk/gtkmarshal.h>
-#include <gtk/gtksignal.h>
-
-#include <gal/util/e-util.h>
-
-#include "e-select-names-model.h"
-#include "e-select-names-marshal.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#define MAX_LENGTH 2047
-
-
-enum {
- E_SELECT_NAMES_MODEL_CHANGED,
- E_SELECT_NAMES_MODEL_RESIZED,
- E_SELECT_NAMES_MODEL_LAST_SIGNAL
-};
-
-static guint e_select_names_model_signals[E_SELECT_NAMES_MODEL_LAST_SIGNAL] = { 0 };
-
-/* Object argument IDs */
-enum {
- ARG_0,
- ARG_CARD,
-};
-
-struct _ESelectNamesModelPrivate {
- gchar *id;
- gchar *title;
-
- GList *data; /* of EDestination */
-
- gint limit;
-
- gint freeze_count;
- gboolean pending_changed;
-};
-
-static GObjectClass *parent_class = NULL;
-
-static void e_select_names_model_init (ESelectNamesModel *model);
-static void e_select_names_model_class_init (ESelectNamesModelClass *klass);
-
-static void e_select_names_model_dispose (GObject *object);
-
-GType
-e_select_names_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_model_init,
- };
-
- type = g_type_register_static (G_TYPE_OBJECT, "ESelectNamesModel", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_model_class_init (ESelectNamesModelClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS(klass);
- parent_class = g_type_class_peek_parent (klass);
-
- e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesModelClass, changed),
- NULL, NULL,
- e_select_names_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_select_names_model_signals[E_SELECT_NAMES_MODEL_RESIZED] =
- g_signal_new ("resized",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ESelectNamesModelClass, resized),
- NULL, NULL,
- e_select_names_marshal_NONE__INT_INT_INT,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_INT);
-
- klass->changed = NULL;
-
- object_class->dispose = e_select_names_model_dispose;
-}
-
-/**
- * e_select_names_model_init:
- */
-static void
-e_select_names_model_init (ESelectNamesModel *model)
-{
- model->priv = g_new0 (struct _ESelectNamesModelPrivate, 1);
-
- model->priv->limit = -1;
-}
-
-static void
-e_select_names_model_dispose (GObject *object)
-{
- ESelectNamesModel *model = E_SELECT_NAMES_MODEL (object);
-
- if (model->priv) {
- g_free (model->priv->title);
- g_free (model->priv->id);
-
- g_list_foreach (model->priv->data, (GFunc) g_object_unref, NULL);
- g_list_free (model->priv->data);
-
- g_free (model->priv);
- model->priv = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-
-static void
-e_select_names_model_changed (ESelectNamesModel *model)
-{
- if (model->priv->freeze_count > 0) {
- model->priv->pending_changed = TRUE;
- } else {
- g_signal_emit (model, e_select_names_model_signals[E_SELECT_NAMES_MODEL_CHANGED], 0);
- model->priv->pending_changed = FALSE;
- }
-}
-
-static void
-destination_changed_proxy (EDestination *dest, gpointer closure)
-{
- e_select_names_model_changed (E_SELECT_NAMES_MODEL (closure));
-}
-
-/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
-
-ESelectNamesModel *
-e_select_names_model_new (void)
-{
- ESelectNamesModel *model;
- model = g_object_new (E_TYPE_SELECT_NAMES_MODEL, NULL);
- return model;
-}
-
-ESelectNamesModel *
-e_select_names_model_duplicate (ESelectNamesModel *old)
-{
- ESelectNamesModel *model = e_select_names_model_new ();
- GList *iter;
-
- model->priv->id = g_strdup (old->priv->id);
- model->priv->title = g_strdup (old->priv->title);
-
- for (iter = old->priv->data; iter != NULL; iter = g_list_next (iter)) {
- EDestination *dup = e_destination_copy (E_DESTINATION (iter->data));
- e_select_names_model_append (model, dup);
- }
-
- model->priv->limit = old->priv->limit;
-
- return model;
-}
-
-gchar *
-e_select_names_model_get_textification (ESelectNamesModel *model, const char *separator)
-{
- gchar *text;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (separator && *separator, NULL);
-
- if (model->priv->data == NULL) {
-
- text = g_strdup ("");
-
- } else {
- gchar **strv = g_new0 (gchar *, g_list_length (model->priv->data)+1);
- gint i = 0;
- GList *iter = model->priv->data;
-
- while (iter) {
- EDestination *dest = E_DESTINATION (iter->data);
- strv[i] = (gchar *) e_destination_get_textrep (dest, FALSE);
- ++i;
- iter = g_list_next (iter);
- }
-
- text = g_strjoinv (separator, strv);
-
- if (g_utf8_strlen(text, -1) > MAX_LENGTH) {
- char *p = g_utf8_offset_to_pointer (text, MAX_LENGTH);
- *p = '\0';
- text = g_realloc (text, p - text + 1);
- }
-
- g_free (strv);
-
- }
-
- return text;
-}
-
-gchar *
-e_select_names_model_get_address_text (ESelectNamesModel *model, const char *separator)
-{
- gchar *addr_text;
-
- g_return_val_if_fail (model != NULL, NULL);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (separator && *separator, NULL);
-
- if (model->priv->data == NULL) {
-
- addr_text = g_strdup ("");
-
- } else {
- gchar **strv = g_new0 (gchar *, g_list_length (model->priv->data)+1);
- gint i = 0;
- GList *iter = model->priv->data;
-
- while (iter) {
- EDestination *dest = E_DESTINATION (iter->data);
- strv[i] = (gchar *) e_destination_get_address (dest);
- if (strv[i])
- ++i;
- iter = g_list_next (iter);
- }
-
- addr_text = g_strjoinv (separator, strv);
-
- g_free (strv);
-
- }
-
- return addr_text;
-}
-
-gint
-e_select_names_model_count (ESelectNamesModel *model)
-{
- g_return_val_if_fail (model != NULL, 0);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), 0);
-
- return g_list_length (model->priv->data);
-}
-
-gint
-e_select_names_model_get_limit (ESelectNamesModel *model)
-{
- g_return_val_if_fail (model != NULL, 0);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), 0);
-
- return model->priv->limit;
-}
-
-void
-e_select_names_model_set_limit (ESelectNamesModel *model, gint limit)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
-
- model->priv->limit = MAX (limit, -1);
-}
-
-gboolean
-e_select_names_model_at_limit (ESelectNamesModel *model)
-{
- g_return_val_if_fail (model != NULL, TRUE);
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), TRUE);
-
- return model->priv->limit >= 0 && g_list_length (model->priv->data) >= model->priv->limit;
-}
-
-const EDestination *
-e_select_names_model_get_destination (ESelectNamesModel *model, gint index)
-{
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (0 <= index, NULL);
- g_return_val_if_fail (index < g_list_length (model->priv->data), NULL);
-
- return E_DESTINATION (g_list_nth_data (model->priv->data, index));
-}
-
-gchar *
-e_select_names_model_export_destinationv (ESelectNamesModel *model)
-{
- EDestination **destv;
- gchar *str;
- gint i, len = 0;
- GList *j;
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
-
- len = g_list_length (model->priv->data);
- destv = g_new0 (EDestination *, len+1);
-
- for (i=0, j = model->priv->data; j != NULL; j = g_list_next (j)) {
- EDestination *dest = E_DESTINATION (j->data);
-
- if (dest)
- destv[i++] = dest;
- }
-
- str = e_destination_exportv (destv);
- g_free (destv);
-
- return str;
-}
-
-static
-void send_changed (EDestination *dest, ECard *card, gpointer closure)
-{
- ESelectNamesModel *model = closure;
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_import_destinationv (ESelectNamesModel *model,
- gchar *destinationv)
-{
- EDestination **destv;
- gint i;
-
- g_return_if_fail (model && E_IS_SELECT_NAMES_MODEL (model));
-
- destv = e_destination_importv (destinationv);
-
- e_select_names_model_delete_all (model);
-
- if (destv == NULL)
- return;
-
- for (i = 0; destv[i]; i++) {
- e_destination_use_card (destv[i], send_changed, model);
- e_select_names_model_append (model, destv[i]);
- }
- g_free (destv);
-}
-
-ECard *
-e_select_names_model_get_card (ESelectNamesModel *model, gint index)
-{
- const EDestination *dest;
-
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (0 <= index, NULL);
- g_return_val_if_fail (index < g_list_length (model->priv->data), NULL);
-
- dest = e_select_names_model_get_destination (model, index);
- return dest ? e_destination_get_card (dest) : NULL;
-
-}
-
-const gchar *
-e_select_names_model_get_string (ESelectNamesModel *model, gint index)
-{
- const EDestination *dest;
-
- g_return_val_if_fail (model && E_IS_SELECT_NAMES_MODEL (model), NULL);
- g_return_val_if_fail (0 <= index, NULL);
- g_return_val_if_fail (index < g_list_length (model->priv->data), NULL);
-
- dest = e_select_names_model_get_destination (model, index);
-
- return dest ? e_destination_get_textrep (dest, FALSE) : "";
-}
-
-static void
-connect_destination (ESelectNamesModel *model, EDestination *dest)
-{
- g_signal_connect (dest,
- "changed",
- G_CALLBACK (destination_changed_proxy),
- model);
-}
-
-static void
-disconnect_destination (ESelectNamesModel *model, EDestination *dest)
-{
- g_signal_handlers_disconnect_by_func (dest, destination_changed_proxy, model);
-}
-
-gboolean
-e_select_names_model_contains (ESelectNamesModel *model, const EDestination *dest)
-{
- GList *iter;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), FALSE);
- g_return_val_if_fail (E_IS_DESTINATION (dest), FALSE);
-
- for (iter = model->priv->data; iter != NULL; iter = g_list_next (iter)) {
- if (iter->data != NULL && e_destination_equal (dest, E_DESTINATION (iter->data)))
- return TRUE;
- }
-
- return FALSE;
-}
-
-void
-e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination *dest)
-{
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (0 <= index && index <= g_list_length (model->priv->data));
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- if (e_select_names_model_at_limit (model)) {
- /* FIXME: This is bad. */
- g_object_unref (dest);
- return;
- }
-
- connect_destination (model, dest);
-
- model->priv->data = g_list_insert (model->priv->data, dest, index);
-
- g_object_ref (dest);
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_append (ESelectNamesModel *model, EDestination *dest)
-{
- g_return_if_fail (model && E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- if (e_select_names_model_at_limit (model)) {
- /* FIXME: This is bad. */
- g_object_unref (dest);
- return;
- }
-
- connect_destination (model, dest);
-
- model->priv->data = g_list_append (model->priv->data, dest);
-
- g_object_ref (dest);
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination *dest)
-{
- GList *node;
- const gchar *new_str, *old_str;
- gint old_strlen=0, new_strlen=0;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (model->priv->data == NULL || (0 <= index && index < g_list_length (model->priv->data)));
- g_return_if_fail (dest && E_IS_DESTINATION (dest));
-
- new_str = e_destination_get_textrep (dest, FALSE);
- new_strlen = new_str ? strlen (new_str) : 0;
-
- if (model->priv->data == NULL) {
-
- connect_destination (model, dest);
-
- model->priv->data = g_list_append (model->priv->data, dest);
- g_object_ref (dest);
-
- } else {
-
- node = g_list_nth (model->priv->data, index);
-
- if (node->data != dest) {
-
- disconnect_destination (model, E_DESTINATION (node->data));
- connect_destination (model, dest);
-
- old_str = e_destination_get_textrep (E_DESTINATION (node->data), FALSE);
- old_strlen = old_str ? strlen (old_str) : 0;
-
- g_object_unref (node->data);
-
- node->data = dest;
- g_object_ref (dest);
- }
- }
-
- e_select_names_model_changed (model);
-
- g_signal_emit (model, e_select_names_model_signals[E_SELECT_NAMES_MODEL_RESIZED], 0,
- index, old_strlen, new_strlen);
-}
-
-void
-e_select_names_model_delete (ESelectNamesModel *model, gint index)
-{
- GList *node;
- EDestination *dest;
-
- g_return_if_fail (model != NULL);
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (0 <= index && index < g_list_length (model->priv->data));
-
- node = g_list_nth (model->priv->data, index);
- dest = E_DESTINATION (node->data);
-
- disconnect_destination (model, dest);
- g_object_unref (dest);
-
- model->priv->data = g_list_remove_link (model->priv->data, node);
- g_list_free_1 (node);
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_clean (ESelectNamesModel *model, gboolean clean_last_entry)
-{
- GList *iter, *next;
- gboolean changed = FALSE;
-
- g_return_if_fail (model != NULL && E_IS_SELECT_NAMES_MODEL (model));
-
- iter = model->priv->data;
-
- while (iter) {
- EDestination *dest;
-
- next = g_list_next (iter);
-
- if (next == NULL && !clean_last_entry)
- break;
-
- dest = iter->data ? E_DESTINATION (iter->data) : NULL;
-
- if (dest == NULL || e_destination_is_empty (dest)) {
- if (dest) {
- disconnect_destination (model, dest);
- g_object_unref (dest);
- }
- model->priv->data = g_list_remove_link (model->priv->data, iter);
- g_list_free_1 (iter);
- changed = TRUE;
- }
-
- iter = next;
- }
-
- if (changed)
- e_select_names_model_changed (model);
-}
-
-static void
-delete_all_iter (gpointer data, gpointer closure)
-{
- disconnect_destination (E_SELECT_NAMES_MODEL (closure), E_DESTINATION (data));
- g_object_unref (data);
-}
-
-void
-e_select_names_model_delete_all (ESelectNamesModel *model)
-{
- g_return_if_fail (model != NULL && E_IS_SELECT_NAMES_MODEL (model));
-
- g_list_foreach (model->priv->data, delete_all_iter, model);
- g_list_free (model->priv->data);
- model->priv->data = NULL;
-
- e_select_names_model_changed (model);
-}
-
-void
-e_select_names_model_overwrite_copy (ESelectNamesModel *dest, ESelectNamesModel *src)
-{
- gint i, len;
-
- g_return_if_fail (dest && E_IS_SELECT_NAMES_MODEL (dest));
- g_return_if_fail (src && E_IS_SELECT_NAMES_MODEL (src));
-
- if (src == dest)
- return;
-
- e_select_names_model_delete_all (dest);
- len = e_select_names_model_count (src);
- for (i = 0; i < len; ++i) {
- const EDestination *d = e_select_names_model_get_destination (src, i);
- if (d)
- e_select_names_model_append (dest, e_destination_copy (d));
- }
-}
-
-void
-e_select_names_model_merge (ESelectNamesModel *dest, ESelectNamesModel *src)
-{
- gint i, len;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (dest));
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (src));
-
- if (src == dest)
- return;
-
- len = e_select_names_model_count (src);
- for (i = 0; i < len; ++i) {
- const EDestination *d = e_select_names_model_get_destination (src, i);
- if (d && !e_select_names_model_contains (dest, d))
- e_select_names_model_append (dest, e_destination_copy (d));
- }
-}
-
-void
-e_select_names_model_name_pos (ESelectNamesModel *model, gint seplen, gint index, gint *pos, gint *length)
-{
- gint rp = 0, i, len = 0;
- GList *iter;
- const gchar *str;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (seplen > 0);
-
- i = 0;
- iter = model->priv->data;
- while (iter && i <= index) {
- rp += len + (i > 0 ? seplen : 0);
- str = e_destination_get_textrep (E_DESTINATION (iter->data), FALSE);
- len = str ? g_utf8_strlen (str, -1) : 0;
- ++i;
- iter = g_list_next (iter);
- }
-
- if (i <= index) {
- rp = -1;
- len = 0;
- }
-
- if (pos)
- *pos = rp;
- if (length)
- *length = len;
-}
-
-void
-e_select_names_model_text_pos (ESelectNamesModel *model, gint seplen, gint pos, gint *index, gint *start_pos, gint *length)
-{
- GList *iter;
- const gchar *str;
- gint len = 0, i = 0, sp = 0, adj = 0;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (seplen > 0);
-
- iter = model->priv->data;
-
- while (iter != NULL) {
- str = e_destination_get_textrep (E_DESTINATION (iter->data), FALSE);
- len = str ? g_utf8_strlen (str, -1) : 0;
-
- if (sp <= pos && pos <= sp + len + adj) {
- break;
- }
-
- sp += len + adj + 1;
- adj = seplen-1;
- ++i;
-
- iter = g_list_next (iter);
- }
-
- if (i != 0)
- sp += seplen-1; /* skip past "magic space" */
-
- if (iter == NULL) {
-#if 0
- g_print ("text_pos ended NULL\n");
-#endif
- i = -1;
- sp = -1;
- len = 0;
- } else {
-#if 0
- g_print ("text_pos got index %d\n", i);
-#endif
- }
-
- if (index)
- *index = i;
- if (start_pos)
- *start_pos = sp;
- if (length)
- *length = len;
-}
-
-void
-e_select_names_model_cardify (ESelectNamesModel *model, EBook *book, gint index, gint delay)
-{
- EDestination *dest;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (book == NULL || E_IS_BOOK (book));
- g_return_if_fail (0 <= index && index < g_list_length (model->priv->data));
-
- dest = E_DESTINATION (g_list_nth_data (model->priv->data, index));
-
- if (!e_destination_is_empty (dest)) {
-
- if (delay > 0)
- e_destination_cardify_delayed (dest, book, delay);
- else
- e_destination_cardify (dest, book);
- }
-}
-
-gboolean
-e_select_names_model_uncardify (ESelectNamesModel *model, gint index)
-{
- EDestination *dest;
- gboolean rv = FALSE;
-
- g_return_val_if_fail (E_IS_SELECT_NAMES_MODEL (model), FALSE);
- g_return_val_if_fail (0 <= index && index < g_list_length (model->priv->data), FALSE);
-
- dest = E_DESTINATION (g_list_nth_data (model->priv->data, index));
-
- if (!e_destination_is_empty (dest)) {
- EDestination *cpy_dest = e_destination_copy (dest);
-
- rv = e_destination_uncardify (cpy_dest);
-
- if (rv) {
- e_select_names_model_replace (model, index, cpy_dest);
- }
-
- }
-
- return rv;
-}
-
-void
-e_select_names_model_cancel_cardify (ESelectNamesModel *model, gint index)
-{
- EDestination *dest;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (0 <= index && index < g_list_length (model->priv->data));
-
- dest = E_DESTINATION (g_list_nth_data (model->priv->data, index));
-
- e_destination_cancel_cardify (dest);
-}
-
-void
-e_select_names_model_cardify_all (ESelectNamesModel *model, EBook *book, gint delay)
-{
- GList *iter;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (book == NULL || E_IS_BOOK (book));
-
- for (iter = model->priv->data; iter != NULL; iter = g_list_next (iter)) {
- EDestination *dest = E_DESTINATION (iter->data);
- if (!e_destination_is_empty (dest)) {
-
- if (delay > 0)
- e_destination_cardify_delayed (dest, book, delay);
- else
- e_destination_cardify (dest, book);
- }
- }
-}
-
-void
-e_select_names_model_cancel_cardify_all (ESelectNamesModel *model)
-{
- GList *iter;
-
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
-
- for (iter = model->priv->data; iter != NULL; iter = g_list_next (iter)) {
- EDestination *dest = E_DESTINATION (iter->data);
- e_destination_cancel_cardify (dest);
- }
-}
-
-void
-e_select_names_model_freeze (ESelectNamesModel *model)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
-
- ++model->priv->freeze_count;
-}
-
-void
-e_select_names_model_thaw (ESelectNamesModel *model)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_MODEL (model));
- g_return_if_fail (model->priv->freeze_count > 0);
-
- --model->priv->freeze_count;
- if (model->priv->pending_changed)
- e_select_names_model_changed (model);
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-model.h b/addressbook/gui/component/select-names/e-select-names-model.h
deleted file mode 100644
index 8a3c5381b7..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-model.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_MODEL_H__
-#define __E_SELECT_NAMES_MODEL_H__
-
-#include <time.h>
-#include <gtk/gtkobject.h>
-#include <stdio.h>
-#include <e-util/e-list.h>
-#include <addressbook/backend/ebook/e-card.h>
-#include <addressbook/backend/ebook/e-destination.h>
-
-#define E_TYPE_SELECT_NAMES_MODEL (e_select_names_model_get_type ())
-#define E_SELECT_NAMES_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModel))
-#define E_SELECT_NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_MODEL, ESelectNamesModelClass))
-#define E_IS_SELECT_NAMES_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_MODEL))
-#define E_IS_SELECT_NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_MODEL))
-
-typedef struct _ESelectNamesModel ESelectNamesModel;
-typedef struct _ESelectNamesModelClass ESelectNamesModelClass;
-struct _ESelectNamesModelPrivate;
-
-struct _ESelectNamesModel {
- GObject object;
-
- struct _ESelectNamesModelPrivate *priv;
-};
-
-struct _ESelectNamesModelClass {
- GObjectClass parent_class;
-
- void (*changed) (ESelectNamesModel *model);
- void (*resized) (ESelectNamesModel *model, gint index, gint old_len, gint new_len);
-};
-
-GType e_select_names_model_get_type (void);
-
-ESelectNamesModel *e_select_names_model_new (void);
-ESelectNamesModel *e_select_names_model_duplicate (ESelectNamesModel *old);
-
-gchar *e_select_names_model_get_textification (ESelectNamesModel *model, const char *separator);
-gchar *e_select_names_model_get_address_text (ESelectNamesModel *model, const char *separator);
-
-gint e_select_names_model_count (ESelectNamesModel *model);
-gint e_select_names_model_get_limit (ESelectNamesModel *model);
-void e_select_names_model_set_limit (ESelectNamesModel *model, gint limit);
-gboolean e_select_names_model_at_limit (ESelectNamesModel *model);
-
-const EDestination *e_select_names_model_get_destination (ESelectNamesModel *model, gint index);
-gchar *e_select_names_model_export_destinationv (ESelectNamesModel *model);
-void e_select_names_model_import_destinationv (ESelectNamesModel *model,
- gchar *destinationv);
-ECard *e_select_names_model_get_card (ESelectNamesModel *model, gint index);
-const gchar *e_select_names_model_get_string (ESelectNamesModel *model, gint index);
-
-gboolean e_select_names_model_contains (ESelectNamesModel *model, const EDestination *dest);
-
-void e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination *dest);
-void e_select_names_model_append (ESelectNamesModel *model, EDestination *dest);
-void e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination *dest);
-void e_select_names_model_delete (ESelectNamesModel *model, gint index);
-void e_select_names_model_delete_all (ESelectNamesModel *model);
-void e_select_names_model_overwrite_copy (ESelectNamesModel *dest, ESelectNamesModel *src);
-void e_select_names_model_merge (ESelectNamesModel *dest, ESelectNamesModel *src);
-
-void e_select_names_model_clean (ESelectNamesModel *model, gboolean clean_last_entry);
-
-void e_select_names_model_name_pos (ESelectNamesModel *model, gint seplen, gint index, gint *pos, gint *length);
-void e_select_names_model_text_pos (ESelectNamesModel *model, gint seplen, gint pos, gint *index, gint *start_pos, gint *length);
-
-void e_select_names_model_cardify (ESelectNamesModel *model, EBook *book, gint index, gint delay);
-gboolean e_select_names_model_uncardify (ESelectNamesModel *model, gint index);
-void e_select_names_model_cancel_cardify (ESelectNamesModel *model, gint index);
-void e_select_names_model_cardify_all (ESelectNamesModel *model, EBook *book, gint delay);
-void e_select_names_model_cancel_cardify_all (ESelectNamesModel *model);
-
-/* This is a mildly annoying freeze/thaw pair, in that it only applies to the 'changed'
- signal and not to 'resized'. This could cause unexpected results in some cases. */
-void e_select_names_model_freeze (ESelectNamesModel *model);
-void e_select_names_model_thaw (ESelectNamesModel *model);
-
-
-#endif /* ! __E_SELECT_NAMES_MODEL_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-popup.c b/addressbook/gui/component/select-names/e-select-names-popup.c
deleted file mode 100644
index d7fabd9426..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-popup.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-popup.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <glib.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkimagemenuitem.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <gtk/gtkradiomenuitem.h>
-#include <gtk/gtkseparatormenuitem.h>
-#include <gtk/gtklabel.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/gui/contact-editor/e-contact-editor.h>
-#include <addressbook/gui/contact-editor/e-contact-quick-add.h>
-#include "e-addressbook-util.h"
-#include "e-select-names-popup.h"
-
-#define LIST_ICON_FILENAME "contact-list-16.png"
-#define CONTACT_ICON_FILENAME "evolution-contacts-mini.png"
-
-typedef struct _PopupInfo PopupInfo;
-struct _PopupInfo {
- ESelectNamesTextModel *text_model;
- EDestination *dest;
- gint pos;
- gint index;
-};
-
-static PopupInfo *
-popup_info_new (ESelectNamesTextModel *text_model, EDestination *dest, gint pos, gint index)
-{
- PopupInfo *info = g_new0 (PopupInfo, 1);
- info->text_model = text_model;
- info->dest = dest;
- info->pos = pos;
- info->index = index;
-
- if (text_model)
- g_object_ref (text_model);
-
- if (dest)
- g_object_ref (dest);
-
- return info;
-}
-
-static void
-popup_info_free (PopupInfo *info)
-{
- if (info) {
-
- if (info->text_model)
- g_object_unref (info->text_model);
-
- if (info->dest)
- g_object_unref (info->dest);
-
- g_free (info);
- }
-}
-
-static void
-popup_info_cleanup (GtkWidget *w, gpointer info)
-{
- popup_info_free ((PopupInfo *) info);
-}
-
-/* You are in a maze of twisty little callbacks, all alike... */
-
-static void
-make_contact_editor_cb (EBook *book, gpointer user_data)
-{
- if (book) {
- EDestination *dest = E_DESTINATION (user_data);
- ECard *card;
-
- card = (ECard *) e_destination_get_card (dest);
- if (e_card_evolution_list (card)) {
- EContactListEditor *ce;
- ce = e_addressbook_show_contact_list_editor (book, card, FALSE, TRUE);
- e_contact_list_editor_raise (ce);
- }
- else {
- EContactEditor *ce;
- ce = e_addressbook_show_contact_editor (book, card, FALSE, TRUE);
- e_contact_editor_raise (ce);
- }
- g_object_unref (dest);
- }
-}
-
-#if TOO_MANY_MENU_ITEMS
-static void
-edit_contact_info_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- if (info == NULL)
- return;
-
- g_object_ref (info->dest);
- e_book_use_default_book (make_contact_editor_cb, (gpointer) info->dest);
-}
-#endif
-
-static void
-change_email_num_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- gint n;
- EDestination *dest;
-
- if (info == NULL)
- return;
-
- if (! GTK_CHECK_MENU_ITEM (w)->active)
- return;
-
- n = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "number"));
-
- if (n != e_destination_get_email_num (info->dest)) {
- dest = e_destination_new ();
- e_destination_set_card (dest, e_destination_get_card (info->dest), n);
- e_select_names_model_replace (info->text_model->source, info->index, dest);
- }
-}
-
-#if TOO_MANY_MENU_ITEMS
-static void
-remove_recipient_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- e_select_names_model_delete (info->text_model->source, info->index);
-}
-
-static void
-remove_all_recipients_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- e_select_names_model_delete_all (info->text_model->source);
-}
-
-static void
-toggle_html_mail_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM (w);
- const EDestination *dest;
-
- if (info == NULL)
- return;
-
- dest = info->dest;
-
- item = GTK_CHECK_MENU_ITEM (item);
- e_destination_set_html_mail_pref ((EDestination *) dest, item->active);
-}
-#endif
-
-static void
-populate_popup_card (GtkWidget *pop, gboolean list, PopupInfo *info)
-{
- GtkWidget *image;
- ECard *card;
- EIterator *iterator;
- GtkWidget *menuitem;
-
- card = e_destination_get_card (info->dest);
-
-#if TOO_MANY_MENU_ITEMS
- menuitem = gtk_separator_menu_item_new();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (_("Remove All"));
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (remove_all_recipients_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (_("Remove"));
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (remove_recipient_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (list ? _("View Contact List") : _("View Contact Info"));
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (edit_contact_info_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_check_menu_item_new_with_label (_("Send HTML Mail?"));
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
- e_destination_get_html_mail_pref (info->dest));
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (toggle_html_mail_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-#endif
-
- if (card->email) {
- menuitem = gtk_separator_menu_item_new();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- if (e_list_length (card->email) > 1) {
- GSList *radiogroup = NULL;
- gint n = e_destination_get_email_num (info->dest);
- gint j = e_list_length (card->email) - 1;
-
- iterator = e_list_get_iterator (card->email);
- for (e_iterator_last (iterator); e_iterator_is_valid (iterator); e_iterator_prev (iterator)) {
- char *email = (char *)e_iterator_get (iterator);
- char *label = NULL;
-
- if (!strncmp (email, "<?xml", 5)) {
- EDestination *dest = e_destination_import (email);
- if (dest) {
- label = g_strdup (e_destination_get_textrep (dest, TRUE));
- g_object_unref (dest);
- }
- }
- else {
- label = g_strdup (email);
- }
-
- if (list) {
- menuitem = gtk_menu_item_new_with_label (label);
- }
- else {
- menuitem = gtk_radio_menu_item_new_with_label (radiogroup, label);
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (change_email_num_cb),
- info);
- if (j == n)
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
-
- g_object_set_data (G_OBJECT (menuitem), "number", GINT_TO_POINTER (j));
- radiogroup = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem));
- }
-
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- j--;
-
- g_free (label);
- }
-
- g_object_unref (iterator);
- } else {
- menuitem = gtk_menu_item_new_with_label (e_destination_get_email (info->dest));
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
- }
- }
-
- menuitem = gtk_separator_menu_item_new ();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- image = gtk_image_new_from_file (list
- ? EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME
- : EVOLUTION_IMAGESDIR "/" CONTACT_ICON_FILENAME);
- gtk_widget_show (image);
- menuitem = gtk_image_menu_item_new_with_label (e_destination_get_name (info->dest));
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem),
- image);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-}
-
-static void
-quick_add_cb (GtkWidget *w, gpointer user_data)
-{
- PopupInfo *info = (PopupInfo *) user_data;
- e_contact_quick_add_free_form (e_destination_get_address (info->dest), NULL, NULL);
-}
-
-static void
-populate_popup_nocard (GtkWidget *pop, PopupInfo *info)
-{
- const gchar *str;
- GtkWidget *menuitem;
-
- menuitem = gtk_separator_menu_item_new ();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- menuitem = gtk_menu_item_new_with_label (_("Add to Contacts"));
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
- g_signal_connect (menuitem, "activate",
- G_CALLBACK (quick_add_cb),
- info);
-
-#if TOO_MANY_MENU_ITEMS
- menuitem = gtk_check_menu_item_new_with_label (_("Send HTML Mail?"));
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem),
- e_destination_get_html_mail_pref (info->dest));
- g_signal_connect (menuitem, "toggled",
- G_CALLBACK (toggle_html_mail_cb),
- info);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-#endif
-
- menuitem = gtk_separator_menu_item_new ();
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-
- str = e_destination_get_name (info->dest);
- if (! (str && *str))
- str = e_destination_get_email (info->dest);
- if (! (str && *str))
- str = _("Unnamed Contact");
-
- menuitem = gtk_menu_item_new_with_label (str);
- gtk_widget_show (menuitem);
- gtk_menu_shell_prepend (GTK_MENU_SHELL (pop), menuitem);
-}
-
-void
-e_select_names_populate_popup (GtkWidget *menu, ESelectNamesTextModel *text_model,
- GdkEventButton *ev, gint pos, GtkWidget *for_widget)
-{
- ESelectNamesModel *model;
- PopupInfo *info;
- EDestination *dest;
- gint index;
-
- g_return_if_fail (GTK_IS_MENU_SHELL (menu));
- g_return_if_fail (E_IS_SELECT_NAMES_TEXT_MODEL (text_model));
- g_return_if_fail (ev);
- g_return_if_fail (0 <= pos);
-
- model = text_model->source;
-
- e_select_names_model_text_pos (model, text_model->seplen, pos, &index, NULL, NULL);
- if (index < 0 || index >= e_select_names_model_count (model))
- return;
-
- /* XXX yuck, why does this return a const? */
- dest = (EDestination *)e_select_names_model_get_destination (model, index);
- if (e_destination_is_empty (dest))
- return;
-
- info = popup_info_new (text_model, dest, pos, index);
-
- if (e_destination_contains_card (dest)) {
- populate_popup_card (menu, e_destination_is_evolution_list (dest), info);
- } else {
- populate_popup_nocard (menu, info);
- }
-
- /* Clean up our info item after we've made our selection. */
- g_signal_connect (menu,
- "selection-done",
- G_CALLBACK (popup_info_cleanup),
- info);
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-popup.h b/addressbook/gui/component/select-names/e-select-names-popup.h
deleted file mode 100644
index 531275190b..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-popup.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-select-names-popup.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_SELECT_NAMES_POPUP_H__
-#define __E_SELECT_NAMES_POPUP_H__
-
-#include "e-select-names-text-model.h"
-
-void e_select_names_populate_popup (GtkWidget *menu, ESelectNamesTextModel *text_model,
- GdkEventButton *ev, gint pos, GtkWidget *for_widget);
-
-#endif /* __E_SELECT_NAMES_POPUP_H__ */
-
diff --git a/addressbook/gui/component/select-names/e-select-names-section.etspec b/addressbook/gui/component/select-names/e-select-names-section.etspec
deleted file mode 100644
index 9d7b038892..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-section.etspec
+++ /dev/null
@@ -1,7 +0,0 @@
-<ETableSpecification no-headers="true" cursor-mode="line" alternating-row-colors="false">
- <ETableColumn model_col= "0" _title="Name" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="collate" search="string"/>
- <ETableState>
- <column source="0"/>
- <grouping> <leaf column="0" ascending="true"/> </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.c b/addressbook/gui/component/select-names/e-select-names-table-model.c
deleted file mode 100644
index 1c55c3804d..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-table-model.c
+++ /dev/null
@@ -1,369 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <gtk/gtksignal.h>
-#include <gal/util/e-util.h>
-#include <libgnome/gnome-i18n.h>
-
-#include "e-select-names-table-model.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-/* Object argument IDs */
-enum {
- PROP_0,
- PROP_SOURCE,
-};
-
-static void e_select_names_table_model_init (ESelectNamesTableModel *model);
-static void e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass);
-
-static void e_select_names_table_model_dispose (GObject *object);
-static void e_select_names_table_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_select_names_table_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_select_names_table_model_model_changed (ESelectNamesModel *source,
- ESelectNamesTableModel *model);
-
-static ETableModelClass *parent_class = NULL;
-
-static void
-e_select_names_table_model_add_source (ESelectNamesTableModel *model,
- ESelectNamesModel *source)
-{
- model->source = source;
- if (model->source)
- g_object_ref(model->source);
- model->source_changed_id = g_signal_connect(model->source, "changed",
- G_CALLBACK(e_select_names_table_model_model_changed),
- model);
-}
-
-static void
-e_select_names_table_model_drop_source (ESelectNamesTableModel *model)
-{
- if (model->source_changed_id)
- g_signal_handler_disconnect(model->source, model->source_changed_id);
- if (model->source)
- g_object_unref(model->source);
- model->source = NULL;
- model->source_changed_id = 0;
-}
-
-/**
- * e_select_names_table_model_get_type:
- * @void:
- *
- * Registers the &ESelectNamesTableModel class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ESelectNamesTableModel class.
- **/
-GType
-e_select_names_table_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesTableModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_table_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesTableModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_table_model_init,
- };
-
- type = g_type_register_static (e_table_model_get_type (), "ESelectNamesTableModel", &info, 0);
- }
-
- return type;
-}
-
-/**
- * e_select_names_table_model_new:
- * @VCard: a string in vCard format
- *
- * Returns: a new #ESelectNamesTableModel that wraps the @VCard.
- */
-ETableModel *
-e_select_names_table_model_new (ESelectNamesModel *source)
-{
- ETableModel *model = g_object_new (E_TYPE_SELECT_NAMES_TABLE_MODEL, NULL);
- g_object_set(model,
- "source", source,
- NULL);
- return model;
-}
-
-static void
-fill_in_info (ESelectNamesTableModel *model)
-{
- if (model->source) {
- int count = e_select_names_model_count (model->source);
- gint i;
-
- model->count = count;
- model->data = g_new(ESelectNamesTableModelData, count);
-
- for (i = 0; i < count; ++i) {
- const EDestination *dest = e_select_names_model_get_destination (model->source, i);
- ECard *card = dest ? e_destination_get_card (dest) : NULL;
-
- if (card) {
- ECardSimple *simple = e_card_simple_new(card);
- model->data[i].name = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_NAME_OR_ORG);
- if (model->data[i].name == 0)
- model->data[i].name = g_strdup("");
- model->data[i].email = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_EMAIL);
- if (model->data[i].email == 0)
- model->data[i].email = g_strdup("");
- g_object_unref(simple);
- } else {
- const gchar *name = e_destination_get_name (dest);
- const gchar *email = e_destination_get_email (dest);
-
- model->data[i].name = g_strdup (name && *name ? name : email);
- model->data[i].email = g_strdup (email);
- }
- }
- } else {
- model->count = 0;
- }
-}
-
-static void
-clear_info (ESelectNamesTableModel *model)
-{
- if (model->data) {
- int i;
- for (i = 0; i < model->count; i++) {
- g_free(model->data[i].name);
- g_free(model->data[i].email);
- }
- g_free(model->data);
- model->data = NULL;
- }
-
- model->count = -1;
-}
-
-/*
- * ESelectNamesTableModel lifecycle management and vcard loading/saving.
- */
-
-static void
-e_select_names_table_model_dispose (GObject *object)
-{
- ESelectNamesTableModel *model;
-
- model = E_SELECT_NAMES_TABLE_MODEL (object);
-
- e_select_names_table_model_drop_source (model);
- clear_info(model);
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-e_select_names_table_model_col_count (ETableModel *etc)
-{
- return 3;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-e_select_names_table_model_row_count (ETableModel *etc)
-{
- ESelectNamesTableModel *e_select_names_table_model = E_SELECT_NAMES_TABLE_MODEL(etc);
- if (e_select_names_table_model->count == -1) {
- if (e_select_names_table_model->source) {
- fill_in_info(e_select_names_table_model);
- } else {
- return 0;
- }
- }
- return e_select_names_table_model->count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-e_select_names_table_model_value_at (ETableModel *etc, int col, int row)
-{
- ESelectNamesTableModel *e_select_names_table_model = E_SELECT_NAMES_TABLE_MODEL(etc);
- if (e_select_names_table_model->data == NULL) {
- fill_in_info(e_select_names_table_model);
- }
- switch (col) {
- case 0:
- if (e_select_names_table_model->data[row].name == NULL) {
- fill_in_info(e_select_names_table_model);
- }
- return e_select_names_table_model->data[row].name;
- break;
- case 1:
- if (e_select_names_table_model->data[row].email == NULL) {
- fill_in_info(e_select_names_table_model);
- }
- return e_select_names_table_model->data[row].email;
- break;
- case 2:
- /* underline column*/
- return (void*)TRUE;
- break;
- }
- return "";
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-e_select_names_table_model_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-e_select_names_table_model_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return FALSE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-e_select_names_table_model_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-e_select_names_table_model_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-e_select_names_table_model_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-e_select_names_table_model_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-e_select_names_table_model_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-e_select_names_table_model_model_changed (ESelectNamesModel *source,
- ESelectNamesTableModel *model)
-{
- e_table_model_pre_change(E_TABLE_MODEL(model));
- clear_info(model);
- e_table_model_changed(E_TABLE_MODEL(model));
-}
-
-/* Set_arg handler for the model */
-static void
-e_select_names_table_model_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTableModel *model;
-
- model = E_SELECT_NAMES_TABLE_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- e_select_names_table_model_drop_source (model);
- e_select_names_table_model_add_source (model, E_SELECT_NAMES_MODEL(g_value_get_object (value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/* Get_arg handler for the model */
-static void
-e_select_names_table_model_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTableModel *model;
-
- model = E_SELECT_NAMES_TABLE_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- g_value_set_object (value, model->source);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/**
- * e_select_names_table_model_init:
- */
-static void
-e_select_names_table_model_init (ESelectNamesTableModel *model)
-{
- model->source = NULL;
- model->source_changed_id = 0;
-
- model->count = -1;
- model->data = NULL;
-}
-
-static void
-e_select_names_table_model_class_init (ESelectNamesTableModelClass *klass)
-{
- GObjectClass *object_class;
- ETableModelClass *table_model_class;
-
- object_class = G_OBJECT_CLASS(klass);
- table_model_class = E_TABLE_MODEL_CLASS(klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_table_model_dispose;
- object_class->get_property = e_select_names_table_model_get_property;
- object_class->set_property = e_select_names_table_model_set_property;
-
- g_object_class_install_property (object_class, PROP_SOURCE,
- g_param_spec_object ("source",
- _("Source"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_SELECT_NAMES_MODEL,
- G_PARAM_READWRITE));
-
- table_model_class->column_count = e_select_names_table_model_col_count;
- table_model_class->row_count = e_select_names_table_model_row_count;
- table_model_class->value_at = e_select_names_table_model_value_at;
- table_model_class->set_value_at = e_select_names_table_model_set_value_at;
- table_model_class->is_cell_editable = e_select_names_table_model_is_cell_editable;
- table_model_class->duplicate_value = e_select_names_table_model_duplicate_value;
- table_model_class->free_value = e_select_names_table_model_free_value;
- table_model_class->initialize_value = e_select_names_table_model_initialize_value;
- table_model_class->value_is_empty = e_select_names_table_model_value_is_empty;
- table_model_class->value_to_string = e_select_names_table_model_value_to_string;
-}
diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.h b/addressbook/gui/component/select-names/e-select-names-table-model.h
deleted file mode 100644
index 1fd1026f19..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-table-model.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * Copyright (C) 2000 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_TABLE_MODEL_H__
-#define __E_SELECT_NAMES_TABLE_MODEL_H__
-
-#include <time.h>
-#include <stdio.h>
-#include <gtk/gtkobject.h>
-#include <gal/e-table/e-table-model.h>
-#include "e-select-names-model.h"
-
-#define E_TYPE_SELECT_NAMES_TABLE_MODEL (e_select_names_table_model_get_type ())
-#define E_SELECT_NAMES_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModel))
-#define E_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL, ESelectNamesTableModelClass))
-#define E_IS_SELECT_NAMES_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_TABLE_MODEL))
-#define E_IS_SELECT_NAMES_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TABLE_MODEL))
-
-typedef struct {
- char *name;
- char *email;
-} ESelectNamesTableModelData;
-
-typedef struct _ESelectNamesTableModel ESelectNamesTableModel;
-typedef struct _ESelectNamesTableModelClass ESelectNamesTableModelClass;
-
-struct _ESelectNamesTableModel {
- ETableModel parent;
-
- ESelectNamesModel *source;
- int source_changed_id;
-
- int count;
- ESelectNamesTableModelData *data; /* This is used as an array. */
-};
-
-struct _ESelectNamesTableModelClass {
- ETableModelClass parent_class;
-};
-
-ETableModel *e_select_names_table_model_new (ESelectNamesModel *source);
-
-/* Standard Gtk function */
-GType e_select_names_table_model_get_type (void);
-
-#endif /* ! __E_SELECT_NAMES_TABLE_MODEL_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.c b/addressbook/gui/component/select-names/e-select-names-text-model.c
deleted file mode 100644
index 7859d5b056..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-text-model.c
+++ /dev/null
@@ -1,847 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <gal/e-text/e-text-model-repos.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <addressbook/gui/contact-editor/e-contact-editor.h>
-#include "e-select-names-text-model.h"
-#include "e-addressbook-util.h"
-
-static FILE *out = NULL; /* stream for debugging spew */
-
-/* Object argument IDs */
-enum {
- PROP_0,
- PROP_SOURCE,
-};
-
-static void e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass);
-static void e_select_names_text_model_init (ESelectNamesTextModel *model);
-static void e_select_names_text_model_dispose (GObject *object);
-static void e_select_names_text_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_select_names_text_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-static void e_select_names_text_model_set_source (ESelectNamesTextModel *model, ESelectNamesModel *source);
-
-static const gchar *e_select_names_text_model_get_text (ETextModel *model);
-static void e_select_names_text_model_set_text (ETextModel *model, const gchar *text);
-static void e_select_names_text_model_insert (ETextModel *model, gint position, const gchar *text);
-static void e_select_names_text_model_insert_length (ETextModel *model, gint position, const gchar *text, gint length);
-static void e_select_names_text_model_delete (ETextModel *model, gint position, gint length);
-
-static gint e_select_names_text_model_obj_count (ETextModel *model);
-static const gchar *e_select_names_text_model_get_nth_obj (ETextModel *model, gint n, gint *len);
-static void e_select_names_text_model_activate_obj (ETextModel *model, gint n);
-
-
-static ETextModelClass *parent_class;
-#define PARENT_TYPE e_text_model_get_type()
-
-/**
- * e_select_names_text_model_get_type:
- * @void:
- *
- * Registers the &ESelectNamesTextModel class if necessary, and returns the type ID
- * associated to it.
- *
- * Return value: The type ID of the &ESelectNamesTextModel class.
- **/
-GtkType
-e_select_names_text_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesTextModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_text_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNamesTextModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_text_model_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "ESelectNamesTextModel", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_text_model_class_init (ESelectNamesTextModelClass *klass)
-{
- GObjectClass *object_class;
- ETextModelClass *text_model_class;
-
- object_class = G_OBJECT_CLASS(klass);
- text_model_class = E_TEXT_MODEL_CLASS(klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_text_model_dispose;
- object_class->get_property = e_select_names_text_model_get_property;
- object_class->set_property = e_select_names_text_model_set_property;
-
- g_object_class_install_property (object_class, PROP_SOURCE,
- g_param_spec_object ("source",
- _("Source"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_SELECT_NAMES_MODEL,
- G_PARAM_READWRITE));
-
- text_model_class->get_text = e_select_names_text_model_get_text;
- text_model_class->set_text = e_select_names_text_model_set_text;
- text_model_class->insert = e_select_names_text_model_insert;
- text_model_class->insert_length = e_select_names_text_model_insert_length;
- text_model_class->delete = e_select_names_text_model_delete;
-
- text_model_class->obj_count = e_select_names_text_model_obj_count;
- text_model_class->get_nth_obj = e_select_names_text_model_get_nth_obj;
- text_model_class->object_activated = e_select_names_text_model_activate_obj;
-
- if (getenv ("EVO_DEBUG_SELECT_NAMES_TEXT_MODEL")) {
- out = fopen ("/tmp/evo-debug-select-names-text-model", "w");
- if (out)
- setvbuf (out, NULL, _IONBF, 0);
- }
-}
-
-static void
-dump_model (ESelectNamesTextModel *text_model)
-{
- ESelectNamesModel *model = text_model->source;
- gint i;
-
- if (out == NULL)
- return;
-
- fprintf (out, "\n*** Model State: count=%d\n", e_select_names_model_count (model));
-
- for (i=0; i<e_select_names_model_count (model); ++i)
- fprintf (out, "[%d] \"%s\" %s\n", i,
- e_select_names_model_get_string (model, i),
- e_select_names_model_get_card (model, i) ? "<card>" : "");
- fprintf (out, "\n");
-}
-
-static void
-e_select_names_text_model_init (ESelectNamesTextModel *model)
-{
- const gchar *default_sep;
-
- model->last_magic_comma_pos = -1;
-
- if (getenv ("EVOLUTION_DISABLE_MAGIC_COMMA"))
- default_sep = ",";
- else
- default_sep = ", ";
-
- e_select_names_text_model_set_separator (model, default_sep);
-}
-
-static void
-e_select_names_text_model_dispose (GObject *object)
-{
- ESelectNamesTextModel *model;
-
- model = E_SELECT_NAMES_TEXT_MODEL (object);
-
- if (model->text) {
- g_free (model->text);
- model->text = NULL;
- }
- if (model->sep) {
- g_free (model->sep);
- model->sep = NULL;
- }
-
- e_select_names_text_model_set_source (model, NULL);
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-static void
-e_select_names_text_model_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTextModel *model;
-
- model = E_SELECT_NAMES_TEXT_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- e_select_names_text_model_set_source(model, E_SELECT_NAMES_MODEL (g_value_get_object(value)));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_select_names_text_model_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- ESelectNamesTextModel *model;
-
- model = E_SELECT_NAMES_TEXT_MODEL (object);
-
- switch (prop_id) {
- case PROP_SOURCE:
- g_value_set_object (value, model->source);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-resize_cb (ESelectNamesModel *source, gint index, gint old_len, gint new_len, ETextModel *model)
-{
- EReposDeleteShift repos_del;
- EReposInsertShift repos_ins;
- gint pos;
- gint seplen = E_SELECT_NAMES_TEXT_MODEL (model)->seplen;
-
- e_select_names_model_name_pos (source, seplen, index, &pos, NULL);
-
- if (new_len < old_len) {
-
- repos_del.model = model;
- repos_del.pos = pos;
- repos_del.len = old_len - new_len;
- e_text_model_reposition (model, e_repos_delete_shift, &repos_del);
-
- } else if (old_len < new_len) {
-
- repos_ins.model = model;
- repos_ins.pos = pos;
- repos_ins.len = new_len - old_len;
- e_text_model_reposition (model, e_repos_insert_shift, &repos_ins);
-
- }
-}
-
-static void
-changed_cb (ESelectNamesModel *source, ETextModel *model)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
-
- g_free (text_model->text);
- text_model->text = NULL;
-
- e_text_model_changed (model);
-}
-
-
-static void
-e_select_names_text_model_set_source (ESelectNamesTextModel *model,
- ESelectNamesModel *source)
-{
- if (source == model->source)
- return;
-
- if (model->source) {
- g_signal_handler_disconnect (model->source, model->source_changed_id);
- g_signal_handler_disconnect (model->source, model->source_resize_id);
- g_object_unref (model->source);
- }
-
- model->source = source;
-
- if (model->source) {
- g_object_ref (model->source);
- model->source_changed_id = g_signal_connect (model->source,
- "changed",
- G_CALLBACK (changed_cb),
- model);
- model->source_resize_id = g_signal_connect (model->source,
- "resized",
- G_CALLBACK (resize_cb),
- model);
- }
-}
-
-ETextModel *
-e_select_names_text_model_new (ESelectNamesModel *source)
-{
- ETextModel *model = g_object_new (E_TYPE_SELECT_NAMES_TEXT_MODEL, NULL);
- e_select_names_text_model_set_source (E_SELECT_NAMES_TEXT_MODEL (model), source);
- return model;
-}
-
-void
-e_select_names_text_model_set_separator (ESelectNamesTextModel *model, const char *sep)
-{
- g_return_if_fail (E_IS_SELECT_NAMES_TEXT_MODEL (model));
- g_return_if_fail (sep && *sep);
-
- g_free (model->sep);
- model->sep = g_strdup (sep);
- model->seplen = g_utf8_strlen (sep, -1);
-}
-
-static const gchar *
-e_select_names_text_model_get_text (ETextModel *model)
-{
- ESelectNamesTextModel *snm = E_SELECT_NAMES_TEXT_MODEL(model);
-
- if (snm == NULL)
- return "";
- else if (snm->text == NULL)
- snm->text = e_select_names_model_get_textification (snm->source, snm->sep);
-
- return snm->text;
-}
-
-static void
-e_select_names_text_model_set_text (ETextModel *model, const gchar *text)
-{
- ESelectNamesTextModel *snm = E_SELECT_NAMES_TEXT_MODEL(model);
-
- e_select_names_model_delete_all (snm->source);
- e_select_names_text_model_insert (model, 0, text);
-}
-
-static void
-e_select_names_text_model_insert (ETextModel *model, gint position, const gchar *text)
-{
- e_select_names_text_model_insert_length (model, position, text, g_utf8_strlen (text, -1));
-}
-
-static void
-e_select_names_text_model_insert_length (ETextModel *model, gint pos, const gchar *text, gint length)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
- ESelectNamesModel *source = text_model->source;
- const char *t;
- gchar *tmp;
-
- if (out) {
- tmp = g_strndup (text, length);
- fprintf (out, ">> insert \"%s\" (len=%d) at %d\n", tmp, length, pos);
- g_free (tmp);
- }
-
- tmp = e_select_names_model_get_textification (source, text_model->sep);
- pos = CLAMP (pos, 0, g_utf8_strlen (tmp, -1));
- g_free (tmp);
-
- /* We want to control all cursor motions ourselves, rather than taking hints
- from the ESelectNamesModel. */
- g_signal_handler_block (source, text_model->source_resize_id);
-
- /* We handle this one character at a time. */
-
- for (t = text; length >= 0; t = g_utf8_next_char (t), length--) {
- gint index, start_pos, text_len;
- gboolean inside_quote = FALSE;
- gunichar ut = g_utf8_get_char (t);
-
- if (ut == 0)
- break;
-
- text_model->last_magic_comma_pos = -1;
-
- if (out)
- fprintf (out, "processing [%d]\n", ut);
-
- e_select_names_model_text_pos (source, text_model->seplen, pos, &index, &start_pos, &text_len);
-
- if (out)
- fprintf (out, "index=%d start_pos=%d text_len=%d\n", index, start_pos, text_len);
-
- /* Is this a quoted or an unquoted separator we are dealing with? */
- if (ut == g_utf8_get_char(text_model->sep) && index >= 0) {
- const EDestination *dest = e_select_names_model_get_destination (source, index);
- if (dest) {
- const gchar *str = e_destination_get_textrep (dest, FALSE);
- int j;
- const char *jp;
-
- if (out)
- fprintf (out, "str=%s pos=%d\n", str, pos);
-
- for (jp = str, j = 0; j<pos-start_pos && *jp; jp = g_utf8_next_char (jp), ++j) {
- if (*jp == '"') {
- inside_quote = !inside_quote;
- if (out)
- fprintf (out, "flip to %d at %d\n", start_pos+j, inside_quote);
- }
- }
- }
- if (out)
- fprintf (out, inside_quote ? "inside quote\n" : "not inside quote\n");
- }
-
-
- if (ut == g_utf8_get_char (text_model->sep) && !inside_quote) {
-
- /* This is the case of hitting , first thing in an empty entry */
- if (index == -1) {
- EReposAbsolute repos;
-
- e_select_names_model_insert (source, 0, e_destination_new ());
- e_select_names_model_insert (source, 0, e_destination_new ());
-
- repos.model = model;
- repos.pos = -1; /* At end */
- e_text_model_reposition (model, e_repos_absolute, &repos);
-
-
- } else if (pos <= start_pos || pos == start_pos + text_len) {
- EReposInsertShift repos;
- gint ins_point = index;
-
- if (text_len != 0 && pos == start_pos + text_len)
- ++ins_point;
-
- /* Block adjacent blank cards. */
- if (! ((ins_point < e_select_names_model_count (source) &&
- (e_select_names_model_get_string (source, ins_point) == NULL))
- || (ins_point > 0 && (e_select_names_model_get_string (source, ins_point-1) == NULL)))) {
-
- e_select_names_model_insert (source, ins_point, e_destination_new ());
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
- pos += text_model->seplen;
- }
-
- } else {
- EReposInsertShift repos;
- gint offset = MAX (pos - start_pos, 0);
- const gchar *str = e_select_names_model_get_string (source, index);
- gchar *str1 = g_strndup (str, offset);
- gchar *str2 = g_strdup (str+offset);
- EDestination *d1 = e_destination_new (), *d2 = e_destination_new ();
-
- e_destination_set_raw (d1, str1);
- e_destination_set_raw (d2, str2);
-
- e_select_names_model_replace (source, index, d1);
- e_select_names_model_insert (source, index+1, d2);
-
- g_free (str1);
- g_free (str2);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
- pos += text_model->seplen;
- }
-
- if (text_model->seplen > 1)
- text_model->last_magic_comma_pos = pos;
-
- } else {
- EReposInsertShift repos;
- gint offset = MAX (pos - start_pos, 0);
- const gchar *str;
- GString *new_str = g_string_new (NULL);
- gint this_length = 1;
- gboolean whitespace = g_unichar_isspace (ut);
-
- str = index >= 0 ? e_select_names_model_get_string (source, index) : NULL;
- if (str && *str) {
- if (pos <= start_pos) {
- if (whitespace) {
- /* swallow leading whitespace */
- this_length = 0;
- } else {
- /* Adjust for our "magic white space" */
- /* FIXME: This code does the wrong thing if seplen > 2 */
- g_string_append_unichar (new_str, ut);
- g_string_append (new_str, pos < start_pos ? " " : "");
- g_string_append (new_str, str);
- if (pos < start_pos)
- ++this_length;
- }
- } else {
- const char *u;
- int n;
- for (u = str, n = 0; n < offset; u = g_utf8_next_char (u), n++)
- g_string_append_unichar (new_str, g_utf8_get_char (u));
- g_string_append_unichar (new_str, ut);
- g_string_append (new_str, u);
- }
- } else {
- if (whitespace) {
- /* swallow leading whitespace */
- this_length = 0;
- } else {
- g_string_append_unichar (new_str, ut);
- }
- }
-
- if (new_str->len) {
-
- EDestination *dest;
- dest = index >= 0 ? e_destination_copy (e_select_names_model_get_destination (source, index)) : e_destination_new ();
- e_destination_set_raw (dest, new_str->str);
- e_select_names_model_replace (source, index, dest);
-
- /* e_select_names_model_replace (source, index, dest); */
-
- if (this_length > 0) {
- repos.model = model;
- repos.pos = pos;
- repos.len = this_length;
- e_text_model_reposition (model, e_repos_insert_shift, &repos);
-
- pos += this_length;
- }
- }
- g_string_free (new_str, TRUE);
- }
- }
-
- dump_model (text_model);
-
- g_signal_handler_unblock (source, text_model->source_resize_id);
-}
-
-
-static void
-e_select_names_text_model_delete (ETextModel *model, gint pos, gint length)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
- ESelectNamesModel *source = text_model->source;
- gint index, start_pos, text_len, offset;
-
- if (out) {
- const gchar *str = e_select_names_model_get_textification (source, text_model->sep);
- gint i, len;
-
- fprintf (out, ">> delete %d at pos %d\n", length, pos);
-
- len = strlen (str);
- for (i=0; i<pos && i<len; ++i)
- fprintf (out, "%c", str[i]);
- fprintf (out, "[");
- for (i=pos; i<pos+length && i<len; ++i)
- fprintf (out, "%c", str[i]);
- fprintf (out, "]");
- for (i=pos+length; i<len; ++i)
- fprintf (out, "%c", str[i]);
- fprintf (out, "\n");
- }
-
- if (length < 0)
- return;
-
- if (text_model->last_magic_comma_pos == pos+1 && length == 1) {
- pos -= text_model->seplen-1;
- if (pos >= 0)
- length = text_model->seplen;
- text_model->last_magic_comma_pos = -1;
- }
-
- e_select_names_model_text_pos (source, text_model->seplen, pos, &index, &start_pos, &text_len);
-
- if (out)
- fprintf (out, "index=%d, start_pos=%d, text_len=%d\n", index, start_pos, text_len);
-
- /* We want to control all cursor motions ourselves, rather than taking hints
- from the ESelectNamesModel. */
- g_signal_handler_block (source, E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id);
-
- /* First, we handle a few tricky cases. */
-
- if (pos < start_pos) {
- EReposAbsolute repos;
-
- repos.model = model;
- repos.pos = pos;
- e_text_model_reposition (model, e_repos_absolute, &repos);
-
- length -= start_pos - pos;
-
- if (length > 0)
- e_select_names_text_model_delete (model, start_pos, length);
- goto finished;
- }
-
- if (pos == start_pos + text_len) {
- /* We are positioned right at the end of an entry, possibly right in front of a comma. */
-
- if (index+1 < e_select_names_model_count (source)) {
- EReposDeleteShift repos;
- EDestination *new_dest;
- const gchar *str1 = e_select_names_model_get_string (source, index);
- const gchar *str2 = e_select_names_model_get_string (source, index+1);
- gchar *new_str;
-
- while (str1 && *str1 && isspace ((gint) *str1))
- ++str1;
- while (str2 && *str2 && isspace ((gint) *str2))
- ++str2;
-
- if (str1 && str2)
- new_str = g_strdup_printf ("%s%s%s", str1, text_model->sep+1, str2);
- else if (str1)
- new_str = g_strdup (str1);
- else if (str2)
- new_str = g_strdup (str2);
- else
- new_str = g_strdup ("");
-
- if (out)
- fprintf (out, "joining \"%s\" and \"%s\" to \"%s\"\n", str1, str2, new_str);
-
- e_select_names_model_delete (source, index+1);
-
- new_dest = e_destination_new ();
- e_destination_set_raw (new_dest, new_str);
- e_select_names_model_replace (source, index, new_dest);
- g_free (new_str);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
-
- if (length > 1)
- e_select_names_text_model_delete (model, pos, length-1);
- } else {
- /* If we are at the end of the last entry (which we must be if we end up in this block),
- we can just do nothing. So this else-block is here just to give us a place to
- put this comment. */
- }
-
- goto finished;
- }
-
- if (pos + length > start_pos + text_len) {
- /* Uh oh... our changes straddle two objects. */
-
- if (pos == start_pos) { /* Delete the whole thing */
- EReposDeleteShift repos;
-
- e_select_names_model_delete (source, index);
-
- if (out)
- fprintf (out, "deleted all of %d\n", index);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_len + text_model->seplen;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
-
- length -= text_len + text_model->seplen;
- if (length > 0)
- e_select_names_text_model_delete (model, pos, length);
-
- } else {
- /* Delete right up to the end, and then call e_select_names_text_model_delete again
- to finish the job. */
- gint len1, len2;
-
- len1 = text_len - (pos - start_pos);
- len2 = length - len1;
-
- if (out)
- fprintf (out, "two-stage delete: %d, %d\n", len1, len2);
-
-
- e_select_names_text_model_delete (model, pos, len1);
- e_select_names_text_model_delete (model, pos, len2);
- }
-
- goto finished;
- }
-
- /* Our changes are confined to just one entry. */
- if (length > 0) {
- const gchar *str;
- gchar *new_str;
-
- offset = pos - start_pos;
-
- str = e_select_names_model_get_string (source, index);
-
- if (str) {
- const char *p;
- char *np;
- int i;
- EReposDeleteShift repos;
- EDestination *dest;
-
- new_str = g_new0 (char, strlen (str) * 6 + 1); /* worse case it can't be any longer than this */
-
- /* copy the region before the deletion */
- for (p = str, i = 0, np = new_str; i < offset; i++) {
- gunichar ch;
-
- ch = g_utf8_get_char (p);
- g_unichar_to_utf8 (ch, np);
-
- np = g_utf8_next_char (np);
- p = g_utf8_next_char (p);
- }
-
- /* skip the deleted segment */
- for (i = 0; i < length; i++)
- p = g_utf8_next_char (p);
-
- /* copy the region after the deletion */
- for (; *p; p = g_utf8_next_char (p)) {
- gunichar ch;
-
- ch = g_utf8_get_char (p);
- g_unichar_to_utf8 (ch, np);
-
- np = g_utf8_next_char (np);
- }
-
- dest = index >= 0 ? e_destination_copy (e_select_names_model_get_destination (source, index)) : e_destination_new ();
- e_destination_set_raw (dest, new_str);
- e_select_names_model_replace (source, index, dest);
-
- if (out)
- fprintf (out, "new_str: \"%s\"\n", new_str);
-
- g_free (new_str);
-
- repos.model = model;
- repos.pos = pos;
- repos.len = length;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
-
- } else {
- EReposDeleteShift repos;
-
- e_select_names_model_delete (source, index);
-
- if (out)
- fprintf (out, "deleted %d\n", index);
-
-
- repos.model = model;
- repos.pos = pos;
- repos.len = text_model->seplen;
-
- e_text_model_reposition (model, e_repos_delete_shift, &repos);
- }
- }
-
- finished:
- E_SELECT_NAMES_TEXT_MODEL (model)->last_magic_comma_pos = -1;
- g_signal_handler_unblock (source, E_SELECT_NAMES_TEXT_MODEL (model)->source_resize_id);
- dump_model (E_SELECT_NAMES_TEXT_MODEL (model));
-}
-
-static gint
-e_select_names_text_model_obj_count (ETextModel *model)
-{
- ESelectNamesModel *source = E_SELECT_NAMES_TEXT_MODEL (model)->source;
- gint i, count;
-
- count = i = e_select_names_model_count (source);
- while (i > 0) {
- const EDestination *dest;
- --i;
- dest = e_select_names_model_get_destination (source, i);
- if (e_destination_get_card (dest) == NULL)
- --count;
- }
-
- return count;
-}
-
-static gint
-nth_obj_index (ESelectNamesModel *source, gint n)
-{
- gint i, N;
-
- i = 0;
- N = e_select_names_model_count (source);
-
- do {
- const EDestination *dest = e_select_names_model_get_destination (source, i);
- if (e_destination_get_card (dest))
- --n;
- ++i;
- } while (n >= 0 && i < N);
-
- if (i <= N)
- --i;
- else
- i = -1;
-
- return i;
-}
-
-static const gchar *
-e_select_names_text_model_get_nth_obj (ETextModel *model, gint n, gint *len)
-{
- ESelectNamesTextModel *text_model = E_SELECT_NAMES_TEXT_MODEL (model);
- ESelectNamesModel *source = text_model->source;
- gint i, pos;
-
- i = nth_obj_index (source, n);
- if (i < 0)
- return NULL;
-
- e_select_names_model_name_pos (source, text_model->seplen, i, &pos, len);
- if (pos < 0)
- return NULL;
-
- if (text_model->text == NULL)
- text_model->text = e_select_names_model_get_textification (source, text_model->sep);
- return g_utf8_offset_to_pointer (text_model->text, pos);
-}
-
-static void
-e_select_names_text_model_activate_obj (ETextModel *model, gint n)
-{
- ESelectNamesModel *source = E_SELECT_NAMES_TEXT_MODEL (model)->source;
- ECard *card;
- gint i;
-
- i = nth_obj_index (source, n);
- g_return_if_fail (i >= 0);
-
- card = e_select_names_model_get_card (source, i);
- g_return_if_fail (card != NULL);
-
- /* present read-only contact editor when someone double clicks from here */
- if (e_card_evolution_list (card)) {
- EContactListEditor *ce;
- ce = e_addressbook_show_contact_list_editor (e_card_get_book(card), card, FALSE, FALSE);
- e_contact_list_editor_raise (ce);
- }
- else {
- EContactEditor *ce;
- ce = e_addressbook_show_contact_editor (e_card_get_book(card), card, FALSE, FALSE);
- e_contact_editor_raise (ce);
- }
-}
-
-
-
diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.h b/addressbook/gui/component/select-names/e-select-names-text-model.h
deleted file mode 100644
index eec062aee6..0000000000
--- a/addressbook/gui/component/select-names/e-select-names-text-model.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- * Jon Trowbridge <trow@ximian.com>
- *
- * Copyright (C) 2000, 2001 Ximian, Inc.
- */
-
-#ifndef __E_SELECT_NAMES_TEXT_MODEL_H__
-#define __E_SELECT_NAMES_TEXT_MODEL_H__
-
-#include <time.h>
-#include <stdio.h>
-#include <gtk/gtkobject.h>
-#include <gal/e-text/e-text-model.h>
-#include "e-select-names-model.h"
-
-#define E_TYPE_SELECT_NAMES_TEXT_MODEL (e_select_names_text_model_get_type ())
-#define E_SELECT_NAMES_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModel))
-#define E_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL, ESelectNamesTextModelClass))
-#define E_IS_SELECT_NAMES_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES_TEXT_MODEL))
-#define E_IS_SELECT_NAMES_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SELECT_NAMES_TEXT_MODEL))
-
-typedef struct _ESelectNamesTextModel ESelectNamesTextModel;
-typedef struct _ESelectNamesTextModelClass ESelectNamesTextModelClass;
-
-struct _ESelectNamesTextModel {
- ETextModel parent;
-
- ESelectNamesModel *source;
- gint source_changed_id;
- gint source_resize_id;
-
- gchar *text;
-
- gchar *sep;
- gint seplen;
-
- gint last_magic_comma_pos;
-};
-
-struct _ESelectNamesTextModelClass {
- ETextModelClass parent_class;
-};
-
-ETextModel *e_select_names_text_model_new (ESelectNamesModel *source);
-void e_select_names_text_model_set_separator (ESelectNamesTextModel *model, const char *sep);
-
-/* Standard Gtk function */
-GType e_select_names_text_model_get_type (void);
-
-#endif /* ! __E_SELECT_NAMES_TEXT_MODEL_H__ */
diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c
deleted file mode 100644
index f009fbbd63..0000000000
--- a/addressbook/gui/component/select-names/e-select-names.c
+++ /dev/null
@@ -1,845 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-select-names.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <gal/e-table/e-table-simple.h>
-#include <gal/e-table/e-table-without.h>
-#include <gal/widgets/e-popup-menu.h>
-
-#include <addressbook/gui/widgets/e-addressbook-model.h>
-#include <addressbook/gui/widgets/e-addressbook-table-adapter.h>
-#include <addressbook/gui/component/e-cardlist-model.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/gui/component/addressbook-component.h>
-#include <addressbook/gui/component/addressbook-storage.h>
-#include <addressbook/gui/component/addressbook.h>
-#include <shell/evolution-shell-client.h>
-#include <shell/evolution-folder-selector-button.h>
-
-#include "e-select-names.h"
-#include <addressbook/backend/ebook/e-card-simple.h>
-#include "e-select-names-table-model.h"
-#include <gal/widgets/e-categories-master-list-option-menu.h>
-#include <gal/e-text/e-entry.h>
-#include <e-util/e-categories-master-list-wombat.h>
-#include "e-util/e-sexp.h"
-
-static void e_select_names_init (ESelectNames *names);
-static void e_select_names_class_init (ESelectNamesClass *klass);
-static void e_select_names_dispose (GObject *object);
-static void update_query (GtkWidget *widget, ESelectNames *e_select_names);
-
-static void sync_table_and_models (ESelectNamesModel *triggering_model, ESelectNames *esl);
-
-static GtkDialogClass *parent_class = NULL;
-#define PARENT_TYPE gtk_dialog_get_type()
-
-/* The arguments we take */
-enum {
- ARG_0,
-};
-
-typedef struct {
- char *title;
- ESelectNamesModel *source;
- ESelectNamesTableModel *table_model;
- ESelectNames *names;
- GtkWidget *label;
- GtkWidget *button;
- GtkWidget *recipient_table;
- gulong changed_id;
-} ESelectNamesChild;
-
-GType
-e_select_names_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (ESelectNamesClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_select_names_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (ESelectNames),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_select_names_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "ESelectNames", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_select_names_class_init (ESelectNamesClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->dispose = e_select_names_dispose;
-}
-
-GtkWidget *e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2);
-GtkWidget *e_addressbook_create_folder_selector(char *name, char *string1, char *string2, int num1, int num2);
-
-static void
-search_result (EAddressbookModel *model, EBookViewStatus status, ESelectNames *esn)
-{
- sync_table_and_models (NULL, esn);
-}
-
-static void
-set_book(EBook *book, EBookStatus status, ESelectNames *esn)
-{
- g_object_set(esn->model,
- "book", book,
- NULL);
- update_query (NULL, esn);
- g_object_unref(book);
- g_object_unref(esn->model);
- g_object_unref(esn);
-}
-
-static void
-addressbook_model_set_uri(ESelectNames *e_select_names, EAddressbookModel *model, const char *uri)
-{
- EBook *book;
- char *book_uri;
-
- book_uri = e_book_expand_uri (uri);
-
- /* If uri == the current uri, then we don't have to do anything */
- book = e_addressbook_model_get_ebook (model);
- if (book) {
- const gchar *current_uri = e_book_get_uri (book);
- if (current_uri && !strcmp (book_uri, current_uri)) {
- g_free (book_uri);
- return;
- }
- }
-
- book = e_book_new();
-
- g_object_ref(e_select_names);
- g_object_ref(model);
- addressbook_load_uri(book, book_uri, (EBookCallback) set_book, e_select_names);
-
- g_free (book_uri);
-}
-
-static void *
-card_key (ECard *card)
-{
- EBook *book;
- const gchar *book_uri;
-
- if (card == NULL)
- return NULL;
-
- g_assert (E_IS_CARD (card));
-
- book = e_card_get_book (card);
- book_uri = book ? e_book_get_uri (book) : "NoBook";
- return g_strdup_printf ("%s|%s", book_uri ? book_uri : "NoURI", e_card_get_id (card));
-}
-
-static void
-sync_one_model (gpointer k, gpointer val, gpointer closure)
-{
- ETableWithout *etw = E_TABLE_WITHOUT (closure);
- ESelectNamesChild *child = val;
- ESelectNamesModel *model = child->source;
- gint i, count;
- ECard *card;
- void *key;
-
- count = e_select_names_model_count (model);
- for (i = 0; i < count; ++i) {
- card = e_select_names_model_get_card (model, i);
- if (card) {
- key = card_key (card);
- e_table_without_hide (etw, key);
- g_free (key);
- }
- }
-}
-
-static void
-sync_table_and_models (ESelectNamesModel *triggering_model, ESelectNames *esl)
-{
- e_table_without_show_all (E_TABLE_WITHOUT (esl->without));
- g_hash_table_foreach (esl->children, sync_one_model, esl->without);
-}
-
-static void
-real_add_address_cb (int model_row, gpointer closure)
-{
- ESelectNamesChild *child = closure;
- ESelectNames *names = child->names;
- ECard *card;
- EDestination *dest = e_destination_new ();
- gint mapped_row;
-
- mapped_row = e_table_subset_view_to_model_row (E_TABLE_SUBSET (names->without), model_row);
-
- card = e_addressbook_model_get_card (E_ADDRESSBOOK_MODEL(names->model), mapped_row);
-
- if (card != NULL) {
- e_destination_set_card (dest, card, 0);
-
- e_select_names_model_append (child->source, dest);
- e_select_names_model_clean (child->source, FALSE);
-
- g_object_unref(card);
- }
-}
-
-static void
-real_add_address(ESelectNames *names, ESelectNamesChild *child)
-{
- e_select_names_model_freeze (child->source);
- e_table_selected_row_foreach(e_table_scrolled_get_table(names->table),
- real_add_address_cb, child);
- e_select_names_model_thaw (child->source);
-}
-
-static void
-add_address(ETable *table, int row, int col, GdkEvent *event, ESelectNames *names)
-{
- ESelectNamesChild *child;
-
- child = g_hash_table_lookup(names->children, names->def);
- if (child) {
- real_add_address(names, child);
- }
-}
-
-static void
-sensitize_button (gpointer key, gpointer data, gpointer user_data)
-{
- gboolean *sensitive = user_data;
- ESelectNamesChild *child = data;
-
- gtk_widget_set_sensitive (child->button, *sensitive);
-}
-
-static void
-selection_change (ETable *table, ESelectNames *names)
-{
- gboolean sensitive;
-
- sensitive = e_table_selected_count (table) > 0;
-
- g_hash_table_foreach (names->children, sensitize_button, &sensitive);
-}
-
-static void *
-esn_get_key_fn (ETableModel *source, int row, void *closure)
-{
- EAddressbookModel *model = E_ADDRESSBOOK_MODEL (closure);
- ECard *card = e_addressbook_model_get_card (model, row);
- void *key = card_key (card);
- g_object_unref (card);
- return key;
-}
-
-static void *
-esn_dup_key_fn (const void *key, void *closure)
-{
- void *dup = (void *) g_strdup ((const gchar *) key);
- return dup;
-}
-
-static void
-esn_free_gotten_key_fn (void *key, void *closure)
-{
- g_free (key);
-}
-
-static void
-esn_free_duped_key_fn (void *key, void *closure)
-{
- g_free (key);
-}
-
-GtkWidget *
-e_addressbook_create_ebook_table(char *name, char *string1, char *string2, int num1, int num2)
-{
- ETableModel *adapter;
- ETableModel *without;
- EAddressbookModel *model;
- GtkWidget *table;
-
- model = e_addressbook_model_new ();
- adapter = E_TABLE_MODEL (e_addressbook_table_adapter_new (model));
-
- g_object_set(model,
- "editable", FALSE,
- NULL);
-
- without = e_table_without_new (adapter,
- g_str_hash,
- g_str_equal,
- esn_get_key_fn,
- esn_dup_key_fn,
- esn_free_gotten_key_fn,
- esn_free_duped_key_fn,
- model);
-
- table = e_table_scrolled_new_from_spec_file (without,
- NULL,
- EVOLUTION_ETSPECDIR "/e-select-names.etspec",
- NULL);
-
- g_object_set_data(G_OBJECT(table), "adapter", adapter);
- g_object_set_data(G_OBJECT(table), "without", without);
- g_object_set_data(G_OBJECT(table), "model", model);
-
- return table;
-}
-
-GtkWidget *
-e_addressbook_create_folder_selector(char *name, char *string1, char *string2, int num1, int num2)
-{
- return g_object_new (EVOLUTION_TYPE_FOLDER_SELECTOR_BUTTON, NULL);
-}
-
-static void
-folder_selected (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder,
- ESelectNames *e_select_names)
-{
- addressbook_model_set_uri(e_select_names, e_select_names->model, folder->physicalUri);
-
- e_config_listener_set_string (e_book_get_config_database(),
- "/apps/evolution/addressbook/select_names/last_used_uri", folder->physicalUri);
-}
-
-static void
-update_query (GtkWidget *widget, ESelectNames *e_select_names)
-{
- char *category = "";
- const char *search = "";
- char *query;
- char *q_array[4];
- int i;
- GString *s = g_string_new ("");
-
- if (e_select_names->categories) {
- category = e_categories_master_list_option_menu_get_category (E_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories));
- }
- if (e_select_names->select_entry) {
- search = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
- }
-
- e_sexp_encode_string (s, search);
-
- i = 0;
- q_array[i++] = "(contains \"email\" \"\")";
- if (category && *category)
- q_array[i++] = g_strdup_printf ("(is \"category\" \"%s\")", category);
- if (search && *search)
- q_array[i++] = g_strdup_printf ("(or (beginswith \"email\" %s) "
- " (beginswith \"full_name\" %s) "
- " (beginswith \"nickname\" %s)"
- " (beginswith \"file_as\" %s))",
- s->str, s->str, s->str, s->str);
- q_array[i++] = NULL;
- if (i > 2) {
- char *temp = g_strjoinv (" ", q_array);
- query = g_strdup_printf ("(and %s)", temp);
- g_free (temp);
- } else {
- query = g_strdup (q_array[0]);
- }
- g_object_set (e_select_names->model,
- "query", query,
- NULL);
- for (i = 1; q_array[i]; i++) {
- g_free (q_array[i]);
- }
- g_free (query);
- g_string_free (s, TRUE);
-}
-
-static void
-status_message (EAddressbookModel *model, const gchar *message, ESelectNames *e_select_names)
-{
- if (message == NULL)
- gtk_label_set_text (GTK_LABEL (e_select_names->status_message), "");
- else
- gtk_label_set_text (GTK_LABEL (e_select_names->status_message), message);
-}
-
-static void
-categories_changed (GtkWidget *widget, ESelectNames *e_select_names)
-{
- update_query (widget, e_select_names);
-}
-
-static void
-select_entry_changed (GtkWidget *widget, ESelectNames *e_select_names)
-{
- if (e_select_names->select_entry) {
- const char *select_string = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry));
- char *select_strcoll_string = g_utf8_collate_key (select_string, -1);
- int count;
- ETable *table;
- int i;
-
- table = e_table_scrolled_get_table (e_select_names->table);
-
- count = e_table_model_row_count (e_select_names->without);
-
- for (i = 0; i < count; i++) {
- int model_row = e_table_view_to_model_row (table, i);
- char *row_strcoll_string =
- g_utf8_collate_key (e_table_model_value_at (e_select_names->without,
- E_CARD_SIMPLE_FIELD_NAME_OR_ORG,
- model_row),
- -1);
- if (g_utf8_collate (select_strcoll_string, row_strcoll_string) <= 0) {
- g_free (row_strcoll_string);
- break;
- }
- g_free (row_strcoll_string);
- }
- g_free (select_strcoll_string);
- if (i == count)
- i --;
-
- if (count > 0) {
- i = e_table_view_to_model_row (table, i);
- e_table_set_cursor_row (table, i);
- }
- }
-}
-
-GtkWidget *e_select_names_create_categories (gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_select_names_create_categories (gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- ECategoriesMasterList *ecml;
- GtkWidget *option_menu;
-
- ecml = e_categories_master_list_wombat_new ();
- option_menu = e_categories_master_list_option_menu_new (ecml);
- g_object_unref (ecml);
-
- return option_menu;
-}
-
-static void
-clear_widget (gpointer data, GObject *where_object_was)
-{
- GtkWidget **widget_ref = data;
- *widget_ref = NULL;
-}
-
-static void
-e_select_names_init (ESelectNames *e_select_names)
-{
- GladeXML *gui;
- GtkWidget *widget, *button;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/select-names.glade", NULL, NULL);
- e_select_names->gui = gui;
-
- e_select_names->children = g_hash_table_new(g_str_hash, g_str_equal);
- e_select_names->child_count = 0;
- e_select_names->def = NULL;
-
- widget = glade_xml_get_widget(gui, "table-top");
- if (!widget) {
- return;
- }
- gtk_widget_ref(widget);
- gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(e_select_names)->vbox), widget, TRUE, TRUE, 0);
- gtk_widget_unref(widget);
-
- gtk_dialog_add_buttons (GTK_DIALOG (e_select_names),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (e_select_names),
- GTK_RESPONSE_OK);
-
- gtk_container_set_border_width (GTK_CONTAINER (e_select_names), 12);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (e_select_names)->vbox), 6);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (e_select_names)->action_area), 12);
-
- gtk_window_set_modal (GTK_WINDOW (e_select_names), TRUE);
-
- gtk_window_set_title(GTK_WINDOW(e_select_names), _("Select Contacts from Addressbook"));
- gtk_window_set_resizable(GTK_WINDOW(e_select_names), TRUE);
-
- e_select_names->table = E_TABLE_SCROLLED(glade_xml_get_widget(gui, "table-source"));
- e_select_names->model = g_object_get_data(G_OBJECT(e_select_names->table), "model");
- e_select_names->adapter = g_object_get_data(G_OBJECT(e_select_names->table), "adapter");
- e_select_names->without = g_object_get_data(G_OBJECT(e_select_names->table), "without");
- gtk_widget_show (GTK_WIDGET (e_select_names->table));
-
- e_select_names->status_message = glade_xml_get_widget (gui, "status-message");
- if (e_select_names->status_message && !GTK_IS_LABEL (e_select_names->status_message))
- e_select_names->status_message = NULL;
- if (e_select_names->status_message) {
- e_select_names->status_id = g_signal_connect (e_select_names->model, "status_message",
- G_CALLBACK (status_message), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->status_message), clear_widget, &e_select_names->status_message);
- }
-
- e_select_names->search_id = g_signal_connect (e_select_names->model,
- "search_result", G_CALLBACK (search_result),
- e_select_names);
-
- e_select_names->categories = glade_xml_get_widget (gui, "custom-categories");
- if (e_select_names->categories && !E_IS_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories))
- e_select_names->categories = NULL;
- if (e_select_names->categories) {
- g_signal_connect(e_select_names->categories, "changed",
- G_CALLBACK(categories_changed), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->categories), clear_widget, &e_select_names->categories);
- }
- gtk_widget_show (e_select_names->categories);
-
- e_select_names->select_entry = glade_xml_get_widget (gui, "entry-select");
- if (e_select_names->select_entry && !GTK_IS_ENTRY (e_select_names->select_entry))
- e_select_names->select_entry = NULL;
- if (e_select_names->select_entry) {
- g_signal_connect(e_select_names->select_entry, "changed",
- G_CALLBACK(select_entry_changed), e_select_names);
- g_signal_connect(e_select_names->select_entry, "activate",
- G_CALLBACK(update_query), e_select_names);
- g_object_weak_ref (G_OBJECT (e_select_names->select_entry), clear_widget, &e_select_names->select_entry);
- }
-
- button = glade_xml_get_widget (gui, "button-find");
- if (button && GTK_IS_BUTTON (button))
- g_signal_connect(button, "clicked",
- G_CALLBACK(update_query), e_select_names);
-
- button = glade_xml_get_widget (gui, "folder-selector");
- if (button && EVOLUTION_IS_FOLDER_SELECTOR_BUTTON (button))
- g_signal_connect(button, "selected",
- G_CALLBACK(folder_selected), e_select_names);
- gtk_widget_show (button);
-
- g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "double_click",
- G_CALLBACK (add_address), e_select_names);
- g_signal_connect (e_table_scrolled_get_table (e_select_names->table), "selection_change",
- G_CALLBACK (selection_change), e_select_names);
- selection_change (e_table_scrolled_get_table (e_select_names->table), e_select_names);
-}
-
-static void e_select_names_child_free(char *key, ESelectNamesChild *child, ESelectNames *e_select_names)
-{
- g_signal_handler_disconnect(child->source, child->changed_id);
-
- g_free(child->title);
- g_object_unref(child->table_model);
- g_object_unref(child->source);
- g_free(key);
- g_free(child);
-}
-
-static void
-e_select_names_dispose (GObject *object)
-{
- ESelectNames *e_select_names = E_SELECT_NAMES(object);
-
- if (e_select_names->status_id) {
- g_signal_handler_disconnect(e_select_names->model, e_select_names->status_id);
- e_select_names->status_id = 0;
- }
-
- if (e_select_names->search_id) {
- g_signal_handler_disconnect(e_select_names->model, e_select_names->search_id);
- e_select_names->search_id = 0;
- }
-
- if (e_select_names->gui) {
- g_object_unref(e_select_names->gui);
- e_select_names->gui = NULL;
- }
-
- if (e_select_names->children) {
- g_hash_table_foreach(e_select_names->children, (GHFunc) e_select_names_child_free, e_select_names);
- g_hash_table_destroy(e_select_names->children);
- e_select_names->children = NULL;
- }
-
- if (e_select_names->without) {
- g_object_unref(e_select_names->without);
- e_select_names->without = NULL;
- }
- if (e_select_names->adapter) {
- g_object_unref(e_select_names->adapter);
- e_select_names->adapter = NULL;
- }
- if (e_select_names->model) {
- g_object_unref(e_select_names->model);
- e_select_names->model = NULL;
- }
-
- if (e_select_names->def) {
- g_free(e_select_names->def);
- e_select_names->def = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-GtkWidget*
-e_select_names_new (EvolutionShellClient *shell_client)
-{
- ESelectNames *e_select_names;
- const char *selector_types[] = { "contacts/*", NULL };
- char *contacts_uri;
- GtkWidget *button;
- EConfigListener *db;
-
- e_select_names = g_object_new (E_TYPE_SELECT_NAMES, NULL);
-
- db = e_book_get_config_database ();
- contacts_uri = e_config_listener_get_string_with_default (
- db, "/apps/evolution/addressbook/select_names/last_used_uri",
- NULL, NULL);
- if (!contacts_uri)
- contacts_uri = g_strdup (e_book_get_default_book_uri ());
-
- button = glade_xml_get_widget (e_select_names->gui, "folder-selector");
- evolution_folder_selector_button_construct (EVOLUTION_FOLDER_SELECTOR_BUTTON (button),
- shell_client,
- _("Find contact in"),
- contacts_uri,
- selector_types);
-
- addressbook_model_set_uri(e_select_names, e_select_names->model, contacts_uri);
-
- g_free (contacts_uri);
-
- return GTK_WIDGET (e_select_names);
-}
-
-static void
-button_clicked(GtkWidget *button, ESelectNamesChild *child)
-{
- real_add_address(child->names, child);
-}
-
-static void
-remove_address(ETable *table, int row, int col, GdkEvent *event, ESelectNamesChild *child)
-{
- e_select_names_model_delete (child->source, row);
-}
-
-struct _RightClickData {
- ESelectNamesChild *child;
- int row;
-};
-typedef struct _RightClickData RightClickData;
-
-static void
-remove_cb (GtkWidget *widget, void *data)
-{
- RightClickData *rcdata = (RightClickData *)data;
-
- e_select_names_model_delete (rcdata->child->source, rcdata->row);
-
- /* Free everything we've created */
- g_free (rcdata);
-}
-
-static void
-section_right_click_cb (ETable *et, int row, int col, GdkEvent *ev, ESelectNamesChild *child)
-{
- static EPopupMenu right_click_menu[] = {
- E_POPUP_ITEM (N_("Remove"), G_CALLBACK (remove_cb), 0),
- E_POPUP_TERMINATOR
- };
- RightClickData *rcdata = g_new0 (RightClickData, 1);
-
- rcdata->row = row;
- rcdata->child = child;
-
- e_popup_menu_run (right_click_menu, (GdkEvent *)ev, 0, 0, rcdata);
-}
-
-void
-e_select_names_add_section (ESelectNames *e_select_names,
- const char *name, const char *id,
- ESelectNamesModel *source)
-{
- ESelectNamesChild *child;
- GtkWidget *button;
- GtkWidget *label;
- GtkWidget *alignment;
- GtkTable *table;
- char *label_text;
- ETable *etable;
- ETableExtras *extras;
- ECell *string_cell;
-
- GtkWidget *sw;
-
- if (g_hash_table_lookup(e_select_names->children, id)) {
- return;
- }
-
- table = GTK_TABLE(glade_xml_get_widget (e_select_names->gui, "table-recipients"));
-
- child = g_new(ESelectNamesChild, 1);
-
- child->names = e_select_names;
- child->title = g_strdup (_(name));
-
- child->table_model = (ESelectNamesTableModel*)e_select_names_table_model_new (source);
-
- child->source = source;
- g_object_ref(child->source);
-
- e_select_names->child_count++;
-
- alignment = gtk_alignment_new(0, 0, 1, 0);
-
- label_text = g_strconcat (child->title, " ->", NULL);
-
- label = gtk_label_new ("");
-
- gtk_label_set_markup (GTK_LABEL(label), label_text);
-
- g_free (label_text);
-
- button = gtk_button_new ();
- gtk_container_add (GTK_CONTAINER (button), label);
- child->label = label;
- child->button = button;
-
- gtk_container_add(GTK_CONTAINER(alignment), button);
- gtk_widget_show_all(alignment);
- g_signal_connect(button, "clicked",
- G_CALLBACK(button_clicked), child);
- gtk_table_attach(table, alignment,
- 0, 1,
- e_select_names->child_count,
- e_select_names->child_count + 1,
- GTK_FILL, GTK_FILL,
- 0, 0);
-
- etable = e_table_scrolled_get_table (e_select_names->table);
- gtk_widget_set_sensitive (button, e_table_selected_count (etable) > 0);
-
- extras = e_table_extras_new ();
- string_cell = e_table_extras_get_cell (extras, "string");
-
- g_object_set (string_cell,
- "underline_column", 2,
- NULL);
-
- sw = e_table_scrolled_new_from_spec_file (E_TABLE_MODEL (child->table_model),
- extras,
- EVOLUTION_ETSPECDIR "/e-select-names-section.etspec",
- NULL);
- g_object_unref (extras);
-
- child->recipient_table = GTK_WIDGET (e_table_scrolled_get_table (E_TABLE_SCROLLED (sw)));
-
- g_signal_connect (child->recipient_table,
- "right_click",
- G_CALLBACK (section_right_click_cb),
- child);
-
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
-
- g_signal_connect(child->recipient_table, "double_click",
- G_CALLBACK(remove_address), child);
-
- child->changed_id = g_signal_connect (child->source,
- "changed",
- G_CALLBACK (sync_table_and_models),
- e_select_names);
-
- gtk_widget_show_all (sw);
-
- gtk_table_attach(table, sw,
- 1, 2,
- e_select_names->child_count,
- e_select_names->child_count + 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
- 0, 0);
-
- g_hash_table_insert(e_select_names->children, g_strdup(id), child);
-
- sync_table_and_models (child->source, e_select_names);
-}
-
-void
-e_select_names_set_default (ESelectNames *e_select_names,
- const char *id)
-{
- ESelectNamesChild *child;
-
- if (e_select_names->def) {
- child = g_hash_table_lookup(e_select_names->children, e_select_names->def);
- if (child) {
- GtkWidget *label = child->label;
-
- /* set the previous default to non-bold */
- gtk_label_set_markup (GTK_LABEL (label), child->title);
- }
- }
-
- g_free(e_select_names->def);
- e_select_names->def = g_strdup(id);
-
- if (e_select_names->def) {
- child = g_hash_table_lookup(e_select_names->children, e_select_names->def);
- if (child) {
- GtkWidget *label = child->label;
- char *markup = g_strconcat ("<b>", child->title, "</b>", NULL);
-
- /* set the new default to bold */
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
- }
- }
-}
diff --git a/addressbook/gui/component/select-names/e-select-names.etspec b/addressbook/gui/component/select-names/e-select-names.etspec
deleted file mode 100644
index 114f84cc8c..0000000000
--- a/addressbook/gui/component/select-names/e-select-names.etspec
+++ /dev/null
@@ -1,7 +0,0 @@
-<ETableSpecification no-headers="true" cursor-mode="line">
- <ETableColumn model_col= "44" _title="Name" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="collate" search="string"/>
- <ETableState>
- <column source="0"/>
- <grouping> <leaf column="0" ascending="true"/> </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/component/select-names/e-select-names.h b/addressbook/gui/component/select-names/e-select-names.h
deleted file mode 100644
index 8e672da92a..0000000000
--- a/addressbook/gui/component/select-names/e-select-names.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-select-names.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_SELECT_NAMES_H__
-#define __E_SELECT_NAMES_H__
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <gal/e-table/e-table.h>
-#include <gal/e-table/e-table-scrolled.h>
-
-#include "evolution-shell-client.h"
-#include "e-addressbook-model.h"
-
-#include "e-select-names-model.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* ESelectNames - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define E_TYPE_SELECT_NAMES (e_select_names_get_type ())
-#define E_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SELECT_NAMES, ESelectNames))
-#define E_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SELECT_NAMES, ESelectNamesClass))
-#define E_IS_SELECT_NAMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SELECT_NAMES))
-#define E_IS_SELECT_NAMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_SELECT_NAMES))
-
-typedef struct _ESelectNames ESelectNames;
-typedef struct _ESelectNamesClass ESelectNamesClass;
-typedef struct _ESelectNamesFolder ESelectNamesFolder;
-
-struct _ESelectNames
-{
- GtkDialog parent;
-
- /* item specific fields */
- GladeXML *gui;
-
- GHashTable *children; /* Of type char * to ESelectNamesChild */
- int child_count;
- ETableScrolled *table;
- ETableModel *adapter;
- ETableModel *without;
- EAddressbookModel *model;
- GtkWidget *categories;
- GtkWidget *select_entry;
- GtkWidget *status_message;
- char *def;
- ESelectNamesFolder *current_folder;
-
- /* signal handlers */
- gulong status_id;
- gulong search_id;
-};
-
-struct _ESelectNamesClass
-{
- GtkDialogClass parent_class;
-};
-
-
-GtkWidget *e_select_names_new (EvolutionShellClient *shell_client);
-GType e_select_names_get_type (void);
-
-void e_select_names_add_section (ESelectNames *e_select_names,
- const char *name,
- const char *id,
- ESelectNamesModel *source);
-void e_select_names_set_default (ESelectNames *e_select_names,
- const char *id);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_SELECT_NAMES_H__ */
diff --git a/addressbook/gui/component/select-names/e-simple-card-bonobo.c b/addressbook/gui/component/select-names/e-simple-card-bonobo.c
deleted file mode 100644
index 07203618b3..0000000000
--- a/addressbook/gui/component/select-names/e-simple-card-bonobo.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-simple-card-bonobo.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Ettore Perazzoli <ettore@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-simple-card-bonobo.h"
-
-#include <gal/util/e-util.h>
-
-#include "Evolution-Addressbook-SelectNames.h"
-
-
-#define PARENT_TYPE BONOBO_TYPE_OBJECT
-static BonoboObjectClass *parent_class = NULL;
-
-struct _ESimpleCardBonoboPrivate {
- ECardSimple *card_simple;
-};
-
-
-
-static GNOME_Evolution_Addressbook_SimpleCard_Arbitrary *
-impl_SimpleCard_get_arbitrary (PortableServer_Servant servant,
- const CORBA_char *key,
- CORBA_Environment *ev)
-{
- ESimpleCardBonobo *simple_card;
- ESimpleCardBonoboPrivate *priv;
- GNOME_Evolution_Addressbook_SimpleCard_Arbitrary *ret_val = GNOME_Evolution_Addressbook_SimpleCard_Arbitrary__alloc ();
-
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
- priv = simple_card->priv;
-
- if (priv->card_simple) {
- const ECardArbitrary *arbitrary = e_card_simple_get_arbitrary (priv->card_simple, key);
- ret_val->key = CORBA_string_dup (arbitrary->key);
- ret_val->value = CORBA_string_dup (arbitrary->value);
- ret_val->type = CORBA_string_dup (arbitrary->type);
- } else {
- ret_val->key = CORBA_string_dup ("");
- ret_val->value = CORBA_string_dup ("");
- ret_val->type = CORBA_string_dup ("");
- }
-
- return ret_val;
-}
-
-static void
-impl_SimpleCard_set_arbitrary (PortableServer_Servant servant,
- const CORBA_char *key,
- const CORBA_char *type,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
- ESimpleCardBonobo *simple_card;
- ESimpleCardBonoboPrivate *priv;
-
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
- priv = simple_card->priv;
-
- if (priv->card_simple) {
- e_card_simple_set_arbitrary (priv->card_simple, key, type, value);
- }
-}
-
-static CORBA_char *
-impl_SimpleCard_get (PortableServer_Servant servant,
- GNOME_Evolution_Addressbook_SimpleCard_Field field,
- CORBA_Environment *ev)
-{
- ESimpleCardBonobo *simple_card;
- ESimpleCardBonoboPrivate *priv;
-
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
- priv = simple_card->priv;
-
- if (priv->card_simple) {
- char *value = e_card_simple_get (priv->card_simple,
- field);
- char *ret_val = CORBA_string_dup (value ? value : "");
- g_free (value);
- return ret_val;
- } else {
- return CORBA_string_dup ("");
- }
-}
-
-static void
-impl_SimpleCard_set (PortableServer_Servant servant,
- GNOME_Evolution_Addressbook_SimpleCard_Field field,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
-
- ESimpleCardBonobo *simple_card;
- ESimpleCardBonoboPrivate *priv;
-
- simple_card = E_SIMPLE_CARD_BONOBO (bonobo_object (servant));
- priv = simple_card->priv;
-
- if (priv->card_simple) {
- e_card_simple_set (priv->card_simple,
- field,
- value);
- }
-}
-
-
-/* GtkObject methods. */
-
-static void
-impl_dispose (GObject *object)
-{
- ESimpleCardBonobo *simple_card;
- ESimpleCardBonoboPrivate *priv;
-
- simple_card = E_SIMPLE_CARD_BONOBO (object);
- priv = simple_card->priv;
-
- if (priv) {
- if (priv->card_simple) {
- g_object_unref (priv->card_simple);
- }
-
- g_free (priv);
- simple_card->priv = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-
-static void
-e_simple_card_bonobo_class_init (ESimpleCardBonoboClass *klass)
-{
- GObjectClass *object_class;
- POA_GNOME_Evolution_Addressbook_SimpleCard__epv *epv;
-
- object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_ref (BONOBO_TYPE_OBJECT);
-
- object_class->dispose = impl_dispose;
-
- epv = &klass->epv;
- epv->getArbitrary = impl_SimpleCard_get_arbitrary;
- epv->setArbitrary = impl_SimpleCard_set_arbitrary;
- epv->get = impl_SimpleCard_get;
- epv->set = impl_SimpleCard_set;
-}
-
-static void
-e_simple_card_bonobo_init (ESimpleCardBonobo *simple_card)
-{
- ESimpleCardBonoboPrivate *priv;
-
- priv = g_new (ESimpleCardBonoboPrivate, 1);
-
- priv->card_simple = NULL;
-
- simple_card->priv = priv;
-}
-
-
-void
-e_simple_card_bonobo_construct (ESimpleCardBonobo *simple_card,
- ECardSimple *card_simple)
-{
- g_return_if_fail (simple_card != NULL);
- g_return_if_fail (E_IS_SIMPLE_CARD_BONOBO (simple_card));
-
- simple_card->priv->card_simple = card_simple;
- g_object_ref (card_simple);
-}
-
-ESimpleCardBonobo *
-e_simple_card_bonobo_new (ECardSimple *card_simple)
-{
- ESimpleCardBonobo *simple_card;
-
- simple_card = g_object_new (E_TYPE_SIMPLE_CARD_BONOBO, NULL);
-
- e_simple_card_bonobo_construct (simple_card, card_simple);
-
- return simple_card;
-}
-
-
-BONOBO_TYPE_FUNC_FULL (
- ESimpleCardBonobo,
- GNOME_Evolution_Addressbook_SimpleCard,
- PARENT_TYPE,
- e_simple_card_bonobo);
diff --git a/addressbook/gui/component/select-names/e-simple-card-bonobo.h b/addressbook/gui/component/select-names/e-simple-card-bonobo.h
deleted file mode 100644
index 7bc2d65830..0000000000
--- a/addressbook/gui/component/select-names/e-simple-card-bonobo.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* e-simple-card-bonobo.h
- *
- * Copyright (C) 2000 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Ettore Perazzoli <ettore@ximian.com>
- * Chris Lahey <clahey@ximian.com>
- */
-
-#ifndef __E_SIMPLE_CARD_BONOBO_H__
-#define __E_SIMPLE_CARD_BONOBO_H__
-
-#include <bonobo/bonobo-object.h>
-
-#include "Evolution-Addressbook-SelectNames.h"
-#include <addressbook/backend/ebook/e-card-simple.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define E_TYPE_SIMPLE_CARD_BONOBO (e_simple_card_bonobo_get_type ())
-#define E_SIMPLE_CARD_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SIMPLE_CARD_BONOBO, ESimpleCardBonobo))
-#define E_SIMPLE_CARD_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SIMPLE_CARD_BONOBO, ESimpleCardBonoboClass))
-#define E_IS_SIMPLE_CARD_BONOBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SIMPLE_CARD_BONOBO))
-#define E_IS_SIMPLE_CARD_BONOBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SIMPLE_CARD_BONOBO))
-
-
-typedef struct _ESimpleCardBonobo ESimpleCardBonobo;
-typedef struct _ESimpleCardBonoboPrivate ESimpleCardBonoboPrivate;
-typedef struct _ESimpleCardBonoboClass ESimpleCardBonoboClass;
-
-struct _ESimpleCardBonobo {
- BonoboObject parent;
-
- ESimpleCardBonoboPrivate *priv;
-};
-
-struct _ESimpleCardBonoboClass {
- BonoboObjectClass parent_class;
-
- POA_GNOME_Evolution_Addressbook_SimpleCard__epv epv;
-};
-
-
-GType e_simple_card_bonobo_get_type (void);
-ESimpleCardBonobo *e_simple_card_bonobo_new (ECardSimple *card_simple);
-void e_simple_card_bonobo_construct (ESimpleCardBonobo *simple_card,
- ECardSimple *card_simple);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __E_SIMPLE_CARD_BONOBO_H__ */
diff --git a/addressbook/gui/component/select-names/recipient.glade b/addressbook/gui/component/select-names/recipient.glade
deleted file mode 100644
index edcf6bbab0..0000000000
--- a/addressbook/gui/component/select-names/recipient.glade
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkWindow" id="window1">
- <property name="visible">no</property>
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">yes</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child>
- <widget class="GtkHBox" id="hbox-top">
- <property name="homogeneous">no</property>
- <property name="spacing">4</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="xalign">1.08033e-07</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="text-button">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">-&gt;</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
diff --git a/addressbook/gui/component/select-names/select-names.glade b/addressbook/gui/component/select-names/select-names.glade
deleted file mode 100644
index 7ff1b4ebc7..0000000000
--- a/addressbook/gui/component/select-names/select-names.glade
+++ /dev/null
@@ -1,452 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-top">
- <property name="border_width">12</property>
- <property name="title" translatable="yes">Select Names</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">417</property>
- <property name="default_height">332</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button5">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-top">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator1">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table4">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Type a name into the entry, or
-select one from the list below:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-recipients">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Selected Contacts:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="entry-select">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-find">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Find</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="Custom" id="table-source">
- <property name="visible">True</property>
- <property name="creation_function">e_addressbook_create_ebook_table</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 10 Jun 2000 22:02:57 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="status-message">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">3</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkTable" id="table5">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Folder:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Category:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="Custom" id="custom-categories">
- <property name="visible">True</property>
- <property name="creation_function">e_select_names_create_categories</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 19 Feb 2002 23:06:24 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="folder-selector">
- <property name="visible">True</property>
- <property name="creation_function">e_addressbook_create_folder_selector</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 15 Jul 2002 02:21:32 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show Contacts</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/.cvsignore b/addressbook/gui/contact-editor/.cvsignore
deleted file mode 100644
index ddbd38bb6e..0000000000
--- a/addressbook/gui/contact-editor/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-contact-editor-test
-contact-editor.gladep
-e-contact-editor-marshal.c
-e-contact-editor-marshal.h
diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am
deleted file mode 100644
index c6738099b9..0000000000
--- a/addressbook/gui/contact-editor/Makefile.am
+++ /dev/null
@@ -1,60 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/ \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/widgets/e-table \
- -I$(top_builddir)/shell \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)\"" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"contact-editor\" \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecontacteditor.la
-
-libecontacteditor_la_SOURCES = \
- e-contact-editor-address.c \
- e-contact-editor-address.h \
- e-contact-editor-fullname.c \
- e-contact-editor-fullname.h \
- e-contact-editor-marshal.c \
- e-contact-editor.c \
- e-contact-editor.h \
- e-contact-save-as.c \
- e-contact-save-as.h \
- e-contact-quick-add.c \
- e-contact-quick-add.h
-
-# GLib marshalling cruft
-
-e-contact-editor-marshal.h: e-contact-editor-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=ece_marshal e-contact-editor-marshal.list --header > e-contact-editor-marshal.tmp \
- && mv e-contact-editor-marshal.tmp e-contact-editor-marshal.h ) \
- || ( rm -f e-contact-editor-marshal.tmp && exit 1 )
-
-e-contact-editor-marshal.c: e-contact-editor-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=ece_marshal e-contact-editor-marshal.list --body > e-contact-editor-marshal.tmp \
- && mv e-contact-editor-marshal.tmp e-contact-editor-marshal.c ) \
- || ( rm -f e-contact-editor-marshal.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-contact-editor-marshal.c e-contact-editor-marshal.h
-
-glade_DATA = \
- contact-editor.glade \
- fulladdr.glade \
- fullname.glade
-
-BUILT_SOURCES = $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST= $(glade_DATA) \
- e-contact-editor-marshal.list
diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade
deleted file mode 100644
index 2ef6954d10..0000000000
--- a/addressbook/gui/contact-editor/contact-editor.glade
+++ /dev/null
@@ -1,2317 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-<requires lib="bonobo"/>
-
-<widget class="GtkDialog" id="dialog2">
- <property name="border_width">2</property>
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button28">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button29">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button30">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table2">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">2</property>
-
- <child>
- <widget class="GtkEntry" id="entry2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkButton" id="button31">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button32">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Delete</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="clist1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="dialog-add-phone">
- <property name="title" translatable="yes">New phone type</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button43">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button44">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame-add-phone">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment9">
- <property name="border_width">9</property>
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkEntry" id="entry-add-phone">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">New phone type</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GnomeApp" id="contact editor">
- <property name="title" translatable="yes">Contact Editor</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="enable_layout_config">True</property>
-
- <child internal-child="dock">
- <widget class="BonoboDock" id="dock1">
- <property name="visible">True</property>
- <property name="allow_floating">True</property>
-
- <child>
- <widget class="GtkNotebook" id="notebook-contact-editor">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkTable" id="table-contact-editor-general">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">14</property>
- <property name="n_columns">8</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="entry-phone1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-phone2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-phone3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-phone4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-fullname">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Full _Name...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkButton" id="button-email1">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow1">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone4">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow5">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment7">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone2">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow3">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment8">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone1">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow2">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator4">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">8</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_padding">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-phone3">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow4">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-fullname">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-jobtitle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-company">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-email1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator5">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">4</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_padding">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo-file-as">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">True</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-file-as">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget3">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget4">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator6">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">4</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="y_padding">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment-htmlmail">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-htmlmail">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Wants to receive _HTML mail</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">expand|shrink|fill</property>
- <property name="y_options">shrink|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-address">
- <property name="visible">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkArrow" id="arrow6">
- <property name="visible">True</property>
- <property name="arrow_type">GTK_ARROW_DOWN</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">6</property>
- <property name="right_attach">7</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Business:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone1</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Home:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone2</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox3">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Business fa_x:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone3</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox4">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-phone4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Mobile:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-phone4</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox5">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-email1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Primary _email:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-email1</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox-business">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-address">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> B_usiness:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">text-address</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">6</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton-mailingaddress">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_This is the mailing address</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator9">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">4</property>
- <property name="top_attach">11</property>
- <property name="bottom_attach">12</property>
- <property name="y_padding">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator10">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">8</property>
- <property name="top_attach">11</property>
- <property name="bottom_attach">12</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox7">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="label-jobtitle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Job title:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-jobtitle</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom1">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:19:47 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom2">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">cellphone.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:02 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom3">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">envelope.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:19:51 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom4">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">house.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:06 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">5</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom10">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">globe.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:19:56 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-company">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Organi_zation:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-company</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-fulladdr">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_ddress...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="left_attach">5</property>
- <property name="right_attach">7</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="accellabel-fileas">
- <property name="visible">True</property>
- <property name="label" translatable="yes">File a_s:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-file-as</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="accellabel-web">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Web page address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-web</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment16">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkButton" id="button-categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Categories...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">12</property>
- <property name="bottom_attach">13</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom6">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">briefcase.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:09 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">12</property>
- <property name="bottom_attach">14</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment19">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkEntry" id="entry-categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">12</property>
- <property name="bottom_attach">13</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="text-address">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">7</property>
- <property name="right_attach">8</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">9</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="entry-web">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_editor_create_web</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 08 Feb 2003 09:14:46 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-contact-editor-details">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">9</property>
- <property name="n_columns">6</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-department">
- <property name="visible">True</property>
- <property name="label" translatable="yes">D_epartment:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-department</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-office">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Office:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-office</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-profession">
- <property name="visible">True</property>
- <property name="label" translatable="yes">P_rofession:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-profession</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-nickname">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Nickname:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-nickname</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-spouse">
- <property name="visible">True</property>
- <property name="label" translatable="yes">S_pouse:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-spouse</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-birthday">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Birthda_y:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">dateedit-birthday</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-assistant">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_ssistant's name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-assistant</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-manager">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Manager's name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-manager</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-anniversary">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Anni_versary:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">dateedit-anniversary</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-spouse">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-department">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-office">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-profession">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-nickname">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-assistant">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-manager">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator7">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">6</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-comments">
- <property name="visible">True</property>
- <property name="label" translatable="yes">No_tes:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">text-comments</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHSeparator" id="hseparator8">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">6</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom7">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">briefcase.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:13 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom8">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:16 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="text-comments">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">6</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom9">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">globe.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:19 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="dateedit-birthday">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">e_contact_editor_create_date</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 05 Jun 2001 02:36:27 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="dateedit-anniversary">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">e_contact_editor_create_date</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 05 Jun 2001 02:36:32 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">4</property>
- <property name="right_attach">6</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label16">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Details</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">7</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="Custom" id="custom12">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">globe.png</property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Thu, 18 May 2000 12:20:13 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">If this person publishes free/busy or other calendar information on the Internet, enter the address
-of that information here.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment18">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0.75</property>
- <property name="yscale">1</property>
-
- <child>
- <widget class="GtkTable" id="table-contact-editor-collaboration">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-caluri">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Public Calendar URL:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-caluri</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-fburl">
- <property name="visible">True</property>
- <property name="label" translatable="yes">F_ree/Busy URL:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-fburl</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="entry-caluri">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_editor_create_web</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 10 Feb 2003 20:37:57 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="entry-fburl">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_editor_create_web</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 10 Feb 2003 20:38:00 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Collaboration</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child internal-child="appbar">
- <widget class="GnomeAppBar" id="appbar1">
- <property name="visible">True</property>
- <property name="has_progress">True</property>
- <property name="has_status">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c
deleted file mode 100644
index f6a75bbfe5..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-address.c
+++ /dev/null
@@ -1,603 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-editor-address.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <e-contact-editor-address.h>
-
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnome/gnome-util.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtklabel.h>
-#include <string.h>
-#include <stdlib.h>
-#include <locale.h>
-
-static void e_contact_editor_address_init (EContactEditorAddress *card);
-static void e_contact_editor_address_class_init (EContactEditorAddressClass *klass);
-static void e_contact_editor_address_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_address_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_address_dispose (GObject *object);
-
-static void fill_in_info(EContactEditorAddress *editor);
-static void extract_info(EContactEditorAddress *editor);
-
-static GtkDialogClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_ADDRESS,
- PROP_EDITABLE
-};
-
-GType
-e_contact_editor_address_get_type (void)
-{
- static GType contact_editor_address_type = 0;
-
- if (!contact_editor_address_type) {
- static const GTypeInfo contact_editor_address_info = {
- sizeof (EContactEditorAddressClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_address_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditorAddress),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_address_init,
- };
-
- contact_editor_address_type = g_type_register_static (GTK_TYPE_DIALOG, "EContactEditorAddress", &contact_editor_address_info, 0);
- }
-
- return contact_editor_address_type;
-}
-
-static void
-e_contact_editor_address_class_init (EContactEditorAddressClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
-
- object_class->set_property = e_contact_editor_address_set_property;
- object_class->get_property = e_contact_editor_address_get_property;
- object_class->dispose = e_contact_editor_address_dispose;
-
- g_object_class_install_property (object_class, PROP_ADDRESS,
- g_param_spec_pointer ("address",
- _("Address"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-}
-
-static GList *
-add_to_tab_order(GList *list, GladeXML *gui, char *name)
-{
- GtkWidget *widget = glade_xml_get_widget(gui, name);
- return g_list_prepend(list, widget);
-}
-
-static void
-setup_tab_order(GladeXML *gui)
-{
- GtkWidget *container;
- GList *list = NULL;
-
- container = glade_xml_get_widget(gui, "table-checkaddress");
-
- if (container) {
- list = add_to_tab_order(list, gui, "entry-city");
- list = add_to_tab_order(list, gui, "entry-region");
- list = add_to_tab_order(list, gui, "entry-code");
- list = add_to_tab_order(list, gui, "combo-country");
- list = g_list_reverse(list);
- e_container_change_tab_order(GTK_CONTAINER(container), list);
- g_list_free(list);
- }
-}
-
-static char * countries [] = {
- N_("United States"),
- N_("Afghanistan"),
- N_("Albania"),
- N_("Algeria"),
- N_("American Samoa"),
- N_("Andorra"),
- N_("Angola"),
- N_("Anguilla"),
- N_("Antarctica"),
- N_("Antigua And Barbuda"),
- N_("Argentina"),
- N_("Armenia"),
- N_("Aruba"),
- N_("Australia"),
- N_("Austria"),
- N_("Azerbaijan"),
- N_("Bahamas"),
- N_("Bahrain"),
- N_("Bangladesh"),
- N_("Barbados"),
- N_("Belarus"),
- N_("Belgium"),
- N_("Belize"),
- N_("Benin"),
- N_("Bermuda"),
- N_("Bhutan"),
- N_("Bolivia"),
- N_("Bosnia And Herzegowina"),
- N_("Botswana"),
- N_("Bouvet Island"),
- N_("Brazil"),
- N_("British Indian Ocean Territory"),
- N_("Brunei Darussalam"),
- N_("Bulgaria"),
- N_("Burkina Faso"),
- N_("Burundi"),
- N_("Cambodia"),
- N_("Cameroon"),
- N_("Canada"),
- N_("Cape Verde"),
- N_("Cayman Islands"),
- N_("Central African Republic"),
- N_("Chad"),
- N_("Chile"),
- N_("China"),
- N_("Christmas Island"),
- N_("Cocos (Keeling) Islands"),
- N_("Colombia"),
- N_("Comoros"),
- N_("Congo"),
- N_("Congo"),
- N_("Cook Islands"),
- N_("Costa Rica"),
- N_("Cote d'Ivoire"),
- N_("Croatia"),
- N_("Cuba"),
- N_("Cyprus"),
- N_("Czech Republic"),
- N_("Denmark"),
- N_("Djibouti"),
- N_("Dominica"),
- N_("Dominican Republic"),
- N_("East Timor"),
- N_("Ecuador"),
- N_("Egypt"),
- N_("El Salvador"),
- N_("Equatorial Guinea"),
- N_("Eritrea"),
- N_("Estonia"),
- N_("Ethiopia"),
- N_("Falkland Islands"),
- N_("Faroe Islands"),
- N_("Fiji"),
- N_("Finland"),
- N_("France"),
- N_("French Guiana"),
- N_("French Polynesia"),
- N_("French Southern Territories"),
- N_("Gabon"),
- N_("Gambia"),
- N_("Georgia"),
- N_("Germany"),
- N_("Ghana"),
- N_("Gibraltar"),
- N_("Greece"),
- N_("Greenland"),
- N_("Grenada"),
- N_("Guadeloupe"),
- N_("Guam"),
- N_("Guatemala"),
- N_("Guinea"),
- N_("Guinea-bissau"),
- N_("Guyana"),
- N_("Haiti"),
- N_("Heard And McDonald Islands"),
- N_("Holy See"),
- N_("Honduras"),
- N_("Hong Kong"),
- N_("Hungary"),
- N_("Iceland"),
- N_("India"),
- N_("Indonesia"),
- N_("Ireland"),
- N_("Israel"),
- N_("Italy"),
- N_("Jamaica"),
- N_("Japan"),
- N_("Jordan"),
- N_("Kazakhstan"),
- N_("Kenya"),
- N_("Kiribati"),
- N_("Korea, Republic Of"),
- N_("Kuwait"),
- N_("Kyrgyzstan"),
- N_("Laos"),
- N_("Latvia"),
- N_("Lebanon"),
- N_("Lesotho"),
- N_("Liberia"),
- N_("Liechtenstein"),
- N_("Lithuania"),
- N_("Luxembourg"),
- N_("Macau"),
- N_("Macedonia"),
- N_("Madagascar"),
- N_("Malawi"),
- N_("Malaysia"),
- N_("Maldives"),
- N_("Mali"),
- N_("Malta"),
- N_("Marshall Islands"),
- N_("Martinique"),
- N_("Mauritania"),
- N_("Mauritius"),
- N_("Mayotte"),
- N_("Mexico"),
- N_("Micronesia"),
- N_("Moldova, Republic Of"),
- N_("Monaco"),
- N_("Mongolia"),
- N_("Montserrat"),
- N_("Morocco"),
- N_("Mozambique"),
- N_("Myanmar"),
- N_("Namibia"),
- N_("Nauru"),
- N_("Nepal"),
- N_("Netherlands"),
- N_("Netherlands Antilles"),
- N_("New Caledonia"),
- N_("New Zealand"),
- N_("Nicaragua"),
- N_("Niger"),
- N_("Nigeria"),
- N_("Niue"),
- N_("Norfolk Island"),
- N_("Northern Mariana Islands"),
- N_("Norway"),
- N_("Oman"),
- N_("Pakistan"),
- N_("Palau"),
- N_("Palestinian Territory"),
- N_("Panama"),
- N_("Papua New Guinea"),
- N_("Paraguay"),
- N_("Peru"),
- N_("Philippines"),
- N_("Pitcairn"),
- N_("Poland"),
- N_("Portugal"),
- N_("Puerto Rico"),
- N_("Qatar"),
- N_("Reunion"),
- N_("Romania"),
- N_("Russian Federation"),
- N_("Rwanda"),
- N_("Saint Kitts And Nevis"),
- N_("Saint Lucia"),
- N_("Saint Vincent And The Grena-dines"),
- N_("Samoa"),
- N_("San Marino"),
- N_("Sao Tome And Principe"),
- N_("Saudi Arabia"),
- N_("Senegal"),
- N_("Seychelles"),
- N_("Sierra Leone"),
- N_("Singapore"),
- N_("Slovakia"),
- N_("Slovenia"),
- N_("Solomon Islands"),
- N_("Somalia"),
- N_("South Africa"),
- N_("South Georgia And The South Sandwich Islands"),
- N_("Spain"),
- N_("Sri Lanka"),
- N_("St. Helena"),
- N_("St. Pierre And Miquelon"),
- N_("Sudan"),
- N_("Suriname"),
- N_("Svalbard And Jan Mayen Islands"),
- N_("Swaziland"),
- N_("Sweden"),
- N_("Switzerland"),
- N_("Taiwan"),
- N_("Tajikistan"),
- N_("Tanzania, United Republic Of"),
- N_("Thailand"),
- N_("Togo"),
- N_("Tokelau"),
- N_("Tonga"),
- N_("Trinidad And Tobago"),
- N_("Tunisia"),
- N_("Turkey"),
- N_("Turkmenistan"),
- N_("Turks And Caicos Islands"),
- N_("Tuvalu"),
- N_("Uganda"),
- N_("Ukraine"),
- N_("United Arab Emirates"),
- N_("United Kingdom"),
- N_("United States Minor Outlying Islands"),
- N_("Uruguay"),
- N_("Uzbekistan"),
- N_("Vanuatu"),
- N_("Venezuela"),
- N_("Viet Nam"),
- N_("Virgin Islands, British"),
- N_("Virgin Islands, U.S."),
- N_("Wallis And Futuna Islands"),
- N_("Western Sahara"),
- N_("Yemen"),
- N_("Yugoslavia"),
- N_("Zambia"),
- N_("Zimbabwe"),
- NULL
-};
-
-static int
-compare_func (const void *voida, const void *voidb)
-{
- char * const *stringa = voida, * const *stringb = voidb;
-
- return strcoll (*stringa, *stringb);
-}
-
-static void
-fill_in_countries (GladeXML *gui)
-{
- GtkCombo *combo;
- combo = (GtkCombo *) glade_xml_get_widget(gui, "combo-country");
- if (combo && GTK_IS_COMBO (combo)) {
- static gboolean sorted = FALSE;
- static GList *country_list;
- if (!sorted) {
- int i;
- char *locale;
-
- for (i = 0; countries[i]; i++) {
- countries[i] = _(countries[i]);
- }
-
- locale = setlocale (LC_COLLATE, NULL);
- qsort (countries + 1, i - 1, sizeof (countries[0]), compare_func);
- country_list = NULL;
- for (i = 0; countries[i]; i++) {
- country_list = g_list_prepend (country_list, countries[i]);
- }
- country_list = g_list_reverse (country_list);
- sorted = TRUE;
- }
- gtk_combo_set_popdown_strings (combo, country_list);
- }
-}
-
-static void
-e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address)
-{
- GladeXML *gui;
- GtkWidget *widget;
- char *icon_path;
-
- gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_address),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_address), TRUE);
-
- e_contact_editor_address->address = NULL;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/fulladdr.glade", NULL, NULL);
- e_contact_editor_address->gui = gui;
-
- setup_tab_order (gui);
- fill_in_countries (gui);
-
- widget = glade_xml_get_widget(gui, "dialog-checkaddress");
- gtk_window_set_title (GTK_WINDOW (e_contact_editor_address),
- GTK_WINDOW (widget)->title);
-
- widget = glade_xml_get_widget(gui, "table-checkaddress");
- g_object_ref(widget);
- gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_address)->vbox), widget, TRUE, TRUE, 0);
- g_object_unref(widget);
-
- icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png");
- gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_address), icon_path);
- g_free (icon_path);
-}
-
-void
-e_contact_editor_address_dispose (GObject *object)
-{
- EContactEditorAddress *e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS(object);
-
- if (e_contact_editor_address->gui) {
- g_object_unref(e_contact_editor_address->gui);
- e_contact_editor_address->gui = NULL;
- }
-
- if (e_contact_editor_address->address) {
- e_card_delivery_address_unref(e_contact_editor_address->address);
- e_contact_editor_address->address = NULL;
- }
-}
-
-GtkWidget*
-e_contact_editor_address_new (const ECardDeliveryAddress *address)
-{
- GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_ADDRESS, NULL);
- g_object_set (widget,
- "address", address,
- NULL);
- return widget;
-}
-
-static void
-e_contact_editor_address_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- EContactEditorAddress *e_contact_editor_address;
-
- e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS (object);
-
- switch (prop_id){
- case PROP_ADDRESS:
- e_card_delivery_address_unref(e_contact_editor_address->address);
- e_contact_editor_address->address = e_card_delivery_address_copy(g_value_get_pointer (value));
- fill_in_info(e_contact_editor_address);
- break;
- case PROP_EDITABLE: {
- int i;
- char *widget_names[] = {
- "entry-street",
- "entry-city",
- "entry-ext",
- "entry-po",
- "entry-region",
- "combo-country",
- "entry-code",
- "label-street",
- "label-city",
- "label-ext",
- "label-po",
- "label-region",
- "label-country",
- "label-code",
- NULL
- };
- e_contact_editor_address->editable = g_value_get_boolean (value) ? TRUE : FALSE;
- for (i = 0; widget_names[i] != NULL; i ++) {
- GtkWidget *w = glade_xml_get_widget(e_contact_editor_address->gui, widget_names[i]);
- if (GTK_IS_ENTRY (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (w),
- e_contact_editor_address->editable);
- }
- else if (GTK_IS_COMBO (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (w)->entry),
- e_contact_editor_address->editable);
- gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_address->editable);
- }
- else if (GTK_IS_LABEL (w)) {
- gtk_widget_set_sensitive (w, e_contact_editor_address->editable);
- }
- }
- break;
- }
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_editor_address_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- EContactEditorAddress *e_contact_editor_address;
-
- e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS (object);
-
- switch (prop_id) {
- case PROP_ADDRESS:
- extract_info(e_contact_editor_address);
- g_value_set_pointer (value, e_card_delivery_address_ref(e_contact_editor_address->address));
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor_address->editable ? TRUE : FALSE);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-fill_in_field(EContactEditorAddress *editor, char *field, char *string)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry) {
- if (string)
- gtk_entry_set_text(entry, string);
- else
- gtk_entry_set_text(entry, "");
- }
-}
-
-static void
-fill_in_info(EContactEditorAddress *editor)
-{
- ECardDeliveryAddress *address = editor->address;
- if (address) {
- fill_in_field(editor, "entry-street" , address->street );
- fill_in_field(editor, "entry-po" , address->po );
- fill_in_field(editor, "entry-ext" , address->ext );
- fill_in_field(editor, "entry-city" , address->city );
- fill_in_field(editor, "entry-region" , address->region );
- fill_in_field(editor, "entry-code" , address->code );
- fill_in_field(editor, "entry-country", address->country);
- }
-}
-
-static char *
-extract_field(EContactEditorAddress *editor, char *field)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry)
- return g_strdup (gtk_entry_get_text(entry));
- else
- return NULL;
-}
-
-static void
-extract_info(EContactEditorAddress *editor)
-{
- ECardDeliveryAddress *address = editor->address;
- if (!address) {
- address = e_card_delivery_address_new();
- editor->address = address;
- }
- address->street = extract_field(editor, "entry-street" );
- address->po = extract_field(editor, "entry-po" );
- address->ext = extract_field(editor, "entry-ext" );
- address->city = extract_field(editor, "entry-city" );
- address->region = extract_field(editor, "entry-region" );
- address->code = extract_field(editor, "entry-code" );
- address->country = extract_field(editor, "entry-country");
-}
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.h b/addressbook/gui/contact-editor/e-contact-editor-address.h
deleted file mode 100644
index 7faab47a4f..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-address.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-editor-address.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_EDITOR_ADDRESS_H__
-#define __E_CONTACT_EDITOR_ADDRESS_H__
-
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <ebook/e-card.h>
-
-G_BEGIN_DECLS
-
-/* EContactEditorAddress - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * name ECardName * RW The card currently being edited. Returns a copy.
- */
-
-#define E_TYPE_CONTACT_EDITOR_ADDRESS (e_contact_editor_address_get_type ())
-#define E_CONTACT_EDITOR_ADDRESS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_EDITOR_ADDRESS, EContactEditorAddress))
-#define E_CONTACT_EDITOR_ADDRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_EDITOR_ADDRESS, EContactEditorAddressClass))
-#define E_IS_CONTACT_EDITOR_ADDRESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_EDITOR_ADDRESS))
-#define E_IS_CONTACT_EDITOR_ADDRESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_EDITOR_ADDRESS))
-
-
-typedef struct _EContactEditorAddress EContactEditorAddress;
-typedef struct _EContactEditorAddressClass EContactEditorAddressClass;
-
-struct _EContactEditorAddress
-{
- GtkDialog parent;
-
- /* item specific fields */
- ECardDeliveryAddress *address;
-
- guint editable : 1;
-
- GladeXML *gui;
-};
-
-struct _EContactEditorAddressClass
-{
- GtkDialogClass parent_class;
-};
-
-
-GtkWidget *e_contact_editor_address_new(const ECardDeliveryAddress *name);
-GType e_contact_editor_address_get_type (void);
-
-G_END_DECLS
-
-#endif /* __E_CONTACT_EDITOR_ADDRESS_H__ */
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
deleted file mode 100644
index 917a8fd075..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-editor-fullname.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "e-contact-editor-fullname.h"
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-
-static void e_contact_editor_fullname_init (EContactEditorFullname *card);
-static void e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass);
-static void e_contact_editor_fullname_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_fullname_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_fullname_dispose (GObject *object);
-
-static void fill_in_info(EContactEditorFullname *editor);
-static void extract_info(EContactEditorFullname *editor);
-
-static GtkDialogClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_NAME,
- PROP_EDITABLE
-};
-
-GType
-e_contact_editor_fullname_get_type (void)
-{
- static GType contact_editor_fullname_type = 0;
-
- if (!contact_editor_fullname_type) {
- static const GTypeInfo contact_editor_fullname_info = {
- sizeof (EContactEditorFullnameClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_fullname_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditorFullname),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_fullname_init,
- };
-
- contact_editor_fullname_type = g_type_register_static (GTK_TYPE_DIALOG, "EContactEditorFullname", &contact_editor_fullname_info, 0);
- }
-
- return contact_editor_fullname_type;
-}
-
-static void
-e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
-
- object_class->set_property = e_contact_editor_fullname_set_property;
- object_class->get_property = e_contact_editor_fullname_get_property;
- object_class->dispose = e_contact_editor_fullname_dispose;
-
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_pointer ("name",
- _("Name"),
- /*_( */"XXX blurb" /*)*/,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-}
-
-static void
-e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullname)
-{
- GladeXML *gui;
- GtkWidget *widget;
- char *icon_path;
-
- gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_fullname),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_window_set_resizable(GTK_WINDOW(e_contact_editor_fullname), TRUE);
-
- e_contact_editor_fullname->name = NULL;
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/fullname.glade", NULL, NULL);
- e_contact_editor_fullname->gui = gui;
-
- widget = glade_xml_get_widget(gui, "dialog-checkfullname");
- gtk_window_set_title (GTK_WINDOW (e_contact_editor_fullname),
- GTK_WINDOW (widget)->title);
-
- widget = glade_xml_get_widget(gui, "table-checkfullname");
- g_object_ref(widget);
- gtk_container_remove(GTK_CONTAINER(widget->parent), widget);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0);
- g_object_unref(widget);
-
- icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png");
- gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_fullname), icon_path);
- g_free (icon_path);
-}
-
-void
-e_contact_editor_fullname_dispose (GObject *object)
-{
- EContactEditorFullname *e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME(object);
-
- if (e_contact_editor_fullname->gui) {
- g_object_unref(e_contact_editor_fullname->gui);
- e_contact_editor_fullname->gui = NULL;
- }
-
- if (e_contact_editor_fullname->name) {
- e_card_name_unref(e_contact_editor_fullname->name);
- e_contact_editor_fullname->name = NULL;
- }
-}
-
-GtkWidget*
-e_contact_editor_fullname_new (const ECardName *name)
-{
- GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL);
- g_object_set (widget,
- "name", name,
- NULL);
- return widget;
-}
-
-static void
-e_contact_editor_fullname_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- EContactEditorFullname *e_contact_editor_fullname;
-
- e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object);
-
- switch (prop_id){
- case PROP_NAME:
- e_card_name_unref(e_contact_editor_fullname->name);
- e_contact_editor_fullname->name = e_card_name_copy(g_value_get_pointer (value));
- fill_in_info(e_contact_editor_fullname);
- break;
- case PROP_EDITABLE: {
- int i;
- char *widget_names[] = {
- "combo-title",
- "combo-suffix",
- "entry-first",
- "entry-middle",
- "entry-last",
- "label-title",
- "label-suffix",
- "label-first",
- "label-middle",
- "label-last",
- NULL
- };
- e_contact_editor_fullname->editable = g_value_get_boolean (value) ? TRUE : FALSE;
- for (i = 0; widget_names[i] != NULL; i ++) {
- GtkWidget *w = glade_xml_get_widget(e_contact_editor_fullname->gui, widget_names[i]);
- if (GTK_IS_ENTRY (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (w),
- e_contact_editor_fullname->editable);
- }
- else if (GTK_IS_COMBO (w)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (w)->entry),
- e_contact_editor_fullname->editable);
- gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_fullname->editable);
- }
- else if (GTK_IS_LABEL (w)) {
- gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable);
- }
- }
- break;
- }
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_editor_fullname_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- EContactEditorFullname *e_contact_editor_fullname;
-
- e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME (object);
-
- switch (prop_id) {
- case PROP_NAME:
- extract_info(e_contact_editor_fullname);
- g_value_set_pointer (value, e_card_name_ref(e_contact_editor_fullname->name));
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor_fullname->editable ? TRUE : FALSE);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-fill_in_field(EContactEditorFullname *editor, char *field, char *string)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry) {
- if (string)
- gtk_entry_set_text(entry, string);
- else
- gtk_entry_set_text(entry, "");
- }
-}
-
-static void
-fill_in_info(EContactEditorFullname *editor)
-{
- ECardName *name = editor->name;
- if (name) {
- fill_in_field(editor, "entry-title", name->prefix);
- fill_in_field(editor, "entry-first", name->given);
- fill_in_field(editor, "entry-middle", name->additional);
- fill_in_field(editor, "entry-last", name->family);
- fill_in_field(editor, "entry-suffix", name->suffix);
- }
-}
-
-static char *
-extract_field(EContactEditorFullname *editor, char *field)
-{
- GtkEntry *entry = GTK_ENTRY(glade_xml_get_widget(editor->gui, field));
- if (entry)
- return g_strdup (gtk_entry_get_text(entry));
- else
- return NULL;
-}
-
-static void
-extract_info(EContactEditorFullname *editor)
-{
- ECardName *name = editor->name;
- if (!name) {
- name = e_card_name_new();
- editor->name = name;
- }
-
- name->prefix = extract_field(editor, "entry-title" );
- name->given = extract_field(editor, "entry-first" );
- name->additional = extract_field(editor, "entry-middle");
- name->family = extract_field(editor, "entry-last" );
- name->suffix = extract_field(editor, "entry-suffix");
-}
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.h b/addressbook/gui/contact-editor/e-contact-editor-fullname.h
deleted file mode 100644
index 3c8e055a96..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-editor-fullname.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_EDITOR_FULLNAME_H__
-#define __E_CONTACT_EDITOR_FULLNAME_H__
-
-#include <gtk/gtkdialog.h>
-#include <glade/glade.h>
-#include <ebook/e-card.h>
-
-G_BEGIN_DECLS
-
-/* EContactEditorFullname - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * name ECardName * RW The card currently being edited. Returns a copy.
- */
-
-#define E_TYPE_CONTACT_EDITOR_FULLNAME (e_contact_editor_fullname_get_type ())
-#define E_CONTACT_EDITOR_FULLNAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_EDITOR_FULLNAME, EContactEditorFullname))
-#define E_CONTACT_EDITOR_FULLNAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_EDITOR_FULLNAME, EContactEditorFullnameClass))
-#define E_IS_CONTACT_EDITOR_FULLNAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_EDITOR_FULLNAME))
-#define E_IS_CONTACT_EDITOR_FULLNAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_EDITOR_FULLNAME))
-
-
-typedef struct _EContactEditorFullname EContactEditorFullname;
-typedef struct _EContactEditorFullnameClass EContactEditorFullnameClass;
-
-struct _EContactEditorFullname
-{
- GtkDialog parent;
-
- /* item specific fields */
- ECardName *name;
- GladeXML *gui;
-
- /* Whether the dialog will accept modifications */
- guint editable : 1;
-};
-
-struct _EContactEditorFullnameClass
-{
- GtkDialogClass parent_class;
-};
-
-
-GtkWidget *e_contact_editor_fullname_new(const ECardName *name);
-GType e_contact_editor_fullname_get_type (void);
-
-G_END_DECLS
-
-#endif /* __E_CONTACT_EDITOR_FULLNAME_H__ */
diff --git a/addressbook/gui/contact-editor/e-contact-editor-marshal.list b/addressbook/gui/contact-editor/e-contact-editor-marshal.list
deleted file mode 100644
index 58b2640de5..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor-marshal.list
+++ /dev/null
@@ -1,2 +0,0 @@
-NONE:INT,OBJECT
-NONE:NONE
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
deleted file mode 100644
index 28443887f5..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ /dev/null
@@ -1,2753 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-contact-editor.h"
-
-#include <string.h>
-#include <time.h>
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <gtk/gtkcombo.h>
-#include <gtk/gtktextview.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-#include <libgnomeui/gnome-popup-menu.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <libgnome/gnome-i18n.h>
-
-#include <bonobo/bonobo-ui-container.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-window.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gal/widgets/e-categories.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/e-text/e-entry.h>
-
-#include <e-util/e-categories-master-list-wombat.h>
-
-#include "addressbook/printing/e-contact-print.h"
-#include "addressbook/printing/e-contact-print-envelope.h"
-#include "addressbook/gui/widgets/e-addressbook-util.h"
-#include "e-util/e-gui-utils.h"
-#include "widgets/misc/e-dateedit.h"
-#include "widgets/misc/e-url-entry.h"
-#include "shell/evolution-shell-component-utils.h"
-
-#include "e-card-merging.h"
-
-#include "e-contact-editor-address.h"
-#include "e-contact-editor-fullname.h"
-#include "e-contact-editor-marshal.h"
-#include "e-contact-save-as.h"
-
-/* Signal IDs */
-enum {
- CARD_ADDED,
- CARD_MODIFIED,
- CARD_DELETED,
- EDITOR_CLOSED,
- LAST_SIGNAL
-};
-
-static void e_contact_editor_init (EContactEditor *card);
-static void e_contact_editor_class_init (EContactEditorClass *klass);
-static void e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_editor_dispose (GObject *object);
-
-static void _email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
-static void _phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
-static void _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor);
-static void find_address_mailing (EContactEditor *editor);
-static void enable_writable_fields(EContactEditor *editor);
-static void set_editable(EContactEditor *editor);
-static void fill_in_info(EContactEditor *editor);
-static void extract_info(EContactEditor *editor);
-static void set_fields(EContactEditor *editor);
-static void set_address_field(EContactEditor *editor, int result);
-static void add_field_callback(GtkWidget *widget, EContactEditor *editor);
-static void command_state_changed (EContactEditor *ce);
-static void widget_changed (GtkWidget *widget, EContactEditor *editor);
-static void close_dialog (EContactEditor *ce);
-static void enable_widget (GtkWidget *widget, gboolean enabled);
-
-static GtkObjectClass *parent_class = NULL;
-
-static guint contact_editor_signals[LAST_SIGNAL];
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_CARD,
- PROP_IS_NEW_CARD,
- PROP_EDITABLE,
- PROP_CHANGED,
- PROP_WRITABLE_FIELDS
-};
-
-enum {
- DYNAMIC_LIST_EMAIL,
- DYNAMIC_LIST_PHONE,
- DYNAMIC_LIST_ADDRESS
-};
-
-static GSList *all_contact_editors = NULL;
-
-GType
-e_contact_editor_get_type (void)
-{
- static GType contact_editor_type = 0;
-
- if (!contact_editor_type) {
- static const GTypeInfo contact_editor_info = {
- sizeof (EContactEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_editor_init,
- };
-
- contact_editor_type = g_type_register_static (GTK_TYPE_OBJECT, "EContactEditor", &contact_editor_info, 0);
- }
-
- return contact_editor_type;
-}
-
-static void
-e_contact_editor_class_init (EContactEditorClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_OBJECT);
-
- object_class->set_property = e_contact_editor_set_property;
- object_class->get_property = e_contact_editor_get_property;
- object_class->dispose = e_contact_editor_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("Card"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_IS_NEW_CARD,
- g_param_spec_boolean ("is_new_card",
- _("Is New Card"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WRITABLE_FIELDS,
- g_param_spec_object ("writable_fields",
- _("Writable Fields"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_LIST,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CHANGED,
- g_param_spec_boolean ("changed",
- _("Changed"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- contact_editor_signals[CARD_ADDED] =
- g_signal_new ("card_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, card_added),
- NULL, NULL,
- ece_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_editor_signals[CARD_MODIFIED] =
- g_signal_new ("card_modified",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, card_modified),
- NULL, NULL,
- ece_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_editor_signals[CARD_DELETED] =
- g_signal_new ("card_deleted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, card_deleted),
- NULL, NULL,
- ece_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_editor_signals[EDITOR_CLOSED] =
- g_signal_new ("editor_closed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactEditorClass, editor_closed),
- NULL, NULL,
- ece_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-connect_arrow_button_signal (EContactEditor *editor, gchar *button_xml, GCallback func)
-{
- GladeXML *gui = editor->gui;
- GtkWidget *button = glade_xml_get_widget(gui, button_xml);
- if (button && GTK_IS_BUTTON(button)) {
- g_signal_connect(button, "button_press_event", func, editor);
- }
-}
-
-static void
-connect_arrow_button_signals (EContactEditor *editor)
-{
- connect_arrow_button_signal(editor, "button-phone1", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone2", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone3", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-phone4", G_CALLBACK (_phone_arrow_pressed));
- connect_arrow_button_signal(editor, "button-address", G_CALLBACK (_address_arrow_pressed));
- connect_arrow_button_signal(editor, "button-email1", G_CALLBACK (_email_arrow_pressed));
-}
-
-static void
-wants_html_changed (GtkWidget *widget, EContactEditor *editor)
-{
- gboolean wants_html;
- g_object_get (widget,
- "active", &wants_html,
- NULL);
- g_object_set (editor->card,
- "wants_html", wants_html,
- NULL);
-
- widget_changed (widget, editor);
-}
-
-static void
-phone_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- int which;
- GtkEntry *entry = GTK_ENTRY(widget);
- ECardPhone *phone;
-
- if ( widget == glade_xml_get_widget(editor->gui, "entry-phone1") ) {
- which = 1;
- } else if ( widget == glade_xml_get_widget(editor->gui, "entry-phone2") ) {
- which = 2;
- } else if ( widget == glade_xml_get_widget(editor->gui, "entry-phone3") ) {
- which = 3;
- } else if ( widget == glade_xml_get_widget(editor->gui, "entry-phone4") ) {
- which = 4;
- } else
- return;
- phone = e_card_phone_new();
- phone->number = g_strdup (gtk_entry_get_text(entry));
- e_card_simple_set_phone(editor->simple, editor->phone_choice[which - 1], phone);
- e_card_phone_unref(phone);
- set_fields(editor);
-
- widget_changed (widget, editor);
-}
-
-static void
-email_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- const gchar *string;
- GtkEntry *entry = GTK_ENTRY(widget);
-
- string = gtk_entry_get_text(entry);
-
- e_card_simple_set_email(editor->simple, editor->email_choice, string);
-
- widget_changed (widget, editor);
-}
-
-static void
-address_text_changed (GtkTextBuffer *buffer, EContactEditor *editor)
-{
- ECardAddrLabel *address;
- GtkTextIter start_iter, end_iter;
-
- if (editor->address_choice == -1)
- return;
-
- address = e_card_address_label_new();
-
- if (editor->address_mailing == editor->address_choice || editor->address_mailing == -1) {
- GtkWidget *check;
-
- address->flags |= E_CARD_ADDR_DEFAULT;
-
- check = glade_xml_get_widget(editor->gui, "checkbutton-mailingaddress");
- if (check && GTK_IS_CHECK_BUTTON (check)) {
- g_signal_handlers_block_matched (check,
- G_SIGNAL_MATCH_DATA,
- 0, 0,
- NULL, NULL, editor);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
- g_signal_handlers_unblock_matched (check,
- G_SIGNAL_MATCH_DATA,
- 0, 0,
- NULL, NULL, editor);
- }
- }
-
- gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (buffer), &start_iter);
- gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (buffer), &end_iter);
-
- address->data = gtk_text_buffer_get_text (GTK_TEXT_BUFFER (buffer), &start_iter, &end_iter, FALSE);
-
- e_card_simple_set_address(editor->simple, editor->address_choice, address);
- e_card_address_label_unref(address);
-
- widget_changed (NULL, editor);
-}
-
-
-static void
-address_mailing_changed (GtkWidget *widget, EContactEditor *editor)
-{
- const ECardDeliveryAddress *curr;
- ECardDeliveryAddress *address;
- gboolean mailing_address;
-
- if (editor->address_choice == -1)
- return;
-
- mailing_address = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
- /* Mark the current address as the mailing address */
- curr = e_card_simple_get_delivery_address (editor->simple,
- editor->address_choice);
-
- address = e_card_delivery_address_copy (curr);
-
- if (!address)
- address = e_card_delivery_address_new ();
-
- if (mailing_address)
- address->flags |= E_CARD_ADDR_DEFAULT;
- else
- address->flags &= ~E_CARD_ADDR_DEFAULT;
-
- e_card_simple_set_delivery_address(editor->simple, editor->address_choice, address);
- e_card_delivery_address_unref (address);
-
- /* Unset the previous mailing address flag */
- if (mailing_address && editor->address_mailing != -1) {
- const ECardDeliveryAddress *curr;
-
- curr = e_card_simple_get_delivery_address(editor->simple,
- editor->address_mailing);
- address = e_card_delivery_address_copy (curr);
- address->flags &= ~E_CARD_ADDR_DEFAULT;
- e_card_simple_set_delivery_address(editor->simple,
- editor->address_mailing,
- address);
- e_card_delivery_address_unref (address);
- }
-
- /* Remember the new mailing address */
- if (mailing_address)
- editor->address_mailing = editor->address_choice;
- else
- editor->address_mailing = -1;
-
- widget_changed (widget, editor);
-}
-
-
-/* This function tells you whether name_to_style will make sense. */
-static gboolean
-style_makes_sense(const ECardName *name, char *company, int style)
-{
- switch (style) {
- case 0: /* Fall Through */
- case 1:
- return TRUE;
- case 2:
- if (company && *company)
- return TRUE;
- else
- return FALSE;
- case 3: /* Fall Through */
- case 4:
- if (company && *company && name && ((name->given && *name->given) || (name->family && *name->family)))
- return TRUE;
- else
- return FALSE;
- default:
- return FALSE;
- }
-}
-
-static char *
-name_to_style(const ECardName *name, char *company, int style)
-{
- char *string;
- char *strings[4], **stringptr;
- char *substring;
- switch (style) {
- case 0:
- stringptr = strings;
- if (name) {
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- }
- *stringptr = NULL;
- string = g_strjoinv(", ", strings);
- break;
- case 1:
- stringptr = strings;
- if (name) {
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- }
- *stringptr = NULL;
- string = g_strjoinv(" ", strings);
- break;
- case 2:
- string = g_strdup(company);
- break;
- case 3: /* Fall Through */
- case 4:
- stringptr = strings;
- if (name) {
- if (name->family && *name->family)
- *(stringptr++) = name->family;
- if (name->given && *name->given)
- *(stringptr++) = name->given;
- }
- *stringptr = NULL;
- substring = g_strjoinv(", ", strings);
- if (!(company && *company))
- company = "";
- if (style == 3)
- string = g_strdup_printf("%s (%s)", substring, company);
- else
- string = g_strdup_printf("%s (%s)", company, substring);
- g_free(substring);
- break;
- default:
- string = g_strdup("");
- }
- return string;
-}
-
-static int
-file_as_get_style (EContactEditor *editor)
-{
- GtkEntry *file_as = GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-file-as"));
- char *filestring;
- char *trystring;
- ECardName *name = editor->name;
- int i;
- int style;
-
- if (!(file_as && GTK_IS_ENTRY(file_as)))
- return -1;
-
- filestring = g_strdup (gtk_entry_get_text(file_as));
-
- style = -1;
- for (i = 0; i < 5; i++) {
- trystring = name_to_style(name, editor->company, i);
- if (!strcmp(trystring, filestring)) {
- g_free(trystring);
- g_free(filestring);
- return i;
- }
- g_free(trystring);
- }
- g_free (filestring);
- return -1;
-}
-
-static void
-file_as_set_style(EContactEditor *editor, int style)
-{
- char *string;
- int i;
- GList *strings = NULL;
- GtkEntry *file_as = GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-file-as"));
- GtkWidget *widget;
-
-
- if (!(file_as && GTK_IS_ENTRY(file_as)))
- return;
-
- if (style == -1) {
- string = g_strdup (gtk_entry_get_text(file_as));
- strings = g_list_append(strings, string);
- }
-
- widget = glade_xml_get_widget(editor->gui, "combo-file-as");
-
- for (i = 0; i < 5; i++) {
- if (style_makes_sense(editor->name, editor->company, i)) {
- char *u;
- u = name_to_style(editor->name, editor->company, i);
- if (u) strings = g_list_append(strings, u);
- }
- }
-
- if (widget && GTK_IS_COMBO(widget)) {
- GtkCombo *combo = GTK_COMBO(widget);
- gtk_combo_set_popdown_strings(combo, strings);
- g_list_foreach(strings, (GFunc) g_free, NULL);
- g_list_free(strings);
- }
-
- if (style != -1) {
- string = name_to_style(editor->name, editor->company, style);
- gtk_entry_set_text(file_as, string);
- g_free(string);
- }
-}
-
-static void
-name_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- int style = 0;
- const char *string;
-
- style = file_as_get_style(editor);
-
- e_card_name_unref(editor->name);
-
- string = gtk_entry_get_text (GTK_ENTRY(widget));
- editor->name = e_card_name_from_string(string);
-
- file_as_set_style(editor, style);
-
- widget_changed (widget, editor);
-}
-
-static void
-company_entry_changed (GtkWidget *widget, EContactEditor *editor)
-{
- int style = 0;
-
- style = file_as_get_style(editor);
-
- g_free(editor->company);
-
- editor->company = g_strdup (gtk_entry_get_text(GTK_ENTRY(widget)));
-
- file_as_set_style(editor, style);
-
- widget_changed (widget, editor);
-}
-
-static void
-field_changed (GtkWidget *widget, EContactEditor *editor)
-{
- if (!editor->changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
-}
-
-static void
-set_entry_changed_signal_phone(EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (phone_entry_changed), editor);
-}
-
-static void
-set_entry_changed_signal_email(EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (email_entry_changed), editor);
-}
-
-static void
-widget_changed (GtkWidget *widget, EContactEditor *editor)
-{
- if (!editor->editable) {
- g_warning ("non-editable contact editor has an editable field in it.");
- return;
- }
-
- if (!editor->changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
-}
-
-static void
-set_entry_changed_signal_field(EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && GTK_IS_ENTRY(widget))
- g_signal_connect(widget, "changed",
- G_CALLBACK (field_changed), editor);
-}
-
-static void
-set_urlentry_changed_signal_field (EContactEditor *editor, char *id)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
- if (widget && E_IS_URL_ENTRY(widget)) {
- GtkWidget *entry = e_url_entry_get_entry (E_URL_ENTRY (widget));
- g_signal_connect (entry, "changed",
- G_CALLBACK (field_changed), editor);
- }
-}
-
-static void
-set_entry_changed_signals(EContactEditor *editor)
-{
- GtkWidget *widget;
- set_entry_changed_signal_phone(editor, "entry-phone1");
- set_entry_changed_signal_phone(editor, "entry-phone2");
- set_entry_changed_signal_phone(editor, "entry-phone3");
- set_entry_changed_signal_phone(editor, "entry-phone4");
-
- set_entry_changed_signal_email(editor, "entry-email1");
-
- widget = glade_xml_get_widget(editor->gui, "text-address");
- if (widget && GTK_IS_TEXT_VIEW(widget)) {
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- g_signal_connect(buffer, "changed",
- G_CALLBACK (address_text_changed), editor);
- }
-
- widget = glade_xml_get_widget(editor->gui, "entry-fullname");
- if (widget && GTK_IS_ENTRY(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (name_entry_changed), editor);
- }
-
- widget = glade_xml_get_widget(editor->gui, "entry-company");
- if (widget && GTK_IS_ENTRY(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (company_entry_changed), editor);
- }
-
- set_urlentry_changed_signal_field (editor, "entry-web");
- set_urlentry_changed_signal_field (editor, "entry-caluri");
- set_urlentry_changed_signal_field (editor, "entry-fburl");
-
- set_entry_changed_signal_field(editor, "entry-categories");
- set_entry_changed_signal_field(editor, "entry-jobtitle");
- set_entry_changed_signal_field(editor, "entry-file-as");
- set_entry_changed_signal_field(editor, "entry-manager");
- set_entry_changed_signal_field(editor, "entry-assistant");
- set_entry_changed_signal_field(editor, "entry-office");
- set_entry_changed_signal_field(editor, "entry-department");
- set_entry_changed_signal_field(editor, "entry-profession");
- set_entry_changed_signal_field(editor, "entry-nickname");
- set_entry_changed_signal_field(editor, "entry-spouse");
-
- widget = glade_xml_get_widget(editor->gui, "text-comments");
- if (widget && GTK_IS_TEXT_VIEW(widget)) {
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- g_signal_connect (buffer, "changed",
- G_CALLBACK (widget_changed), editor);
- }
- widget = glade_xml_get_widget(editor->gui, "dateedit-birthday");
- if (widget && E_IS_DATE_EDIT(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (widget_changed), editor);
- }
- widget = glade_xml_get_widget(editor->gui, "dateedit-anniversary");
- if (widget && E_IS_DATE_EDIT(widget)) {
- g_signal_connect (widget, "changed",
- G_CALLBACK (widget_changed), editor);
- }
-}
-
-static void
-full_name_clicked(GtkWidget *button, EContactEditor *editor)
-{
- GtkDialog *dialog = GTK_DIALOG(e_contact_editor_fullname_new(editor->name));
- int result;
-
- g_object_set (dialog,
- "editable", editor->fullname_editable,
- NULL);
- gtk_widget_show(GTK_WIDGET(dialog));
- result = gtk_dialog_run (dialog);
- gtk_widget_hide (GTK_WIDGET (dialog));
-
- if (editor->fullname_editable && result == GTK_RESPONSE_OK) {
- ECardName *name;
- GtkWidget *fname_widget;
- int style = 0;
-
- g_object_get (dialog,
- "name", &name,
- NULL);
-
- style = file_as_get_style(editor);
-
- fname_widget = glade_xml_get_widget(editor->gui, "entry-fullname");
- if (fname_widget && GTK_IS_ENTRY(fname_widget)) {
- char *full_name = e_card_name_to_string(name);
- gtk_entry_set_text(GTK_ENTRY(fname_widget), full_name);
- g_free(full_name);
- }
-
- e_card_name_unref(editor->name);
- editor->name = e_card_name_ref(name);
-
- file_as_set_style(editor, style);
- }
- gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-static void
-full_addr_clicked(GtkWidget *button, EContactEditor *editor)
-{
- GtkDialog *dialog;
- int result;
- const ECardDeliveryAddress *address;
-
- address = e_card_simple_get_delivery_address(editor->simple, editor->address_choice);
-
- dialog = GTK_DIALOG(e_contact_editor_address_new(address));
- g_object_set (dialog,
- "editable", editor->address_editable[editor->address_choice],
- NULL);
- gtk_widget_show(GTK_WIDGET(dialog));
-
- result = gtk_dialog_run (dialog);
-
- gtk_widget_hide (GTK_WIDGET (dialog));
-
- if (editor->address_editable[editor->address_choice] && result == GTK_RESPONSE_OK) {
- ECardDeliveryAddress *new_address;
- GtkWidget *address_widget;
- int saved_choice = editor->address_choice;
-
- editor->address_choice = -1;
-
- g_object_get (dialog,
- "address", &new_address,
- NULL);
-
- address_widget = glade_xml_get_widget(editor->gui, "text-address");
- if (address_widget && GTK_IS_TEXT_VIEW(address_widget)) {
- GtkTextBuffer *buffer;
- char *string = e_card_delivery_address_to_string(new_address);
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (address_widget));
-
- gtk_text_buffer_set_text (buffer, string, strlen (string));
-
- g_free(string);
- }
-
- editor->address_choice = saved_choice;
-
- e_card_simple_set_delivery_address(editor->simple, editor->address_choice, new_address);
-
- e_card_delivery_address_unref(new_address);
-
- widget_changed (NULL, editor);
- }
- gtk_widget_destroy (GTK_WIDGET (dialog));
-}
-
-static void
-categories_clicked(GtkWidget *button, EContactEditor *editor)
-{
- char *categories = NULL;
- GtkDialog *dialog;
- int result;
- GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories");
- ECategoriesMasterList *ecml;
- if (entry && GTK_IS_ENTRY(entry))
- categories = g_strdup (gtk_entry_get_text(GTK_ENTRY(entry)));
- else if (editor->card)
- g_object_get (editor->card,
- "categories", &categories,
- NULL);
- dialog = GTK_DIALOG(e_categories_new(categories));
-
- if (dialog == NULL) {
- GtkWidget *uh_oh = gtk_message_dialog_new (NULL,
- 0, GTK_MESSAGE_ERROR,
- GTK_RESPONSE_OK,
- _("Category editor not available."));
- g_free (categories);
- gtk_widget_show (uh_oh);
- return;
- }
-
- ecml = e_categories_master_list_wombat_new ();
- g_object_set (dialog,
- "header", _("This contact belongs to these categories:"),
- "ecml", ecml,
- NULL);
- g_object_unref (ecml);
- gtk_widget_show(GTK_WIDGET(dialog));
- result = gtk_dialog_run (dialog);
- g_free (categories);
- if (result == GTK_RESPONSE_OK) {
- g_object_get (dialog,
- "categories", &categories,
- NULL);
- if (entry && GTK_IS_ENTRY(entry))
- gtk_entry_set_text(GTK_ENTRY(entry), categories);
- else
- g_object_set (editor->card,
- "categories", categories,
- NULL);
- g_free(categories);
- }
- gtk_widget_destroy(GTK_WIDGET(dialog));
-}
-
-typedef struct {
- EContactEditor *ce;
- gboolean should_close;
-} EditorCloseStruct;
-
-static void
-card_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruct *ecs)
-{
- EContactEditor *ce = ecs->ce;
- gboolean should_close = ecs->should_close;
-
- gtk_widget_set_sensitive (ce->app, TRUE);
- ce->in_async_call = FALSE;
-
- e_card_set_id (ce->card, id);
-
- g_signal_emit (ce, contact_editor_signals[CARD_ADDED], 0,
- status, ce->card);
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- ce->is_new_card = FALSE;
-
- if (should_close) {
- close_dialog (ce);
- }
- else {
- ce->changed = FALSE;
- command_state_changed (ce);
- }
- }
-
- g_object_unref (ce);
- g_free (ecs);
-}
-
-static void
-card_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
-{
- EContactEditor *ce = ecs->ce;
- gboolean should_close = ecs->should_close;
-
- gtk_widget_set_sensitive (ce->app, TRUE);
- ce->in_async_call = FALSE;
-
- g_signal_emit (ce, contact_editor_signals[CARD_MODIFIED], 0,
- status, ce->card);
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- if (should_close) {
- close_dialog (ce);
- }
- else {
- ce->changed = FALSE;
- command_state_changed (ce);
- }
- }
-
- g_object_unref (ce);
- g_free (ecs);
-}
-
-/* Emits the signal to request saving a card */
-static void
-save_card (EContactEditor *ce, gboolean should_close)
-{
- extract_info (ce);
- e_card_simple_sync_card (ce->simple);
-
- if (ce->book) {
- EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);
-
- ecs->ce = ce;
- g_object_ref (ecs->ce);
-
- ecs->should_close = should_close;
-
- gtk_widget_set_sensitive (ce->app, FALSE);
- ce->in_async_call = TRUE;
-
- if (ce->is_new_card)
- e_card_merging_book_add_card (ce->book, ce->card, (EBookIdCallback)card_added_cb, ecs);
- else
- e_card_merging_book_commit_card (ce->book, ce->card, (EBookCallback)card_modified_cb, ecs);
- }
-}
-
-/* Closes the dialog box and emits the appropriate signals */
-static void
-close_dialog (EContactEditor *ce)
-{
- if (ce->app != NULL) {
- gtk_widget_destroy (ce->app);
- ce->app = NULL;
- g_signal_emit (ce, contact_editor_signals[EDITOR_CLOSED], 0);
- }
-}
-
-static gboolean
-prompt_to_save_changes (EContactEditor *editor)
-{
- if (!editor->changed)
- return TRUE;
-
- switch (e_addressbook_prompt_save_dialog (GTK_WINDOW(editor->app))) {
- case GTK_RESPONSE_YES:
- save_card (editor, FALSE);
- return TRUE;
- case GTK_RESPONSE_NO:
- return TRUE;
- case GTK_RESPONSE_CANCEL:
- default:
- return FALSE;
- }
-}
-
-/* Menu callbacks */
-
-/* File/Save callback */
-static void
-file_save_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
- save_card (ce, FALSE);
-}
-
-/* File/Close callback */
-static void
-file_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
- if (!prompt_to_save_changes (ce))
- return;
-
- close_dialog (ce);
-}
-
-static void
-file_save_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
- ECard *card;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
- e_card_simple_sync_card (ce->simple);
-
- card = ce->card;
- e_contact_save_as(_("Save Contact as VCard"), card, GTK_WINDOW (ce->app));
-}
-
-static void
-file_send_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
- ECard *card;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
- e_card_simple_sync_card (ce->simple);
-
- card = ce->card;
- e_addressbook_send_card(card, E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT);
-}
-
-static void
-file_send_to_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce;
- ECard *card;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
- e_card_simple_sync_card (ce->simple);
-
- card = ce->card;
- e_addressbook_send_card(card, E_ADDRESSBOOK_DISPOSITION_AS_TO);
-}
-
-gboolean
-e_contact_editor_confirm_delete (GtkWindow *parent)
-{
- GtkWidget *dialog;
- gint result;
-
- dialog = gtk_message_dialog_new (parent,
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
-#if notyet
- /* XXX we really need to handle the plural case here.. */
- (plural
- ? _("Are you sure you want\n"
- "to delete these contacts?"))
-#endif
- _("Are you sure you want\n"
- "to delete this contact?"));
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
- NULL);
-
- result = gtk_dialog_run(GTK_DIALOG (dialog));
-
- gtk_widget_destroy (dialog);
-
- return (result == GTK_RESPONSE_ACCEPT);
-}
-
-static void
-card_deleted_cb (EBook *book, EBookStatus status, EContactEditor *ce)
-{
- gtk_widget_set_sensitive (ce->app, TRUE);
- ce->in_async_call = FALSE;
-
- g_signal_emit (ce, contact_editor_signals[CARD_DELETED], 0,
- status, ce->card);
-
- /* always close the dialog after we successfully delete a card */
- if (status == E_BOOK_STATUS_SUCCESS)
- close_dialog (ce);
-}
-
-static void
-delete_cb (GtkWidget *widget, gpointer data)
-{
- EContactEditor *ce = E_CONTACT_EDITOR (data);
- ECard *card = ce->card;
- ECardSimple *simple = ce->simple;
-
- g_object_ref(card);
- g_object_ref(simple);
-
- if (e_contact_editor_confirm_delete(GTK_WINDOW(ce->app))) {
-
- extract_info (ce);
- e_card_simple_sync_card (simple);
-
- if (!ce->is_new_card && ce->book) {
- gtk_widget_set_sensitive (ce->app, FALSE);
- ce->in_async_call = TRUE;
-
- e_book_remove_card (ce->book, card, (EBookCallback)card_deleted_cb, ce);
- }
- }
-
- g_object_unref(card);
- g_object_unref(simple);
-}
-
-/* Emits the signal to request printing a card */
-static void
-print_cb (BonoboUIComponent *uih, void *data, const char *path)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
- e_card_simple_sync_card (ce->simple);
-
- gtk_widget_show(e_contact_print_card_dialog_new(ce->card));
-}
-
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
-/* Emits the signal to request printing a card */
-static void
-print_envelope_cb (BonoboUIComponent *uih, void *data, const char *path)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- extract_info (ce);
- e_card_simple_sync_card (ce->simple);
-
- gtk_widget_show(e_contact_print_envelope_dialog_new(ce->card));
-}
-#endif
-
-/* Toolbar/Save and Close callback */
-static void
-tb_save_and_close_cb (BonoboUIComponent *uih, void *data, const char *path)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
- save_card (ce, TRUE);
-}
-
-static
-BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSave", file_save_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveAs", file_save_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSaveClose", tb_save_and_close_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSendAs", file_send_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorSendTo", file_send_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorDelete", delete_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactEditorPrint", print_cb),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- BONOBO_UI_UNSAFE_VERB ("ContactEditorPrintEnvelope", print_envelope_cb),
-#endif
- /* BONOBO_UI_UNSAFE_VERB ("ContactEditorPageSetup", file_page_setup_menu), */
- BONOBO_UI_UNSAFE_VERB ("ContactEditorClose", file_close_cb),
-
- BONOBO_UI_VERB_END
-};
-
-EPixmap pixmaps[] = {
- E_PIXMAP ("/commands/ContactEditorSave", "save-16.png"),
- E_PIXMAP ("/commands/ContactEditorSaveClose", "save-16.png"),
- E_PIXMAP ("/commands/ContactEditorSaveAs", "save-as-16.png"),
- E_PIXMAP ("/commands/ContactEditorDelete", "evolution-trash-mini.png"),
- E_PIXMAP ("/commands/ContactEditorPrint", "print.xpm"),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- E_PIXMAP ("/commands/ContactEditorPrintEnvelope", "print.xpm"),
-#endif
- E_PIXMAP ("/Toolbar/ContactEditorSaveClose", "buttons/save-24.png"),
- E_PIXMAP ("/Toolbar/ContactEditorDelete", "buttons/delete-message.png"),
- E_PIXMAP ("/Toolbar/ContactEditorPrint", "buttons/print.png"),
-
- E_PIXMAP_END
-};
-
-static void
-create_ui (EContactEditor *ce)
-{
- bonobo_ui_component_add_verb_list_with_data (ce->uic, verbs, ce);
-
- bonobo_ui_util_set_ui (ce->uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-contact-editor.xml",
- "evolution-contact-editor", NULL);
-
- e_pixmaps_update (ce->uic, pixmaps);
-}
-
-/* Callback used when the dialog box is destroyed */
-static gint
-app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- EContactEditor *ce;
-
- ce = E_CONTACT_EDITOR (data);
-
- /* if we're saving, don't allow the dialog to close */
- if (ce->in_async_call)
- return TRUE;
-
- if (!prompt_to_save_changes (ce))
- return TRUE;
-
- close_dialog (ce);
- return TRUE;
-}
-
-static GList *
-add_to_tab_order(GList *list, GladeXML *gui, char *name)
-{
- GtkWidget *widget = glade_xml_get_widget(gui, name);
- return g_list_prepend(list, widget);
-}
-
-static void
-setup_tab_order(GladeXML *gui)
-{
- GtkWidget *container;
- GList *list = NULL;
-
- container = glade_xml_get_widget(gui, "table-contact-editor-general");
-
- if (container) {
- list = add_to_tab_order(list, gui, "entry-fullname");
- list = add_to_tab_order(list, gui, "entry-jobtitle");
- list = add_to_tab_order(list, gui, "entry-company");
- list = add_to_tab_order(list, gui, "combo-file-as");
- list = add_to_tab_order(list, gui, "entry-phone1");
- list = add_to_tab_order(list, gui, "entry-phone2");
- list = add_to_tab_order(list, gui, "entry-phone3");
- list = add_to_tab_order(list, gui, "entry-phone4");
-
- list = add_to_tab_order(list, gui, "entry-email1");
- list = add_to_tab_order(list, gui, "alignment-htmlmail");
- list = add_to_tab_order(list, gui, "entry-web");
- list = add_to_tab_order(list, gui, "button-fulladdr");
- list = add_to_tab_order(list, gui, "text-address");
- list = g_list_reverse(list);
- e_container_change_tab_order(GTK_CONTAINER(container), list);
- g_list_free(list);
- }
-}
-
-static void
-e_contact_editor_init (EContactEditor *e_contact_editor)
-{
- GladeXML *gui;
- GtkWidget *widget;
- GtkWidget *bonobo_win;
- GtkWidget *wants_html;
- BonoboUIContainer *container;
- char *icon_path;
-
- e_contact_editor->email_info = NULL;
- e_contact_editor->phone_info = NULL;
- e_contact_editor->address_info = NULL;
- e_contact_editor->email_popup = NULL;
- e_contact_editor->phone_popup = NULL;
- e_contact_editor->address_popup = NULL;
- e_contact_editor->email_list = NULL;
- e_contact_editor->phone_list = NULL;
- e_contact_editor->address_list = NULL;
- e_contact_editor->name = e_card_name_new();
- e_contact_editor->company = g_strdup("");
-
- e_contact_editor->email_choice = 0;
- e_contact_editor->phone_choice[0] = E_CARD_SIMPLE_PHONE_ID_BUSINESS;
- e_contact_editor->phone_choice[1] = E_CARD_SIMPLE_PHONE_ID_HOME;
- e_contact_editor->phone_choice[2] = E_CARD_SIMPLE_PHONE_ID_BUSINESS_FAX;
- e_contact_editor->phone_choice[3] = E_CARD_SIMPLE_PHONE_ID_MOBILE;
- e_contact_editor->address_choice = 0;
- e_contact_editor->address_mailing = -1;
-
- e_contact_editor->arbitrary_fields = NULL;
-
- e_contact_editor->simple = e_card_simple_new(NULL);
-
- e_contact_editor->card = NULL;
- e_contact_editor->changed = FALSE;
- e_contact_editor->in_async_call = FALSE;
- e_contact_editor->editable = TRUE;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-editor.glade", NULL, NULL);
- e_contact_editor->gui = gui;
-
- setup_tab_order(gui);
-
- e_contact_editor->app = glade_xml_get_widget (gui, "contact editor");
-
- e_container_foreach_leaf (GTK_CONTAINER (e_contact_editor->app),
- (GtkCallback) add_field_callback,
- e_contact_editor);
-
- connect_arrow_button_signals(e_contact_editor);
- set_entry_changed_signals(e_contact_editor);
-
- wants_html = glade_xml_get_widget(e_contact_editor->gui, "checkbutton-htmlmail");
- if (wants_html && GTK_IS_TOGGLE_BUTTON(wants_html))
- g_signal_connect (wants_html, "toggled",
- G_CALLBACK (wants_html_changed), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "checkbutton-mailingaddress");
- if (widget && GTK_IS_TOGGLE_BUTTON(widget))
- g_signal_connect (widget, "toggled",
- G_CALLBACK (address_mailing_changed), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "button-fullname");
- if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (full_name_clicked), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "button-fulladdr");
- if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (full_addr_clicked), e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "button-categories");
- if (widget && GTK_IS_BUTTON(widget))
- g_signal_connect (widget, "clicked",
- G_CALLBACK (categories_clicked), e_contact_editor);
-
- /* Construct the app */
- bonobo_win = bonobo_window_new ("contact-editor-dialog", _("Contact Editor"));
-
- /* FIXME: The sucking bit */
- {
- GtkWidget *contents;
-
- contents = bonobo_dock_get_client_area (gnome_app_get_dock (GNOME_APP(e_contact_editor->app)));
-
- if (!contents) {
- g_message ("contact_editor_construct(): Could not get contents");
- return;
- }
- g_object_ref (contents);
- gtk_container_remove (GTK_CONTAINER (contents->parent), contents);
- bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents);
- gtk_widget_destroy (e_contact_editor->app);
- e_contact_editor->app = bonobo_win;
- }
-
- /* Build the menu and toolbar */
- container = bonobo_window_get_ui_container (BONOBO_WINDOW (e_contact_editor->app));
-
- e_contact_editor->uic = bonobo_ui_component_new_default ();
- if (!e_contact_editor->uic) {
- g_message ("e_contact_editor_init(): eeeeek, could not create the UI handler!");
- return;
- }
- bonobo_ui_component_set_container (e_contact_editor->uic,
- bonobo_object_corba_objref (BONOBO_OBJECT (container)),
- NULL);
-
- create_ui (e_contact_editor);
-
- widget = glade_xml_get_widget(e_contact_editor->gui, "entry-fullname");
- if (widget)
- gtk_widget_grab_focus (widget);
-
- /* Connect to the deletion of the dialog */
-
- g_signal_connect (e_contact_editor->app, "delete_event",
- GTK_SIGNAL_FUNC (app_delete_event_cb), e_contact_editor);
-
- /* set the icon */
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png", NULL);
- gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor->app), icon_path);
- g_free (icon_path);
-}
-
-void
-e_contact_editor_dispose (GObject *object) {
- EContactEditor *e_contact_editor = E_CONTACT_EDITOR(object);
-
- if (e_contact_editor->writable_fields) {
- g_object_unref(e_contact_editor->writable_fields);
- e_contact_editor->writable_fields = NULL;
- }
- if (e_contact_editor->email_list) {
- g_list_foreach(e_contact_editor->email_list, (GFunc) g_free, NULL);
- g_list_free(e_contact_editor->email_list);
- e_contact_editor->email_list = NULL;
- }
- if (e_contact_editor->email_info) {
- g_free(e_contact_editor->email_info);
- e_contact_editor->email_info = NULL;
- }
- if (e_contact_editor->email_popup) {
- g_object_unref(e_contact_editor->email_popup);
- e_contact_editor->email_popup = NULL;
- }
-
- if (e_contact_editor->phone_list) {
- g_list_foreach(e_contact_editor->phone_list, (GFunc) g_free, NULL);
- g_list_free(e_contact_editor->phone_list);
- e_contact_editor->phone_list = NULL;
- }
- if (e_contact_editor->phone_info) {
- g_free(e_contact_editor->phone_info);
- e_contact_editor->phone_info = NULL;
- }
- if (e_contact_editor->phone_popup) {
- g_object_unref(e_contact_editor->phone_popup);
- e_contact_editor->phone_popup = NULL;
- }
-
- if (e_contact_editor->address_list) {
- g_list_foreach(e_contact_editor->address_list, (GFunc) g_free, NULL);
- g_list_free(e_contact_editor->address_list);
- e_contact_editor->address_list = NULL;
- }
- if (e_contact_editor->address_info) {
- g_free(e_contact_editor->address_info);
- e_contact_editor->address_info = NULL;
- }
- if (e_contact_editor->address_popup) {
- g_object_unref(e_contact_editor->address_popup);
- e_contact_editor->address_popup = NULL;
- }
-
- if (e_contact_editor->simple) {
- g_object_unref(e_contact_editor->simple);
- e_contact_editor->simple = NULL;
- }
-
- if (e_contact_editor->card) {
- g_object_unref(e_contact_editor->card);
- e_contact_editor->card = NULL;
- }
-
- if (e_contact_editor->book) {
- g_object_unref(e_contact_editor->book);
- e_contact_editor->book = NULL;
- }
-
- if (e_contact_editor->name) {
- e_card_name_unref(e_contact_editor->name);
- e_contact_editor->name = NULL;
- }
-
- if (e_contact_editor->company) {
- g_free (e_contact_editor->company);
- e_contact_editor->company = NULL;
- }
-
- if (e_contact_editor->gui) {
- g_object_unref(e_contact_editor->gui);
- e_contact_editor->gui = NULL;
- }
-}
-
-static void
-command_state_changed (EContactEditor *ce)
-{
- bonobo_ui_component_set_prop (ce->uic,
- "/commands/ContactEditorSaveClose",
- "sensitive",
- ce->changed ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (ce->uic,
- "/commands/ContactEditorSave",
- "sensitive",
- ce->changed ? "1" : "0", NULL);
- bonobo_ui_component_set_prop (ce->uic,
- "/commands/ContactEditorDelete",
- "sensitive",
- (ce->editable && !ce->is_new_card) ? "1" : "0", NULL);
-}
-
-static void
-supported_fields_cb (EBook *book, EBookStatus status,
- EList *fields, EContactEditor *ce)
-{
- if (!g_slist_find (all_contact_editors, ce)) {
- g_warning ("supported_fields_cb called for book that's still around, but contact editor that's been destroyed.");
- return;
- }
-
- g_object_set (ce,
- "writable_fields", fields,
- NULL);
-
- e_contact_editor_show (ce);
-
- command_state_changed (ce);
-}
-
-static void
-contact_editor_destroy_notify (void *data,
- GObject *where_the_object_was)
-{
- EContactEditor *ce = E_CONTACT_EDITOR (data);
-
- all_contact_editors = g_slist_remove (all_contact_editors, ce);
-}
-
-EContactEditor *
-e_contact_editor_new (EBook *book,
- ECard *card,
- gboolean is_new_card,
- gboolean editable)
-{
- EContactEditor *ce;
-
- g_return_val_if_fail (E_IS_BOOK (book), NULL);
- g_return_val_if_fail (E_IS_CARD (card), NULL);
-
- ce = g_object_new (E_TYPE_CONTACT_EDITOR, NULL);
-
- all_contact_editors = g_slist_prepend (all_contact_editors, ce);
- g_object_weak_ref (G_OBJECT (ce), contact_editor_destroy_notify, ce);
-
- g_object_ref (ce);
- gtk_object_sink (GTK_OBJECT (ce));
-
- g_object_set (ce,
- "book", book,
- "card", card,
- "is_new_card", is_new_card,
- "editable", editable,
- NULL);
-
- if (book)
- e_book_get_supported_fields (book, (EBookFieldsCallback)supported_fields_cb, ce);
-
- return ce;
-}
-
-static void
-e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EContactEditor *editor;
-
- editor = E_CONTACT_EDITOR (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (editor->book)
- g_object_unref(editor->book);
- editor->book = E_BOOK(g_value_get_object (value));
- g_object_ref (editor->book);
- /* XXX more here about editable/etc. */
- break;
- case PROP_CARD:
- if (editor->card)
- g_object_unref(editor->card);
- editor->card = e_card_duplicate(E_CARD(g_value_get_object (value)));
- g_object_set(editor->simple,
- "card", editor->card,
- NULL);
- fill_in_info(editor);
- editor->changed = FALSE;
- break;
-
- case PROP_IS_NEW_CARD:
- editor->is_new_card = g_value_get_boolean (value) ? TRUE : FALSE;
- break;
-
- case PROP_EDITABLE: {
- gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE;
- gboolean changed = (editor->editable != new_value);
-
- editor->editable = new_value;
-
- if (changed) {
- set_editable (editor);
- command_state_changed (editor);
- }
- break;
- }
-
- case PROP_CHANGED: {
- gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE;
- gboolean changed = (editor->changed != new_value);
-
- editor->changed = new_value;
-
- if (changed)
- command_state_changed (editor);
- break;
- }
- case PROP_WRITABLE_FIELDS:
- if (editor->writable_fields)
- g_object_unref(editor->writable_fields);
- editor->writable_fields = g_value_get_object (value);
- if (editor->writable_fields)
- g_object_ref (editor->writable_fields);
- else
- editor->writable_fields = e_list_new(NULL, NULL, NULL);
- enable_writable_fields (editor);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EContactEditor *e_contact_editor;
-
- e_contact_editor = E_CONTACT_EDITOR (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, e_contact_editor->book);
- break;
-
- case PROP_CARD:
- e_card_simple_sync_card(e_contact_editor->simple);
- extract_info(e_contact_editor);
- g_value_set_object (value, e_contact_editor->card);
- break;
-
- case PROP_IS_NEW_CARD:
- g_value_set_boolean (value, e_contact_editor->is_new_card ? TRUE : FALSE);
- break;
-
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_contact_editor->editable ? TRUE : FALSE);
- break;
-
- case PROP_CHANGED:
- g_value_set_boolean (value, e_contact_editor->changed ? TRUE : FALSE);
- break;
-
- case PROP_WRITABLE_FIELDS:
- if (e_contact_editor->writable_fields)
- g_value_set_object (value, e_list_duplicate (e_contact_editor->writable_fields));
- else
- g_value_set_object (value, NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-_popup_position(GtkMenu *menu,
- gint *x,
- gint *y,
- gboolean *push_in,
- gpointer data)
-{
- GtkWidget *button = GTK_WIDGET(data);
- GtkRequisition request;
- int mh, mw;
- gdk_window_get_origin (button->window, x, y);
- *x += button->allocation.x;
- *y += button->allocation.y;
-
- gtk_widget_size_request(GTK_WIDGET(menu), &request);
-
- mh = request.height;
- mw = request.width;
-
- *x -= mw;
- if (*x < 0)
- *x = 0;
-
- if (*y < 0)
- *y = 0;
-
- if ((*x + mw) > gdk_screen_width ())
- *x = gdk_screen_width () - mw;
-
- if ((*y + mh) > gdk_screen_height ())
- *y = gdk_screen_height () - mh;
-
- *push_in = FALSE;
-}
-
-static gint
-_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor, GtkWidget *popup, GList **list, GnomeUIInfo **info, gchar *label)
-{
- gint menu_item;
-
- g_signal_stop_emission_by_name (widget, "button_press_event");
-
- gtk_widget_realize(popup);
- menu_item = gnome_popup_menu_do_popup_modal(popup, _popup_position, widget, button, editor, widget);
- if ( menu_item != -1 ) {
- GtkWidget *label_widget = glade_xml_get_widget(editor->gui, label);
- if (label_widget && GTK_IS_LABEL(label_widget)) {
- g_object_set (label_widget,
- "label", _(g_list_nth_data(*list, menu_item)),
- NULL);
- }
- }
- return menu_item;
-}
-
-static void
-e_contact_editor_build_ui_info(GList *list, GnomeUIInfo **infop)
-{
- GnomeUIInfo *info;
- GnomeUIInfo singleton = { GNOME_APP_UI_TOGGLEITEM, NULL, NULL, NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, 0, 0, 0, NULL };
- GnomeUIInfo end = GNOMEUIINFO_END;
- int length;
- int i;
-
- info = *infop;
-
- if ( info )
- g_free(info);
- length = g_list_length( list );
- info = g_new(GnomeUIInfo, length + 2);
- for (i = 0; i < length; i++) {
- info[i] = singleton;
- info[i].label = _(list->data);
- list = list->next;
- }
- info[i] = end;
-
- *infop = info;
-}
-
-static void
-e_contact_editor_build_phone_ui (EContactEditor *editor)
-{
- int i;
-
- if (editor->phone_list == NULL) {
- static char *info[] = {
- N_("Assistant"),
- N_("Business"),
- N_("Business 2"),
- N_("Business Fax"),
- N_("Callback"),
- N_("Car"),
- N_("Company"),
- N_("Home"),
- N_("Home 2"),
- N_("Home Fax"),
- N_("ISDN"),
- N_("Mobile"),
- N_("Other"),
- N_("Other Fax"),
- N_("Pager"),
- N_("Primary"),
- N_("Radio"),
- N_("Telex"),
- N_("TTY/TDD")
- };
-
- for (i = 0; i < sizeof(info) / sizeof(info[0]); i++) {
- editor->phone_list = g_list_append(editor->phone_list, g_strdup(info[i]));
- }
- }
- if (editor->phone_info == NULL) {
- e_contact_editor_build_ui_info(editor->phone_list, &editor->phone_info);
-
- if ( editor->phone_popup )
- g_object_unref(editor->phone_popup);
-
- editor->phone_popup = gnome_popup_menu_new(editor->phone_info);
- g_object_ref (editor->phone_popup);
- gtk_object_sink (GTK_OBJECT (editor->phone_popup));
- }
-}
-
-static void
-e_contact_editor_build_email_ui (EContactEditor *editor)
-{
- int i;
-
- if (editor->email_list == NULL) {
- static char *info[] = {
- N_("Primary Email"),
- N_("Email 2"),
- N_("Email 3")
- };
-
- for (i = 0; i < sizeof(info) / sizeof(info[0]); i++) {
- editor->email_list = g_list_append(editor->email_list, g_strdup(info[i]));
- }
- }
- if (editor->email_info == NULL) {
- e_contact_editor_build_ui_info(editor->email_list, &editor->email_info);
-
- if ( editor->email_popup )
- g_object_unref(editor->email_popup);
-
- editor->email_popup = gnome_popup_menu_new(editor->email_info);
- g_object_ref (editor->email_popup);
- gtk_object_sink (GTK_OBJECT (editor->email_popup));
- }
-}
-
-static void
-e_contact_editor_build_address_ui (EContactEditor *editor)
-{
- int i;
-
- if (editor->address_list == NULL) {
- static char *info[] = {
- N_("Business"),
- N_("Home"),
- N_("Other")
- };
-
- for (i = 0; i < sizeof(info) / sizeof(info[0]); i++) {
- editor->address_list = g_list_append(editor->address_list, g_strdup(info[i]));
- }
- }
- if (editor->address_info == NULL) {
- e_contact_editor_build_ui_info(editor->address_list, &editor->address_info);
-
- if ( editor->address_popup )
- g_object_unref(editor->address_popup);
-
- editor->address_popup = gnome_popup_menu_new(editor->address_info);
- g_object_ref (editor->address_popup);
- gtk_object_sink (GTK_OBJECT (editor->address_popup));
- }
-}
-
-static void
-_phone_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor)
-{
- int which;
- int i;
- gchar *label;
- gchar *entry;
- int result;
- if ( widget == glade_xml_get_widget(editor->gui, "button-phone1") ) {
- which = 1;
- } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone2") ) {
- which = 2;
- } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone3") ) {
- which = 3;
- } else if ( widget == glade_xml_get_widget(editor->gui, "button-phone4") ) {
- which = 4;
- } else
- return;
-
- label = g_strdup_printf("label-phone%d", which);
- entry = g_strdup_printf("entry-phone%d", which);
-
- e_contact_editor_build_phone_ui (editor);
-
- for(i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i++) {
- const ECardPhone *phone = e_card_simple_get_phone(editor->simple, i);
- gboolean checked;
- checked = phone && phone->number && *phone->number;
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->phone_info[i].widget),
- checked);
- }
-
- result = _arrow_pressed (widget, button, editor, editor->phone_popup, &editor->phone_list, &editor->phone_info, label);
-
- if (result != -1) {
- editor->phone_choice[which - 1] = result;
- set_fields(editor);
- enable_widget (glade_xml_get_widget (editor->gui, label), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, entry), editor->editable);
- }
-
- g_free(label);
- g_free(entry);
-}
-
-static void
-_email_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor)
-{
- int i;
- int result;
-
- e_contact_editor_build_email_ui (editor);
-
- for(i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i++) {
- const char *string = e_card_simple_get_email(editor->simple, i);
- gboolean checked;
- checked = string && *string;
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->email_info[i].widget),
- checked);
- }
-
- result = _arrow_pressed (widget, button, editor, editor->email_popup, &editor->email_list, &editor->email_info, "label-email1");
-
- if (result != -1) {
- editor->email_choice = result;
- set_fields(editor);
-
- /* make sure the buttons/entry is/are sensitive */
- enable_widget (glade_xml_get_widget (editor->gui, "label-email1"), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, "entry-email1"), editor->editable);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), editor->editable);
- }
-}
-
-static void
-_address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEditor *editor)
-{
- int i;
- int result;
-
- e_contact_editor_build_address_ui (editor);
-
- for(i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- const ECardAddrLabel *address = e_card_simple_get_address(editor->simple, i);
- gboolean checked;
- checked = address && address->data && *address->data;
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(editor->address_info[i].widget),
- checked);
- }
-
- result = _arrow_pressed (widget, button, editor, editor->address_popup, &editor->address_list, &editor->address_info, "label-address");
-
- if (result != -1) {
- set_address_field(editor, result);
-
- /* make sure the buttons/entry is/are sensitive */
- enable_widget (glade_xml_get_widget (editor->gui, "label-address"), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, "text-address"), editor->address_editable[result]);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-mailingaddress"), editor->address_editable[result]);
- }
-}
-
-static void
-find_address_mailing (EContactEditor *editor)
-{
- const ECardDeliveryAddress *address;
- int i;
-
- editor->address_mailing = -1;
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- address = e_card_simple_get_delivery_address(editor->simple, i);
- if (address && (address->flags & E_CARD_ADDR_DEFAULT)) {
- if (editor->address_mailing == -1) {
- editor->address_mailing = i;
- } else {
- ECardDeliveryAddress *new;
-
- new = e_card_delivery_address_copy (address);
- new->flags &= ~E_CARD_ADDR_DEFAULT;
- e_card_simple_set_delivery_address(editor->simple, i, new);
- e_card_delivery_address_unref (new);
- }
- }
- }
-}
-
-static void
-set_field(EContactEditor *editor, GtkEntry *entry, const char *string)
-{
- const char *oldstring = gtk_entry_get_text(entry);
- if (!string)
- string = "";
- if (strcmp(string, oldstring)) {
- g_signal_handlers_block_matched (entry,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, editor);
- gtk_entry_set_text(entry, string);
- g_signal_handlers_unblock_matched (entry,
- G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, editor);
- }
-}
-
-static void
-set_phone_field(EContactEditor *editor, GtkWidget *entry, const ECardPhone *phone)
-{
- set_field(editor, GTK_ENTRY(entry), phone ? phone->number : "");
-}
-
-static void
-set_fields(EContactEditor *editor)
-{
- GtkWidget *entry;
- GtkWidget *label_widget;
- int i;
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone1");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[0]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone2");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[1]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone3");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[2]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-phone4");
- if (entry && GTK_IS_ENTRY(entry))
- set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[3]));
-
- entry = glade_xml_get_widget(editor->gui, "entry-email1");
- if (entry && GTK_IS_ENTRY(entry))
- set_field(editor, GTK_ENTRY(entry), e_card_simple_get_email(editor->simple, editor->email_choice));
-
-
-
- e_contact_editor_build_address_ui (editor);
-
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) {
- const ECardAddrLabel *address = e_card_simple_get_address(editor->simple, i);
-
- if (address && address->data && *address->data)
- break;
- }
- if (i == E_CARD_SIMPLE_ADDRESS_ID_LAST)
- i = 0;
-
- label_widget = glade_xml_get_widget(editor->gui, "label-address");
- if (label_widget && GTK_IS_LABEL(label_widget)) {
- g_object_set (label_widget,
- "label", _(g_list_nth_data(editor->address_list, i)),
- NULL);
- }
-
- set_address_field(editor, i);
-}
-
-static void
-set_address_field(EContactEditor *editor, int result)
-{
- GtkWidget *text, *check;
-
- text = glade_xml_get_widget(editor->gui, "text-address");
-
- if (text && GTK_IS_TEXT_VIEW(text)) {
- GtkTextBuffer *buffer;
- GtkTextIter start_iter, end_iter;
- const ECardAddrLabel *address;
-
- if (result == -1)
- result = editor->address_choice;
- editor->address_choice = -1;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
-
- gtk_text_buffer_get_start_iter (buffer, &start_iter);
- gtk_text_buffer_get_end_iter (buffer, &end_iter);
-
- gtk_text_buffer_delete (buffer, &start_iter, &end_iter);
-
- address = e_card_simple_get_address(editor->simple, result);
- if (address && address->data)
- gtk_text_buffer_insert (buffer, &start_iter, address->data, strlen (address->data));
-
- check = glade_xml_get_widget(editor->gui, "checkbutton-mailingaddress");
- if (check && GTK_IS_CHECK_BUTTON (check)) {
- if (address && address->data)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
- address->flags & E_CARD_ADDR_DEFAULT);
- else
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
- }
-
- editor->address_choice = result;
- }
-}
-
-static void
-add_field_callback(GtkWidget *widget, EContactEditor *editor)
-{
- const char *name;
- int i;
- static const char *builtins[] = {
- "entry-fullname",
- "entry-web",
- "entry-company",
- "entry-department",
- "entry-office",
- "entry-jobtitle",
- "entry-profession",
- "entry-manager",
- "entry-assistant",
- "entry-nickname",
- "entry-spouse",
- "text-comments",
- "entry-categories",
- "entry-file-as",
- "dateedit-anniversary",
- "dateedit-birthday",
- "entry-phone1",
- "entry-phone2",
- "entry-phone3",
- "entry-phone4",
- "entry-email1",
- "text-address",
- "checkbutton-mailingaddress",
- "checkbutton-htmlmail",
- "entry-caluri",
- "entry-fburl",
- NULL
- };
- name = glade_get_widget_name(widget);
- if (name) {
- for (i = 0; builtins[i]; i++) {
- if (!strcmp(name, builtins[i]))
- return;
- }
- if (GTK_IS_ENTRY(widget) || GTK_IS_TEXT_VIEW(widget)) {
- editor->arbitrary_fields = g_list_prepend(editor->arbitrary_fields, g_strdup(name));
- }
- }
-}
-
-static struct {
- char *id;
- char *key;
-} field_mapping [] = {
- { "entry-fullname", "full_name" },
- { "entry-web", "url" },
- { "entry-company", "org" },
- { "entry-department", "org_unit" },
- { "entry-office", "office" },
- { "entry-jobtitle", "title" },
- { "entry-profession", "role" },
- { "entry-manager", "manager" },
- { "entry-assistant", "assistant" },
- { "entry-nickname", "nickname" },
- { "entry-spouse", "spouse" },
- { "text-comments", "note" },
- { "entry-categories", "categories" },
- { "entry-caluri", "caluri" },
- { "entry-fburl", "fburl" },
-};
-
-static void
-fill_in_field(EContactEditor *editor, char *id, char *value)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, id);
-
- if (!widget)
- return;
-
- if (E_IS_URL_ENTRY (widget))
- widget = e_url_entry_get_entry (E_URL_ENTRY (widget));
-
- if (GTK_IS_TEXT_VIEW (widget)) {
- if (value)
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget)),
- value, strlen (value));
- }
- else if (GTK_IS_EDITABLE(widget)) {
- int position = 0;
- GtkEditable *editable = GTK_EDITABLE(widget);
- gtk_editable_delete_text(editable, 0, -1);
- if (value)
- gtk_editable_insert_text(editable, value, strlen(value), &position);
- }
-}
-
-static void
-fill_in_card_field(EContactEditor *editor, ECard *card, char *id, char *key)
-{
- char *string;
- g_object_get (card,
- key, &string,
- NULL);
- fill_in_field(editor, id, string);
- g_free (string);
-}
-
-static void
-fill_in_single_field(EContactEditor *editor, char *name)
-{
- ECardSimple *simple = editor->simple;
- GtkWidget *widget = glade_xml_get_widget(editor->gui, name);
-
- if (widget && GTK_IS_EDITABLE(widget)) {
- int position = 0;
- GtkEditable *editable = GTK_EDITABLE(widget);
- const ECardArbitrary *arbitrary;
-
- gtk_editable_delete_text(editable, 0, -1);
- arbitrary = e_card_simple_get_arbitrary(simple,
- name);
- if (arbitrary && arbitrary->value)
- gtk_editable_insert_text(editable, arbitrary->value, strlen(arbitrary->value), &position);
- }
-}
-
-static void
-disable_widget_foreach (char *key, GtkWidget *widget, gpointer closure)
-{
- enable_widget (widget, FALSE);
-}
-
-static struct {
- char *widget_name;
- ECardSimpleField field_id;
- gboolean desensitize_for_read_only;
-} widget_field_mappings[] = {
- { "entry-web", E_CARD_SIMPLE_FIELD_URL, TRUE },
- { "accellabel-web", E_CARD_SIMPLE_FIELD_URL },
-
- { "entry-jobtitle", E_CARD_SIMPLE_FIELD_TITLE, TRUE },
- { "label-jobtitle", E_CARD_SIMPLE_FIELD_TITLE },
-
- { "entry-company", E_CARD_SIMPLE_FIELD_ORG, TRUE },
- { "label-company", E_CARD_SIMPLE_FIELD_ORG },
-
- { "combo-file-as", E_CARD_SIMPLE_FIELD_FILE_AS, TRUE },
- { "entry-file-as", E_CARD_SIMPLE_FIELD_FILE_AS, TRUE },
- { "accellabel-fileas", E_CARD_SIMPLE_FIELD_FILE_AS },
-
- { "label-department", E_CARD_SIMPLE_FIELD_ORG_UNIT },
- { "entry-department", E_CARD_SIMPLE_FIELD_ORG_UNIT, TRUE },
-
- { "label-office", E_CARD_SIMPLE_FIELD_OFFICE },
- { "entry-office", E_CARD_SIMPLE_FIELD_OFFICE, TRUE },
-
- { "label-profession", E_CARD_SIMPLE_FIELD_ROLE },
- { "entry-profession", E_CARD_SIMPLE_FIELD_ROLE, TRUE },
-
- { "label-manager", E_CARD_SIMPLE_FIELD_MANAGER },
- { "entry-manager", E_CARD_SIMPLE_FIELD_MANAGER, TRUE },
-
- { "label-assistant", E_CARD_SIMPLE_FIELD_ASSISTANT },
- { "entry-assistant", E_CARD_SIMPLE_FIELD_ASSISTANT, TRUE },
-
- { "label-nickname", E_CARD_SIMPLE_FIELD_NICKNAME },
- { "entry-nickname", E_CARD_SIMPLE_FIELD_NICKNAME, TRUE },
-
- { "label-spouse", E_CARD_SIMPLE_FIELD_SPOUSE },
- { "entry-spouse", E_CARD_SIMPLE_FIELD_SPOUSE, TRUE },
-
- { "label-birthday", E_CARD_SIMPLE_FIELD_BIRTH_DATE },
- { "dateedit-birthday", E_CARD_SIMPLE_FIELD_BIRTH_DATE, TRUE },
-
- { "label-anniversary", E_CARD_SIMPLE_FIELD_ANNIVERSARY },
- { "dateedit-anniversary", E_CARD_SIMPLE_FIELD_ANNIVERSARY, TRUE },
-
- { "label-comments", E_CARD_SIMPLE_FIELD_NOTE },
- { "text-comments", E_CARD_SIMPLE_FIELD_NOTE, TRUE },
-
- { "entry-fullname", E_CARD_SIMPLE_FIELD_FULL_NAME, TRUE },
-
- { "button-categories", E_CARD_SIMPLE_FIELD_CATEGORIES, TRUE },
- { "entry-categories", E_CARD_SIMPLE_FIELD_CATEGORIES, TRUE },
-
- { "label-caluri", E_CARD_SIMPLE_FIELD_CALURI },
- { "entry-caluri", E_CARD_SIMPLE_FIELD_CALURI, TRUE },
-
- { "label-fburl", E_CARD_SIMPLE_FIELD_FBURL },
- { "entry-fburl", E_CARD_SIMPLE_FIELD_FBURL, TRUE }
-};
-static int num_widget_field_mappings = sizeof(widget_field_mappings) / sizeof (widget_field_mappings[0]);
-
-static void
-enable_writable_fields(EContactEditor *editor)
-{
- EList *fields = editor->writable_fields;
- EIterator *iter;
- GHashTable *dropdown_hash, *supported_hash;
- int i;
- ECardSimple *simple;
- ECard *card;
- char *widget_name;
-
- if (!fields)
- return;
-
- card = e_card_new ("");
- simple = e_card_simple_new (card);
-
- dropdown_hash = g_hash_table_new (g_str_hash, g_str_equal);
- supported_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* build our hashtable of the drop down menu items */
- e_contact_editor_build_phone_ui (editor);
- for (i = 0; i < E_CARD_SIMPLE_PHONE_ID_LAST; i ++)
- g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_phone_to_field (i)),
- editor->phone_info[i].widget);
- e_contact_editor_build_email_ui (editor);
- for (i = 0; i < E_CARD_SIMPLE_EMAIL_ID_LAST; i ++)
- g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_email_to_field (i)),
- editor->email_info[i].widget);
- e_contact_editor_build_address_ui (editor);
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++)
- g_hash_table_insert (dropdown_hash,
- (char*)e_card_simple_get_ecard_field(simple, e_card_simple_map_address_to_field (i)),
- editor->address_info[i].widget);
-
- /* then disable them all */
- g_hash_table_foreach (dropdown_hash, (GHFunc)disable_widget_foreach, NULL);
-
- /* disable the label widgets for the dropdowns (4 phone, 1
- email and the toggle button, and 1 address and one for
- the full address button */
- for (i = 0; i < 4; i ++) {
- widget_name = g_strdup_printf ("label-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), FALSE);
- g_free (widget_name);
- widget_name = g_strdup_printf ("entry-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), FALSE);
- g_free (widget_name);
- }
- enable_widget (glade_xml_get_widget (editor->gui, "label-email1"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "entry-email1"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-mailingaddress"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "label-address"), FALSE);
- enable_widget (glade_xml_get_widget (editor->gui, "text-address"), FALSE);
-
- editor->fullname_editable = FALSE;
-
- /* enable widgets that map directly from a field to a widget (the drop down items) */
- iter = e_list_get_iterator (fields);
- for (; e_iterator_is_valid (iter); e_iterator_next (iter)) {
- char *field = (char*)e_iterator_get (iter);
- GtkWidget *widget = g_hash_table_lookup (dropdown_hash, field);
- int i;
-
- if (widget) {
- enable_widget (widget, TRUE);
- }
- else {
- /* if it's not a field that's handled by the
- dropdown items, add it to the has to be
- used in the second step */
- g_hash_table_insert (supported_hash, field, field);
- }
-
- for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i ++) {
- if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_address_to_field(i)))) {
- editor->address_editable [i] = TRUE;
- }
- }
-
- /* ugh - this is needed to make sure we don't have a
- disabled label next to a drop down when the item in
- the menu (the one reflected in the label) is
- enabled. */
- if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_email_to_field(editor->email_choice)))) {
- enable_widget (glade_xml_get_widget (editor->gui, "label-email1"), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, "entry-email1"), editor->editable);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-htmlmail"), editor->editable);
- }
- else if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_address_to_field(editor->address_choice)))) {
- enable_widget (glade_xml_get_widget (editor->gui, "label-address"), TRUE);
- enable_widget (glade_xml_get_widget (editor->gui, "checkbutton-mailingaddress"), editor->editable);
- enable_widget (glade_xml_get_widget (editor->gui, "text-address"), editor->editable);
- }
- else for (i = 0; i < 4; i ++) {
- if (!strcmp (field, e_card_simple_get_ecard_field (simple, e_card_simple_map_phone_to_field(editor->phone_choice[i])))) {
- widget_name = g_strdup_printf ("label-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), TRUE);
- g_free (widget_name);
- widget_name = g_strdup_printf ("entry-phone%d", i+1);
- enable_widget (glade_xml_get_widget (editor->gui, widget_name), editor->editable);
- g_free (widget_name);
- }
- }
- }
-
- /* handle the label next to the dropdown widgets */
-
- for (i = 0; i < num_widget_field_mappings; i ++) {
- gboolean enabled;
- GtkWidget *w;
- const char *field;
-
- w = glade_xml_get_widget(editor->gui, widget_field_mappings[i].widget_name);
- if (!w) {
- g_warning (_("Could not find widget for a field: `%s'"),
- widget_field_mappings[i].widget_name);
- continue;
- }
- field = e_card_simple_get_ecard_field (simple,
- widget_field_mappings[i].field_id);
-
- enabled = (g_hash_table_lookup (supported_hash, field) != NULL);
-
- if (widget_field_mappings[i].desensitize_for_read_only && !editor->editable) {
- enabled = FALSE;
- }
-
- enable_widget (w, enabled);
- }
-
- editor->fullname_editable = (g_hash_table_lookup (supported_hash, "full_name") != NULL);
-
- g_hash_table_destroy (dropdown_hash);
- g_hash_table_destroy (supported_hash);
- g_object_unref (simple);
- g_object_unref (card);
-}
-
-static void
-set_editable (EContactEditor *editor)
-{
- int i;
- char *entry;
- /* set the sensitivity of all the non-dropdown entry/texts/dateedits */
- for (i = 0; i < num_widget_field_mappings; i ++) {
- if (widget_field_mappings[i].desensitize_for_read_only) {
- GtkWidget *widget = glade_xml_get_widget(editor->gui, widget_field_mappings[i].widget_name);
- enable_widget (widget, editor->editable);
- }
- }
-
- /* handle the phone dropdown entries */
- for (i = 0; i < 4; i ++) {
- entry = g_strdup_printf ("entry-phone%d", i+1);
-
- enable_widget (glade_xml_get_widget(editor->gui, entry),
- editor->editable);
-
- g_free (entry);
- }
-
- /* handle the email dropdown entry */
- entry = "entry-email1";
- enable_widget (glade_xml_get_widget(editor->gui, entry),
- editor->editable);
- enable_widget (glade_xml_get_widget(editor->gui, "checkbutton-htmlmail"),
- editor->editable);
-
- /* handle the address dropdown entry */
- entry = "text-address";
- enable_widget (glade_xml_get_widget(editor->gui, entry),
- editor->editable);
-}
-
-static void
-fill_in_info(EContactEditor *editor)
-{
- ECard *card = editor->card;
- if (card) {
- char *file_as;
- ECardName *name;
- const ECardDate *anniversary;
- const ECardDate *bday;
- int i;
- GtkWidget *widget;
- GList *list;
- gboolean wants_html, wants_html_set;
-
- g_object_get (card,
- "file_as", &file_as,
- "name", &name,
- "anniversary", &anniversary,
- "birth_date", &bday,
- "wants_html_set", &wants_html_set,
- "wants_html", &wants_html,
- NULL);
-
- for (i = 0; i < sizeof(field_mapping) / sizeof(field_mapping[0]); i++) {
- fill_in_card_field(editor, card, field_mapping[i].id, field_mapping[i].key);
- }
-
- for (list = editor->arbitrary_fields; list; list = list->next) {
- fill_in_single_field(editor, list->data);
- }
-
- find_address_mailing (editor);
-
- if (wants_html_set) {
- GtkWidget *widget = glade_xml_get_widget(editor->gui, "checkbutton-htmlmail");
- if (widget && GTK_IS_CHECK_BUTTON(widget)) {
- g_object_set (widget,
- "active", wants_html,
- NULL);
- }
- }
-
- /* File as has to come after company and name or else it'll get messed up when setting them. */
- fill_in_field(editor, "entry-file-as", file_as);
- g_free (file_as);
-
- e_card_name_unref(editor->name);
- editor->name = e_card_name_ref(name);
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-anniversary");
- if (widget && E_IS_DATE_EDIT(widget)) {
- EDateEdit *dateedit;
- dateedit = E_DATE_EDIT(widget);
- if (anniversary)
- e_date_edit_set_date (dateedit,
- anniversary->year,
- anniversary->month,
- anniversary->day);
- else
- e_date_edit_set_time (dateedit, -1);
- }
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-birthday");
- if (widget && E_IS_DATE_EDIT(widget)) {
- EDateEdit *dateedit;
- dateedit = E_DATE_EDIT(widget);
- if (bday)
- e_date_edit_set_date (dateedit,
- bday->year,
- bday->month,
- bday->day);
- else
- e_date_edit_set_time (dateedit, -1);
- }
-
- set_fields(editor);
- }
-}
-
-static void
-extract_field(EContactEditor *editor, ECard *card, char *editable_id, char *key)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, editable_id);
- char *string = NULL;
-
- if (!widget)
- return;
-
- if (E_IS_URL_ENTRY (widget))
- widget = e_url_entry_get_entry (E_URL_ENTRY (widget));
-
- if (GTK_IS_EDITABLE (widget))
- string = gtk_editable_get_chars(GTK_EDITABLE (widget), 0, -1);
- else if (GTK_IS_TEXT_VIEW (widget)) {
- GtkTextIter start, end;
- GtkTextBuffer *buffer;
-
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
- gtk_text_buffer_get_start_iter (buffer, &start);
- gtk_text_buffer_get_end_iter (buffer, &end);
-
- string = gtk_text_buffer_get_text (buffer, &start, &end, TRUE);
- }
-
- if (string && *string)
- g_object_set (card,
- key, string,
- NULL);
- else
- g_object_set (card,
- key, NULL,
- NULL);
-
- if (string) g_free(string);
-}
-
-static void
-extract_single_field(EContactEditor *editor, char *name)
-{
- GtkWidget *widget = glade_xml_get_widget(editor->gui, name);
- ECardSimple *simple = editor->simple;
- if (widget && GTK_IS_EDITABLE(widget)) {
- GtkEditable *editable = GTK_EDITABLE(widget);
- char *string = gtk_editable_get_chars(editable, 0, -1);
-
- if (string && *string)
- e_card_simple_set_arbitrary(simple,
- name,
- NULL,
- string);
- else
- e_card_simple_set_arbitrary(simple,
- name,
- NULL,
- NULL);
- if (string) g_free(string);
- }
-}
-
-static void
-extract_info(EContactEditor *editor)
-{
- ECard *card = editor->card;
- if (card) {
- ECardDate anniversary;
- ECardDate bday;
- int i;
- GtkWidget *widget;
- GList *list;
-
- widget = glade_xml_get_widget(editor->gui, "entry-file-as");
- if (widget && GTK_IS_EDITABLE(widget)) {
- GtkEditable *editable = GTK_EDITABLE(widget);
- char *string = gtk_editable_get_chars(editable, 0, -1);
-
- if (string && *string)
- g_object_set (card,
- "file_as", string,
- NULL);
-
- if (string) g_free(string);
- }
-
- for (i = 0; i < sizeof(field_mapping) / sizeof(field_mapping[0]); i++) {
- extract_field(editor, card, field_mapping[i].id, field_mapping[i].key);
- }
-
- for (list = editor->arbitrary_fields; list; list = list->next) {
- extract_single_field(editor, list->data);
- }
-
- if (editor->name)
- g_object_set (card,
- "name", editor->name,
- NULL);
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-anniversary");
- if (widget && E_IS_DATE_EDIT(widget)) {
- if (e_date_edit_get_date (E_DATE_EDIT (widget),
- &anniversary.year,
- &anniversary.month,
- &anniversary.day)) {
- /* g_print ("%d %d %d\n", anniversary.year, anniversary.month, anniversary.day); */
- g_object_set (card,
- "anniversary", &anniversary,
- NULL);
- } else
- g_object_set (card,
- "anniversary", NULL,
- NULL);
- }
-
- widget = glade_xml_get_widget(editor->gui, "dateedit-birthday");
- if (widget && E_IS_DATE_EDIT(widget)) {
- if (e_date_edit_get_date (E_DATE_EDIT (widget),
- &bday.year,
- &bday.month,
- &bday.day)) {
- /* g_print ("%d %d %d\n", bday.year, bday.month, bday.day); */
- g_object_set (card,
- "birth_date", &bday,
- NULL);
- } else
- g_object_set (card,
- "birth_date", NULL,
- NULL);
- }
- }
-}
-
-/**
- * e_contact_editor_raise:
- * @config: The %EContactEditor object.
- *
- * Raises the dialog associated with this %EContactEditor object.
- */
-void
-e_contact_editor_raise (EContactEditor *editor)
-{
- /* FIXME: perhaps we should raise at realize time */
- if (GTK_WIDGET (editor->app)->window)
- gdk_window_raise (GTK_WIDGET (editor->app)->window);
-}
-
-/**
- * e_contact_editor_show:
- * @ce: The %EContactEditor object.
- *
- * Shows the dialog associated with this %EContactEditor object.
- */
-void
-e_contact_editor_show (EContactEditor *ce)
-{
- gtk_widget_show (ce->app);
-}
-
-GtkWidget *
-e_contact_editor_create_date(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_date(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- GtkWidget *widget = e_date_edit_new ();
- e_date_edit_set_allow_no_date_set (E_DATE_EDIT (widget),
- TRUE);
- e_date_edit_set_show_time (E_DATE_EDIT (widget), FALSE);
- e_date_edit_set_time (E_DATE_EDIT (widget), -1);
- gtk_widget_show (widget);
- return widget;
-}
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- GtkWidget *widget = e_url_entry_new ();
- gtk_widget_show (widget);
- return widget;
-}
-
-static void
-enable_widget (GtkWidget *widget, gboolean enabled)
-{
- if (GTK_IS_ENTRY (widget)) {
- gtk_editable_set_editable (GTK_EDITABLE (widget), enabled);
- }
- else if (GTK_IS_TEXT_VIEW (widget)) {
- gtk_text_view_set_editable (GTK_TEXT_VIEW (widget), enabled);
- }
- else if (GTK_IS_COMBO (widget)) {
- gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (widget)->entry),
- enabled);
- gtk_widget_set_sensitive (GTK_COMBO (widget)->button, enabled);
- }
- else if (E_IS_URL_ENTRY (widget)) {
- GtkWidget *e = e_url_entry_get_entry (E_URL_ENTRY (widget));
- gtk_editable_set_editable (GTK_EDITABLE (e), enabled);
- }
- else if (E_IS_DATE_EDIT (widget)) {
- e_date_edit_set_editable (E_DATE_EDIT (widget), enabled);
- }
- else
- gtk_widget_set_sensitive (widget, enabled);
-}
-
-
-gboolean
-e_contact_editor_request_close_all (void)
-{
- GSList *p;
- GSList *pnext;
- gboolean retval;
-
- retval = TRUE;
- for (p = all_contact_editors; p != NULL; p = pnext) {
- pnext = p->next;
-
- e_contact_editor_raise (E_CONTACT_EDITOR (p->data));
- if (! prompt_to_save_changes (E_CONTACT_EDITOR (p->data))) {
- retval = FALSE;
- break;
- }
-
- close_dialog (E_CONTACT_EDITOR (p->data));
- }
-
- return retval;
-}
diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h
deleted file mode 100644
index 8642aecac1..0000000000
--- a/addressbook/gui/contact-editor/e-contact-editor.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-editor.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_EDITOR_H__
-#define __E_CONTACT_EDITOR_H__
-
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-app-helper.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <glade/glade.h>
-
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-card.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-G_BEGIN_DECLS
-
-/* EContactEditor - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * card ECard * RW The card currently being edited
- */
-
-#define E_TYPE_CONTACT_EDITOR (e_contact_editor_get_type ())
-#define E_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_EDITOR, EContactEditor))
-#define E_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_EDITOR, EContactEditorClass))
-#define E_IS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_EDITOR))
-#define E_IS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_EDITOR))
-
-
-typedef struct _EContactEditor EContactEditor;
-typedef struct _EContactEditorClass EContactEditorClass;
-
-struct _EContactEditor
-{
- GtkObject object;
-
- /* item specific fields */
- EBook *book;
- ECard *card;
- ECardSimple *simple;
-
- /* UI handler */
- BonoboUIComponent *uic;
-
- GladeXML *gui;
- GtkWidget *app;
- GnomeUIInfo *email_info;
- GnomeUIInfo *phone_info;
- GnomeUIInfo *address_info;
- GtkWidget *email_popup;
- GtkWidget *phone_popup;
- GtkWidget *address_popup;
- GList *email_list;
- GList *phone_list;
- GList *address_list;
-
- ECardName *name;
- char *company;
-
- ECardSimpleEmailId email_choice;
- ECardSimplePhoneId phone_choice[4];
- ECardSimpleAddressId address_choice;
- ECardSimpleAddressId address_mailing;
-
- GList *arbitrary_fields;
-
- /* Whether we are editing a new card or an existing one */
- guint is_new_card : 1;
-
- /* Whether the card has been changed since bringing up the contact editor */
- guint changed : 1;
-
- /* Whether the contact editor will accept modifications */
- guint editable : 1;
-
- /* Whether the fullname will accept modifications */
- guint fullname_editable : 1;
-
- /* Whether each of the addresses are editable */
- gboolean address_editable[E_CARD_SIMPLE_ADDRESS_ID_LAST];
-
- /* Whether an async wombat call is in progress */
- guint in_async_call : 1;
-
- EList *writable_fields;
-};
-
-struct _EContactEditorClass
-{
- GtkObjectClass parent_class;
-
- /* Notification signals */
-
- void (* card_added) (EContactEditor *ce, EBookStatus status, ECard *card);
- void (* card_modified) (EContactEditor *ce, EBookStatus status, ECard *card);
- void (* card_deleted) (EContactEditor *ce, EBookStatus status, ECard *card);
- void (* editor_closed) (EContactEditor *ce);
-};
-
-EContactEditor *e_contact_editor_new (EBook *book,
- ECard *card,
- gboolean is_new_card,
- gboolean editable);
-GType e_contact_editor_get_type (void);
-
-void e_contact_editor_show (EContactEditor *editor);
-void e_contact_editor_close (EContactEditor *editor);
-void e_contact_editor_raise (EContactEditor *editor);
-
-gboolean e_contact_editor_confirm_delete (GtkWindow *parent);
-
-gboolean e_contact_editor_request_close_all (void);
-
-G_END_DECLS
-
-#endif /* __E_CONTACT_EDITOR_H__ */
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
deleted file mode 100644
index 703996ee07..0000000000
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ /dev/null
@@ -1,465 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-contact-quick-add.c
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#include <config.h>
-#include <ctype.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkstock.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-app.h>
-#include <addressbook/gui/component/addressbook.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/backend/ebook/e-card.h>
-#include "e-contact-editor.h"
-#include "e-contact-quick-add.h"
-#include "e-card-merging.h"
-
-typedef struct _QuickAdd QuickAdd;
-struct _QuickAdd {
- gchar *name;
- gchar *email;
- ECard *card;
-
- EContactQuickAddCallback cb;
- gpointer closure;
-
- GtkWidget *name_entry;
- GtkWidget *email_entry;
-
- gint refs;
-
-};
-
-static QuickAdd *
-quick_add_new (void)
-{
- QuickAdd *qa = g_new0 (QuickAdd, 1);
- qa->card = e_card_new ("");
- qa->refs = 1;
- return qa;
-}
-
-static void
-quick_add_ref (QuickAdd *qa)
-{
- if (qa) {
- ++qa->refs;
- }
-}
-
-static void
-quick_add_unref (QuickAdd *qa)
-{
- if (qa) {
- --qa->refs;
- if (qa->refs == 0) {
- g_free (qa->name);
- g_free (qa->email);
- g_object_unref (qa->card);
- g_free (qa);
- }
- }
-}
-
-static void
-quick_add_set_name (QuickAdd *qa, const gchar *name)
-{
- ECardName *card_name;
-
- if (name == qa->name)
- return;
-
- g_free (qa->name);
-
- card_name = e_card_name_from_string (name);
- qa->name = e_card_name_to_string (card_name);
-
- g_object_set (qa->card,
- "full_name", qa->name,
- NULL);
-
- e_card_name_unref (card_name);
-}
-
-static void
-quick_add_set_email (QuickAdd *qa, const gchar *email)
-{
- ECardSimple *simple;
-
- if (email == qa->email)
- return;
-
- g_free (qa->email);
- qa->email = g_strdup (email);
-
- simple = e_card_simple_new (qa->card);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_EMAIL, email);
- e_card_simple_sync_card (simple);
- g_object_unref (simple);
-}
-
-static void
-merge_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) closure;
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- e_card_merging_book_add_card (book, qa->card, NULL, NULL);
- if (qa->cb)
- qa->cb (qa->card, qa->closure);
- g_object_unref (book);
- } else {
- /* Something went wrong. */
- if (book)
- g_object_unref (book);
- if (qa->cb)
- qa->cb (NULL, qa->closure);
- }
-
- quick_add_unref (qa);
-}
-
-static void
-quick_add_merge_card (QuickAdd *qa)
-{
- EBook *book;
-
- quick_add_ref (qa);
-
- book = e_book_new ();
- addressbook_load_default_book (book, merge_cb, qa);
-}
-
-
-/*
- * Raise a contact editor with all fields editable, and hook up all signals accordingly.
- */
-
-static void
-card_added_cb (EContactEditor *ce, EBookStatus status, ECard *card, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) g_object_get_data (G_OBJECT (ce), "quick_add");
-
- if (qa) {
-
- if (qa->cb)
- qa->cb (qa->card, qa->closure);
-
- /* We don't need to unref qa because we set_data_full below */
- g_object_set_data (G_OBJECT (ce), "quick_add", NULL);
- }
-}
-
-static void
-editor_closed_cb (GtkWidget *w, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) g_object_get_data (G_OBJECT (w), "quick_add");
-
- if (qa)
- /* We don't need to unref qa because we set_data_full below */
- g_object_set_data (G_OBJECT (w), "quick_add", NULL);
-
- g_object_unref (w);
-}
-
-static void
-ce_have_book (EBook *book, EBookStatus status, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) closure;
-
- if (status != E_BOOK_STATUS_SUCCESS) {
- if (book)
- g_object_unref (book);
- g_warning ("Couldn't open local address book.");
- quick_add_unref (qa);
- } else {
- EContactEditor *contact_editor = e_contact_editor_new (book, qa->card, TRUE, TRUE /* XXX */);
-
- /* mark it as changed so the Save buttons are enabled when we bring up the dialog. */
- g_object_set (contact_editor,
- "changed", TRUE,
- NULL);
-
- /* We pass this via object data, so that we don't get a dangling pointer referenced if both
- the "card_added" and "editor_closed" get emitted. (Which, based on a backtrace in bugzilla,
- I think can happen and cause a crash. */
- g_object_set_data_full (G_OBJECT (contact_editor), "quick_add", qa,
- (GDestroyNotify) quick_add_unref);
-
- g_signal_connect (contact_editor,
- "card_added",
- G_CALLBACK (card_added_cb),
- NULL);
- g_signal_connect (contact_editor,
- "editor_closed",
- G_CALLBACK (editor_closed_cb),
- NULL);
-
- g_object_unref (book);
- }
-}
-
-static void
-edit_card (QuickAdd *qa)
-{
- EBook *book;
- book = e_book_new ();
- addressbook_load_default_book (book, ce_have_book, qa);
-}
-
-#define QUICK_ADD_RESPONSE_EDIT_FULL 2
-
-static void
-clicked_cb (GtkWidget *w, gint button, gpointer closure)
-{
- QuickAdd *qa = (QuickAdd *) closure;
-
- /* Get data out of entries. */
- if (button == GTK_RESPONSE_OK || button == QUICK_ADD_RESPONSE_EDIT_FULL) {
- gchar *name = NULL;
- gchar *email = NULL;
-
- if (qa->name_entry) {
- gchar *tmp;
- tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->name_entry), 0, -1);
- name = tmp;
- }
-
- if (qa->email_entry) {
- gchar *tmp;
- tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->email_entry), 0, -1);
- email = tmp;
- }
-
- quick_add_set_name (qa, name);
- quick_add_set_email (qa, email);
-
- g_free (name);
- g_free (email);
- }
-
- gtk_widget_destroy (w);
-
- if (button == GTK_RESPONSE_OK) {
-
- /* OK */
- quick_add_merge_card (qa);
-
- } else if (button == QUICK_ADD_RESPONSE_EDIT_FULL) {
-
- /* EDIT FULL */
- edit_card (qa);
-
- } else {
- /* CANCEL */
- quick_add_unref (qa);
- }
-
-}
-
-static GtkWidget *
-build_quick_add_dialog (QuickAdd *qa)
-{
- GtkWidget *dialog;
- GtkTable *table;
- const gint xpad=6, ypad=6;
-
- g_return_val_if_fail (qa != NULL, NULL);
-
- dialog = gtk_dialog_new_with_buttons (_("Contact Quick-Add"),
- NULL, /* XXX */
- (GtkDialogFlags) 0,
- _("_Edit Full"), QUICK_ADD_RESPONSE_EDIT_FULL,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- g_signal_connect (dialog, "response", G_CALLBACK (clicked_cb), qa);
-
- qa->name_entry = gtk_entry_new ();
- if (qa->name)
- gtk_entry_set_text (GTK_ENTRY (qa->name_entry), qa->name);
-
-
- qa->email_entry = gtk_entry_new ();
- if (qa->email)
- gtk_entry_set_text (GTK_ENTRY (qa->email_entry), qa->email);
-
- table = GTK_TABLE (gtk_table_new (2, 2, FALSE));
-
- gtk_table_attach (table, gtk_label_new_with_mnemonic (_("_Full Name:")),
- 0, 1, 0, 1,
- 0, 0, xpad, ypad);
- gtk_table_attach (table, qa->name_entry,
- 1, 2, 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND, xpad, ypad);
- gtk_table_attach (table, gtk_label_new_with_mnemonic (_("E-_mail:")),
- 0, 1, 1, 2,
- 0, 0, xpad, ypad);
- gtk_table_attach (table, qa->email_entry,
- 1, 2, 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND, xpad, ypad);
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
- 6);
-
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox),6);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- GTK_WIDGET (table),
- TRUE, TRUE, 6);
- gtk_widget_show_all (GTK_WIDGET (table));
-
-
- return dialog;
-}
-
-void
-e_contact_quick_add (const gchar *in_name, const gchar *email,
- EContactQuickAddCallback cb, gpointer closure)
-{
- QuickAdd *qa;
- GtkWidget *dialog;
- gchar *name = NULL;
- gint len;
-
- /* We need to have *something* to work with. */
- if (in_name == NULL && email == NULL) {
- if (cb)
- cb (NULL, closure);
- return;
- }
-
- if (in_name) {
- name = g_strdup (in_name);
-
- /* Remove extra whitespace and the quotes some mailers put around names. */
- g_strstrip (name);
- len = strlen (name);
- if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) {
- name[0] = ' ';
- name[len-1] = ' ';
- }
- g_strstrip (name);
- }
-
- qa = quick_add_new ();
- qa->cb = cb;
- qa->closure = closure;
- if (name)
- quick_add_set_name (qa, name);
- if (email)
- quick_add_set_email (qa, email);
-
- dialog = build_quick_add_dialog (qa);
- gtk_widget_show_all (dialog);
-
- g_free (name);
-}
-
-void
-e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure)
-{
- gchar *name=NULL, *email=NULL;
- const gchar *last_at, *s;
- gboolean in_quote;
-
- if (text == NULL) {
- e_contact_quick_add (NULL, NULL, cb, closure);
- return;
- }
-
- /* Look for things that look like e-mail addresses embedded in text */
- in_quote = FALSE;
- last_at = NULL;
- for (s = text; *s; ++s) {
- if (*s == '@' && !in_quote)
- last_at = s;
- else if (*s == '"')
- in_quote = !in_quote;
- }
-
-
- if (last_at == NULL) {
- /* No at sign, so we treat it all as the name */
- name = g_strdup (text);
- } else {
- gboolean bad_char = FALSE;
-
- /* walk backwards to whitespace or a < or a quote... */
- while (last_at >= text && !bad_char
- && !(isspace ((gint) *last_at) || *last_at == '<' || *last_at == '"')) {
- /* Check for some stuff that can't appear in a legal e-mail address. */
- if (*last_at == '['
- || *last_at == ']'
- || *last_at == '('
- || *last_at == ')')
- bad_char = TRUE;
- --last_at;
- }
- if (last_at < text)
- last_at = text;
-
- /* ...and then split the text there */
- if (!bad_char) {
- if (text < last_at)
- name = g_strndup (text, last_at-text);
- email = g_strdup (last_at);
- }
- }
-
- /* If all else has failed, make it the name. */
- if (name == NULL && email == NULL)
- name = g_strdup (text);
-
-
-
- /* Clean up email, remove bracketing <>s */
- if (email && *email) {
- gboolean changed = FALSE;
- g_strstrip (email);
- if (*email == '<') {
- *email = ' ';
- changed = TRUE;
- }
- if (email[strlen (email)-1] == '>') {
- email[strlen (email)-1] = ' ';
- changed = TRUE;
- }
- if (changed)
- g_strstrip (email);
- }
-
-
- e_contact_quick_add (name, email, cb, closure);
- g_free (name);
- g_free (email);
-}
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.h b/addressbook/gui/contact-editor/e-contact-quick-add.h
deleted file mode 100644
index 1bf69ee114..0000000000
--- a/addressbook/gui/contact-editor/e-contact-quick-add.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * e-contact-quick-add.h
- *
- * Copyright (C) 2001 Ximian, Inc.
- *
- * Developed by Jon Trowbridge <trow@ximian.com>
- */
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef __E_CONTACT_QUICK_ADD_H__
-#define __E_CONTACT_QUICK_ADD_H__
-
-#include <addressbook/backend/ebook/e-card.h>
-
-typedef void (*EContactQuickAddCallback) (ECard *new_card, gpointer closure);
-
-void e_contact_quick_add (const gchar *name, const gchar *email,
- EContactQuickAddCallback cb, gpointer closure);
-
-void e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure);
-
-#endif /* __E_CONTACT_QUICK_ADD_H__ */
-
diff --git a/addressbook/gui/contact-editor/e-contact-save-as.c b/addressbook/gui/contact-editor/e-contact-save-as.c
deleted file mode 100644
index a141560763..0000000000
--- a/addressbook/gui/contact-editor/e-contact-save-as.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-editor.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-contact-save-as.h"
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <gtk/gtkfilesel.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gal/util/e-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <errno.h>
-#include <string.h>
-#include <libgnomeui/gnome-messagebox.h>
-
-static gint file_exists(GtkFileSelection *filesel, const char *filename);
-
-typedef struct {
- GtkFileSelection *filesel;
- char *vcard;
-} SaveAsInfo;
-
-static void
-save_it(GtkWidget *widget, SaveAsInfo *info)
-{
- gint error = 0;
- gint response = 0;
-
- const char *filename = gtk_file_selection_get_filename (info->filesel);
-
- error = e_write_file (filename, info->vcard, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC);
-
- if (error == EEXIST) {
- response = file_exists(info->filesel, filename);
- switch (response) {
- case GTK_RESPONSE_ACCEPT : /* Overwrite */
- e_write_file(filename, info->vcard, O_WRONLY | O_CREAT | O_TRUNC);
- break;
- case GTK_RESPONSE_REJECT : /* cancel */
- return;
- }
- } else if (error != 0) {
- GtkWidget *dialog;
- char *str;
-
- str = g_strdup_printf (_("Error saving %s: %s"), filename, strerror(errno));
- dialog = gtk_message_dialog_new (GTK_WINDOW (info->filesel),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- str);
- g_free (str);
-
- gtk_widget_show (dialog);
-
- return;
- }
-
- gtk_widget_destroy(GTK_WIDGET(info->filesel));
-}
-
-static void
-close_it(GtkWidget *widget, SaveAsInfo *info)
-{
- gtk_widget_destroy (GTK_WIDGET (info->filesel));
-}
-
-static void
-destroy_it(void *data, GObject *where_the_object_was)
-{
- SaveAsInfo *info = data;
- g_free (info->vcard);
- g_free (info);
-}
-
-static char *
-make_safe_filename (const char *prefix, char *name)
-{
- char *safe, *p;
-
- if (!name) {
- /* This is a filename. Translators take note. */
- name = _("card.vcf");
- }
-
- p = strrchr (name, '/');
- if (p)
- safe = g_strdup_printf ("%s%s%s", prefix, p, ".vcf");
- else
- safe = g_strdup_printf ("%s/%s%s", prefix, name, ".vcf");
-
- p = strrchr (safe, '/') + 1;
- if (p)
- e_filename_make_safe (p);
-
- return safe;
-}
-
-void
-e_contact_save_as(char *title, ECard *card, GtkWindow *parent_window)
-{
- GtkFileSelection *filesel;
- char *file;
- char *name;
- SaveAsInfo *info = g_new(SaveAsInfo, 1);
-
- filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title));
-
- g_object_get (card,
- "file_as", &name,
- NULL);
- file = make_safe_filename (g_get_home_dir(), name);
- gtk_file_selection_set_filename (filesel, file);
- g_free (file);
- g_free (name);
-
- info->filesel = filesel;
- info->vcard = e_card_get_vcard(card);
-
- g_signal_connect(filesel->ok_button, "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(filesel->cancel_button, "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-
- if (parent_window) {
- gtk_window_set_transient_for (GTK_WINDOW (filesel),
- parent_window);
- gtk_window_set_modal (GTK_WINDOW (filesel), TRUE);
- }
-
- gtk_widget_show(GTK_WIDGET(filesel));
-}
-
-void
-e_contact_list_save_as(char *title, GList *list, GtkWindow *parent_window)
-{
- GtkFileSelection *filesel;
- SaveAsInfo *info = g_new(SaveAsInfo, 1);
-
- filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title));
-
- /* This is a filename. Translators take note. */
- if (list && list->data && list->next == NULL) {
- char *name, *file;
- g_object_get (list->data,
- "file_as", &name,
- NULL);
- file = make_safe_filename (g_get_home_dir(), name);
- gtk_file_selection_set_filename (filesel, file);
- g_free (file);
- g_free (name);
- } else {
- char *file;
- file = make_safe_filename (g_get_home_dir(), _("list"));
- gtk_file_selection_set_filename (filesel, file);
- g_free (file);
- }
-
- info->filesel = filesel;
- info->vcard = e_card_list_get_vcard (list);
-
- g_signal_connect(filesel->ok_button, "clicked",
- G_CALLBACK (save_it), info);
- g_signal_connect(filesel->cancel_button, "clicked",
- G_CALLBACK (close_it), info);
- g_object_weak_ref (G_OBJECT (filesel), destroy_it, info);
-
- if (parent_window) {
- gtk_window_set_transient_for (GTK_WINDOW (filesel),
- parent_window);
- gtk_window_set_modal (GTK_WINDOW (filesel), TRUE);
- }
-
- gtk_widget_show(GTK_WIDGET(filesel));
-}
-
-static gint
-file_exists(GtkFileSelection *filesel, const char *filename)
-{
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (filesel),
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("%s already exists\nDo you want to overwrite it?"), filename);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
- _("Overwrite"), GTK_RESPONSE_ACCEPT,
- NULL);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return response;
-}
diff --git a/addressbook/gui/contact-editor/e-contact-save-as.h b/addressbook/gui/contact-editor/e-contact-save-as.h
deleted file mode 100644
index 2b01ad8435..0000000000
--- a/addressbook/gui/contact-editor/e-contact-save-as.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-save-as.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_SAVE_AS_H__
-#define __E_CONTACT_SAVE_AS_H__
-
-#include <gtk/gtkwindow.h>
-#include <glade/glade.h>
-#include "addressbook/backend/ebook/e-card.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-void e_contact_save_as (gchar *title, ECard *card, GtkWindow *parent_window);
-void e_contact_list_save_as (gchar *title, GList *list, GtkWindow *parent_window);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_CONTACT_EDITOR_H__ */
diff --git a/addressbook/gui/contact-editor/fulladdr.glade b/addressbook/gui/contact-editor/fulladdr.glade
deleted file mode 100644
index c7767b9751..0000000000
--- a/addressbook/gui/contact-editor/fulladdr.glade
+++ /dev/null
@@ -1,446 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-checkaddress">
- <property name="title" translatable="yes">Full Address</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox-container">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-checkaddress">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label-street">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-street</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-city">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ci_ty:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-city</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-city">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-ext">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-po">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_PO Box:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-po</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-ext">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Address _2:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-ext</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-po">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-street">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-region">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_State/Province:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-region</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-region">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo-country">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-country">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget1">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-code">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-code">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_ZIP Code:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-code</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-country">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Countr_y:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-country</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/fullname.glade b/addressbook/gui/contact-editor/fullname.glade
deleted file mode 100644
index 9e170c93d0..0000000000
--- a/addressbook/gui/contact-editor/fullname.glade
+++ /dev/null
@@ -1,674 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-checkfullname">
- <property name="title" translatable="yes">Full Name</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox-container">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">8</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table-checkfullname">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkCombo" id="combo-title">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-title">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget1">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget2">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget4">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Mr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget6">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Mrs.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget8">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ms.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget10">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Miss</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget12">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Dr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget14">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget15">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo-suffix">
- <property name="visible">True</property>
- <property name="value_in_list">False</property>
- <property name="allow_empty">True</property>
- <property name="case_sensitive">False</property>
- <property name="enable_arrow_keys">True</property>
- <property name="enable_arrows_always">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="entry-suffix">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget16">
- <property name="visible">True</property>
- <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget17">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget18">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget19">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget20">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget21">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget22">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Jr.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget23">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">I</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget25">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">II</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget27">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget28">
- <property name="visible">True</property>
- <property name="label" translatable="yes">III</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget29">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Esq.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkListItem" id="convertwidget31">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget32">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-first">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-middle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry-last">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-first">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_First:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-first</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-title">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Title:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-title</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-middle">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Middle:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-middle</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-last">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Last:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-last</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label-suffix">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Suffix:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">entry-suffix</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c
deleted file mode 100644
index 4a8c111563..0000000000
--- a/addressbook/gui/contact-editor/test-editor.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <glade/glade.h>
-#include "e-contact-editor.h"
-#include "ebook/e-card.h"
-
-#define TEST_VCARD \
-"BEGIN:VCARD
-" \
-"FN:Nat
-" \
-"N:Friedman;Nat;D;Mr.
-" \
-"BDAY:1977-08-06
-" \
-"TEL;WORK:617 679 1984
-" \
-"TEL;CELL:123 456 7890
-" \
-"EMAIL;INTERNET:nat@nat.org
-" \
-"EMAIL;INTERNET:nat@ximian.com
-" \
-"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;
-" \
-"ADR;HOME;POSTAL;INTL:P.O. Box 202;;;Any Town 2;MI;12344-4321;USA
-" \
-"END:VCARD
-" \
-"
-"
-
-static char *
-read_file (char *name)
-{
- int len;
- char buff[65536];
- char line[1024];
- FILE *f;
-
- f = fopen (name, "r");
- if (f == NULL)
- g_error ("Unable to open %s!\n", name);
-
- len = 0;
- while (fgets (line, sizeof (line), f) != NULL) {
- strcpy (buff + len, line);
- len += strlen (line);
- }
-
- fclose (f);
-
- return g_strdup (buff);
-}
-
-/* Callback used when a contact editor is closed */
-static void
-editor_closed_cb (EContactEditor *ce, gpointer data)
-{
- static int count = 2;
-
- count--;
- g_object_unref (ce);
-
- if (count == 0)
- exit (0);
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Contact Editor Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the contact editor canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- char *cardstr;
- EContactEditor *ce;
-
- gnome_program_init("Contact Editor Test", VERSION, LIBGNOMEUI_MODULE, argc, argv, NULL);
-
- glade_init ();
-
- cardstr = NULL;
- if (argc == 2)
- cardstr = read_file (argv [1]);
-
- if (cardstr == NULL)
- cardstr = TEST_VCARD;
-
- ce = e_contact_editor_new (NULL, e_card_new_with_default_charset (cardstr, "ISO-8859-1"), TRUE, FALSE);
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), NULL);
-
- ce = e_contact_editor_new (NULL, e_card_new_with_default_charset (cardstr, "ISO-8859-1"), TRUE, FALSE);
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), NULL);
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/gui/contact-list-editor/.cvsignore b/addressbook/gui/contact-list-editor/.cvsignore
deleted file mode 100644
index f151930645..0000000000
--- a/addressbook/gui/contact-list-editor/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.pure
-e-contact-list-editor-marshal.c
-e-contact-list-editor-marshal.h
diff --git a/addressbook/gui/contact-list-editor/Makefile.am b/addressbook/gui/contact-list-editor/Makefile.am
deleted file mode 100644
index 82e296f8cf..0000000000
--- a/addressbook/gui/contact-list-editor/Makefile.am
+++ /dev/null
@@ -1,55 +0,0 @@
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/ \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/addressbook/gui/contact-editor \
- -I$(top_builddir)/shell \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)\"" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"contact-list-editor\" \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecontactlisteditor.la
-
-libecontactlisteditor_la_SOURCES = \
- e-contact-list-editor.c \
- e-contact-list-editor.h \
- e-contact-list-editor-marshal.c \
- e-contact-list-model.c \
- e-contact-list-model.h
-
-# GLib marshalling cruft
-
-e-contact-list-editor-marshal.h: e-contact-list-editor-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=ecle_marshal e-contact-list-editor-marshal.list --header > e-contact-list-editor-marshal.tmp \
- && mv e-contact-list-editor-marshal.tmp e-contact-list-editor-marshal.h ) \
- || ( rm -f e-contact-list-editor-marshal.tmp && exit 1 )
-
-e-contact-list-editor-marshal.c: e-contact-list-editor-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=ecle_marshal e-contact-list-editor-marshal.list --body > e-contact-list-editor-marshal.tmp \
- && mv e-contact-list-editor-marshal.tmp e-contact-list-editor-marshal.c ) \
- || ( rm -f e-contact-list-editor-marshal.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-contact-list-editor-marshal.c e-contact-list-editor-marshal.h
-
-
-glade_DATA = contact-list-editor.glade
-etspec_DATA = e-contact-list-editor.etspec
-
-BUILT_SOURCES = $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = $(glade_DATA) \
- $(etspec_DATA) \
- e-contact-list-editor-marshal.list
diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.glade b/addressbook/gui/contact-list-editor/contact-list-editor.glade
deleted file mode 100644
index c64eebd520..0000000000
--- a/addressbook/gui/contact-list-editor/contact-list-editor.glade
+++ /dev/null
@@ -1,313 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-<requires lib="bonobo"/>
-
-<widget class="GnomeApp" id="contact list editor">
- <property name="title" translatable="yes">contact-list-editor</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_width">426</property>
- <property name="default_height">304</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="enable_layout_config">True</property>
-
- <child internal-child="dock">
- <widget class="BonoboDock" id="dock1">
- <property name="visible">True</property>
- <property name="allow_floating">True</property>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_List name:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">list-name-entry</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="list-name-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom7">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">evolution-contacts-plain.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 23 Jun 2001 05:59:21 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame3">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Type an email address or drag a contact into the list below:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="email-entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="contact-list-table">
- <property name="visible">True</property>
- <property name="creation_function">e_contact_list_editor_create_table</property>
- <property name="string1"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Sat, 23 Jun 2001 06:00:16 GMT</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="visible-addrs-checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Hide addresses when sending mail to this list</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">
-</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox4">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="add-email-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="remove-button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Members</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list b/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list
deleted file mode 100644
index 8d94a0bf3b..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor-marshal.list
+++ /dev/null
@@ -1,4 +0,0 @@
-INT:OBJECT
-NONE:INT,OBJECT
-NONE:INT,OBJECT
-NONE:NONE
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
deleted file mode 100644
index ab6ea97096..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ /dev/null
@@ -1,1044 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-list-editor.c
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-contact-list-editor.h"
-
-#include <string.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-window-icon.h>
-#include <bonobo/bonobo-ui-container.h>
-#include <bonobo/bonobo-ui-util.h>
-#include <bonobo/bonobo-window.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include "shell/evolution-shell-component-utils.h"
-
-#include "addressbook/gui/widgets/e-addressbook-util.h"
-
-#include "e-contact-editor.h"
-#include "e-contact-save-as.h"
-#include "e-contact-list-model.h"
-#include "e-contact-list-editor-marshal.h"
-
-/* Signal IDs */
-enum {
- LIST_ADDED,
- LIST_MODIFIED,
- LIST_DELETED,
- EDITOR_CLOSED,
- LAST_SIGNAL
-};
-
-static void e_contact_list_editor_init (EContactListEditor *editor);
-static void e_contact_list_editor_class_init (EContactListEditorClass *klass);
-static void e_contact_list_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_contact_list_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_contact_list_editor_dispose (GObject *object);
-
-static void create_ui (EContactListEditor *ce);
-static void set_editable (EContactListEditor *editor);
-static void command_state_changed (EContactListEditor *editor);
-static void close_dialog (EContactListEditor *cle);
-static void extract_info(EContactListEditor *editor);
-static void fill_in_info(EContactListEditor *editor);
-
-static void add_email_cb (GtkWidget *w, EContactListEditor *editor);
-static void remove_entry_cb (GtkWidget *w, EContactListEditor *editor);
-static void list_name_changed_cb (GtkWidget *w, EContactListEditor *editor);
-static void visible_addrs_toggled_cb (GtkWidget *w, EContactListEditor *editor);
-
-static gint app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data);
-static gboolean table_drag_drop_cb (ETable *table, int row, int col, GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static gboolean table_drag_motion_cb (ETable *table, int row, int col, GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor);
-static void table_drag_data_received_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data, guint info, guint time,
- EContactListEditor *editor);
-
-static GtkObjectClass *parent_class = NULL;
-
-static guint contact_list_editor_signals[LAST_SIGNAL];
-
-enum DndTargetType {
- DND_TARGET_TYPE_VCARD,
-};
-#define VCARD_TYPE "text/x-vcard"
-static GtkTargetEntry drag_types[] = {
- { VCARD_TYPE, 0, DND_TARGET_TYPE_VCARD },
-};
-static const int num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]);
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_CARD,
- PROP_IS_NEW_LIST,
- PROP_EDITABLE
-};
-
-static GSList *all_contact_list_editors = NULL;
-
-GType
-e_contact_list_editor_get_type (void)
-{
- static GType cle_type = 0;
-
- if (!cle_type) {
- static const GTypeInfo cle_info = {
- sizeof (EContactListEditorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_list_editor_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactListEditor),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_list_editor_init,
- };
-
- cle_type = g_type_register_static (GTK_TYPE_OBJECT, "EContactListEditor", &cle_info, 0);
- }
-
- return cle_type;
-}
-
-
-static void
-e_contact_list_editor_class_init (EContactListEditorClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_ref (GTK_TYPE_OBJECT);
-
- object_class->set_property = e_contact_list_editor_set_property;
- object_class->get_property = e_contact_list_editor_get_property;
- /* object_class->dispose = e_contact_list_editor_dispose;*/
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("Card"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_IS_NEW_LIST,
- g_param_spec_boolean ("is_new_list",
- _("Is New List"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- contact_list_editor_signals[LIST_ADDED] =
- g_signal_new ("list_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_added),
- NULL, NULL,
- ecle_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[LIST_MODIFIED] =
- g_signal_new ("list_modified",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_modified),
- NULL, NULL,
- ecle_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[LIST_DELETED] =
- g_signal_new ("list_deleted",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, list_deleted),
- NULL, NULL,
- ecle_marshal_NONE__INT_OBJECT,
- G_TYPE_NONE, 2,
- G_TYPE_INT, G_TYPE_OBJECT);
-
- contact_list_editor_signals[EDITOR_CLOSED] =
- g_signal_new ("editor_closed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EContactListEditorClass, editor_closed),
- NULL, NULL,
- ecle_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-e_contact_list_editor_init (EContactListEditor *editor)
-{
- GladeXML *gui;
- GtkWidget *bonobo_win;
- BonoboUIContainer *container;
- char *icon_path;
-
- editor->card = NULL;
- editor->changed = FALSE;
- editor->editable = TRUE;
- editor->in_async_call = FALSE;
- editor->is_new_list = FALSE;
-
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-list-editor.glade", NULL, NULL);
- editor->gui = gui;
-
- editor->app = glade_xml_get_widget (gui, "contact list editor");
-
- editor->table = glade_xml_get_widget (gui, "contact-list-table");
- editor->model = g_object_get_data (G_OBJECT(editor->table), "model");
-
- /* XXX need this for libglade-2 it seems */
- gtk_widget_show (editor->table);
-
- editor->add_button = glade_xml_get_widget (editor->gui, "add-email-button");
- editor->remove_button = glade_xml_get_widget (editor->gui, "remove-button");
-
- editor->email_entry = glade_xml_get_widget (gui, "email-entry");
- editor->list_name_entry = glade_xml_get_widget (gui, "list-name-entry");
-
- editor->visible_addrs_checkbutton = glade_xml_get_widget (gui, "visible-addrs-checkbutton");
-
- /* Construct the app */
- bonobo_win = bonobo_window_new ("contact-list-editor", _("Contact List Editor"));
-
- /* FIXME: The sucking bit */
- {
- GtkWidget *contents;
-
- contents = bonobo_dock_get_client_area (gnome_app_get_dock (GNOME_APP (editor->app)));
-
- if (!contents) {
- g_message ("contact_list_editor_construct(): Could not get contents");
- return;
- }
- gtk_widget_ref (contents);
- gtk_container_remove (GTK_CONTAINER (contents->parent), contents);
- bonobo_window_set_contents (BONOBO_WINDOW (bonobo_win), contents);
- gtk_widget_destroy (editor->app);
- editor->app = bonobo_win;
- }
-
- /* Build the menu and toolbar */
-
- container = bonobo_window_get_ui_container (BONOBO_WINDOW (editor->app));
-
- editor->uic = bonobo_ui_component_new_default ();
- if (!editor->uic) {
- g_message ("e_contact_list_editor_init(): eeeeek, could not create the UI handler!");
- return;
- }
- bonobo_ui_component_set_container (editor->uic,
- bonobo_object_corba_objref (
- BONOBO_OBJECT (container)), NULL);
-
- create_ui (editor);
-
- /* connect signals */
- g_signal_connect (editor->add_button,
- "clicked", G_CALLBACK(add_email_cb), editor);
- g_signal_connect (editor->email_entry,
- "activate", G_CALLBACK(add_email_cb), editor);
- g_signal_connect (editor->remove_button,
- "clicked", G_CALLBACK(remove_entry_cb), editor);
- g_signal_connect (editor->list_name_entry,
- "changed", G_CALLBACK(list_name_changed_cb), editor);
- g_signal_connect (editor->visible_addrs_checkbutton,
- "toggled", G_CALLBACK(visible_addrs_toggled_cb), editor);
-
- e_table_drag_dest_set (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- 0, drag_types, num_drag_types, GDK_ACTION_LINK);
-
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_motion", G_CALLBACK(table_drag_motion_cb), editor);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_drop", G_CALLBACK (table_drag_drop_cb), editor);
- g_signal_connect (e_table_scrolled_get_table (E_TABLE_SCROLLED (editor->table)),
- "table_drag_data_received", G_CALLBACK(table_drag_data_received_cb), editor);
-
- command_state_changed (editor);
-
- /* Connect to the deletion of the dialog */
-
- g_signal_connect (editor->app, "delete_event",
- G_CALLBACK (app_delete_event_cb), editor);
-
- /* set the icon */
- icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "contact-list-16.png", NULL);
- gnome_window_icon_set_from_file (GTK_WINDOW (editor->app), icon_path);
- g_free (icon_path);
-}
-
-static void
-e_contact_list_editor_dispose (GObject *object)
-{
- /* XXX need to call parent dispose */
-}
-
-typedef struct {
- EContactListEditor *cle;
- gboolean should_close;
-} EditorCloseStruct;
-
-static void
-list_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruct *ecs)
-{
- EContactListEditor *cle = ecs->cle;
- gboolean should_close = ecs->should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- e_card_set_id (cle->card, id);
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_ADDED], 0,
- status, cle->card);
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- cle->is_new_list = FALSE;
-
- if (should_close)
- close_dialog (cle);
- else
- command_state_changed (cle);
- }
-
- g_object_unref (cle);
- g_free (ecs);
-}
-
-static void
-list_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs)
-{
- EContactListEditor *cle = ecs->cle;
- gboolean should_close = ecs->should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_MODIFIED], 0,
- status, cle->card);
-
- if (status == E_BOOK_STATUS_SUCCESS) {
- if (should_close)
- close_dialog (cle);
- }
-
- g_object_unref (cle); /* release ref held for ebook callback */
- g_free (ecs);
-}
-
-static void
-save_card (EContactListEditor *cle, gboolean should_close)
-{
- extract_info (cle);
-
- if (cle->book) {
- EditorCloseStruct *ecs = g_new(EditorCloseStruct, 1);
-
- ecs->cle = cle;
- g_object_ref (cle);
- ecs->should_close = should_close;
-
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, FALSE);
- cle->in_async_call = TRUE;
-
- if (cle->is_new_list)
- e_book_add_card (cle->book, cle->card, (EBookIdCallback)list_added_cb, ecs);
- else
- e_book_commit_card (cle->book, cle->card, (EBookCallback)list_modified_cb, ecs);
-
- cle->changed = FALSE;
- }
-}
-
-static gboolean
-is_named (EContactListEditor *editor)
-{
- char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1);
- gboolean named = FALSE;
-
- if (string && *string) {
- named = TRUE;
- }
-
- g_free (string);
-
- return named;
-}
-
-static gboolean
-prompt_to_save_changes (EContactListEditor *editor)
-{
- if (!editor->changed || !is_named (editor))
- return TRUE;
-
- switch (e_addressbook_prompt_save_dialog (GTK_WINDOW(editor->app))) {
- case GTK_RESPONSE_YES:
- save_card (editor, FALSE);
- return TRUE;
- case GTK_RESPONSE_NO:
- return TRUE;
- case GTK_RESPONSE_CANCEL:
- default:
- return FALSE;
- }
-}
-
-static void
-file_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- if (!prompt_to_save_changes (cle))
- return;
-
- close_dialog (cle);
-}
-
-static void
-file_save_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- save_card (cle, FALSE);
-}
-
-static void
-file_save_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- e_contact_save_as(_("Save List as VCard"), cle->card, GTK_WINDOW (cle->app));
-}
-
-static void
-file_send_as_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- e_addressbook_send_card(cle->card, E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT);
-}
-
-static void
-file_send_to_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
-
- extract_info (cle);
-
- e_addressbook_send_card(cle->card, E_ADDRESSBOOK_DISPOSITION_AS_TO);
-}
-
-static void
-tb_save_and_close_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
- save_card (cle, TRUE);
-}
-
-static void
-list_deleted_cb (EBook *book, EBookStatus status, EContactListEditor *cle)
-{
- if (cle->app)
- gtk_widget_set_sensitive (cle->app, TRUE);
- cle->in_async_call = FALSE;
-
- g_signal_emit (cle, contact_list_editor_signals[LIST_DELETED], 0,
- status, cle->card);
-
- /* always close the dialog after we successfully delete a list */
- if (status == E_BOOK_STATUS_SUCCESS)
- close_dialog (cle);
-
- g_object_unref (cle); /* release reference held for callback */
-}
-
-static void
-delete_cb (GtkWidget *widget, gpointer data)
-{
- EContactListEditor *cle = E_CONTACT_LIST_EDITOR (data);
- ECard *card = cle->card;
-
- g_object_ref (card);
-
- if (e_contact_editor_confirm_delete(GTK_WINDOW(cle->app))) {
-
- extract_info (cle);
-
- if (!cle->is_new_list) {
- gtk_widget_set_sensitive (cle->app, FALSE);
- cle->in_async_call = TRUE;
-
- g_object_ref (cle); /* hold reference for callback */
- e_book_remove_card (cle->book, card, (EBookCallback)list_deleted_cb, cle);
- }
- }
-
- g_object_unref (card);
-}
-
-static
-BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSave", file_save_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSaveClose", tb_save_and_close_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorDelete", delete_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSaveAs", file_save_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSendAs", file_send_as_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorSendTo", file_send_to_cb),
- BONOBO_UI_UNSAFE_VERB ("ContactListEditorClose", file_close_cb),
- BONOBO_UI_VERB_END
-};
-
-static EPixmap pixmaps[] = {
- E_PIXMAP ("/commands/ContactListEditorSave", "save-16.png"),
- E_PIXMAP ("/commands/ContactListEditorSaveClose", "save-16.png"),
- E_PIXMAP ("/commands/ContactListEditorSaveAs", "save-as-16.png"),
-
- E_PIXMAP ("/commands/ContactListEditorDelete", "evolution-trash-mini.png"),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- E_PIXMAP ("/commands/ContactListEditorPrint", "print.xpm"),
- E_PIXMAP ("/commands/ContactListEditorPrintEnvelope", "print.xpm"),
-#endif
- E_PIXMAP ("/Toolbar/ContactListEditorSaveClose", "buttons/save-24.png"),
- E_PIXMAP ("/Toolbar/ContactListEditorDelete", "buttons/delete-message.png"),
- E_PIXMAP ("/Toolbar/ContactListEditorPrint", "buttons/print.png"),
-
- E_PIXMAP_END
-};
-
-static void
-create_ui (EContactListEditor *ce)
-{
- bonobo_ui_component_add_verb_list_with_data (
- ce->uic, verbs, ce);
-
- bonobo_ui_util_set_ui (ce->uic, PREFIX,
- EVOLUTION_UIDIR "/evolution-contact-list-editor.xml",
- "evolution-contact-list-editor", NULL);
-
- e_pixmaps_update (ce->uic, pixmaps);
-}
-
-static void
-contact_list_editor_destroy_notify (gpointer data,
- GObject *where_the_object_was)
-{
- EContactListEditor *ce = E_CONTACT_LIST_EDITOR (data);
-
- all_contact_list_editors = g_slist_remove (all_contact_list_editors, ce);
-}
-
-EContactListEditor *
-e_contact_list_editor_new (EBook *book,
- ECard *list_card,
- gboolean is_new_list,
- gboolean editable)
-{
- EContactListEditor *ce = g_object_new (E_TYPE_CONTACT_LIST_EDITOR, NULL);
-
- all_contact_list_editors = g_slist_prepend (all_contact_list_editors, ce);
- g_object_weak_ref (G_OBJECT (ce), contact_list_editor_destroy_notify, ce);
-
- g_object_ref (ce);
- gtk_object_sink (GTK_OBJECT (ce));
-
- g_object_set (ce,
- "book", book,
- "card", list_card,
- "is_new_list", is_new_list,
- "editable", editable,
- NULL);
-
- return ce;
-}
-
-static void
-e_contact_list_editor_set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- EContactListEditor *editor;
-
- editor = E_CONTACT_LIST_EDITOR (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (editor->book)
- g_object_unref (editor->book);
- editor->book = E_BOOK(g_value_get_object (value));
- g_object_ref (editor->book);
- /* XXX more here about editable/etc. */
- break;
- case PROP_CARD:
- if (editor->card)
- g_object_unref (editor->card);
- editor->card = e_card_duplicate(E_CARD(g_value_get_object (value)));
- fill_in_info(editor);
- editor->changed = FALSE;
- command_state_changed (editor);
- break;
- case PROP_IS_NEW_LIST: {
- gboolean new_value = g_value_get_boolean (value);
- gboolean changed = (editor->is_new_list != new_value);
-
- editor->is_new_list = new_value;
-
- if (changed)
- command_state_changed (editor);
- break;
- }
- case PROP_EDITABLE: {
- gboolean new_value = g_value_get_boolean (value);
- gboolean changed = (editor->editable != new_value);
-
- editor->editable = new_value;
-
- if (changed) {
- set_editable (editor);
- command_state_changed (editor);
- }
- break;
- }
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_contact_list_editor_get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- EContactListEditor *editor;
-
- editor = E_CONTACT_LIST_EDITOR (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, editor->book);
- break;
-
- case PROP_CARD:
- extract_info(editor);
- g_value_set_object (value, editor->card);
- break;
-
- case PROP_IS_NEW_LIST:
- g_value_set_boolean (value, editor->is_new_list);
- break;
-
- case PROP_EDITABLE:
- g_value_set_boolean (value, editor->editable);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-void
-e_contact_list_editor_show (EContactListEditor *editor)
-{
- gtk_widget_show (editor->app);
-}
-
-void
-e_contact_list_editor_raise (EContactListEditor *editor)
-{
- gdk_window_raise (GTK_WIDGET (editor->app)->window);
-}
-
-GtkWidget *
-e_contact_list_editor_create_table(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_contact_list_editor_create_table(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
-
- ETableModel *model;
- GtkWidget *table;
-
- model = e_contact_list_model_new ();
-
- table = e_table_scrolled_new_from_spec_file (model,
- NULL,
- EVOLUTION_ETSPECDIR "/e-contact-list-editor.etspec",
- NULL);
-
- g_object_set_data(G_OBJECT(table), "model", model);
-
- return table;
-}
-
-static void
-add_email_cb (GtkWidget *w, EContactListEditor *editor)
-{
- GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (editor->table));
- const char *text = gtk_entry_get_text (GTK_ENTRY(editor->email_entry));
-
- if (text && *text) {
- e_contact_list_model_add_email (E_CONTACT_LIST_MODEL(editor->model), text);
-
- /* Skip to the end of the list */
- if (adj->upper - adj->lower > adj->page_size)
- gtk_adjustment_set_value (adj, adj->upper);
- }
-
- gtk_entry_set_text (GTK_ENTRY(editor->email_entry), "");
-
- editor->changed = TRUE;
-
- command_state_changed (editor);
-}
-
-static void
-remove_row (int model_row, EContactListEditor *editor)
-{
- e_contact_list_model_remove_row (E_CONTACT_LIST_MODEL (editor->model), model_row);
-}
-
-static void
-remove_entry_cb (GtkWidget *w, EContactListEditor *editor)
-{
- e_table_selected_row_foreach (e_table_scrolled_get_table(E_TABLE_SCROLLED(editor->table)),
- (EForeachFunc)remove_row, editor);
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-list_name_changed_cb (GtkWidget *w, EContactListEditor *editor)
-{
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-visible_addrs_toggled_cb (GtkWidget *w, EContactListEditor *editor)
-{
- editor->changed = TRUE;
- command_state_changed (editor);
-}
-
-static void
-set_editable (EContactListEditor *editor)
-{
- gtk_widget_set_sensitive (editor->email_entry, editor->editable);
- gtk_widget_set_sensitive (editor->list_name_entry, editor->editable);
- gtk_widget_set_sensitive (editor->add_button, editor->editable);
- gtk_widget_set_sensitive (editor->remove_button, editor->editable);
- gtk_widget_set_sensitive (editor->table, editor->editable);
-}
-
-/* Closes the dialog box and emits the appropriate signals */
-static void
-close_dialog (EContactListEditor *cle)
-{
- g_assert (cle->app != NULL);
-
- gtk_widget_destroy (cle->app);
- cle->app = NULL;
-
- g_signal_emit (cle, contact_list_editor_signals[EDITOR_CLOSED], 0);
-}
-
-/* Callback used when the editor is destroyed */
-static gint
-app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
-{
- EContactListEditor *ce;
-
- ce = E_CONTACT_LIST_EDITOR (data);
-
- /* if we're in an async call, don't allow the dialog to close */
- if (ce->in_async_call)
- return TRUE;
-
- if (!prompt_to_save_changes (ce))
- return TRUE;
-
- close_dialog (ce);
- return TRUE;
-}
-
-static gboolean
-table_drag_motion_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- GList *p;
-
- for (p = context->targets; p != NULL; p = p->next) {
- char *possible_type;
-
- possible_type = gdk_atom_name ((GdkAtom) p->data);
- if (!strcmp (possible_type, VCARD_TYPE)) {
- g_free (possible_type);
- gdk_drag_status (context, GDK_ACTION_LINK, time);
- return TRUE;
- }
-
- g_free (possible_type);
- }
-
- return FALSE;
-}
-
-static gboolean
-table_drag_drop_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y, guint time, EContactListEditor *editor)
-{
- if (context->targets == NULL)
- return FALSE;
-
-
- gtk_drag_get_data (GTK_WIDGET (table), context,
- GDK_POINTER_TO_ATOM (context->targets->data),
- time);
- return TRUE;
-}
-
-static void
-table_drag_data_received_cb (ETable *table, int row, int col,
- GdkDragContext *context,
- gint x, gint y,
- GtkSelectionData *selection_data,
- guint info, guint time, EContactListEditor *editor)
-{
- GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (editor->table));
- char *target_type;
- gboolean changed = FALSE;
- gboolean handled = FALSE;
-
- target_type = gdk_atom_name (selection_data->target);
-
- if (!strcmp (target_type, VCARD_TYPE)) {
-
- GList *card_list = e_card_load_cards_from_string_with_default_charset (selection_data->data, "ISO-8859-1");
- GList *c;
-
- if (card_list)
- handled = TRUE;
-
- for (c = card_list; c; c = c->next) {
- ECard *ecard = c->data;
-
- if (!e_card_evolution_list (ecard)) {
- ECardSimple *simple = e_card_simple_new (ecard);
-
- e_contact_list_model_add_card (E_CONTACT_LIST_MODEL (editor->model),
- simple);
-
- g_object_unref (simple);
-
- changed = TRUE;
- }
- }
- g_list_foreach (card_list, (GFunc)g_object_unref, NULL);
- g_list_free (card_list);
-
- /* Skip to the end of the list */
- if (adj->upper - adj->lower > adj->page_size)
- gtk_adjustment_set_value (adj, adj->upper);
-
- if (changed) {
- editor->changed = TRUE;
- command_state_changed (editor);
- }
- }
-
- gtk_drag_finish (context, handled, FALSE, time);
-}
-
-static void
-command_state_changed (EContactListEditor *editor)
-{
- gboolean named = is_named (editor);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorSaveClose",
- "sensitive",
- editor->changed && named && editor->editable ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorSave",
- "sensitive",
- editor->changed && named && editor->editable ? "1" : "0", NULL);
-
- bonobo_ui_component_set_prop (editor->uic,
- "/commands/ContactListEditorDelete",
- "sensitive",
- editor->editable && !editor->is_new_list ? "1" : "0", NULL);
-}
-
-static void
-extract_info(EContactListEditor *editor)
-{
- ECard *card = editor->card;
- if (card) {
- int i;
- EList *email_list;
- EIterator *email_iter;
- char *string = gtk_editable_get_chars(GTK_EDITABLE (editor->list_name_entry), 0, -1);
-
- if (string && *string)
- g_object_set (card,
- "file_as", string,
- "full_name", string,
- NULL);
-
- g_free (string);
-
-
- g_object_set (card,
- "list", GINT_TO_POINTER (TRUE),
- "list_show_addresses",
- GINT_TO_POINTER (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton))),
- NULL);
-
- g_object_get (card,
- "email", &email_list,
- NULL);
-
- /* clear the email list */
- email_iter = e_list_get_iterator (email_list);
- e_iterator_last (email_iter);
- while (e_iterator_is_valid (E_ITERATOR (email_iter))) {
- e_iterator_delete (E_ITERATOR (email_iter));
- }
- g_object_unref (email_iter);
-
- /* then refill it from the contact list model */
- for (i = 0; i < e_table_model_row_count (editor->model); i ++) {
- const EDestination *dest = e_contact_list_model_get_destination (E_CONTACT_LIST_MODEL (editor->model), i);
- gchar *dest_xml = e_destination_export (dest);
- if (dest_xml) {
- e_list_append (email_list, dest_xml);
- }
- g_free (dest_xml);
- }
- g_object_unref (email_list);
- }
-}
-
-static void
-fill_in_info(EContactListEditor *editor)
-{
- if (editor->card) {
- char *file_as;
- gboolean show_addresses = FALSE;
- gboolean is_evolution_list = FALSE;
- EList *email_list;
- EIterator *email_iter;
-
- g_object_get (editor->card,
- "file_as", &file_as,
- "email", &email_list,
- "list", &is_evolution_list,
- "list_show_addresses", &show_addresses,
- NULL);
-
- gtk_editable_delete_text (GTK_EDITABLE (editor->list_name_entry), 0, -1);
- if (file_as) {
- int position = 0;
- gtk_editable_insert_text (GTK_EDITABLE (editor->list_name_entry), file_as, strlen (file_as), &position);
- g_free (file_as);
- }
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(editor->visible_addrs_checkbutton), !show_addresses);
-
- e_contact_list_model_remove_all (E_CONTACT_LIST_MODEL (editor->model));
-
- email_iter = e_list_get_iterator (email_list);
-
- while (e_iterator_is_valid (email_iter)) {
- const char *dest_xml = e_iterator_get (email_iter);
- EDestination *dest;
-
- /* g_message ("incoming xml: [%s]", dest_xml); */
- dest = e_destination_import (dest_xml);
-
- if (dest != NULL) {
- e_contact_list_model_add_destination (E_CONTACT_LIST_MODEL (editor->model), dest);
- }
-
- e_iterator_next (email_iter);
- }
- g_object_unref (email_list);
- }
-}
-
-
-gboolean
-e_contact_list_editor_request_close_all (void)
-{
- GSList *p;
- GSList *pnext;
- gboolean retval;
-
- retval = TRUE;
- for (p = all_contact_list_editors; p != NULL; p = pnext) {
- pnext = p->next;
-
- e_contact_list_editor_raise (E_CONTACT_LIST_EDITOR (p->data));
- if (! prompt_to_save_changes (E_CONTACT_LIST_EDITOR (p->data))) {
- retval = FALSE;
- break;
- }
-
- close_dialog (E_CONTACT_LIST_EDITOR (p->data));
- }
-
- return retval;
-}
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec b/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec
deleted file mode 100644
index 6d5f4f2514..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.etspec
+++ /dev/null
@@ -1,7 +0,0 @@
-<ETableSpecification no-headers="true" cursor-mode="line" selection-mode="single">
-<ETableColumn model_col= "0" _title="Contact" expansion="1.0" minimum_width="20" resizable="true" cell="string" compare="string" />
- <ETableState>
- <column source="0"/>
- <grouping> </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h b/addressbook/gui/contact-list-editor/e-contact-list-editor.h
deleted file mode 100644
index 184145a0f7..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-list-editor.h
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_CONTACT_LIST_EDITOR_H__
-#define __E_CONTACT_LIST_EDITOR_H__
-
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-app-helper.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <glade/glade.h>
-#include <gal/e-table/e-table-model.h>
-
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-card.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CONTACT_LIST_EDITOR (e_contact_list_editor_get_type ())
-#define E_CONTACT_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditor))
-#define E_CONTACT_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CONTACT_LIST_EDITOR, EContactListEditorClass))
-#define E_IS_CONTACT_LIST_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CONTACT_LIST_EDITOR))
-#define E_IS_CONTACT_LIST_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_CONTACT_LIST_EDITOR))
-
-
-typedef struct _EContactListEditor EContactListEditor;
-typedef struct _EContactListEditorClass EContactListEditorClass;
-
-struct _EContactListEditor
-{
- GtkObject object;
-
- /* item specific fields */
- EBook *book;
- ECard *card;
-
- /* UI handler */
- BonoboUIComponent *uic;
-
- GladeXML *gui;
- GtkWidget *app;
-
- GtkWidget *table;
- ETableModel *model;
- GtkWidget *email_entry;
- GtkWidget *list_name_entry;
- GtkWidget *add_button;
- GtkWidget *remove_button;
- GtkWidget *visible_addrs_checkbutton;
-
- /* Whether we are editing a new card or an existing one */
- guint is_new_list : 1;
-
- /* Whether the card has been changed since bringing up the contact editor */
- guint changed : 1;
-
- /* Whether the contact editor will accept modifications */
- guint editable : 1;
-
- /* Whether an async wombat call is in progress */
- guint in_async_call : 1;
-};
-
-struct _EContactListEditorClass
-{
- GtkObjectClass parent_class;
-
- /* Notification signals */
-
- void (* list_added) (EContactListEditor *cle, EBookStatus status, ECard *card);
- void (* list_modified) (EContactListEditor *cle, EBookStatus status, ECard *card);
- void (* list_deleted) (EContactListEditor *cle, EBookStatus status, ECard *card);
- void (* editor_closed) (EContactListEditor *cle);
-};
-
-EContactListEditor *e_contact_list_editor_new (EBook *book,
- ECard *list_card,
- gboolean is_new_list,
- gboolean editable);
-GType e_contact_list_editor_get_type (void);
-void e_contact_list_editor_show (EContactListEditor *editor);
-void e_contact_list_editor_raise (EContactListEditor *editor);
-
-gboolean e_contact_list_editor_confirm_delete (GtkWindow *parent);
-
-gboolean e_contact_list_editor_request_close_all (void);
-
-G_END_DECLS
-
-
-#endif /* __E_CONTACT_LIST_EDITOR_H__ */
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c
deleted file mode 100644
index 6cad1bd9bf..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-#include <string.h>
-#include "e-contact-list-model.h"
-
-#define PARENT_TYPE e_table_model_get_type()
-static ETableModelClass *parent_class;
-
-#define COLS 1
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-contact_list_col_count (ETableModel *etc)
-{
- return COLS;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-contact_list_row_count (ETableModel *etc)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (etc);
- return model->data_count;
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-contact_list_value_at (ETableModel *etc, int col, int row)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (etc);
-
- return (void *) e_destination_get_textrep (model->data[row], TRUE);
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-contact_list_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- /* nothing */
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-contact_list_is_cell_editable (ETableModel *etc, int col, int row)
-{
- return FALSE;
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-contact_list_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-contact_list_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-contact_list_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-contact_list_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-contact_list_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-contact_list_model_destroy (GtkObject *o)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL (o);
- int i;
-
- for (i = 0; i < model->data_count; i ++) {
- g_object_unref (model->data[i]);
- }
- g_free (model->data);
-
- model->data_count = 0;
- model->data_alloc = 0;
-}
-
-static void
-e_contact_list_model_class_init (GtkObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->destroy = contact_list_model_destroy;
-
- model_class->column_count = contact_list_col_count;
- model_class->row_count = contact_list_row_count;
- model_class->value_at = contact_list_value_at;
- model_class->set_value_at = contact_list_set_value_at;
- model_class->is_cell_editable = contact_list_is_cell_editable;
- model_class->duplicate_value = contact_list_duplicate_value;
- model_class->free_value = contact_list_free_value;
- model_class->initialize_value = contact_list_initialize_value;
- model_class->value_is_empty = contact_list_value_is_empty;
- model_class->value_to_string = contact_list_value_to_string;
-}
-
-static void
-e_contact_list_model_init (GtkObject *object)
-{
- EContactListModel *model = E_CONTACT_LIST_MODEL(object);
-
- model->data_alloc = 10;
- model->data_count = 0;
- model->data = g_new (EDestination*, model->data_alloc);
-}
-
-GType
-e_contact_list_model_get_type (void)
-{
- static GType cle_type = 0;
-
- if (!cle_type) {
- static const GTypeInfo cle_info = {
- sizeof (EContactListModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_contact_list_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EContactListModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_contact_list_model_init,
- };
-
- cle_type = g_type_register_static (E_TABLE_MODEL_TYPE, "EContactListModel", &cle_info, 0);
- }
-
- return cle_type;
-}
-
-void
-e_contact_list_model_construct (EContactListModel *model)
-{
-}
-
-ETableModel *
-e_contact_list_model_new ()
-{
- EContactListModel *model;
-
- model = g_object_new (E_TYPE_CONTACT_LIST_MODEL, NULL);
-
- e_contact_list_model_construct (model);
-
- return E_TABLE_MODEL(model);
-}
-
-void
-e_contact_list_model_add_destination (EContactListModel *model, EDestination *dest)
-{
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (E_IS_DESTINATION (dest));
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- if (model->data_count + 1 >= model->data_alloc) {
- model->data_alloc *= 2;
- model->data = g_renew (EDestination*, model->data, model->data_alloc);
- }
-
- model->data[model->data_count ++] = dest;
- g_object_ref (dest);
-
- e_table_model_row_inserted (E_TABLE_MODEL (model), model->data_count - 1);
-}
-
-void
-e_contact_list_model_add_email (EContactListModel *model,
- const char *email)
-{
- EDestination *new_dest;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (email != NULL);
-
- new_dest = e_destination_new ();
- e_destination_set_email (new_dest, email);
-
- e_contact_list_model_add_destination (model, new_dest);
-}
-
-void
-e_contact_list_model_add_card (EContactListModel *model,
- ECardSimple *simple)
-{
- EDestination *new_dest;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (E_IS_CARD_SIMPLE (simple));
-
- new_dest = e_destination_new ();
- e_destination_set_card (new_dest, simple->card, 0); /* Hard-wired for default e-mail */
-
- e_contact_list_model_add_destination (model, new_dest);
-}
-
-void
-e_contact_list_model_remove_row (EContactListModel *model, int row)
-{
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
- g_return_if_fail (0 <= row && row < model->data_count);
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- g_object_unref (model->data[row]);
- memmove (model->data + row, model->data + row + 1, sizeof (EDestination*) * (model->data_count - row - 1));
- model->data_count --;
-
- e_table_model_row_deleted (E_TABLE_MODEL (model), row);
-}
-
-void
-e_contact_list_model_remove_all (EContactListModel *model)
-{
- int i;
-
- g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
-
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- for (i = 0; i < model->data_count; i ++) {
- g_object_unref (model->data[i]);
- model->data[i] = NULL;
- }
-
- model->data_count = 0;
-
- e_table_model_changed (E_TABLE_MODEL (model));
-}
-
-
-const EDestination *
-e_contact_list_model_get_destination (EContactListModel *model, int row)
-{
- g_return_val_if_fail (E_IS_CONTACT_LIST_MODEL (model), NULL);
- g_return_val_if_fail (0 <= row && row < model->data_count, NULL);
-
- return model->data[row];
-}
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.h b/addressbook/gui/contact-list-editor/e-contact-list-model.h
deleted file mode 100644
index bb07d83544..0000000000
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_CONTACT_LIST_MODEL_H_
-#define _E_CONTACT_LIST_MODEL_H_
-
-#include <gtk/gtk.h>
-#include <gal/e-table/e-table-model.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-book-view.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-#include "addressbook/backend/ebook/e-destination.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_CONTACT_LIST_MODEL (e_contact_list_model_get_type ())
-#define E_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_CONTACT_LIST_MODEL, EContactListModel))
-#define E_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_CONTACT_LIST_MODEL, EContactListModelClass))
-#define E_IS_CONTACT_LIST_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_CONTACT_LIST_MODEL))
-#define E_IS_CONTACT_LIST_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_CONTACT_LIST_MODEL))
-
-typedef struct _EContactListModel EContactListModel;
-typedef struct _EContactListModelClass EContactListModelClass;
-
-struct _EContactListModel {
- ETableModel parent;
-
- EDestination **data;
- int data_count;
- int data_alloc;
-};
-
-
-struct _EContactListModelClass {
- ETableModelClass parent_class;
-};
-
-
-GType e_contact_list_model_get_type (void);
-void e_contact_list_model_construct (EContactListModel *model);
-ETableModel *e_contact_list_model_new (void);
-
-void e_contact_list_model_add_destination (EContactListModel *model, EDestination *dest);
-void e_contact_list_model_add_email (EContactListModel *model, const char *email);
-void e_contact_list_model_add_card (EContactListModel *model, ECardSimple *simple);
-
-void e_contact_list_model_remove_row (EContactListModel *model, int row);
-void e_contact_list_model_remove_all (EContactListModel *model);
-
-const EDestination *e_contact_list_model_get_destination (EContactListModel *model, int row);
-
-G_END_DECLS
-
-#endif /* _E_CONTACT_LIST_MODEL_H_ */
diff --git a/addressbook/gui/merging/.cvsignore b/addressbook/gui/merging/.cvsignore
deleted file mode 100644
index d6c55c7345..0000000000
--- a/addressbook/gui/merging/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/gui/merging/Makefile.am b/addressbook/gui/merging/Makefile.am
deleted file mode 100644
index f30edd5745..0000000000
--- a/addressbook/gui/merging/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-INCLUDES = \
- -DG_LOG_DOMAIN=\"e-card-gui\" \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecardmerging.la
-
-libecardmerging_la_SOURCES = \
- e-card-merging.c \
- e-card-merging.h
-
-
-glade_DATA = e-card-duplicate-detected.glade \
- e-card-merging-book-commit-duplicate-detected.glade
-
-EXTRA_DIST = \
- $(glade_DATA)
diff --git a/addressbook/gui/merging/e-card-duplicate-detected.glade b/addressbook/gui/merging/e-card-duplicate-detected.glade
deleted file mode 100644
index 5c287cd163..0000000000
--- a/addressbook/gui/merging/e-card-duplicate-detected.glade
+++ /dev/null
@@ -1,212 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-duplicate-contact">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Duplicate Contact Detected</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">1</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-old-card">
- <property name="visible">True</property>
- <property name="creation_function">e_card_merging_create_old_card</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 01:33:22 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The name or email address of this contact already exists
-in this folder. Would you like to add it anyway?</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Original Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">New Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom-new-card">
- <property name="visible">True</property>
- <property name="creation_function">e_card_merging_create_old_card</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 01:33:22 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="custom2">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 00:18:39 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/merging/e-card-merging-book-commit-duplicate-detected.glade b/addressbook/gui/merging/e-card-merging-book-commit-duplicate-detected.glade
deleted file mode 100644
index f7cfd259e5..0000000000
--- a/addressbook/gui/merging/e-card-merging-book-commit-duplicate-detected.glade
+++ /dev/null
@@ -1,212 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="dialog-duplicate-contact">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Duplicate Contact Detected</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="has_separator">True</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">1</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button4">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">6</property>
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="Custom" id="custom-old-card">
- <property name="visible">True</property>
- <property name="creation_function">e_card_merging_create_old_card</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 01:33:22 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">The changed email or name of this contact already
-exists in this folder. Would you like to add it anyway?</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Conflicting Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Changed Contact:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="custom-new-card">
- <property name="visible">True</property>
- <property name="creation_function">e_card_merging_create_old_card</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 01:33:22 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="Custom" id="custom2">
- <property name="visible">True</property>
- <property name="creation_function">e_create_image_widget</property>
- <property name="string1">malehead.png</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Jun 2001 00:18:39 GMT</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/addressbook/gui/merging/e-card-merging.c b/addressbook/gui/merging/e-card-merging.c
deleted file mode 100644
index f2322e772c..0000000000
--- a/addressbook/gui/merging/e-card-merging.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Code for checking for duplicates when doing ECard work.
- *
- * Author:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- */
-
-#include <config.h>
-
-#include "e-card-merging.h"
-#include <ebook/e-card-compare.h>
-#include <glade/glade.h>
-#include <gtk/gtksignal.h>
-#include "addressbook/gui/widgets/e-minicard-widget.h"
-
-typedef enum {
- E_CARD_MERGING_ADD,
- E_CARD_MERGING_COMMIT
-} ECardMergingOpType;
-
-typedef struct {
- ECardMergingOpType op;
- EBook *book;
- ECard *card;
- EBookIdCallback id_cb;
- EBookCallback cb;
- gpointer closure;
-} ECardMergingLookup;
-
-static void
-free_lookup (ECardMergingLookup *lookup)
-{
- g_object_unref (lookup->book);
- g_object_unref (lookup->card);
-
- g_free (lookup);
-}
-
-static void
-final_id_cb (EBook *book, EBookStatus status, const char *id, gpointer closure)
-{
- ECardMergingLookup *lookup = closure;
-
- if (lookup->id_cb)
- lookup->id_cb (lookup->book, status, id, lookup->closure);
-
- free_lookup (lookup);
-}
-
-static void
-final_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- ECardMergingLookup *lookup = closure;
-
- if (lookup->cb)
- lookup->cb (lookup->book, status, lookup->closure);
-
- free_lookup (lookup);
-}
-
-static void
-doit (ECardMergingLookup *lookup)
-{
- if (lookup->op == E_CARD_MERGING_ADD)
- e_book_add_card (lookup->book, lookup->card, final_id_cb, lookup);
- else if (lookup->op == E_CARD_MERGING_COMMIT)
- e_book_commit_card (lookup->book, lookup->card, final_cb, lookup);
-}
-
-static void
-cancelit (ECardMergingLookup *lookup)
-{
- if (lookup->op == E_CARD_MERGING_ADD) {
- if (lookup->id_cb)
- final_id_cb (lookup->book, E_BOOK_STATUS_CANCELLED, NULL, lookup);
- } else if (lookup->op == E_CARD_MERGING_COMMIT) {
- if (lookup->cb)
- final_cb (lookup->book, E_BOOK_STATUS_CANCELLED, lookup);
- }
-}
-
-static void
-response (GtkWidget *dialog, int response, ECardMergingLookup *lookup)
-{
- gtk_widget_destroy (dialog);
-
- switch (response) {
- case 0:
- doit (lookup);
- break;
- case 1:
- cancelit (lookup);
- break;
- }
-}
-
-static void
-match_query_callback (ECard *card, ECard *match, ECardMatchType type, gpointer closure)
-{
- ECardMergingLookup *lookup = closure;
-
- if ((gint) type <= (gint) E_CARD_MATCH_VAGUE) {
- doit (lookup);
- } else {
- GladeXML *ui;
-
- GtkWidget *widget;
-
- if (lookup->op == E_CARD_MERGING_ADD)
- ui = glade_xml_new (EVOLUTION_GLADEDIR "/e-card-duplicate-detected.glade", NULL, NULL);
- else if (lookup->op == E_CARD_MERGING_COMMIT)
- ui = glade_xml_new (EVOLUTION_GLADEDIR "/e-card-merging-book-commit-duplicate-detected.glade", NULL, NULL);
- else {
- doit (lookup);
- return;
- }
-
- widget = glade_xml_get_widget (ui, "custom-old-card");
- g_object_set (widget,
- "card", match,
- NULL);
-
- widget = glade_xml_get_widget (ui, "custom-new-card");
- g_object_set (widget,
- "card", card,
- NULL);
-
- widget = glade_xml_get_widget (ui, "dialog-duplicate-contact");
-
- g_signal_connect (widget, "response",
- G_CALLBACK (response), lookup);
-
- gtk_widget_show_all (widget);
- }
-}
-
-gboolean
-e_card_merging_book_add_card (EBook *book,
- ECard *card,
- EBookIdCallback cb,
- gpointer closure)
-{
- ECardMergingLookup *lookup;
-
- lookup = g_new (ECardMergingLookup, 1);
-
- lookup->op = E_CARD_MERGING_ADD;
- lookup->book = g_object_ref (book);
- lookup->card = g_object_ref (card);
- lookup->id_cb = cb;
- lookup->closure = closure;
-
- e_card_locate_match_full (book, card, NULL, match_query_callback, lookup);
-
- return TRUE;
-}
-
-gboolean
-e_card_merging_book_commit_card (EBook *book,
- ECard *card,
- EBookCallback cb,
- gpointer closure)
-{
- ECardMergingLookup *lookup;
- GList *avoid;
-
- lookup = g_new (ECardMergingLookup, 1);
-
- lookup->op = E_CARD_MERGING_COMMIT;
- lookup->book = g_object_ref (book);
- lookup->card = g_object_ref (card);
- lookup->cb = cb;
- lookup->closure = closure;
-
- avoid = g_list_append (NULL, card);
-
- e_card_locate_match_full (book, card, avoid, match_query_callback, lookup);
-
- g_list_free (avoid);
-
- return TRUE;
-}
-
-GtkWidget *
-e_card_merging_create_old_card(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2);
-
-GtkWidget *
-e_card_merging_create_old_card(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- return e_minicard_widget_new ();
-}
diff --git a/addressbook/gui/merging/e-card-merging.h b/addressbook/gui/merging/e-card-merging.h
deleted file mode 100644
index 8ea1f9f018..0000000000
--- a/addressbook/gui/merging/e-card-merging.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * The Evolution addressbook client object.
- *
- * Author:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * Copyright 2001, Ximian, Inc.
- */
-
-#ifndef __E_CARD_MERGING_H__
-#define __E_CARD_MERGING_H__
-
-#include <addressbook/backend/ebook/e-book.h>
-
-G_BEGIN_DECLS
-
-gboolean e_card_merging_book_add_card (EBook *book,
- ECard *card,
- EBookIdCallback cb,
- gpointer closure);
-gboolean e_card_merging_book_commit_card (EBook *book,
- ECard *card,
- EBookCallback cb,
- gpointer closure);
-
-G_END_DECLS
-
-#endif /* ! __E_CARD_MERGING_H__ */
diff --git a/addressbook/gui/search/.cvsignore b/addressbook/gui/search/.cvsignore
deleted file mode 100644
index d6c55c7345..0000000000
--- a/addressbook/gui/search/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
diff --git a/addressbook/gui/search/Makefile.am b/addressbook/gui/search/Makefile.am
deleted file mode 100644
index bdd56e2001..0000000000
--- a/addressbook/gui/search/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-ruledir = $(privdatadir)
-rule_DATA = addresstypes.xml
-
-EXTRA_DIST = addresstypes.xml
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"e-addressbook-search\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/contact-editor \
- -I$(top_srcdir)/widgets/e-text \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_builddir)/shell \
- -DSEARCH_RULE_DIR=\"$(ruledir)\" \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libeaddressbooksearch.la
-
-libeaddressbooksearch_la_SOURCES = \
- e-addressbook-search-dialog.c \
- e-addressbook-search-dialog.h
diff --git a/addressbook/gui/search/addresstypes.xml b/addressbook/gui/search/addresstypes.xml
deleted file mode 100644
index 4ee23af613..0000000000
--- a/addressbook/gui/search/addresstypes.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<filterdescription>
-<partset>
- <part name="name">
- <title>Name</title>
- <input type="optionlist" name="name-type">
- <option value="contains">
- <title>contains</title>
- <code>(contains "full_name" ${name})</code>
- </option>
- <option value="not contains">
- <title>does not contain</title>
- <code>(not (contains "full_name" ${name}))</code>
- </option>
- <option value="is">
- <title>is</title>
- <code>(is "full_name" ${name})))</code>
- </option>
- <option value="is not">
- <title>is not</title>
- <code>(not (is "full_name" ${name}))</code>
- </option>
- <option value="begin">
- <title>begins with</title>
- <code>(beginswith "full_name" ${name})</code>
- </option>
- <option value="end">
- <title>ends in</title>
- <code>(endswith "full_name" ${name})</code>
- </option>
- </input>
- <input type="string" name="name"/>
- </part>
- <part name="email">
- <title>Email</title>
- <input type="optionlist" name="email-type">
- <option value="contains">
- <title>contains</title>
- <code>(contains "email" ${email})</code>
- </option>
- <option value="not contains">
- <title>does not contain</title>
- <code>(not (contains "email" ${email}))</code>
- </option>
- <option value="is">
- <title>is</title>
- <code>(is "email" ${email})</code>
- </option>
- <option value="is not">
- <title>is not</title>
- <code>(not (is "email" ${email}))</code>
- </option>
- </input>
- <input type="address" name="email"/>
- </part>
- <part name="category">
- <title>Category</title>
- <input type="optionlist" name="category-type">
- <option value="contains">
- <title>contains</title>
- <code>(contains "category" ${category})</code>
- </option>
- <option value="not contains">
- <title>does not contain</title>
- <code>(not (contains "category" ${category}))</code>
- </option>
- <option value="is">
- <title>is</title>
- <code>(is "category" ${category})</code>
- </option>
- <option value="is not">
- <title>is not</title>
- <code>(not (is "category" ${category}))</code>
- </option>
- </input>
- <input type="string" name="category"/>
- </part>
- <part name="sexp">
- <title>Expression</title>
- <input type="code" name="code"/>
- </part>
-</partset>
-</filterdescription>
diff --git a/addressbook/gui/search/e-addressbook-search-dialog.c b/addressbook/gui/search/e-addressbook-search-dialog.c
deleted file mode 100644
index 443c30f6a5..0000000000
--- a/addressbook/gui/search/e-addressbook-search-dialog.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-addressbook-search-dialog.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtkbox.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtkstock.h>
-#include <libgnome/gnome-i18n.h>
-#include "gal/util/e-util.h"
-
-#include "e-addressbook-search-dialog.h"
-
-
-static void e_addressbook_search_dialog_init (EAddressbookSearchDialog *widget);
-static void e_addressbook_search_dialog_class_init (EAddressbookSearchDialogClass *klass);
-static void e_addressbook_search_dialog_dispose (GObject *object);
-
-static GtkDialog *parent_class = NULL;
-
-#define PARENT_TYPE GTK_TYPE_DIALOG
-
-E_MAKE_TYPE (e_addressbook_search_dialog,
- "EAddressbookSearchDialog",
- EAddressbookSearchDialog,
- e_addressbook_search_dialog_class_init,
- e_addressbook_search_dialog_init,
- PARENT_TYPE)
-
-static void
-e_addressbook_search_dialog_class_init (EAddressbookSearchDialogClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = (GObjectClass*) klass;
-
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = e_addressbook_search_dialog_dispose;
-}
-
-static GtkWidget *
-get_widget (EAddressbookSearchDialog *view)
-{
- FilterPart *part;
-
- view->context = rule_context_new();
- /* FIXME: hide this in a class */
- rule_context_add_part_set(view->context, "partset", filter_part_get_type(),
- rule_context_add_part, rule_context_next_part);
- rule_context_load(view->context, SEARCH_RULE_DIR "/addresstypes.xml", "");
- view->rule = filter_rule_new();
- part = rule_context_next_part(view->context, NULL);
- if (part == NULL) {
- g_warning("Problem loading search for addressbook no parts to load");
- return gtk_entry_new();
- } else {
- filter_rule_add_part(view->rule, filter_part_clone(part));
- return filter_rule_get_widget(view->rule, view->context);
- }
-}
-
-static char *
-get_query (EAddressbookSearchDialog *view)
-{
- GString *out = g_string_new("");
- char *ret;
-
- filter_rule_build_code(view->rule, out);
- ret = out->str;
- printf("Searching using %s\n", ret);
- g_string_free(out, FALSE);
- return ret;
-}
-
-static void
-dialog_response (GtkWidget *widget, int response_id, EAddressbookSearchDialog *dialog)
-{
- char *query;
-
- if (response_id == GTK_RESPONSE_OK) {
- query = get_query(dialog);
- g_object_set(dialog->view,
- "query", query,
- NULL);
- g_free(query);
- }
-
- gtk_widget_destroy(GTK_WIDGET (dialog));
-}
-
-static void
-e_addressbook_search_dialog_init (EAddressbookSearchDialog *view)
-{
- GtkDialog *dialog = GTK_DIALOG (view);
-
- gtk_window_set_policy(GTK_WINDOW(view), FALSE, TRUE, FALSE);
- gtk_window_set_default_size (GTK_WINDOW (view), 550, 400);
- gtk_window_set_title(GTK_WINDOW(view), _("Advanced Search"));
- view->search = get_widget(view);
- gtk_box_pack_start(GTK_BOX(dialog->vbox), view->search, TRUE, TRUE, 0);
- gtk_widget_show(view->search);
-
- gtk_dialog_add_buttons (dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- /*GTK_STOCK_SAVE, GTK_RESPONSE_APPLY,*/
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
-
- g_signal_connect(dialog, "response",
- G_CALLBACK(dialog_response), view);
-}
-
-GtkWidget *
-e_addressbook_search_dialog_new (EAddressbookView *addr_view)
-{
- EAddressbookSearchDialog *view = g_object_new (E_ADDRESSBOOK_SEARCH_DIALOG_TYPE, NULL);
- view->view = addr_view;
- return GTK_WIDGET(view);
-}
-
-static void
-e_addressbook_search_dialog_dispose (GObject *object)
-{
- EAddressbookSearchDialog *view;
-
- view = E_ADDRESSBOOK_SEARCH_DIALOG (object);
-
- if (view->context) {
- g_object_unref(view->context);
- view->context = NULL;
- }
- if (view->rule) {
- g_object_unref(view->rule);
- view->rule = NULL;
- }
-
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
diff --git a/addressbook/gui/search/e-addressbook-search-dialog.h b/addressbook/gui/search/e-addressbook-search-dialog.h
deleted file mode 100644
index 4be0050ca0..0000000000
--- a/addressbook/gui/search/e-addressbook-search-dialog.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-view-widget.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_ADDRESSBOOK_SEARCH_DIALOG_H__
-#define __E_ADDRESSBOOK_SEARCH_DIALOG_H__
-
-#include <ebook/e-book.h>
-
-#include "addressbook/gui/widgets/e-addressbook-view.h"
-#include "filter/rule-context.h"
-#include "filter/filter-rule.h"
-#include <gtk/gtkdialog.h>
-
-G_BEGIN_DECLS
-
-#define E_ADDRESSBOOK_SEARCH_DIALOG_TYPE (e_addressbook_search_dialog_get_type ())
-#define E_ADDRESSBOOK_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_ADDRESSBOOK_SEARCH_DIALOG_TYPE, EAddressbookSearchDialog))
-#define E_ADDRESSBOOK_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_ADDRESSBOOK_SEARCH_DIALOG_TYPE, EAddressbookSearchDialogClass))
-#define E_IS_ADDRESSBOOK_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_ADDRESSBOOK_SEARCH_DIALOG_TYPE))
-#define E_IS_ADDRESSBOOK_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_ADDRESSBOOK_SEARCH_DIALOG_TYPE))
-
-
-typedef struct _EAddressbookSearchDialog EAddressbookSearchDialog;
-typedef struct _EAddressbookSearchDialogClass EAddressbookSearchDialogClass;
-
-struct _EAddressbookSearchDialog
-{
- GtkDialog parent;
-
- GtkWidget *search;
-
- EAddressbookView *view;
-
- RuleContext *context;
- FilterRule *rule;
-};
-
-struct _EAddressbookSearchDialogClass
-{
- GtkDialogClass parent_class;
-};
-
-GType e_addressbook_search_dialog_get_type (void);
-
-GtkWidget *e_addressbook_search_dialog_new (EAddressbookView *view);
-
-G_END_DECLS
-
-#endif /* __E_ADDRESSBOOK_SEARCH_DIALOG_H__ */
diff --git a/addressbook/gui/widgets/.cvsignore b/addressbook/gui/widgets/.cvsignore
deleted file mode 100644
index d3b9ac4305..0000000000
--- a/addressbook/gui/widgets/.cvsignore
+++ /dev/null
@@ -1,19 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-minicard-label-test
-minicard-test
-minicard-view-test
-minicard-widget-test
-reflow-test
-e-addressbook-marshal.c
-e-addressbook-marshal.h
-Evolution-Composer-stubs.c
-Evolution-Composer-skels.c
-Evolution-Composer-common.c
-Evolution-Composer.h
-
diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am
deleted file mode 100644
index 0626acee52..0000000000
--- a/addressbook/gui/widgets/Makefile.am
+++ /dev/null
@@ -1,167 +0,0 @@
-INCLUDES = \
- -DG_LOG_DOMAIN=\"e-minicard\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir)/addressbook/gui/contact-editor \
- -I$(top_srcdir)/addressbook/gui/merging \
- -I$(top_srcdir)/addressbook/gui/component \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_builddir)/shell \
- -DG_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED \
- -DLIBGNOME_DISABLE_DEPRECATED \
- -DLIBGNOMEUI_DISABLE_DEPRECATED \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-CORBA_COMPOSER_SOURCE_H = \
- Evolution-Composer.h
-CORBA_COMPOSER_SOURCE_C = \
- Evolution-Composer-common.c \
- Evolution-Composer-skels.c \
- Evolution-Composer-stubs.c
-CORBA_COMPOSER_IDL = $(srcdir)/../../../composer/Evolution-Composer.idl
-
-$(CORBA_COMPOSER_SOURCE_H): $(CORBA_COMPOSER_IDL)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(CORBA_COMPOSER_IDL)
-
-$(CORBA_COMPOSER_SOURCE_C): $(CORBA_COMPOSER_SOURCE_H)
-
-CORBA_SOURCE_H = $(CORBA_COMPOSER_SOURCE_H)
-CORBA_SOURCE_C = $(CORBA_COMPOSER_SOURCE_C)
-CORBA_SOURCE = $(CORBA_SOURCE_H) $(CORBA_SOURCE_C)
-
-noinst_LTLIBRARIES = \
- libeminicard.la
-
-libeminicard_la_SOURCES = \
- $(CORBA_SOURCE) \
- e-addressbook-marshal.c \
- e-addressbook-reflow-adapter.c \
- e-addressbook-reflow-adapter.h \
- e-addressbook-table-adapter.c \
- e-addressbook-table-adapter.h \
- e-addressbook-model.c \
- e-addressbook-model.h \
- e-addressbook-util.c \
- e-addressbook-util.h \
- e-addressbook-view.c \
- e-addressbook-view.h \
- e-minicard-control.c \
- e-minicard-control.h \
- e-minicard-label.c \
- e-minicard-label.h \
- e-minicard-view-widget.c \
- e-minicard-view-widget.h \
- e-minicard-view.c \
- e-minicard-view.h \
- e-minicard-widget.c \
- e-minicard-widget.h \
- e-minicard.c \
- e-minicard.h \
- gal-view-factory-minicard.c \
- gal-view-factory-minicard.h \
- gal-view-minicard.c \
- gal-view-minicard.h
-
-#TREEVIEW_SOURCES= e-addressbook-treeview-adapter.c \
-# e-addressbook-treeview-adapter.h \
-# gal-view-factory-treeview.c \
-# gal-view-factory-treeview.h \
-# gal-view-treeview.c \
-# gal-view-treeview.h
-
-# GLib marshalling cruft
-
-e-addressbook-marshal.h: e-addressbook-marshal.list
- ( @GLIB_GENMARSHAL@ --prefix=e_addressbook_marshal e-addressbook-marshal.list --header > e-addressbook-marshal.tmp \
- && mv e-addressbook-marshal.tmp e-addressbook-marshal.h ) \
- || ( rm -f e-addressbook-marshal.tmp && exit 1 )
-
-e-addressbook-marshal.c: e-addressbook-marshal.h
- ( @GLIB_GENMARSHAL@ --prefix=e_addressbook_marshal e-addressbook-marshal.list --body > e-addressbook-marshal.tmp \
- && mv e-addressbook-marshal.tmp e-addressbook-marshal.c ) \
- || ( rm -f e-addressbook-marshal.tmp && exit 1 )
-
-MARSHAL_GENERATED = e-addressbook-marshal.c e-addressbook-marshal.h
-
-BUILT_SOURCES = $(CORBA_SOURCE) $(MARSHAL_GENERATED)
-CLEANFILES = $(BUILT_SOURCES)
-
-dist-hook:
- cd $(distdir); rm -f $(BUILT_SOURCES)
-
-#noinst_PROGRAMS = \
-# minicard-widget-test \
-# minicard-label-test \
-# minicard-test
-## reflow-test
-## minicard-view-test
-#
-#minicard_label_test_SOURCES = \
-# test-minicard-label.c
-#
-#minicard_label_test_LDADD = \
-# libeminicard.a \
-# $(EVOLUTION_ADDRESSBOOK_LIBS) \
-# $(top_builddir)/e-util/libeutil.la
-#
-#minicard_test_SOURCES = \
-# test-minicard.c
-#
-#minicard_test_LDADD = \
-# libeminicard.a \
-# $(top_builddir)/addressbook/backend/ebook/libebook.la \
-# $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.a \
-# $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.a \
-# $(top_builddir)/addressbook/printing/libecontactprint.a \
-# $(top_builddir)/addressbook/gui/merging/libecardmerging.a \
-# $(top_builddir)/widgets/misc/libemiscwidgets.la \
-# $(top_builddir)/addressbook/gui/component/select-names/libeselectnames.la \
-# $(EVOLUTION_ADDRESSBOOK_LIBS) \
-# libeminicard.a
-#
-#reflow_test_SOURCES = \
-# test-reflow.c
-#
-#reflow_test_LDADD = \
-# libeminicard.a \
-# $(top_builddir)/addressbook/backend/ebook/libebook.la \
-# $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \
-# $(top_builddir)/addressbook/printing/libecontactprint.a \
-# $(top_builddir)/widgets/misc/libemiscwidgets.la \
-# $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-#minicard_view_test_SOURCES = \
-# test-minicard-view.c
-
-#minicard_view_test_LDADD = \
-# $(EVOLUTION_ADDRESSBOOK_LIBS)
-# libeminicard.a \
-# $(top_builddir)/addressbook/backend/ebook/libebook.la \
-# $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \
-# $(top_builddir)/addressbook/printing/libecontactprint.a \
-# $(top_builddir)/widgets/misc/libemiscwidgets.la
-#
-#minicard_widget_test_SOURCES = \
-# e-minicard-widget-test.c
-#
-#minicard_widget_test_LDADD = \
-# libeminicard.a \
-# $(top_builddir)/addressbook/backend/ebook/libebook.la \
-# $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.a \
-# $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.a \
-# $(top_builddir)/addressbook/gui/component/select-names/libeselectnames.la \
-# $(top_builddir)/addressbook/printing/libecontactprint.a \
-# $(top_builddir)/widgets/misc/libemiscwidgets.la \
-# $(top_builddir)/addressbook/gui/merging/libecardmerging.a \
-# $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-etspec_DATA= e-addressbook-view.etspec
-
-EXTRA_DIST = \
- $(etspec_DATA) \
- e-addressbook-marshal.list
diff --git a/addressbook/gui/widgets/e-addressbook-marshal.list b/addressbook/gui/widgets/e-addressbook-marshal.list
deleted file mode 100644
index 2b34707dbb..0000000000
--- a/addressbook/gui/widgets/e-addressbook-marshal.list
+++ /dev/null
@@ -1,11 +0,0 @@
-INT:POINTER
-NONE:NONE
-NONE:BOOL
-NONE:POINTER
-NONE:OBJECT
-NONE:ENUM
-NONE:INT,INT
-NONE:INT
-NONE:UINT
-NONE:DOUBLE
-INT:POINTER
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
deleted file mode 100644
index 10af915ecf..0000000000
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ /dev/null
@@ -1,697 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- *
- * Author:
- * Christopher James Lahey <clahey@ximian.com>
- *
- * (C) 1999 Ximian, Inc.
- */
-
-#include <config.h>
-#include "e-addressbook-marshal.h"
-#include "e-addressbook-model.h"
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <gnome.h>
-#include <gal/widgets/e-gui-utils.h>
-#include "e-addressbook-util.h"
-#include "e-addressbook-marshal.h"
-
-#define PARENT_TYPE G_TYPE_OBJECT
-static GObjectClass *parent_class;
-
-/*
- * EAddressbookModel callbacks
- * These are the callbacks that define the behavior of our custom model.
- */
-static void e_addressbook_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_addressbook_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE,
-};
-
-enum {
- WRITABLE_STATUS,
- STATUS_MESSAGE,
- SEARCH_STARTED,
- SEARCH_RESULT,
- FOLDER_BAR_MESSAGE,
- CARD_ADDED,
- CARD_REMOVED,
- CARD_CHANGED,
- MODEL_CHANGED,
- STOP_STATE_CHANGED,
- BACKEND_DIED,
- LAST_SIGNAL
-};
-
-#define COLS (E_CARD_SIMPLE_FIELD_LAST)
-
-static guint e_addressbook_model_signals [LAST_SIGNAL] = {0, };
-
-static void
-free_data (EAddressbookModel *model)
-{
- if (model->data) {
- int i;
-
- for ( i = 0; i < model->data_count; i++ ) {
- g_object_unref (model->data[i]);
- }
-
- g_free(model->data);
- model->data = NULL;
- model->data_count = 0;
- model->allocated_count = 0;
- }
-}
-
-static void
-remove_book_view(EAddressbookModel *model)
-{
- if (model->book_view && model->create_card_id)
- g_signal_handler_disconnect (model->book_view,
- model->create_card_id);
- if (model->book_view && model->remove_card_id)
- g_signal_handler_disconnect (model->book_view,
- model->remove_card_id);
- if (model->book_view && model->modify_card_id)
- g_signal_handler_disconnect (model->book_view,
- model->modify_card_id);
- if (model->book_view && model->status_message_id)
- g_signal_handler_disconnect (model->book_view,
- model->status_message_id);
- if (model->book_view && model->sequence_complete_id)
- g_signal_handler_disconnect (model->book_view,
- model->sequence_complete_id);
-
- model->create_card_id = 0;
- model->remove_card_id = 0;
- model->modify_card_id = 0;
- model->status_message_id = 0;
- model->sequence_complete_id = 0;
-
- model->search_in_progress = FALSE;
-
- if (model->book_view) {
- e_book_view_stop (model->book_view);
- g_object_unref (model->book_view);
- model->book_view = NULL;
- }
-}
-
-static void
-addressbook_dispose(GObject *object)
-{
- EAddressbookModel *model = E_ADDRESSBOOK_MODEL(object);
-
- if (model->get_view_idle) {
- g_source_remove(model->get_view_idle);
- model->get_view_idle = 0;
- }
-
- remove_book_view(model);
- free_data (model);
-
- if (model->book) {
- if (model->writable_status_id)
- g_signal_handler_disconnect (model->book,
- model->writable_status_id);
- model->writable_status_id = 0;
-
- if (model->backend_died_id)
- g_signal_handler_disconnect (model->book,
- model->backend_died_id);
- model->backend_died_id = 0;
-
- g_object_unref (model->book);
- model->book = NULL;
- }
-
- if (model->query) {
- g_free (model->query);
- model->query = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-static void
-update_folder_bar_message (EAddressbookModel *model)
-{
- int count;
- char *message;
-
- count = model->data_count;
-
- switch (count) {
- case 0:
- message = g_strdup (_("No cards"));
- break;
- case 1:
- message = g_strdup (_("1 card"));
- break;
- default:
- message = g_strdup_printf (_("%d cards"), count);
- break;
- }
-
- g_signal_emit (model,
- e_addressbook_model_signals [FOLDER_BAR_MESSAGE], 0,
- message);
-
- g_free (message);
-}
-
-static void
-create_card(EBookView *book_view,
- const GList *cards,
- EAddressbookModel *model)
-{
- int old_count = model->data_count;
- int length = g_list_length ((GList *)cards);
-
- if (model->data_count + length > model->allocated_count) {
- while (model->data_count + length > model->allocated_count)
- model->allocated_count = model->allocated_count * 2 + 1;
- model->data = g_renew(ECard *, model->data, model->allocated_count);
- }
-
- for ( ; cards; cards = cards->next) {
- model->data[model->data_count++] = cards->data;
- g_object_ref (cards->data);
- }
-
- g_signal_emit (model,
- e_addressbook_model_signals [CARD_ADDED], 0,
- old_count, model->data_count - old_count);
-
- update_folder_bar_message (model);
-}
-
-static void
-remove_card(EBookView *book_view,
- GList *ids,
- EAddressbookModel *model)
-{
- int i = 0;
- GList *l;
-
- for (l = ids; l; l = l->next) {
- char *id = l->data;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_get_id(model->data[i]), id) ) {
- g_object_unref (model->data[i]);
- memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (ECard *));
- model->data_count--;
-
- g_signal_emit (model,
- e_addressbook_model_signals [CARD_REMOVED], 0,
- i);
-
- break;
- }
- }
- }
-
- update_folder_bar_message (model);
-}
-
-static void
-modify_card(EBookView *book_view,
- const GList *cards,
- EAddressbookModel *model)
-{
- for ( ; cards; cards = cards->next) {
- int i;
- for ( i = 0; i < model->data_count; i++) {
- if ( !strcmp(e_card_get_id(model->data[i]), e_card_get_id(E_CARD(cards->data))) ) {
- g_object_unref (model->data[i]);
- model->data[i] = e_card_duplicate(E_CARD(cards->data));
- g_signal_emit (model,
- e_addressbook_model_signals [CARD_CHANGED], 0,
- i);
- break;
- }
- }
- }
-}
-
-static void
-status_message (EBookView *book_view,
- char* status,
- EAddressbookModel *model)
-{
- g_signal_emit (model,
- e_addressbook_model_signals [STATUS_MESSAGE], 0,
- status);
-}
-
-static void
-sequence_complete (EBookView *book_view,
- EBookViewStatus status,
- EAddressbookModel *model)
-{
- model->search_in_progress = FALSE;
- status_message (book_view, NULL, model);
- g_signal_emit (model,
- e_addressbook_model_signals [SEARCH_RESULT], 0,
- status);
- g_signal_emit (model,
- e_addressbook_model_signals [STOP_STATE_CHANGED], 0);
-}
-
-static void
-writable_status (EBook *book,
- gboolean writable,
- EAddressbookModel *model)
-{
- if (!model->editable_set) {
- model->editable = writable;
-
- g_signal_emit (model,
- e_addressbook_model_signals [WRITABLE_STATUS], 0,
- writable);
- }
-}
-
-static void
-backend_died (EBook *book,
- EAddressbookModel *model)
-{
- g_signal_emit (model,
- e_addressbook_model_signals [BACKEND_DIED], 0);
-}
-
-static void
-e_addressbook_model_class_init (GObjectClass *object_class)
-{
- parent_class = g_type_class_ref (PARENT_TYPE);
-
- object_class->dispose = addressbook_dispose;
- object_class->set_property = e_addressbook_model_set_property;
- object_class->get_property = e_addressbook_model_get_property;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- e_addressbook_model_signals [WRITABLE_STATUS] =
- g_signal_new ("writable_status",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, writable_status),
- NULL, NULL,
- e_addressbook_marshal_NONE__BOOL,
- G_TYPE_NONE,
- 1, G_TYPE_BOOLEAN);
-
- e_addressbook_model_signals [STATUS_MESSAGE] =
- g_signal_new ("status_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, status_message),
- NULL, NULL,
- e_addressbook_marshal_NONE__POINTER,
- G_TYPE_NONE,
- 1, G_TYPE_POINTER);
-
- e_addressbook_model_signals [SEARCH_STARTED] =
- g_signal_new ("search_started",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, search_started),
- NULL, NULL,
- e_addressbook_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_addressbook_model_signals [SEARCH_RESULT] =
- g_signal_new ("search_result",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, search_result),
- NULL, NULL,
- e_addressbook_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_addressbook_model_signals [FOLDER_BAR_MESSAGE] =
- g_signal_new ("folder_bar_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, folder_bar_message),
- NULL, NULL,
- e_addressbook_marshal_NONE__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- e_addressbook_model_signals [CARD_ADDED] =
- g_signal_new ("card_added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, card_added),
- NULL, NULL,
- e_addressbook_marshal_NONE__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- e_addressbook_model_signals [CARD_REMOVED] =
- g_signal_new ("card_removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, card_removed),
- NULL, NULL,
- e_addressbook_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_addressbook_model_signals [CARD_CHANGED] =
- g_signal_new ("card_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, card_changed),
- NULL, NULL,
- e_addressbook_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_addressbook_model_signals [MODEL_CHANGED] =
- g_signal_new ("model_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, model_changed),
- NULL, NULL,
- e_addressbook_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_addressbook_model_signals [STOP_STATE_CHANGED] =
- g_signal_new ("stop_state_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, stop_state_changed),
- NULL, NULL,
- e_addressbook_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_addressbook_model_signals [BACKEND_DIED] =
- g_signal_new ("backend_died",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookModelClass, backend_died),
- NULL, NULL,
- e_addressbook_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-}
-
-static void
-e_addressbook_model_init (GObject *object)
-{
- EAddressbookModel *model = E_ADDRESSBOOK_MODEL(object);
- model->book = NULL;
- model->query = g_strdup("(contains \"x-evolution-any-field\" \"\")");
- model->book_view = NULL;
- model->get_view_idle = 0;
- model->create_card_id = 0;
- model->remove_card_id = 0;
- model->modify_card_id = 0;
- model->status_message_id = 0;
- model->writable_status_id = 0;
- model->backend_died_id = 0;
- model->sequence_complete_id = 0;
- model->data = NULL;
- model->data_count = 0;
- model->allocated_count = 0;
- model->search_in_progress = FALSE;
- model->editable = FALSE;
- model->editable_set = FALSE;
- model->first_get_view = TRUE;
-}
-
-static void
-book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointer closure)
-{
- EAddressbookModel *model = closure;
-
- remove_book_view(model);
-
- if (status != E_BOOK_STATUS_SUCCESS) {
- e_addressbook_error_dialog (_("Error getting book view"), status);
- return;
- }
-
- model->book_view = book_view;
- if (model->book_view)
- g_object_ref (model->book_view);
- model->create_card_id = g_signal_connect(model->book_view,
- "card_added",
- G_CALLBACK (create_card),
- model);
- model->remove_card_id = g_signal_connect(model->book_view,
- "card_removed",
- G_CALLBACK (remove_card),
- model);
- model->modify_card_id = g_signal_connect(model->book_view,
- "card_changed",
- G_CALLBACK(modify_card),
- model);
- model->status_message_id = g_signal_connect(model->book_view,
- "status_message",
- G_CALLBACK(status_message),
- model);
- model->sequence_complete_id = g_signal_connect(model->book_view,
- "sequence_complete",
- G_CALLBACK(sequence_complete),
- model);
-
- free_data (model);
-
- model->search_in_progress = TRUE;
- g_signal_emit (model,
- e_addressbook_model_signals [MODEL_CHANGED], 0);
- g_signal_emit (model,
- e_addressbook_model_signals [SEARCH_STARTED], 0);
- g_signal_emit (model,
- e_addressbook_model_signals [STOP_STATE_CHANGED], 0);
-}
-
-static gboolean
-get_view (EAddressbookModel *model)
-{
- if (model->book && model->query) {
- if (model->first_get_view) {
- if (e_book_check_static_capability (model->book, "do-initial-query")) {
- e_book_get_book_view (model->book, model->query, book_view_loaded, model);
- } else {
- remove_book_view(model);
- free_data (model);
- g_signal_emit (model,
- e_addressbook_model_signals [MODEL_CHANGED], 0);
- g_signal_emit (model,
- e_addressbook_model_signals [STOP_STATE_CHANGED], 0);
- }
- model->first_get_view = FALSE;
- }
- else
- e_book_get_book_view (model->book, model->query, book_view_loaded, model);
- }
-
- model->get_view_idle = 0;
- return FALSE;
-}
-
-ECard *
-e_addressbook_model_get_card(EAddressbookModel *model,
- int row)
-{
- if (model->data && 0 <= row && row < model->data_count) {
- ECard *card;
- card = e_card_duplicate (model->data[row]);
- return card;
- }
- return NULL;
-}
-
-const ECard *
-e_addressbook_model_peek_card(EAddressbookModel *model,
- int row)
-{
- if (model->data && 0 <= row && row < model->data_count) {
- return model->data[row];
- }
- return NULL;
-}
-
-static void
-e_addressbook_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EAddressbookModel *model;
-
- model = E_ADDRESSBOOK_MODEL (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (model->book) {
- if (model->writable_status_id)
- g_signal_handler_disconnect (model->book,
- model->writable_status_id);
- model->writable_status_id = 0;
-
- if (model->backend_died_id)
- g_signal_handler_disconnect (model->book,
- model->backend_died_id);
- model->backend_died_id = 0;
-
- g_object_unref (model->book);
- }
- model->book = E_BOOK(g_value_get_object (value));
- if (model->book) {
- model->first_get_view = TRUE;
- g_object_ref (model->book);
- if (model->get_view_idle == 0)
- model->get_view_idle = g_idle_add((GSourceFunc)get_view, model);
- g_signal_connect (model->book,
- "writable_status",
- G_CALLBACK (writable_status), model);
- g_signal_connect (model->book,
- "backend_died",
- G_CALLBACK (backend_died), model);
- }
- break;
- case PROP_QUERY:
- if (model->query)
- g_free(model->query);
- model->query = g_strdup(g_value_get_string (value));
- if (model->get_view_idle == 0)
- model->get_view_idle = g_idle_add((GSourceFunc)get_view, model);
- break;
- case PROP_EDITABLE:
- model->editable = g_value_get_boolean (value);
- model->editable_set = TRUE;
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_addressbook_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EAddressbookModel *e_addressbook_model;
-
- e_addressbook_model = E_ADDRESSBOOK_MODEL (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, e_addressbook_model->book);
- break;
- case PROP_QUERY:
- g_value_set_string (value, g_strdup(e_addressbook_model->query));
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_addressbook_model->editable);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-GType
-e_addressbook_model_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookModelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_model_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookModel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_model_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EAddressbookModel", &info, 0);
- }
-
- return type;
-}
-
-EAddressbookModel*
-e_addressbook_model_new (void)
-{
- EAddressbookModel *et;
-
- et = g_object_new (E_TYPE_ADDRESSBOOK_MODEL, NULL);
-
- return et;
-}
-
-void e_addressbook_model_stop (EAddressbookModel *model)
-{
- remove_book_view(model);
- g_signal_emit (model,
- e_addressbook_model_signals [STOP_STATE_CHANGED], 0);
- g_signal_emit (model,
- e_addressbook_model_signals [STATUS_MESSAGE], 0,
- "Search Interrupted.");
-}
-
-gboolean
-e_addressbook_model_can_stop (EAddressbookModel *model)
-{
- return model->search_in_progress;
-}
-
-void
-e_addressbook_model_force_folder_bar_message (EAddressbookModel *model)
-{
- update_folder_bar_message (model);
-}
-
-int
-e_addressbook_model_card_count (EAddressbookModel *model)
-{
- return model->data_count;
-}
-
-ECard *
-e_addressbook_model_card_at (EAddressbookModel *model, int index)
-{
- return model->data[index];
-}
-
-gboolean
-e_addressbook_model_editable (EAddressbookModel *model)
-{
- return model->editable;
-}
-
-EBook *
-e_addressbook_model_get_ebook (EAddressbookModel *model)
-{
- return model->book;
-}
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h
deleted file mode 100644
index 57cfe6f729..0000000000
--- a/addressbook/gui/widgets/e-addressbook-model.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_ADDRESSBOOK_MODEL_H_
-#define _E_ADDRESSBOOK_MODEL_H_
-
-#include <glib.h>
-#include <glib-object.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-book-view.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#define E_TYPE_ADDRESSBOOK_MODEL (e_addressbook_model_get_type ())
-#define E_ADDRESSBOOK_MODEL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModel))
-#define E_ADDRESSBOOK_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_MODEL, EAddressbookModelClass))
-#define E_IS_ADDRESSBOOK_MODEL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_MODEL))
-#define E_IS_ADDRESSBOOK_MODEL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_MODEL))
-
-typedef struct _EAddressbookModel EAddressbookModel;
-typedef struct _EAddressbookModelClass EAddressbookModelClass;
-
-struct _EAddressbookModel {
- GObject parent;
-
- /* item specific fields */
- EBook *book;
- char *query;
- EBookView *book_view;
-
- int get_view_idle;
-
- ECard **data;
- int data_count;
- int allocated_count;
-
- int create_card_id, remove_card_id, modify_card_id;
- int status_message_id, writable_status_id, sequence_complete_id;
- int backend_died_id;
-
- guint search_in_progress : 1;
- guint editable : 1;
- guint editable_set : 1;
- guint first_get_view : 1;
-};
-
-
-struct _EAddressbookModelClass {
- GObjectClass parent_class;
-
- /*
- * Signals
- */
- void (*writable_status) (EAddressbookModel *model, gboolean writable);
- void (*search_started) (EAddressbookModel *model);
- void (*search_result) (EAddressbookModel *model, EBookViewStatus status);
- void (*status_message) (EAddressbookModel *model, const gchar *message);
- void (*folder_bar_message) (EAddressbookModel *model, const gchar *message);
- void (*card_added) (EAddressbookModel *model, gint index, gint count);
- void (*card_removed) (EAddressbookModel *model, gint index);
- void (*card_changed) (EAddressbookModel *model, gint index);
- void (*model_changed) (EAddressbookModel *model);
- void (*stop_state_changed) (EAddressbookModel *model);
- void (*backend_died) (EAddressbookModel *model);
-};
-
-
-GType e_addressbook_model_get_type (void);
-EAddressbookModel *e_addressbook_model_new (void);
-
-/* Returns object with ref count of 1. */
-ECard *e_addressbook_model_get_card (EAddressbookModel *model,
- int row);
-const ECard *e_addressbook_model_peek_card (EAddressbookModel *model,
- int row);
-EBook *e_addressbook_model_get_ebook (EAddressbookModel *model);
-
-void e_addressbook_model_stop (EAddressbookModel *model);
-gboolean e_addressbook_model_can_stop (EAddressbookModel *model);
-
-void e_addressbook_model_force_folder_bar_message (EAddressbookModel *model);
-
-int e_addressbook_model_card_count (EAddressbookModel *model);
-ECard *e_addressbook_model_card_at (EAddressbookModel *model,
- int index);
-gboolean e_addressbook_model_editable (EAddressbookModel *model);
-
-#endif /* _E_ADDRESSBOOK_MODEL_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
deleted file mode 100644
index 7f99062144..0000000000
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ /dev/null
@@ -1,518 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-
-#include <config.h>
-#include <string.h>
-
-#include <libgnome/gnome-i18n.h>
-#include "e-addressbook-marshal.h"
-#include "e-addressbook-reflow-adapter.h"
-#include "e-addressbook-model.h"
-#include "e-addressbook-view.h"
-#include "e-addressbook-util.h"
-
-#include "e-minicard.h"
-#include <gal/widgets/e-popup-menu.h>
-#include <gal/widgets/e-gui-utils.h>
-#include "e-contact-save-as.h"
-#include "addressbook/printing/e-contact-print.h"
-#include "addressbook/printing/e-contact-print-envelope.h"
-
-
-struct _EAddressbookReflowAdapterPrivate {
- EAddressbookModel *model;
-
- gboolean loading;
-
- int create_card_id, remove_card_id, modify_card_id, model_changed_id;
- int search_started_id, search_result_id;
-};
-
-#define PARENT_TYPE e_reflow_model_get_type()
-static EReflowModel *parent_class;
-
-#define d(x)
-
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE,
- PROP_MODEL,
-};
-
-enum {
- DRAG_BEGIN,
- LAST_SIGNAL
-};
-
-static guint e_addressbook_reflow_adapter_signals [LAST_SIGNAL] = {0, };
-
-static void
-unlink_model(EAddressbookReflowAdapter *adapter)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- if (priv->model && priv->create_card_id)
- g_signal_handler_disconnect (priv->model,
- priv->create_card_id);
- if (priv->model && priv->remove_card_id)
- g_signal_handler_disconnect (priv->model,
- priv->remove_card_id);
- if (priv->model && priv->modify_card_id)
- g_signal_handler_disconnect (priv->model,
- priv->modify_card_id);
- if (priv->model && priv->model_changed_id)
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
- if (priv->model && priv->search_started_id)
- g_signal_handler_disconnect (priv->model,
- priv->search_started_id);
- if (priv->model && priv->search_result_id)
- g_signal_handler_disconnect (priv->model,
- priv->search_result_id);
-
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
- priv->search_started_id = 0;
- priv->search_result_id = 0;
-
- if (priv->model)
- g_object_unref (priv->model);
-
- priv->model = NULL;
-}
-
-
-static int
-text_height (PangoLayout *layout, const gchar *text)
-{
- int height;
-
- pango_layout_set_text (layout, text, -1);
-
- pango_layout_get_pixel_size (layout, NULL, &height);
-
- return height;
-}
-
-static void
-addressbook_dispose(GObject *object)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
-
- unlink_model (adapter);
-}
-
-static void
-addressbook_set_width (EReflowModel *erm, int width)
-{
-}
-
-/* This function returns the number of items in our EReflowModel. */
-static int
-addressbook_count (EReflowModel *erm)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- return e_addressbook_model_card_count (priv->model);
-}
-
-/* This function returns the height of the minicard in question */
-static int
-addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- ECardSimpleField field;
- int count = 0;
- char *string;
- ECardSimple *simple = e_card_simple_new (e_addressbook_model_card_at (priv->model, i));
- PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (parent)->canvas), "");
- int height;
-
- string = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_FILE_AS);
- height = text_height (layout, string ? string : "") + 10.0;
- g_free(string);
-
- for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING && count < 5; field++) {
-
- if (field == E_CARD_SIMPLE_FIELD_FAMILY_NAME)
- continue;
-
- string = e_card_simple_get(simple, field);
- if (string && *string) {
- int this_height;
- int field_text_height;
-
- this_height = text_height (layout, e_card_simple_get_name(simple, field));
-
- field_text_height = text_height (layout, string);
- if (this_height < field_text_height)
- this_height = field_text_height;
-
- this_height += 3;
-
- height += this_height;
- count ++;
- }
- g_free (string);
- }
- height += 2;
-
- g_object_unref (simple);
- g_object_unref (layout);
-
- return height;
-}
-
-static int
-addressbook_compare (EReflowModel *erm, int n1, int n2)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- ECard *card1, *card2;
-
- if (priv->loading) {
- return n1-n2;
- }
- else {
- card1 = e_addressbook_model_card_at (priv->model, n1);
- card2 = e_addressbook_model_card_at (priv->model, n2);
-
- if (card1 && card2) {
- char *file_as1, *file_as2;
- file_as1 = card1->file_as;
- file_as2 = card2->file_as;
- if (file_as1 && file_as2)
- return g_utf8_collate(file_as1, file_as2);
- if (file_as1)
- return -1;
- if (file_as2)
- return 1;
- return strcmp(e_card_get_id(card1), e_card_get_id(card2));
- }
- if (card1)
- return -1;
- if (card2)
- return 1;
- return 0;
- }
-}
-
-static int
-adapter_drag_begin (EMinicard *card, GdkEvent *event, EAddressbookReflowAdapter *adapter)
-{
- gint ret_val = 0;
-
- g_signal_emit (adapter,
- e_addressbook_reflow_adapter_signals[DRAG_BEGIN], 0,
- event, &ret_val);
-
- return ret_val;
-}
-
-static GnomeCanvasItem *
-addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
- GnomeCanvasItem *item;
-
- item = gnome_canvas_item_new(parent,
- e_minicard_get_type(),
- "card", e_addressbook_model_card_at (priv->model, i),
- "editable", e_addressbook_model_editable (priv->model),
- NULL);
-
-#if 0
- g_signal_connect (item, "selected",
- G_CALLBACK(card_selected), 0, emvm);
-#endif
-
- g_signal_connect (item, "drag_begin",
- G_CALLBACK(adapter_drag_begin), adapter);
-
- return item;
-}
-
-static void
-addressbook_reincarnate (EReflowModel *erm, int i, GnomeCanvasItem *item)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- gnome_canvas_item_set(item,
- "card", e_addressbook_model_card_at (priv->model, i),
- NULL);
-}
-
-static void
-create_card (EAddressbookModel *model,
- gint index, gint count,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_items_inserted (E_REFLOW_MODEL (adapter),
- index,
- count);
-}
-
-static void
-remove_card (EAddressbookModel *model,
- gint index,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_item_removed (E_REFLOW_MODEL (adapter), index);
-}
-
-static void
-modify_card (EAddressbookModel *model,
- gint index,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_item_changed (E_REFLOW_MODEL (adapter), index);
-}
-
-static void
-model_changed (EAddressbookModel *model,
- EAddressbookReflowAdapter *adapter)
-{
- e_reflow_model_changed (E_REFLOW_MODEL (adapter));
-}
-
-static void
-search_started (EAddressbookModel *model,
- EAddressbookReflowAdapter *adapter)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- priv->loading = TRUE;
-}
-
-static void
-search_result (EAddressbookModel *model,
- EBookViewStatus status,
- EAddressbookReflowAdapter *adapter)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- priv->loading = FALSE;
-
- e_reflow_model_comparison_changed (E_REFLOW_MODEL (adapter));
-}
-
-static void
-addressbook_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- switch (prop_id) {
- case PROP_BOOK:
- g_object_set (priv->model,
- "book", g_value_get_object (value),
- NULL);
- break;
- case PROP_QUERY:
- g_object_set (priv->model,
- "query", g_value_get_string (value),
- NULL);
- break;
- case PROP_EDITABLE:
- g_object_set (priv->model,
- "editable", g_value_get_boolean (value),
- NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-addressbook_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- switch (prop_id) {
- case PROP_BOOK: {
- g_object_get_property (G_OBJECT (priv->model),
- "book", value);
- break;
- }
- case PROP_QUERY: {
- g_object_get_property (G_OBJECT (priv->model),
- "query", value);
- break;
- }
- case PROP_EDITABLE: {
- g_object_get_property (G_OBJECT (priv->model),
- "editable", value);
- break;
- }
- case PROP_MODEL:
- g_value_set_object (value, priv->model);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_addressbook_reflow_adapter_class_init (GObjectClass *object_class)
-{
- EReflowModelClass *model_class = (EReflowModelClass *) object_class;
-
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->set_property = addressbook_set_property;
- object_class->get_property = addressbook_get_property;
- object_class->dispose = addressbook_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- _("Model"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_ADDRESSBOOK_MODEL,
- G_PARAM_READABLE));
-
- e_addressbook_reflow_adapter_signals [DRAG_BEGIN] =
- g_signal_new ("drag_begin",
- G_OBJECT_CLASS_TYPE(object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookReflowAdapterClass, drag_begin),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- model_class->set_width = addressbook_set_width;
- model_class->count = addressbook_count;
- model_class->height = addressbook_height;
- model_class->compare = addressbook_compare;
- model_class->incarnate = addressbook_incarnate;
- model_class->reincarnate = addressbook_reincarnate;
-}
-
-static void
-e_addressbook_reflow_adapter_init (GtkObject *object)
-{
- EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(object);
- EAddressbookReflowAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookReflowAdapterPrivate, 1);
-
- priv->loading = FALSE;
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
- priv->search_started_id = 0;
- priv->search_result_id = 0;
-}
-
-GType
-e_addressbook_reflow_adapter_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookReflowAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_reflow_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookReflowAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_reflow_adapter_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EAddressbookReflowAdapter", &info, 0);
- }
-
- return type;
-}
-
-void
-e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter,
- EAddressbookModel *model)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- priv->model = model;
- g_object_ref (priv->model);
-
- priv->create_card_id = g_signal_connect(priv->model,
- "card_added",
- G_CALLBACK(create_card),
- adapter);
- priv->remove_card_id = g_signal_connect(priv->model,
- "card_removed",
- G_CALLBACK(remove_card),
- adapter);
- priv->modify_card_id = g_signal_connect(priv->model,
- "card_changed",
- G_CALLBACK(modify_card),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
- adapter);
- priv->search_started_id = g_signal_connect(priv->model,
- "search_started",
- G_CALLBACK(search_started),
- adapter);
- priv->search_result_id = g_signal_connect(priv->model,
- "search_result",
- G_CALLBACK(search_result),
- adapter);
-}
-
-EReflowModel *
-e_addressbook_reflow_adapter_new (EAddressbookModel *model)
-{
- EAddressbookReflowAdapter *et;
-
- et = g_object_new (E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, NULL);
-
- e_addressbook_reflow_adapter_construct (et, model);
-
- return E_REFLOW_MODEL(et);
-}
-
-
-ECard *
-e_addressbook_reflow_adapter_get_card (EAddressbookReflowAdapter *adapter,
- int index)
-{
- EAddressbookReflowAdapterPrivate *priv = adapter->priv;
-
- return e_addressbook_model_get_card (priv->model, index);
-}
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h
deleted file mode 100644
index 4bf131bc5c..0000000000
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_ADDRESSBOOK_REFLOW_ADAPTER_H_
-#define _E_ADDRESSBOOK_REFLOW_ADAPTER_H_
-
-#include <gal/widgets/e-reflow-model.h>
-#include <gal/widgets/e-selection-model.h>
-#include "e-addressbook-model.h"
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-book-view.h"
-#include "addressbook/backend/ebook/e-card.h"
-
-#define E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER (e_addressbook_reflow_adapter_get_type ())
-#define E_ADDRESSBOOK_REFLOW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, EAddressbookReflowAdapter))
-#define E_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER, EAddressbookReflowAdapterClass))
-#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER))
-#define E_IS_ADDRESSBOOK_REFLOW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER))
-
-typedef struct _EAddressbookReflowAdapter EAddressbookReflowAdapter;
-typedef struct _EAddressbookReflowAdapterPrivate EAddressbookReflowAdapterPrivate;
-typedef struct _EAddressbookReflowAdapterClass EAddressbookReflowAdapterClass;
-
-struct _EAddressbookReflowAdapter {
- EReflowModel parent;
-
- EAddressbookReflowAdapterPrivate *priv;
-};
-
-
-struct _EAddressbookReflowAdapterClass {
- EReflowModelClass parent_class;
-
- /*
- * Signals
- */
- gint (* drag_begin) (EAddressbookReflowAdapter *adapter, GdkEvent *event);
-};
-
-
-GType e_addressbook_reflow_adapter_get_type (void);
-void e_addressbook_reflow_adapter_construct (EAddressbookReflowAdapter *adapter,
- EAddressbookModel *model);
-EReflowModel *e_addressbook_reflow_adapter_new (EAddressbookModel *model);
-
-/* Returns object with ref count of 1. */
-ECard *e_addressbook_reflow_adapter_get_card (EAddressbookReflowAdapter *adapter,
- int index);
-#endif /* _E_ADDRESSBOOK_REFLOW_ADAPTER_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
deleted file mode 100644
index b3f79f064c..0000000000
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-#include "e-addressbook-model.h"
-#include "e-addressbook-table-adapter.h"
-#include "e-card-merging.h"
-#include "e-addressbook-util.h"
-#include "ebook/e-destination.h"
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <gnome.h>
-
-struct _EAddressbookTableAdapterPrivate {
- EAddressbookModel *model;
-
- ECardSimple **simples;
- int count;
-
- int create_card_id, remove_card_id, modify_card_id, model_changed_id;
-};
-
-#define PARENT_TYPE e_table_model_get_type()
-static ETableModelClass *parent_class;
-
-#define COLS (E_CARD_SIMPLE_FIELD_LAST)
-
-static void
-unlink_model(EAddressbookTableAdapter *adapter)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- int i;
-
- g_signal_handler_disconnect (priv->model,
- priv->create_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->remove_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->modify_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
-
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
-
- /* free up the existing mapping if there is one */
- if (priv->simples) {
- for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
- g_free (priv->simples);
- priv->simples = NULL;
- }
-
- g_object_unref (priv->model);
-
- priv->model = NULL;
-}
-
-static void
-build_simple_mapping(EAddressbookTableAdapter *adapter)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- int i;
-
- /* free up the existing mapping if there is one */
- if (priv->simples) {
- for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
- g_free (priv->simples);
- }
-
- /* build up our mapping to ECardSimple*'s */
- priv->count = e_addressbook_model_card_count (priv->model);
- priv->simples = g_new (ECardSimple*, priv->count);
- for (i = 0; i < priv->count; i ++) {
- priv->simples[i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, i));
- g_object_ref (priv->simples[i]);
- }
-}
-
-static void
-addressbook_dispose(GObject *object)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(object);
-
- if (adapter->priv) {
- unlink_model(adapter);
-
- g_free (adapter->priv);
- adapter->priv = NULL;
- }
-}
-
-/* This function returns the number of columns in our ETableModel. */
-static int
-addressbook_col_count (ETableModel *etc)
-{
- return COLS;
-}
-
-/* This function returns the number of rows in our ETableModel. */
-static int
-addressbook_row_count (ETableModel *etc)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- return e_addressbook_model_card_count (priv->model);
-}
-
-/* This function returns the value at a particular point in our ETableModel. */
-static void *
-addressbook_value_at (ETableModel *etc, int col, int row)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- const char *value;
-
- if ( col >= COLS || row >= e_addressbook_model_card_count (priv->model) )
- return NULL;
-
- value = e_card_simple_get_const(priv->simples[row], col);
-
- if (value && !strncmp (value, "<?xml", 5)) {
- EDestination *dest = e_destination_import (value);
- if (dest) {
- /* XXX blech, we leak this */
- value = g_strdup (e_destination_get_textrep (dest, TRUE));
- g_object_unref (dest);
- }
- }
-
-
- return (void *)(value ? value : "");
-}
-
-/* This function sets the value at a particular point in our ETableModel. */
-static void
-card_modified_cb (EBook* book, EBookStatus status,
- gpointer user_data)
-{
- if (status != E_BOOK_STATUS_SUCCESS)
- e_addressbook_error_dialog (_("Error modifying card"), status);
-}
-static void
-addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- if (e_addressbook_model_editable (priv->model)) {
- ECard *card;
-
- if ( col >= COLS|| row >= e_addressbook_model_card_count (priv->model) )
- return;
-
- e_table_model_pre_change(etc);
-
- e_card_simple_set(priv->simples[row],
- col,
- val);
- g_object_get(priv->simples[row],
- "card", &card,
- NULL);
-
- e_card_merging_book_commit_card(e_addressbook_model_get_ebook(priv->model),
- card, card_modified_cb, NULL);
- g_object_unref (card);
-
- /* XXX do we need this? shouldn't the commit_card generate a changed signal? */
- e_table_model_cell_changed(etc, col, row);
- }
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-addressbook_is_cell_editable (ETableModel *etc, int col, int row)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- ECard *card;
-
- if (row >= 0 && row < e_addressbook_model_card_count (priv->model))
- card = e_addressbook_model_card_at (priv->model, row);
- else
- card = NULL;
-
- if (!e_addressbook_model_editable(priv->model))
- return FALSE;
- else if (card && e_card_evolution_list (card))
- /* we only allow editing of the name and file as for
- lists */
- return col == E_CARD_SIMPLE_FIELD_FULL_NAME || col == E_CARD_SIMPLE_FIELD_FILE_AS;
- else
- return col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING;
-}
-
-static void
-addressbook_append_row (ETableModel *etm, ETableModel *source, gint row)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etm);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- ECard *card;
- ECardSimple *simple;
- int col;
-
- card = e_card_new("");
- simple = e_card_simple_new(card);
-
- for (col = 0; col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; col++) {
- const void *val = e_table_model_value_at(source, col, row);
- e_card_simple_set(simple, col, val);
- }
- e_card_simple_sync_card(simple);
- e_card_merging_book_add_card (e_addressbook_model_get_ebook (priv->model), card, NULL, NULL);
- g_object_unref (simple);
- g_object_unref (card);
-}
-
-/* This function duplicates the value passed to it. */
-static void *
-addressbook_duplicate_value (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-/* This function frees the value passed to it. */
-static void
-addressbook_free_value (ETableModel *etc, int col, void *value)
-{
- g_free(value);
-}
-
-static void *
-addressbook_initialize_value (ETableModel *etc, int col)
-{
- return g_strdup("");
-}
-
-static gboolean
-addressbook_value_is_empty (ETableModel *etc, int col, const void *value)
-{
- return !(value && *(char *)value);
-}
-
-static char *
-addressbook_value_to_string (ETableModel *etc, int col, const void *value)
-{
- return g_strdup(value);
-}
-
-static void
-e_addressbook_table_adapter_class_init (GObjectClass *object_class)
-{
- ETableModelClass *model_class = (ETableModelClass *) object_class;
-
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->dispose = addressbook_dispose;
-
- model_class->column_count = addressbook_col_count;
- model_class->row_count = addressbook_row_count;
- model_class->value_at = addressbook_value_at;
- model_class->set_value_at = addressbook_set_value_at;
- model_class->is_cell_editable = addressbook_is_cell_editable;
- model_class->append_row = addressbook_append_row;
- model_class->duplicate_value = addressbook_duplicate_value;
- model_class->free_value = addressbook_free_value;
- model_class->initialize_value = addressbook_initialize_value;
- model_class->value_is_empty = addressbook_value_is_empty;
- model_class->value_to_string = addressbook_value_to_string;
-}
-
-static void
-e_addressbook_table_adapter_init (GObject *object)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(object);
- EAddressbookTableAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookTableAdapterPrivate, 1);
-
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
- priv->simples = NULL;
- priv->count = 0;
-}
-
-
-static void
-create_card (EAddressbookModel *model,
- gint index, gint count,
- EAddressbookTableAdapter *adapter)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- int i;
-
- priv->count += count;
- priv->simples = g_renew(ECardSimple *, priv->simples, priv->count);
- memmove (priv->simples + index + count, priv->simples + index, (priv->count - index - count) * sizeof (ECardSimple *));
-
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
- for (i = 0; i < count; i ++) {
- priv->simples[index + i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index + i));
- }
- e_table_model_rows_inserted (E_TABLE_MODEL (adapter), index, count);
-}
-
-static void
-remove_card (EAddressbookModel *model,
- gint index,
- EAddressbookTableAdapter *adapter)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
-
- g_object_unref (priv->simples[index]);
- memmove (priv->simples + index, priv->simples + index + 1, (priv->count - index - 1) * sizeof (ECardSimple *));
- priv->count --;
- e_table_model_rows_deleted (E_TABLE_MODEL (adapter), index, 1);
-}
-
-static void
-modify_card (EAddressbookModel *model,
- gint index,
- EAddressbookTableAdapter *adapter)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
-
- g_object_unref (priv->simples[index]);
- priv->simples[index] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index));
- g_object_ref (priv->simples[index]);
- e_table_model_row_changed (E_TABLE_MODEL (adapter), index);
-}
-
-static void
-model_changed (EAddressbookModel *model,
- EAddressbookTableAdapter *adapter)
-{
- e_table_model_pre_change (E_TABLE_MODEL (adapter));
- build_simple_mapping (adapter);
- e_table_model_changed (E_TABLE_MODEL (adapter));
-}
-
-GType
-e_addressbook_table_adapter_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookTableAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_table_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookTableAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_table_adapter_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "EAddressbookTableAdapter", &info, 0);
- }
-
- return type;
-}
-
-void
-e_addressbook_table_adapter_construct (EAddressbookTableAdapter *adapter,
- EAddressbookModel *model)
-{
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
-
- priv->model = model;
- g_object_ref (priv->model);
-
- priv->create_card_id = g_signal_connect(priv->model,
- "card_added",
- G_CALLBACK(create_card),
- adapter);
- priv->remove_card_id = g_signal_connect(priv->model,
- "card_removed",
- G_CALLBACK(remove_card),
- adapter);
- priv->modify_card_id = g_signal_connect(priv->model,
- "card_changed",
- G_CALLBACK(modify_card),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
- adapter);
-
- build_simple_mapping (adapter);
-}
-
-ETableModel *
-e_addressbook_table_adapter_new (EAddressbookModel *model)
-{
- EAddressbookTableAdapter *et;
-
- et = g_object_new(E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, NULL);
-
- e_addressbook_table_adapter_construct (et, model);
-
- return E_TABLE_MODEL(et);
-}
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.h b/addressbook/gui/widgets/e-addressbook-table-adapter.h
deleted file mode 100644
index df66e1dce9..0000000000
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_ADDRESSBOOK_TABLE_ADAPTER_H_
-#define _E_ADDRESSBOOK_TABLE_ADAPTER_H_
-
-#include <gal/e-table/e-table-model.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-book-view.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#define E_TYPE_ADDRESSBOOK_TABLE_ADAPTER (e_addressbook_table_adapter_get_type ())
-#define E_ADDRESSBOOK_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapter))
-#define E_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER, EAddressbookTableAdapterClass))
-#define E_IS_ADDRESSBOOK_TABLE_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER))
-#define E_IS_ADDRESSBOOK_TABLE_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_TABLE_ADAPTER))
-
-/* Virtual Column list:
- 0 Email
- 1 Full Name
- 2 Street
- 3 Phone
-*/
-
-typedef struct _EAddressbookTableAdapter EAddressbookTableAdapter;
-typedef struct _EAddressbookTableAdapterPrivate EAddressbookTableAdapterPrivate;
-typedef struct _EAddressbookTableAdapterClass EAddressbookTableAdapterClass;
-
-struct _EAddressbookTableAdapter {
- ETableModel parent;
-
- EAddressbookTableAdapterPrivate *priv;
-};
-
-
-struct _EAddressbookTableAdapterClass {
- ETableModelClass parent_class;
-};
-
-
-GType e_addressbook_table_adapter_get_type (void);
-void e_addressbook_table_adapter_construct (EAddressbookTableAdapter *adapter,
- EAddressbookModel *model);
-ETableModel *e_addressbook_table_adapter_new (EAddressbookModel *model);
-
-#endif /* _E_ADDRESSBOOK_TABLE_ADAPTER_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-treeview-adapter.c b/addressbook/gui/widgets/e-addressbook-treeview-adapter.c
deleted file mode 100644
index af4652226e..0000000000
--- a/addressbook/gui/widgets/e-addressbook-treeview-adapter.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-#include <config.h>
-#include "e-addressbook-model.h"
-#include "e-addressbook-treeview-adapter.h"
-#include "e-card-merging.h"
-#include "e-addressbook-util.h"
-#include <gtk/gtktreednd.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-
-struct _EAddressbookTreeViewAdapterPrivate {
- EAddressbookModel *model;
-
- gint stamp;
-
- ECardSimple **simples;
- int count;
-
- int create_card_id, remove_card_id, modify_card_id, model_changed_id;
-};
-
-#define PARENT_TYPE G_TYPE_OBJECT
-GObjectClass *parent_class;
-
-#define COLS (E_CARD_SIMPLE_FIELD_LAST)
-
-static void
-unlink_model(EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- int i;
-
- g_signal_handler_disconnect (priv->model,
- priv->create_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->remove_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->modify_card_id);
- g_signal_handler_disconnect (priv->model,
- priv->model_changed_id);
-
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
-
- /* free up the existing mapping if there is one */
- if (priv->simples) {
- for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
- g_free (priv->simples);
- priv->simples = NULL;
- }
-
- g_object_unref (priv->model);
-
- priv->model = NULL;
-}
-
-static void
-build_simple_mapping(EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- int i;
-
- /* free up the existing mapping if there is one */
- if (priv->simples) {
- for (i = 0; i < priv->count; i ++)
- g_object_unref (priv->simples[i]);
- g_free (priv->simples);
- }
-
- /* build up our mapping to ECardSimple*'s */
- priv->count = e_addressbook_model_card_count (priv->model);
- priv->simples = g_new (ECardSimple*, priv->count);
- for (i = 0; i < priv->count; i ++) {
- priv->simples[i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, i));
- g_object_ref (priv->simples[i]);
- }
-}
-
-static void
-addressbook_destroy(GtkObject *object)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER(object);
-
- unlink_model(adapter);
-
- g_free (adapter->priv);
-}
-
-#if 0
-static void
-addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- if (e_addressbook_model_editable (priv->model)) {
- ECard *card;
-
- if ( col >= COLS|| row >= e_addressbook_model_card_count (priv->model) )
- return;
-
- e_table_model_pre_change(etc);
-
- e_card_simple_set(priv->simples[row],
- col,
- val);
- g_object_get(priv->simples[row],
- "card", &card,
- NULL);
-
- e_card_merging_book_commit_card(e_addressbook_model_get_ebook(priv->model),
- card, card_modified_cb, NULL);
-
- /* XXX do we need this? shouldn't the commit_card generate a changed signal? */
- e_table_model_cell_changed(etc, col, row);
- }
-}
-
-/* This function returns whether a particular cell is editable. */
-static gboolean
-addressbook_is_cell_editable (ETableModel *etc, int col, int row)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etc);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- ECard *card;
-
- if (row >= 0 && row < e_addressbook_model_card_count (priv->model))
- card = e_addressbook_model_card_at (priv->model, row);
- else
- card = NULL;
-
- if (!e_addressbook_model_editable(priv->model))
- return FALSE;
- else if (card && e_card_evolution_list (card))
- /* we only allow editing of the name and file as for
- lists */
- return col == E_CARD_SIMPLE_FIELD_FULL_NAME || col == E_CARD_SIMPLE_FIELD_FILE_AS;
- else
- return col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING;
-}
-
-static void
-addressbook_append_row (ETableModel *etm, ETableModel *source, gint row)
-{
- EAddressbookTableAdapter *adapter = E_ADDRESSBOOK_TABLE_ADAPTER(etm);
- EAddressbookTableAdapterPrivate *priv = adapter->priv;
- ECard *card;
- ECardSimple *simple;
- int col;
-
- card = e_card_new("");
- simple = e_card_simple_new(card);
-
- for (col = 0; col < E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; col++) {
- const void *val = e_table_model_value_at(source, col, row);
- e_card_simple_set(simple, col, val);
- }
- e_card_simple_sync_card(simple);
- e_card_merging_book_add_card (e_addressbook_model_get_ebook (priv->model), card, NULL, NULL);
- g_object_unref (simple);
- g_object_unref (card);
-}
-#endif
-
-static void
-e_addressbook_treeview_adapter_class_init (GtkObjectClass *object_class)
-{
- parent_class = g_type_class_peek_parent (object_class);
-
- object_class->destroy = addressbook_destroy;
-}
-
-static void
-e_addressbook_treeview_adapter_init (GtkObject *object)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER(object);
- EAddressbookTreeViewAdapterPrivate *priv;
-
- priv = adapter->priv = g_new0 (EAddressbookTreeViewAdapterPrivate, 1);
-
- priv->create_card_id = 0;
- priv->remove_card_id = 0;
- priv->modify_card_id = 0;
- priv->model_changed_id = 0;
- priv->simples = NULL;
- priv->count = 0;
-}
-
-static void
-get_iter (EAddressbookTreeViewAdapter *adapter, gint index, GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
-
- iter->stamp = priv->stamp;
- iter->user_data = GINT_TO_POINTER (index);
-}
-
-static void
-create_card (EAddressbookModel *model,
- gint index, gint count,
- EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- int i;
-
- priv->count += count;
- priv->simples = g_renew(ECardSimple *, priv->simples, priv->count);
- memmove (priv->simples + index + count, priv->simples + index, (priv->count - index - count) * sizeof (ECardSimple *));
-
- for (i = 0; i < count; i ++) {
- GtkTreeIter iter;
- GtkTreePath *path;
-
- priv->simples[index + i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index + i));
-
- get_iter (adapter, index + i, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (adapter), &iter);
-
- gtk_tree_model_row_inserted (GTK_TREE_MODEL (adapter), path, &iter);
- gtk_tree_model_row_changed (GTK_TREE_MODEL (adapter), path, &iter);
-
- gtk_tree_path_free (path);
- }
-}
-
-static void
-remove_card (EAddressbookModel *model,
- gint index,
- EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- GtkTreeIter iter;
- GtkTreePath *path;
-
- g_object_unref (priv->simples[index]);
- memmove (priv->simples + index, priv->simples + index + 1, (priv->count - index - 1) * sizeof (ECardSimple *));
- priv->count --;
- get_iter (adapter, index, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (adapter), &iter);
-
- gtk_tree_model_row_deleted (GTK_TREE_MODEL (adapter), path);
-
- gtk_tree_path_free (path);
-}
-
-static void
-modify_card (EAddressbookModel *model,
- gint index,
- EAddressbookTreeViewAdapter *adapter)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
- GtkTreeIter iter;
- GtkTreePath *path;
-
- g_object_unref (priv->simples[index]);
- priv->simples[index] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index));
-
- get_iter (adapter, index, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (adapter), &iter);
-
- gtk_tree_model_row_changed (GTK_TREE_MODEL (adapter), path, &iter);
-
- gtk_tree_path_free (path);
-}
-
-static void
-model_changed (EAddressbookModel *model,
- EAddressbookTreeViewAdapter *adapter)
-{
- int i;
-
- /* there has *got* to be an easier/faster way to do this... */
- for (i = 0; i < adapter->priv->count; i++) {
- remove_card (model, i, adapter);
- }
-
- build_simple_mapping (adapter);
-
- if (adapter->priv->count) {
- printf ("AIIEEEEEE\n");
- }
-
- /* XXX this isn't right either, we need to add the new cards */
-}
-
-static GtkTreeModelFlags
-adapter_get_flags (GtkTreeModel *tree_model)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), 0);
-
- return GTK_TREE_MODEL_LIST_ONLY;
-}
-
-static gint
-adapter_get_n_columns (GtkTreeModel *tree_model)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), 0);
-
- return COLS;
-}
-
-static GType
-adapter_get_column_type (GtkTreeModel *tree_model,
- gint index)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), G_TYPE_INVALID);
- g_return_val_if_fail (index < COLS && index >= 0, G_TYPE_INVALID);
-
- return G_TYPE_STRING;
-}
-
-static gboolean
-adapter_get_iter (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreePath *path)
-{
- EAddressbookTreeViewAdapter *adapter;
- GSList *list;
- gint i;
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), FALSE);
- g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
-
- adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- i = gtk_tree_path_get_indices (path)[0];
-
- if (i >= adapter->priv->count)
- return FALSE;
-
- iter->stamp = adapter->priv->stamp;
- iter->user_data = GINT_TO_POINTER (i);
-
- return TRUE;
-}
-
-static GtkTreePath *
-adapter_get_path (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
- GtkTreePath *retval;
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), NULL);
- g_return_val_if_fail (iter->stamp == adapter->priv->stamp, NULL);
-
-
- if (GPOINTER_TO_INT (iter->user_data) >= adapter->priv->count)
- return NULL;
-
- retval = gtk_tree_path_new ();
- gtk_tree_path_append_index (retval, GPOINTER_TO_INT (iter->user_data));
- return retval;
-}
-
-static void
-adapter_get_value (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gint column,
- GValue *value)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
- ECardSimple *simple;
- gint tmp_column = column;
- const char *v;
-
- g_return_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model));
- g_return_if_fail (column < COLS);
- g_return_if_fail (adapter->priv->stamp == iter->stamp);
-
- simple = adapter->priv->simples [ GPOINTER_TO_INT (iter->user_data) ];
-
- v = e_card_simple_get_const(simple, column);
-
- if (v && !strncmp (v, "<?xml", 5)) {
- EDestination *dest = e_destination_import (v);
- if (dest) {
- /* XXX blech, we leak this */
- v = g_strdup (e_destination_get_textrep (dest, TRUE));
- g_object_unref (dest);
- }
- }
-
- g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, (v ? v : ""));
-}
-
-static gboolean
-adapter_iter_next (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapter *adapter;
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), FALSE);
- g_return_val_if_fail (E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model)->priv->stamp == iter->stamp, FALSE);
-
- adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- iter->user_data = GINT_TO_POINTER (GPOINTER_TO_INT (iter->user_data) + 1);
-
- return (GPOINTER_TO_INT (iter->user_data) < adapter->priv->count);
-}
-
-static gboolean
-adapter_iter_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- /* this is a list, nodes have no children */
- if (parent)
- return FALSE;
-
- /* but if parent == NULL we return the list itself as children of the
- * "root"
- */
- if (adapter->priv->count) {
- iter->stamp = adapter->priv->stamp;
- iter->user_data = GINT_TO_POINTER (0);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-adapter_iter_has_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- return FALSE;
-}
-
-static gint
-adapter_iter_n_children (GtkTreeModel *tree_model,
- GtkTreeIter *iter)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), -1);
- if (iter == NULL)
- return adapter->priv->count;
-
- g_return_val_if_fail (adapter->priv->stamp == iter->stamp, -1);
- return 0;
-}
-
-static gboolean
-adapter_iter_nth_child (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *parent,
- gint n)
-{
- EAddressbookTreeViewAdapter *adapter = E_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model);
-
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (tree_model), FALSE);
-
- if (parent)
- return FALSE;
-
- if (n < adapter->priv->count) {
- iter->stamp = adapter->priv->stamp;
- iter->user_data = GINT_TO_POINTER (n);
- return TRUE;
- }
- else
- return FALSE;
-}
-
-static gboolean
-adapter_iter_parent (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- GtkTreeIter *child)
-{
- return FALSE;
-}
-
-static void
-adapter_tree_model_init (GtkTreeModelIface *iface)
-{
- iface->get_flags = adapter_get_flags;
- iface->get_n_columns = adapter_get_n_columns;
- iface->get_column_type = adapter_get_column_type;
- iface->get_iter = adapter_get_iter;
- iface->get_path = adapter_get_path;
- iface->get_value = adapter_get_value;
- iface->iter_next = adapter_iter_next;
- iface->iter_children = adapter_iter_children;
- iface->iter_has_child = adapter_iter_has_child;
- iface->iter_n_children = adapter_iter_n_children;
- iface->iter_nth_child = adapter_iter_nth_child;
- iface->iter_parent = adapter_iter_parent;
-}
-
-static gboolean
-adapter_drag_data_delete (GtkTreeDragSource *drag_source,
- GtkTreePath *path)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (drag_source), FALSE);
-
- return FALSE;
-}
-
-static gboolean
-adapter_drag_data_get (GtkTreeDragSource *drag_source,
- GtkTreePath *path,
- GtkSelectionData *selection_data)
-{
- g_return_val_if_fail (E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER (drag_source), FALSE);
-
- /* Note that we don't need to handle the GTK_TREE_MODEL_ROW
- * target, because the default handler does it for us, but
- * we do anyway for the convenience of someone maybe overriding the
- * default handler.
- */
-
- if (gtk_tree_set_row_drag_data (selection_data,
- GTK_TREE_MODEL (drag_source),
- path)) {
- return TRUE;
- }
- else {
- if (selection_data->target == gdk_atom_intern ("text/x-vcard", FALSE)) {
- printf ("HI THERE\n");
- }
- }
-
- return FALSE;
-}
-
-static void
-adapter_drag_source_init (GtkTreeDragSourceIface *iface)
-{
- iface->drag_data_delete = adapter_drag_data_delete;
- iface->drag_data_get = adapter_drag_data_get;
-}
-
-GType
-e_addressbook_treeview_adapter_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo adapter_info = {
- sizeof (EAddressbookTreeViewAdapterClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_treeview_adapter_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookTreeViewAdapter),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_treeview_adapter_init,
- };
-
- static const GInterfaceInfo tree_model_info = {
- (GInterfaceInitFunc) adapter_tree_model_init,
- NULL,
- NULL
- };
-
- static const GInterfaceInfo drag_source_info = {
- (GInterfaceInitFunc) adapter_drag_source_init,
- NULL,
- NULL
- };
-
- type = g_type_register_static (PARENT_TYPE, "EAddressbookTreeViewAdapter", &adapter_info, 0);
-
- g_type_add_interface_static (type,
- GTK_TYPE_TREE_MODEL,
- &tree_model_info);
-
- g_type_add_interface_static (type,
- GTK_TYPE_TREE_DRAG_SOURCE,
- &drag_source_info);
- }
-
- return type;
-}
-
-void
-e_addressbook_treeview_adapter_construct (EAddressbookTreeViewAdapter *adapter,
- EAddressbookModel *model)
-{
- EAddressbookTreeViewAdapterPrivate *priv = adapter->priv;
-
- priv->model = model;
- g_object_ref (priv->model);
-
- priv->stamp = g_random_int ();
-
- priv->create_card_id = g_signal_connect(priv->model,
- "card_added",
- G_CALLBACK(create_card),
- adapter);
- priv->remove_card_id = g_signal_connect(priv->model,
- "card_removed",
- G_CALLBACK(remove_card),
- adapter);
- priv->modify_card_id = g_signal_connect(priv->model,
- "card_changed",
- G_CALLBACK(modify_card),
- adapter);
- priv->model_changed_id = g_signal_connect(priv->model,
- "model_changed",
- G_CALLBACK(model_changed),
- adapter);
-
- build_simple_mapping (adapter);
-}
-
-GtkTreeModel *
-e_addressbook_treeview_adapter_new (EAddressbookModel *model)
-{
- EAddressbookTreeViewAdapter *et;
-
- et = g_object_new(E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER, NULL);
-
- e_addressbook_treeview_adapter_construct (et, model);
-
- return (GtkTreeModel*)et;
-}
diff --git a/addressbook/gui/widgets/e-addressbook-treeview-adapter.h b/addressbook/gui/widgets/e-addressbook-treeview-adapter.h
deleted file mode 100644
index 2c4370dee3..0000000000
--- a/addressbook/gui/widgets/e-addressbook-treeview-adapter.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-#ifndef _E_ADDRESSBOOK_TREEVIEW_ADAPTER_H_
-#define _E_ADDRESSBOOK_TREEVIEW_ADAPTER_H_
-
-#include <gtk/gtktreemodel.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/backend/ebook/e-book-view.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#define E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER (e_addressbook_treeview_adapter_get_type ())
-#define E_ADDRESSBOOK_TREEVIEW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER, EAddressbookTreeViewAdapter))
-#define E_ADDRESSBOOK_TREEVIEW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER, EAddressbookTreeViewAdapterClass))
-#define E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER))
-#define E_IS_ADDRESSBOOK_TREEVIEW_ADAPTER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_ADDRESSBOOK_TREEVIEW_ADAPTER))
-
-/* Virtual Column list:
- 0 Email
- 1 Full Name
- 2 Street
- 3 Phone
-*/
-
-typedef struct _EAddressbookTreeViewAdapter EAddressbookTreeViewAdapter;
-typedef struct _EAddressbookTreeViewAdapterPrivate EAddressbookTreeViewAdapterPrivate;
-typedef struct _EAddressbookTreeViewAdapterClass EAddressbookTreeViewAdapterClass;
-
-struct _EAddressbookTreeViewAdapter {
- GObject parent;
-
- EAddressbookTreeViewAdapterPrivate *priv;
-};
-
-
-struct _EAddressbookTreeViewAdapterClass {
- GObjectClass parent_class;
-};
-
-
-GType e_addressbook_treeview_adapter_get_type (void);
-void e_addressbook_treeview_adapter_construct (EAddressbookTreeViewAdapter *adapter,
- EAddressbookModel *model);
-GtkTreeModel *e_addressbook_treeview_adapter_new (EAddressbookModel *model);
-
-#endif /* _E_ADDRESSBOOK_TABLE_ADAPTER_H_ */
diff --git a/addressbook/gui/widgets/e-addressbook-util.c b/addressbook/gui/widgets/e-addressbook-util.c
deleted file mode 100644
index 1226698486..0000000000
--- a/addressbook/gui/widgets/e-addressbook-util.c
+++ /dev/null
@@ -1,635 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser.c
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "e-addressbook-util.h"
-#include "ebook/e-destination.h"
-
-#include <gnome.h>
-
-#include "e-card-merging.h"
-#include <shell/evolution-shell-client.h>
-#include <addressbook/backend/ebook/e-book-util.h>
-
-void
-e_addressbook_error_dialog (const gchar *msg, EBookStatus status)
-{
- static char *status_to_string[] = {
- N_("Success"),
- N_("Unknown error"),
- N_("Repository offline"),
- N_("Permission denied"),
- N_("Card not found"),
- N_("Card ID already exists"),
- N_("Protocol not supported"),
- N_("Cancelled"),
- N_("Authentication Failed"),
- N_("Authentication Required"),
- N_("TLS not Available"),
- N_("Addressbook does not exist"),
- N_("Other error")
- };
- char *error_msg;
- GtkWidget *dialog;
-
- error_msg = g_strdup_printf ("%s: %s", msg, _(status_to_string [status]));
-
- dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
- error_msg);
-
- g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
-
- gtk_widget_show (dialog);
-
- g_free (error_msg);
-}
-
-gint
-e_addressbook_prompt_save_dialog (GtkWindow *parent)
-{
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (parent,
- (GtkDialogFlags)0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("Do you want to save changes?"));
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Discard"), GTK_RESPONSE_NO,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_YES,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
-
- gtk_widget_destroy (dialog);
-
- return response;
-}
-
-static void
-added_cb (EBook* book, EBookStatus status, const char *id,
- gboolean is_list)
-{
- if (status != E_BOOK_STATUS_SUCCESS) {
- e_addressbook_error_dialog (is_list ? _("Error adding list") : _("Error adding card"), status);
- }
-}
-
-static void
-modified_cb (EBook* book, EBookStatus status,
- gboolean is_list)
-{
- if (status != E_BOOK_STATUS_SUCCESS) {
- e_addressbook_error_dialog (is_list ? _("Error modifying list") : _("Error modifying card"),
- status);
- }
-}
-
-static void
-deleted_cb (EBook* book, EBookStatus status,
- gboolean is_list)
-{
- if (status != E_BOOK_STATUS_SUCCESS) {
- e_addressbook_error_dialog (is_list ? _("Error removing list") : _("Error removing card"),
- status);
- }
-}
-
-static void
-editor_closed_cb (GtkObject *editor, gpointer data)
-{
- g_object_unref (editor);
-}
-
-EContactEditor *
-e_addressbook_show_contact_editor (EBook *book, ECard *card,
- gboolean is_new_card,
- gboolean editable)
-{
- EContactEditor *ce;
-
- ce = e_contact_editor_new (book, card, is_new_card, editable);
-
- g_signal_connect (ce, "card_added",
- G_CALLBACK (added_cb), GINT_TO_POINTER (FALSE));
- g_signal_connect (ce, "card_modified",
- G_CALLBACK (modified_cb), GINT_TO_POINTER (FALSE));
- g_signal_connect (ce, "card_deleted",
- G_CALLBACK (deleted_cb), GINT_TO_POINTER (FALSE));
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), NULL);
-
- return ce;
-}
-
-EContactListEditor *
-e_addressbook_show_contact_list_editor (EBook *book, ECard *card,
- gboolean is_new_card,
- gboolean editable)
-{
- EContactListEditor *ce;
-
- ce = e_contact_list_editor_new (book, card, is_new_card, editable);
-
- g_signal_connect (ce, "list_added",
- G_CALLBACK (added_cb), GINT_TO_POINTER (TRUE));
- g_signal_connect (ce, "list_modified",
- G_CALLBACK (modified_cb), GINT_TO_POINTER (TRUE));
- g_signal_connect (ce, "list_deleted",
- G_CALLBACK (deleted_cb), GINT_TO_POINTER (TRUE));
- g_signal_connect (ce, "editor_closed",
- G_CALLBACK (editor_closed_cb), GINT_TO_POINTER (TRUE));
-
- e_contact_list_editor_show (ce);
-
- return ce;
-}
-
-static void
-view_cards (EBook *book, GList *list, gboolean editable)
-{
- for (; list; list = list->next) {
- ECard *card = list->data;
- if (e_card_evolution_list (card))
- e_addressbook_show_contact_list_editor (book, card, FALSE, editable);
- else
- e_addressbook_show_contact_editor (book, card, FALSE, editable);
- }
-}
-
-void
-e_addressbook_show_multiple_cards (EBook *book,
- GList *list,
- gboolean editable)
-{
- if (list) {
- int length = g_list_length (list);
- if (length > 5) {
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- _("Opening %d cards will open %d new windows as well.\n"
- "Do you really want to display all of these cards?"),
- length,
- length);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- if (response == GTK_RESPONSE_YES)
- view_cards (book, list, editable);
- } else {
- view_cards (book, list, editable);
- }
- }
-}
-
-
-
-typedef struct CardCopyProcess_ CardCopyProcess;
-
-typedef void (*CardCopyDone) (CardCopyProcess *process);
-
-struct CardCopyProcess_ {
- int count;
- GList *cards;
- EBook *source;
- EBook *destination;
- CardCopyDone done_cb;
-};
-
-static void
-card_deleted_cb (EBook* book, EBookStatus status, gpointer user_data)
-{
- if (status != E_BOOK_STATUS_SUCCESS) {
- e_addressbook_error_dialog (_("Error removing card"), status);
- }
-}
-
-static void
-do_delete (gpointer data, gpointer user_data)
-{
- EBook *book = user_data;
- ECard *card = data;
-
- e_book_remove_card(book, card, card_deleted_cb, NULL);
-}
-
-static void
-delete_cards (CardCopyProcess *process)
-{
- g_list_foreach (process->cards,
- do_delete,
- process->source);
-}
-
-static void
-process_unref (CardCopyProcess *process)
-{
- process->count --;
- if (process->count == 0) {
- if (process->done_cb) {
- process->done_cb (process);
- }
- e_free_object_list(process->cards);
- g_object_unref (process->source);
- g_object_unref (process->destination);
- g_free (process);
- }
-}
-
-static void
-card_added_cb (EBook* book, EBookStatus status, const char *id, gpointer user_data)
-{
- CardCopyProcess *process = user_data;
-
- if (status != E_BOOK_STATUS_SUCCESS) {
- e_addressbook_error_dialog (_("Error adding card"), status);
- } else {
- process_unref (process);
- }
-}
-
-static void
-do_copy (gpointer data, gpointer user_data)
-{
- EBook *book;
- ECard *card;
- CardCopyProcess *process;
-
- process = user_data;
- card = data;
-
- book = process->destination;
-
- process->count ++;
- e_book_add_card(book, card, card_added_cb, process);
-}
-
-static void
-got_book_cb (EBook *book, gpointer closure)
-{
- CardCopyProcess *process;
- process = closure;
- if (book) {
- process->destination = book;
- g_object_ref (book);
- g_list_foreach (process->cards,
- do_copy,
- process);
- }
- process_unref (process);
-}
-
-extern EvolutionShellClient *global_shell_client;
-
-void
-e_addressbook_transfer_cards (EBook *source, GList *cards /* adopted */, gboolean delete_from_source, GtkWindow *parent_window)
-{
- const char *allowed_types[] = { "contacts/*", NULL };
- GNOME_Evolution_Folder *folder;
- static char *last_uri = NULL;
- CardCopyProcess *process;
- char *desc;
-
- if (cards == NULL)
- return;
-
- if (last_uri == NULL)
- last_uri = g_strdup ("");
-
- if (cards->next == NULL) {
- if (delete_from_source)
- desc = _("Move card to");
- else
- desc = _("Copy card to");
- } else {
- if (delete_from_source)
- desc = _("Move cards to");
- else
- desc = _("Copy cards to");
- }
-
- evolution_shell_client_user_select_folder (global_shell_client,
- parent_window,
- desc, last_uri, allowed_types,
- &folder);
- if (!folder)
- return;
-
- if (strcmp (last_uri, folder->evolutionUri) != 0) {
- g_free (last_uri);
- last_uri = g_strdup (folder->evolutionUri);
- }
-
- process = g_new (CardCopyProcess, 1);
- process->count = 1;
- process->source = source;
- g_object_ref (source);
- process->cards = cards;
- process->destination = NULL;
-
- if (delete_from_source)
- process->done_cb = delete_cards;
- else
- process->done_cb = NULL;
-
- e_book_use_address_book_by_uri (folder->physicalUri, got_book_cb, process);
-
- CORBA_free (folder);
-}
-
-#include <Evolution-Composer.h>
-
-#define COMPOSER_OAFID "OAFIID:GNOME_Evolution_Mail_Composer"
-
-void
-e_addressbook_send_card_list (GList *cards, EAddressbookDisposition disposition)
-{
- GNOME_Evolution_Composer composer_server;
- CORBA_Environment ev;
-
- if (cards == NULL)
- return;
-
- CORBA_exception_init (&ev);
-
- composer_server = bonobo_activation_activate_from_id (COMPOSER_OAFID, 0, NULL, &ev);
-
- if (disposition == E_ADDRESSBOOK_DISPOSITION_AS_TO) {
- GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
- CORBA_char *subject;
- int to_i, bcc_i;
- GList *iter;
- gint to_length = 0, bcc_length = 0;
-
- /* Figure out how many addresses of each kind we have. */
- for (iter = cards; iter != NULL; iter = g_list_next (iter)) {
- ECard *card = E_CARD (iter->data);
- if (e_card_evolution_list (card)) {
- gint len = card->email ? e_list_length (card->email) : 0;
- if (e_card_evolution_list_show_addresses (card))
- to_length += len;
- else
- bcc_length += len;
- } else {
- if (card->email != NULL)
- ++to_length;
- }
- }
-
- /* Now I have to make a CORBA sequences that represents a recipient list with
- the right number of entries, for the cards. */
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = to_length;
- to_list->_length = to_length;
- if (to_length > 0) {
- to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (to_length);
- }
-
- cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- cc_list->_maximum = cc_list->_length = 0;
-
- bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- bcc_list->_maximum = bcc_length;
- bcc_list->_length = bcc_length;
- if (bcc_length > 0) {
- bcc_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (bcc_length);
- }
-
- to_i = 0;
- bcc_i = 0;
- while (cards != NULL) {
- ECard *card = cards->data;
- EIterator *iterator;
- gchar *name, *addr;
- gboolean is_list, is_hidden, free_name_addr;
- GNOME_Evolution_Composer_Recipient *recipient;
-
- if (card->email != NULL) {
-
- is_list = e_card_evolution_list (card);
- is_hidden = is_list && !e_card_evolution_list_show_addresses (card);
-
- for (iterator = e_list_get_iterator (card->email); e_iterator_is_valid (iterator); e_iterator_next (iterator)) {
-
- if (is_hidden) {
- recipient = &(bcc_list->_buffer[bcc_i]);
- ++bcc_i;
- } else {
- recipient = &(to_list->_buffer[to_i]);
- ++to_i;
- }
-
- name = "";
- addr = "";
- free_name_addr = FALSE;
- if (e_iterator_is_valid (iterator)) {
-
- if (is_list) {
- /* We need to decode the list entries, which are XMLified EDestinations. */
- EDestination *dest = e_destination_import (e_iterator_get (iterator));
- if (dest != NULL) {
- name = g_strdup (e_destination_get_name (dest));
- addr = g_strdup (e_destination_get_email (dest));
- free_name_addr = TRUE;
- g_object_unref (dest);
- }
-
- } else { /* is just a plain old card */
- if (card->name)
- name = e_card_name_to_string (card->name);
- addr = g_strdup ((char *) e_iterator_get (iterator));
- free_name_addr = TRUE;
- }
- }
-
- recipient->name = CORBA_string_dup (name ? name : "");
- recipient->address = CORBA_string_dup (addr ? addr : "");
-
- if (free_name_addr) {
- g_free ((gchar *) name);
- g_free ((gchar *) addr);
- }
-
- /* If this isn't a list, we quit after the first (i.e. the default) address. */
- if (!is_list)
- break;
-
- }
- g_object_unref (iterator);
- }
-
- cards = g_list_next (cards);
- }
-
- subject = CORBA_string_dup ("");
-
- GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, subject, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("gui/e-meeting-edit.c: I couldn't set the composer headers via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_free (to_list);
- CORBA_free (cc_list);
- CORBA_free (bcc_list);
- CORBA_free (subject);
- } else if (disposition == E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT) {
- CORBA_char *content_type, *filename, *description;
- GNOME_Evolution_Composer_AttachmentData *attach_data;
- CORBA_boolean show_inline;
- char *tempstr;
-
- GNOME_Evolution_Composer_RecipientList *to_list, *cc_list, *bcc_list;
- CORBA_char *subject;
-
- content_type = CORBA_string_dup ("text/x-vcard");
- filename = CORBA_string_dup ("");
-
- if (cards->next) {
- description = CORBA_string_dup (_("Multiple VCards"));
- } else {
- char *file_as;
-
- g_object_get(cards->data,
- "file_as", &file_as,
- NULL);
-
- tempstr = g_strdup_printf (_("VCard for %s"), file_as);
- description = CORBA_string_dup (tempstr);
- g_free (tempstr);
- g_free (file_as);
- }
-
- show_inline = FALSE;
-
- tempstr = e_card_list_get_vcard (cards);
- attach_data = GNOME_Evolution_Composer_AttachmentData__alloc();
- attach_data->_maximum = attach_data->_length = strlen (tempstr);
- attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length);
- strcpy (attach_data->_buffer, tempstr);
- g_free (tempstr);
-
- GNOME_Evolution_Composer_attachData (composer_server,
- content_type, filename, description,
- show_inline, attach_data,
- &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("gui/e-meeting-edit.c: I couldn't attach data to the composer via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_free (content_type);
- CORBA_free (filename);
- CORBA_free (description);
- CORBA_free (attach_data);
-
- to_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- to_list->_maximum = to_list->_length = 0;
-
- cc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- cc_list->_maximum = cc_list->_length = 0;
-
- bcc_list = GNOME_Evolution_Composer_RecipientList__alloc ();
- bcc_list->_maximum = bcc_list->_length = 0;
-
- if (!cards || cards->next) {
- subject = CORBA_string_dup ("Contact information");
- } else {
- ECard *card = cards->data;
- const gchar *tempstr2;
-
- tempstr2 = NULL;
- g_object_get(card,
- "file_as", &tempstr2,
- NULL);
- if (!tempstr2 || !*tempstr2) {
- g_free (tempstr2);
- g_object_get(card,
- "full_name", &tempstr2,
- NULL);
- } if (!tempstr2 || !*tempstr2) {
- g_free (tempstr2);
- g_object_get(card,
- "org", &tempstr2,
- NULL);
- } if (!tempstr2 || !*tempstr2) {
- EList *list;
- EIterator *iterator;
- g_object_get(card,
- "email", &list,
- NULL);
- iterator = e_list_get_iterator (list);
- if (e_iterator_is_valid (iterator)) {
- tempstr2 = e_iterator_get (iterator);
- }
- g_object_unref (iterator);
- g_object_unref (list);
- }
-
- if (!tempstr2 || !*tempstr2)
- tempstr = g_strdup_printf ("Contact information");
- else
- tempstr = g_strdup_printf ("Contact information for %s", tempstr2);
- subject = CORBA_string_dup (tempstr);
- g_free (tempstr2);
- g_free (tempstr);
- }
-
- GNOME_Evolution_Composer_setHeaders (composer_server, "", to_list, cc_list, bcc_list, subject, &ev);
-
- CORBA_free (to_list);
- CORBA_free (cc_list);
- CORBA_free (bcc_list);
- CORBA_free (subject);
- }
-
- GNOME_Evolution_Composer_show (composer_server, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_printerr ("gui/e-meeting-edit.c: I couldn't show the composer via CORBA! Aagh.\n");
- CORBA_exception_free (&ev);
- return;
- }
-
- CORBA_exception_free (&ev);
-}
-
-void
-e_addressbook_send_card (ECard *card, EAddressbookDisposition disposition)
-{
- GList *list;
- list = g_list_prepend (NULL, card);
- e_addressbook_send_card_list (list, disposition);
- g_list_free (list);
-}
-
diff --git a/addressbook/gui/widgets/e-addressbook-util.h b/addressbook/gui/widgets/e-addressbook-util.h
deleted file mode 100644
index e6ea3ab73b..0000000000
--- a/addressbook/gui/widgets/e-addressbook-util.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-addressbook-util.h
- * Copyright (C) 2001 Ximian, Inc.
- * Author: Chris Toshok <toshok@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_ADDRESSBOOK_UTIL_H__
-#define __E_ADDRESSBOOK_UTIL_H__
-
-#include "addressbook/backend/ebook/e-book.h"
-#include "addressbook/gui/contact-editor/e-contact-editor.h"
-#include "addressbook/gui/contact-list-editor/e-contact-list-editor.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-void e_addressbook_error_dialog (const gchar *msg,
- EBookStatus status);
-gint e_addressbook_prompt_save_dialog (GtkWindow *parent);
-EContactEditor *e_addressbook_show_contact_editor (EBook *book,
- ECard *card,
- gboolean is_new_card,
- gboolean editable);
-EContactListEditor *e_addressbook_show_contact_list_editor (EBook *book,
- ECard *card,
- gboolean is_new_card,
- gboolean editable);
-void e_addressbook_show_multiple_cards (EBook *book,
- GList *list,
- gboolean editable);
-void e_addressbook_transfer_cards (EBook *source,
- GList *cards, /* adopted */
- gboolean delete_from_source,
- GtkWindow *parent_window);
-
-typedef enum {
- E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT,
- E_ADDRESSBOOK_DISPOSITION_AS_TO,
-} EAddressbookDisposition;
-
-void e_addressbook_send_card (ECard *card,
- EAddressbookDisposition disposition);
-void e_addressbook_send_card_list (GList *cards,
- EAddressbookDisposition disposition);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __E_ADDRESSBOOK_UTIL_H__ */
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
deleted file mode 100644
index 35decd7ee2..0000000000
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ /dev/null
@@ -1,2081 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtk.h>
-
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gal/e-table/e-table-scrolled.h>
-#include <gal/e-table/e-table-model.h>
-#include <gal/widgets/e-popup-menu.h>
-#include <gal/widgets/e-gui-utils.h>
-#include <gal/menus/gal-view-factory-etable.h>
-#include <gal/menus/gal-view-etable.h>
-#include <gal/util/e-xml-utils.h>
-#include <libgnomeui/gnome-dialog-util.h>
-
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-
-#include "addressbook/printing/e-contact-print.h"
-#include "addressbook/printing/e-contact-print-envelope.h"
-
-#include "gal-view-factory-minicard.h"
-#include "gal-view-minicard.h"
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
-#include <gal/widgets/e-treeview-selection-model.h>
-#include "gal-view-factory-treeview.h"
-#include "gal-view-treeview.h"
-#endif
-
-#include "e-addressbook-marshal.h"
-#include "e-addressbook-view.h"
-#include "e-addressbook-model.h"
-#include "e-addressbook-util.h"
-#include "e-addressbook-table-adapter.h"
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
-#include "e-addressbook-treeview-adapter.h"
-#endif
-#include "e-addressbook-reflow-adapter.h"
-#include "e-minicard-view-widget.h"
-#include "e-contact-save-as.h"
-#include "e-card-merging.h"
-
-#include "e-contact-editor.h"
-#include <gdk/gdkkeysyms.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-
-#define SHOW_ALL_SEARCH "(contains \"x-evolution-any-field\" \"\")"
-
-#define d(x)
-
-static void e_addressbook_view_init (EAddressbookView *card);
-static void e_addressbook_view_class_init (EAddressbookViewClass *klass);
-
-static void e_addressbook_view_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_addressbook_view_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-
-static void e_addressbook_view_dispose (GObject *object);
-static void change_view_type (EAddressbookView *view, EAddressbookViewType view_type);
-
-static void status_message (GtkObject *object, const gchar *status, EAddressbookView *eav);
-static void search_result (GtkObject *object, EBookViewStatus status, EAddressbookView *eav);
-static void folder_bar_message (GtkObject *object, const gchar *status, EAddressbookView *eav);
-static void stop_state_changed (GtkObject *object, EAddressbookView *eav);
-static void writable_status (GtkObject *object, gboolean writable, EAddressbookView *eav);
-static void backend_died (GtkObject *object, EAddressbookView *eav);
-static void command_state_change (EAddressbookView *eav);
-static void alphabet_state_change (EAddressbookView *eav, gunichar letter);
-
-static void selection_clear_event (GtkWidget *invisible, GdkEventSelection *event,
- EAddressbookView *view);
-static void selection_received (GtkWidget *invisible, GtkSelectionData *selection_data,
- guint time, EAddressbookView *view);
-static void selection_get (GtkWidget *invisible, GtkSelectionData *selection_data,
- guint info, guint time_stamp, EAddressbookView *view);
-static void invisible_destroyed (gpointer data, GObject *where_object_was);
-
-static GtkTableClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_TYPE,
-};
-
-enum {
- STATUS_MESSAGE,
- SEARCH_RESULT,
- FOLDER_BAR_MESSAGE,
- COMMAND_STATE_CHANGE,
- ALPHABET_STATE_CHANGE,
- LAST_SIGNAL
-};
-
-enum DndTargetType {
- DND_TARGET_TYPE_VCARD,
-};
-#define VCARD_TYPE "text/x-vcard"
-static GtkTargetEntry drag_types[] = {
- { VCARD_TYPE, 0, DND_TARGET_TYPE_VCARD },
-};
-static const int num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]);
-
-static guint e_addressbook_view_signals [LAST_SIGNAL] = {0, };
-
-static GdkAtom clipboard_atom = GDK_NONE;
-
-static GalViewCollection *collection = NULL;
-
-GType
-e_addressbook_view_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EAddressbookViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_addressbook_view_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EAddressbookView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_addressbook_view_init,
- };
-
- type = g_type_register_static (GTK_TYPE_TABLE, "EAddressbookView", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_addressbook_view_class_init (EAddressbookViewClass *klass)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = G_OBJECT_CLASS(klass);
- widget_class = GTK_WIDGET_CLASS(klass);
-
- parent_class = gtk_type_class (gtk_table_get_type ());
-
- object_class->set_property = e_addressbook_view_set_property;
- object_class->get_property = e_addressbook_view_get_property;
- object_class->dispose = e_addressbook_view_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TYPE,
- g_param_spec_int ("type",
- _("Type"),
- /*_( */"XXX blurb" /*)*/,
- E_ADDRESSBOOK_VIEW_NONE,
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- E_ADDRESSBOOK_VIEW_TREEVIEW,
-#else
- E_ADDRESSBOOK_VIEW_MINICARD,
-#endif
- E_ADDRESSBOOK_VIEW_NONE,
- G_PARAM_READWRITE));
-
- e_addressbook_view_signals [STATUS_MESSAGE] =
- g_signal_new ("status_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookViewClass, status_message),
- NULL, NULL,
- e_addressbook_marshal_NONE__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- e_addressbook_view_signals [SEARCH_RESULT] =
- g_signal_new ("search_result",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookViewClass, search_result),
- NULL, NULL,
- e_addressbook_marshal_NONE__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- e_addressbook_view_signals [FOLDER_BAR_MESSAGE] =
- g_signal_new ("folder_bar_message",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookViewClass, folder_bar_message),
- NULL, NULL,
- e_addressbook_marshal_NONE__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- e_addressbook_view_signals [COMMAND_STATE_CHANGE] =
- g_signal_new ("command_state_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookViewClass, command_state_change),
- NULL, NULL,
- e_addressbook_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- e_addressbook_view_signals [ALPHABET_STATE_CHANGE] =
- g_signal_new ("alphabet_state_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EAddressbookViewClass, alphabet_state_change),
- NULL, NULL,
- e_addressbook_marshal_NONE__UINT,
- G_TYPE_NONE, 1, G_TYPE_UINT);
-
-
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-}
-
-static void
-e_addressbook_view_init (EAddressbookView *eav)
-{
- eav->view_type = E_ADDRESSBOOK_VIEW_NONE;
-
- eav->model = e_addressbook_model_new ();
-
- g_signal_connect (eav->model,
- "status_message",
- G_CALLBACK (status_message),
- eav);
-
- g_signal_connect (eav->model,
- "search_result",
- G_CALLBACK (search_result),
- eav);
-
- g_signal_connect (eav->model,
- "folder_bar_message",
- G_CALLBACK (folder_bar_message),
- eav);
-
- g_signal_connect (eav->model,
- "stop_state_changed",
- G_CALLBACK (stop_state_changed),
- eav);
-
- g_signal_connect (eav->model,
- "writable_status",
- G_CALLBACK (writable_status),
- eav);
-
- g_signal_connect (eav->model,
- "backend_died",
- G_CALLBACK (backend_died),
- eav);
-
- eav->editable = FALSE;
- eav->book = NULL;
- eav->query = g_strdup (SHOW_ALL_SEARCH);
-
- eav->object = NULL;
- eav->widget = NULL;
-
- eav->view_instance = NULL;
- eav->view_menus = NULL;
- eav->uic = NULL;
- eav->current_alphabet_widget = NULL;
-
- eav->invisible = gtk_invisible_new ();
-
- gtk_selection_add_target (eav->invisible,
- clipboard_atom,
- GDK_SELECTION_TYPE_STRING,
- 0);
-
- g_signal_connect (eav->invisible, "selection_get",
- G_CALLBACK (selection_get),
- eav);
- g_signal_connect (eav->invisible, "selection_clear_event",
- G_CALLBACK (selection_clear_event),
- eav);
- g_signal_connect (eav->invisible, "selection_received",
- G_CALLBACK (selection_received),
- eav);
- g_object_weak_ref (G_OBJECT (eav->invisible), invisible_destroyed, eav);
-}
-
-static void
-e_addressbook_view_dispose (GObject *object)
-{
- EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object);
-
- if (eav->model) {
- g_object_unref (eav->model);
- eav->model = NULL;
- }
-
- if (eav->book) {
- g_object_unref (eav->book);
- eav->book = NULL;
- }
-
- if (eav->query) {
- g_free(eav->query);
- eav->query = NULL;
- }
-
- eav->uic = NULL;
-
- if (eav->view_instance) {
- g_object_unref (eav->view_instance);
- eav->view_instance = NULL;
- }
-
- if (eav->view_menus) {
- g_object_unref (eav->view_menus);
- eav->view_menus = NULL;
- }
-
- if (eav->clipboard_cards) {
- g_list_foreach (eav->clipboard_cards, (GFunc)g_object_unref, NULL);
- g_list_free (eav->clipboard_cards);
- eav->clipboard_cards = NULL;
- }
-
- if (eav->invisible) {
- gtk_widget_destroy (eav->invisible);
- eav->invisible = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-GtkWidget*
-e_addressbook_view_new (void)
-{
- GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_ADDRESSBOOK_VIEW, NULL));
- return widget;
-}
-
-static void
-writable_status (GtkObject *object, gboolean writable, EAddressbookView *eav)
-{
- eav->editable = writable;
- command_state_change (eav);
-}
-
-static void
-init_collection (void)
-{
- GalViewFactory *factory;
- ETableSpecification *spec;
- char *galview;
-
- if (collection == NULL) {
- collection = gal_view_collection_new();
-
- gal_view_collection_set_title (collection, _("Addressbook"));
-
- galview = gnome_util_prepend_user_home("/evolution/views/addressbook/");
- gal_view_collection_set_storage_directories
- (collection,
- EVOLUTION_GALVIEWSDIR "/addressbook/",
- galview);
- g_free(galview);
-
- spec = e_table_specification_new();
- e_table_specification_load_from_file (spec, EVOLUTION_ETSPECDIR "/e-addressbook-view.etspec");
-
- factory = gal_view_factory_etable_new (spec);
- g_object_unref (spec);
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
- factory = gal_view_factory_minicard_new ();
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- factory = gal_view_factory_treeview_new ();
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-#endif
-
- gal_view_collection_load(collection);
- }
-}
-
-static void
-display_view(GalViewInstance *instance,
- GalView *view,
- gpointer data)
-{
- EAddressbookView *address_view = data;
- if (GAL_IS_VIEW_ETABLE(view)) {
- change_view_type (address_view, E_ADDRESSBOOK_VIEW_TABLE);
- gal_view_etable_attach_table (GAL_VIEW_ETABLE(view), e_table_scrolled_get_table(E_TABLE_SCROLLED(address_view->widget)));
- } else if (GAL_IS_VIEW_MINICARD(view)) {
- change_view_type (address_view, E_ADDRESSBOOK_VIEW_MINICARD);
- gal_view_minicard_attach (GAL_VIEW_MINICARD(view), E_MINICARD_VIEW_WIDGET (address_view->object));
- }
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (GAL_IS_VIEW_TREEVIEW (view)) {
- change_view_type (address_view, E_ADDRESSBOOK_VIEW_TREEVIEW);
- gal_view_treeview_attach (GAL_VIEW_TREEVIEW(view), GTK_TREE_VIEW (address_view->object));
- }
-#endif
- address_view->current_view = view;
-}
-
-static void
-setup_menus (EAddressbookView *view)
-{
- if (view->book && view->view_instance == NULL) {
- init_collection ();
- view->view_instance = gal_view_instance_new (collection, e_book_get_uri (view->book));
- }
-
- if (view->view_instance && view->uic) {
- view->view_menus = gal_view_menus_new(view->view_instance);
- gal_view_menus_apply(view->view_menus, view->uic, NULL);
-
- display_view (view->view_instance, gal_view_instance_get_current_view (view->view_instance), view);
-
- g_signal_connect(view->view_instance, "display_view",
- G_CALLBACK (display_view), view);
- }
-}
-
-static void
-e_addressbook_view_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (eav->book) {
- g_object_unref (eav->book);
- }
- if (g_value_get_object (value)) {
- eav->book = E_BOOK(g_value_get_object (value));
- g_object_ref (eav->book);
- }
- else
- eav->book = NULL;
-
- if (eav->view_instance) {
- g_object_unref (eav->view_instance);
- eav->view_instance = NULL;
- }
-
- g_object_set(eav->model,
- "book", eav->book,
- NULL);
-
- setup_menus (eav);
-
- break;
- case PROP_QUERY:
-#if 0 /* This code will mess up ldap a bit. We need to think about the ramifications of this more. */
- if ((g_value_get_string (value) == NULL && !strcmp (eav->query, SHOW_ALL_SEARCH)) ||
- (g_value_get_string (value) != NULL && !strcmp (eav->query, g_value_get_string (value))))
- break;
-#endif
- g_free(eav->query);
- eav->query = g_strdup(g_value_get_string (value));
- if (!eav->query)
- eav->query = g_strdup (SHOW_ALL_SEARCH);
- g_object_set(eav->model,
- "query", eav->query,
- NULL);
- if (eav->current_alphabet_widget != NULL) {
- GtkWidget *current = eav->current_alphabet_widget;
-
- eav->current_alphabet_widget = NULL;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (current), FALSE);
- }
- break;
- case PROP_TYPE:
- change_view_type(eav, g_value_get_int (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_addressbook_view_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EAddressbookView *eav = E_ADDRESSBOOK_VIEW(object);
-
- switch (prop_id) {
- case PROP_BOOK:
- if (eav->book)
- g_value_set_object (value, eav->book);
- else
- g_value_set_object (value, NULL);
- break;
- case PROP_QUERY:
- g_value_set_string (value, eav->query);
- break;
- case PROP_TYPE:
- g_value_set_int (value, eav->view_type);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static ESelectionModel*
-get_selection_model (EAddressbookView *view)
-{
- if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD)
- return e_minicard_view_widget_get_selection_model (E_MINICARD_VIEW_WIDGET(view->object));
- else if (view->view_type == E_ADDRESSBOOK_VIEW_TABLE)
- return e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(view->widget)));
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (view->view_type == E_ADDRESSBOOK_VIEW_TREEVIEW) {
- return e_treeview_get_selection_model (GTK_TREE_VIEW (view->object));
- }
-#endif
- g_return_val_if_reached (NULL);
-}
-
-/* Popup menu stuff */
-typedef struct {
- EAddressbookView *view;
- EPopupMenu *submenu;
- gpointer closure;
-} CardAndBook;
-
-static ESelectionModel*
-card_and_book_get_selection_model (CardAndBook *card_and_book)
-{
- return get_selection_model (card_and_book->view);
-}
-
-static void
-card_and_book_free (CardAndBook *card_and_book)
-{
- EAddressbookView *view = card_and_book->view;
- ESelectionModel *selection;
-
- if (card_and_book->submenu)
- gal_view_instance_free_popup_menu (view->view_instance,
- card_and_book->submenu);
-
- selection = card_and_book_get_selection_model (card_and_book);
- if (selection)
- e_selection_model_right_click_up(selection);
-
- g_object_unref (view);
-}
-
-static void
-get_card_list_1(gint model_row,
- gpointer closure)
-{
- CardAndBook *card_and_book;
- GList **list;
- EAddressbookView *view;
- ECard *card;
-
- card_and_book = closure;
- list = card_and_book->closure;
- view = card_and_book->view;
-
- card = e_addressbook_model_get_card(view->model, model_row);
- *list = g_list_prepend(*list, card);
-}
-
-static GList *
-get_card_list (CardAndBook *card_and_book)
-{
- GList *list = NULL;
- ESelectionModel *selection;
-
- selection = card_and_book_get_selection_model (card_and_book);
-
- if (selection) {
- card_and_book->closure = &list;
- e_selection_model_foreach (selection, get_card_list_1, card_and_book);
- }
-
- return list;
-}
-
-static void
-has_email_address_1(gint model_row,
- gpointer closure)
-{
- CardAndBook *card_and_book;
- gboolean *has_email;
- EAddressbookView *view;
- const ECard *card;
- EList *email;
-
- card_and_book = closure;
- has_email = card_and_book->closure;
- view = card_and_book->view;
-
- if (*has_email)
- return;
-
- card = e_addressbook_model_peek_card(view->model, model_row);
-
- g_object_get (G_OBJECT (card),
- "email", &email,
- NULL);
-
- if (e_list_length (email) > 0)
- *has_email = TRUE;
-
- g_object_unref (email);
-}
-
-static gboolean
-get_has_email_address (CardAndBook *card_and_book)
-{
- ESelectionModel *selection;
- gboolean has_email = FALSE;
-
- selection = card_and_book_get_selection_model (card_and_book);
-
- if (selection) {
- card_and_book->closure = &has_email;
- e_selection_model_foreach (selection, has_email_address_1, card_and_book);
- }
-
- return has_email;
-}
-
-static void
-save_as (GtkWidget *widget, CardAndBook *card_and_book)
-{
- GList *cards = get_card_list (card_and_book);
- if (cards) {
- e_contact_list_save_as(_("Save as VCard"), cards, NULL);
- e_free_object_list(cards);
- }
-}
-
-static void
-send_as (GtkWidget *widget, CardAndBook *card_and_book)
-{
- GList *cards = get_card_list (card_and_book);
- if (cards) {
- e_addressbook_send_card_list(cards, E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT);
- e_free_object_list(cards);
- }
-}
-
-static void
-send_to (GtkWidget *widget, CardAndBook *card_and_book)
-
-{
- GList *cards = get_card_list (card_and_book);
-
- if (cards) {
- e_addressbook_send_card_list(cards, E_ADDRESSBOOK_DISPOSITION_AS_TO);
- e_free_object_list(cards);
- }
-}
-
-static void
-print (GtkWidget *widget, CardAndBook *card_and_book)
-{
- GList *cards = get_card_list (card_and_book);
- if (cards) {
- if (cards->next)
- gtk_widget_show(e_contact_print_card_list_dialog_new(cards));
- else
- gtk_widget_show(e_contact_print_card_dialog_new(cards->data));
- e_free_object_list(cards);
- }
-}
-
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
-static void
-print_envelope (GtkWidget *widget, CardAndBook *card_and_book)
-{
- GList *cards = get_card_list (card_and_book);
- if (cards) {
- gtk_widget_show(e_contact_list_print_envelope_dialog_new(card_and_book->card));
- e_free_object_list(cards);
- }
-}
-#endif
-
-static void
-copy (GtkWidget *widget, CardAndBook *card_and_book)
-{
- e_addressbook_view_copy (card_and_book->view);
-}
-
-static void
-paste (GtkWidget *widget, CardAndBook *card_and_book)
-{
- e_addressbook_view_paste (card_and_book->view);
-}
-
-static void
-cut (GtkWidget *widget, CardAndBook *card_and_book)
-{
- e_addressbook_view_cut (card_and_book->view);
-}
-
-static void
-delete (GtkWidget *widget, CardAndBook *card_and_book)
-{
- if (e_contact_editor_confirm_delete(GTK_WINDOW(gtk_widget_get_toplevel(card_and_book->view->widget)))) {
- EBook *book;
- GList *list = get_card_list(card_and_book);
- GList *iterator;
- gboolean bulk_remove = FALSE;
-
- bulk_remove = e_book_check_static_capability (card_and_book->view->model->book,
- "bulk-remove");
-
- g_object_get(card_and_book->view->model,
- "book", &book,
- NULL);
-
- if (bulk_remove) {
- GList *ids = NULL;
-
- for (iterator = list; iterator; iterator = iterator->next) {
- ECard *card = iterator->data;
- ids = g_list_prepend (ids, (char*)e_card_get_id (card));
- }
-
- /* Remove the cards all at once. */
- e_book_remove_cards (book,
- ids,
- NULL,
- NULL);
-
- g_list_free (ids);
- }
- else {
- for (iterator = list; iterator; iterator = iterator->next) {
- ECard *card = iterator->data;
- /* Remove the card. */
- e_book_remove_card (book,
- card,
- NULL,
- NULL);
- }
- }
- e_free_object_list(list);
- g_object_unref(book);
- }
-}
-
-static void
-copy_to_folder (GtkWidget *widget, CardAndBook *card_and_book)
-{
- e_addressbook_view_copy_to_folder (card_and_book->view);
-}
-
-static void
-move_to_folder (GtkWidget *widget, CardAndBook *card_and_book)
-{
- e_addressbook_view_move_to_folder (card_and_book->view);
-}
-
-static void
-free_popup_info (GtkWidget *w, CardAndBook *card_and_book)
-{
- card_and_book_free (card_and_book);
-}
-
-static void
-new_card (GtkWidget *widget, CardAndBook *card_and_book)
-{
- EBook *book;
- ECard *card;
-
- g_object_get(card_and_book->view->model,
- "book", &book,
- NULL);
-
- e_addressbook_show_contact_editor (book, card = e_card_new(""), TRUE, TRUE);
- g_object_unref(book);
- g_object_unref(card);
-}
-
-static void
-new_list (GtkWidget *widget, CardAndBook *card_and_book)
-{
- EBook *book;
- ECard *card;
-
- g_object_get(card_and_book->view->model,
- "book", &book,
- NULL);
-
- e_addressbook_show_contact_list_editor (book, card = e_card_new(""), TRUE, TRUE);
- g_object_unref(book);
- g_object_unref(card);
-}
-
-#if 0
-static void
-sources (GtkWidget *widget, CardAndBook *card_and_book)
-{
- BonoboControl *control;
- GNOME_Evolution_ShellView shell_view;
- CORBA_Environment ev;
-
- control = g_object_get_data (G_OBJECT (gcal), "control");
- if (control == NULL)
- return;
-
- shell_view = get_shell_view_interface (control);
- if (shell_view == CORBA_OBJECT_NIL)
- return;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_ShellView_showSettings (shell_view, &ev);
-
- if (BONOBO_EX (&ev))
- g_message ("control_util_show_settings(): Could not show settings");
-
- CORBA_exception_free (&ev);
-}
-#endif
-
-#define POPUP_READONLY_MASK 0x1
-#define POPUP_NOSELECTION_MASK 0x2
-#define POPUP_NOEMAIL_MASK 0x4
-
-static void
-do_popup_menu(EAddressbookView *view, GdkEvent *event)
-{
- CardAndBook *card_and_book;
- GtkMenu *popup;
- EPopupMenu *submenu = NULL;
- ESelectionModel *selection_model;
- gboolean selection = FALSE;
-
- EPopupMenu menu[] = {
- E_POPUP_ITEM (N_("New Contact..."), G_CALLBACK(new_card), POPUP_READONLY_MASK),
- E_POPUP_ITEM (N_("New Contact List..."), G_CALLBACK(new_list), POPUP_READONLY_MASK),
- E_POPUP_SEPARATOR,
-#if 0
- E_POPUP_ITEM (N_("Go to Folder..."), G_CALLBACK (goto_folder), 0),
- E_POPUP_ITEM (N_("Import..."), G_CALLBACK (import), POPUP_READONLY_MASK),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Search for Contacts..."), G_CALLBACK (search), 0),
- E_POPUP_ITEM (N_("Addressbook Sources..."), G_CALLBACK (sources), 0),
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Pilot Settings..."), G_CALLBACK (pilot_settings), 0),
-#endif
- E_POPUP_SEPARATOR,
- E_POPUP_ITEM (N_("Save as VCard"), G_CALLBACK(save_as), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Forward Contact"), G_CALLBACK(send_as), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Send Message to Contact"), G_CALLBACK(send_to), POPUP_NOSELECTION_MASK | POPUP_NOEMAIL_MASK),
- E_POPUP_ITEM (N_("Print"), G_CALLBACK(print), POPUP_NOSELECTION_MASK),
-#if 0 /* Envelope printing is disabled for Evolution 1.0. */
- E_POPUP_ITEM (N_("Print Envelope"), G_CALLBACK(print_envelope), POPUP_NOSELECTION_MASK),
-#endif
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("Copy to folder..."), G_CALLBACK(copy_to_folder), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Move to folder..."), G_CALLBACK(move_to_folder), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK),
- E_POPUP_SEPARATOR,
-
- E_POPUP_ITEM (N_("Cut"), G_CALLBACK (cut), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Copy"), G_CALLBACK (copy), POPUP_NOSELECTION_MASK),
- E_POPUP_ITEM (N_("Paste"), G_CALLBACK (paste), POPUP_READONLY_MASK),
- E_POPUP_ITEM (N_("Delete"), G_CALLBACK(delete), POPUP_READONLY_MASK | POPUP_NOSELECTION_MASK),
- E_POPUP_SEPARATOR,
-
-#if 0
- E_POPUP_SUBMENU (N_("Current View"), submenu = gal_view_instance_get_popup_menu (view->view_instance), 0),
-#endif
- E_POPUP_TERMINATOR
- };
-
- card_and_book = g_new(CardAndBook, 1);
- card_and_book->view = view;
- card_and_book->submenu = submenu;
-
- g_object_ref (card_and_book->view);
-
- selection_model = card_and_book_get_selection_model (card_and_book);
- if (selection_model)
- selection = e_selection_model_selected_count (selection_model) > 0;
-
- popup = e_popup_menu_create (menu,
- 0,
- (e_addressbook_model_editable (view->model) ? 0 : POPUP_READONLY_MASK) +
- (selection ? 0 : POPUP_NOSELECTION_MASK) +
- (get_has_email_address (card_and_book) ? 0 : POPUP_NOEMAIL_MASK),
- card_and_book);
-
- g_signal_connect (popup, "selection-done",
- G_CALLBACK (free_popup_info), card_and_book);
- e_popup_menu (popup, event);
-
-}
-
-
-/* Minicard view stuff */
-
-/* Translators: put here a list of labels you want to see on buttons in
- addressbook. You may use any character to separate labels but it must
- also be placed at the begining ot the string */
-const char *button_labels = N_(",123,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z");
-/* Translators: put here a list of characters that correspond to buttons
- in addressbook. You may use any character to separate labels but it
- must also be placed at the begining ot the string.
- Use lower case letters if possible. */
-const char *button_letters = N_(",0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z");
-
-typedef struct {
- EAddressbookView *view;
- GtkWidget *button;
- GtkWidget *vbox;
- gchar *letters;
-} LetterClosure;
-
-static char **
-e_utf8_split (const char *utf8_str, gunichar delim)
-{
- GSList *str_list = NULL, *sl;
- int n = 0;
- const char *str, *s;
- char **str_array;
-
- g_return_val_if_fail (utf8_str != NULL, NULL);
-
- str = utf8_str;
- while (*str != '\0') {
- int len;
- char *new_str;
-
- for (s = str; *s != '\0' && g_utf8_get_char (s) != delim; s = g_utf8_next_char (s))
- ;
- len = s - str;
- new_str = g_new (char, len + 1);
- if (len > 0) {
- memcpy (new_str, str, len);
- }
- new_str[len] = '\0';
- str_list = g_slist_prepend (str_list, new_str);
- n++;
- if (*s != '\0') {
- str = g_utf8_next_char (s);
- } else {
- str = s;
- }
- }
-
- str_array = g_new (char *, n + 1);
- str_array[n--] = NULL;
- for (sl = str_list; sl != NULL; sl = sl->next) {
- str_array[n--] = sl->data;
- }
- g_slist_free (str_list);
-
- return str_array;
-}
-
-static void
-jump_to_letters (EAddressbookView *view, gchar* l)
-{
- char *query;
- char *s;
- char buf[6 + 1];
-
- if (g_unichar_isdigit (g_utf8_get_char(l))) {
- const char *letters = _(button_letters);
- char **letter_v;
- GString *gstr;
- char **p;
-
- letter_v = e_utf8_split (g_utf8_next_char (letters),
- g_utf8_get_char (letters));
- g_assert (letter_v != NULL && letter_v[0] != NULL);
- gstr = g_string_new ("(not (or ");
- for (p = letter_v + 1; *p != NULL; p++) {
- for (s = *p; *s != '\0'; s = g_utf8_next_char (s)) {
- buf [g_unichar_to_utf8 (g_utf8_get_char(s), buf)] = '\0';
- g_string_append_printf (gstr, "(beginswith \"file_as\" \"%s\")", buf);
- }
- }
- g_string_append (gstr, "))");
- query = gstr->str;
- g_strfreev (letter_v);
- g_string_free (gstr, FALSE);
- } else {
- GString *gstr;
-
- gstr = g_string_new ("(or ");
-
- for (s = l; *s != '\0'; s = g_utf8_next_char (s)) {
- buf [g_unichar_to_utf8 (g_utf8_get_char(s), buf)] = '\0';
- g_string_append_printf (gstr, "(beginswith \"file_as\" \"%s\")", buf);
- }
-
- g_string_append (gstr, ")");
- query = gstr->str;
- g_string_free (gstr, FALSE);
- }
- g_object_set (view,
- "query", query,
- NULL);
- g_free (query);
-}
-
-static void
-button_toggled(GtkWidget *button, LetterClosure *closure)
-{
- EAddressbookView *view = closure->view;
-
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
- GtkWidget *current = view->current_alphabet_widget;
-
- view->current_alphabet_widget = NULL;
- if (current && current != button)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (current), FALSE);
- jump_to_letters (view, closure->letters);
- view->current_alphabet_widget = button;
- alphabet_state_change (view, g_utf8_get_char(closure->letters));
- } else {
- if (view->current_alphabet_widget != NULL &&
- view->current_alphabet_widget == button) {
- view->current_alphabet_widget = NULL;
- g_object_set (view,
- "query", NULL,
- NULL);
- alphabet_state_change (view, 0);
- }
- }
-}
-
-static void
-free_closure(gpointer data, GObject *where_object_was)
-{
- GtkWidget *button = GTK_WIDGET (where_object_was);
- LetterClosure *closure = data;
- if (button != NULL &&
- button == closure->view->current_alphabet_widget) {
- closure->view->current_alphabet_widget = NULL;
- }
- g_free (closure->letters);
- g_free (closure);
-}
-
-static GtkWidget *
-create_alphabet (EAddressbookView *view)
-{
- GtkWidget *widget, *viewport, *vbox;
- const char *labels, *letters;
- char **label_v, **letter_v;
- char **pl, **pc;
- gunichar sep;
-
- widget = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (widget),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
- viewport = gtk_viewport_new (NULL, NULL);
- gtk_container_add (GTK_CONTAINER (widget), viewport);
- gtk_container_set_border_width (GTK_CONTAINER (viewport), 4);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
-
- vbox = gtk_vbox_new (FALSE, 4);
- gtk_container_add (GTK_CONTAINER (viewport), vbox);
-
- labels = _(button_labels);
- sep = g_utf8_get_char (labels);
- label_v = e_utf8_split (g_utf8_next_char (labels), sep);
- letters = _(button_letters);
- sep = g_utf8_get_char (letters);
- letter_v = e_utf8_split (g_utf8_next_char (letters), sep);
- g_assert (label_v != NULL && letter_v != NULL);
- for (pl = label_v, pc = letter_v; *pl != NULL && *pc != NULL; pl++, pc++) {
- GtkWidget *button;
- LetterClosure *closure;
- char *label;
-
- label = *pl;
- button = gtk_toggle_button_new_with_label (label);
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-
- closure = g_new (LetterClosure, 1);
- closure->view = view;
- closure->letters = g_strdup (*pc);
- closure->button = button;
- closure->vbox = vbox;
- g_signal_connect(button, "toggled",
- G_CALLBACK (button_toggled), closure);
- g_object_weak_ref (G_OBJECT (button), free_closure, closure);
-
- }
- g_strfreev (label_v);
- g_strfreev (letter_v);
-
- gtk_widget_show_all (widget);
-
- return widget;
-}
-
-static void
-selection_changed (GObject *o, EAddressbookView *view)
-{
- command_state_change (view);
-}
-
-static void
-minicard_right_click (EMinicardView *minicard_view_item, GdkEvent *event, EAddressbookView *view)
-{
- do_popup_menu(view, event);
-}
-
-static void
-create_minicard_view (EAddressbookView *view)
-{
- GtkWidget *scrolled_window;
- GtkWidget *alphabet;
- GtkWidget *minicard_view;
- GtkWidget *minicard_hbox;
- EAddressbookReflowAdapter *adapter;
-
- gtk_widget_push_colormap (gdk_rgb_get_cmap ());
-
- minicard_hbox = gtk_hbox_new(FALSE, 0);
-
- adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(e_addressbook_reflow_adapter_new (view->model));
- minicard_view = e_minicard_view_widget_new(adapter);
-
- /* A hack */
- g_object_set_data (G_OBJECT (adapter), "view", view);
-
- g_signal_connect(minicard_view, "selection_change",
- G_CALLBACK(selection_changed), view);
-
- g_signal_connect(minicard_view, "right_click",
- G_CALLBACK(minicard_right_click), view);
-
-
- view->object = G_OBJECT(minicard_view);
- view->widget = minicard_hbox;
-
- scrolled_window = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
-
- gtk_container_add (GTK_CONTAINER (scrolled_window), minicard_view);
-
-
- gtk_box_pack_start(GTK_BOX(minicard_hbox), scrolled_window, TRUE, TRUE, 0);
-
- alphabet = create_alphabet(view);
- if (alphabet)
- gtk_box_pack_start(GTK_BOX(minicard_hbox), alphabet, FALSE, FALSE, 0);
-
- gtk_table_attach(GTK_TABLE(view), minicard_hbox,
- 0, 1,
- 0, 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
- 0, 0);
-
- gtk_widget_show_all( GTK_WIDGET(minicard_hbox) );
-
- gtk_widget_pop_colormap ();
-
- e_reflow_model_changed (E_REFLOW_MODEL (adapter));
-
- g_object_unref (adapter);
-}
-
-static void
-table_double_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EAddressbookView *view)
-{
- if (E_IS_ADDRESSBOOK_TABLE_ADAPTER(view->object)) {
- EAddressbookModel *model = view->model;
- ECard *card = e_addressbook_model_get_card(model, row);
- EBook *book;
-
- g_object_get(model,
- "book", &book,
- NULL);
-
- g_assert (E_IS_BOOK (book));
-
- if (e_card_evolution_list (card))
- e_addressbook_show_contact_list_editor (book, card, FALSE, view->editable);
- else
- e_addressbook_show_contact_editor (book, card, FALSE, view->editable);
-
- g_object_unref (book);
- g_object_unref (card);
- }
-}
-
-static gint
-table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EAddressbookView *view)
-{
- do_popup_menu(view, event);
- return TRUE;
-}
-
-static gint
-table_white_space_event(ETableScrolled *table, GdkEvent *event, EAddressbookView *view)
-{
- if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *)event)->button == 3) {
- do_popup_menu(view, event);
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-static void
-table_drag_data_get (ETable *table,
- int row,
- int col,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- gpointer user_data)
-{
- EAddressbookView *view = user_data;
-
- if (!E_IS_ADDRESSBOOK_TABLE_ADAPTER(view->object))
- return;
-
- switch (info) {
- case DND_TARGET_TYPE_VCARD: {
- char *value;
-
- value = e_card_get_vcard(view->model->data[row]);
-
- gtk_selection_data_set (selection_data,
- selection_data->target,
- 8,
- value, strlen (value));
- break;
- }
- }
-}
-
-static void
-emit_status_message (EAddressbookView *eav, const gchar *status)
-{
- g_signal_emit (eav,
- e_addressbook_view_signals [STATUS_MESSAGE], 0,
- status);
-}
-
-static void
-emit_search_result (EAddressbookView *eav, EBookViewStatus status)
-{
- g_signal_emit (eav,
- e_addressbook_view_signals [SEARCH_RESULT], 0,
- status);
-}
-
-static void
-emit_folder_bar_message (EAddressbookView *eav, const gchar *message)
-{
- g_signal_emit (eav,
- e_addressbook_view_signals [FOLDER_BAR_MESSAGE], 0,
- message);
-}
-
-static void
-status_message (GtkObject *object, const gchar *status, EAddressbookView *eav)
-{
- emit_status_message (eav, status);
-}
-
-static void
-search_result (GtkObject *object, EBookViewStatus status, EAddressbookView *eav)
-{
- emit_search_result (eav, status);
-}
-
-static void
-folder_bar_message (GtkObject *object, const gchar *status, EAddressbookView *eav)
-{
- emit_folder_bar_message (eav, status);
-}
-
-static void
-stop_state_changed (GtkObject *object, EAddressbookView *eav)
-{
- command_state_change (eav);
-}
-
-static void
-command_state_change (EAddressbookView *eav)
-{
- /* Reffing during emission is unnecessary. Gtk automatically refs during an emission. */
- g_signal_emit (eav, e_addressbook_view_signals [COMMAND_STATE_CHANGE], 0);
-}
-
-static void
-alphabet_state_change (EAddressbookView *eav, gunichar letter)
-{
- g_signal_emit (eav, e_addressbook_view_signals [ALPHABET_STATE_CHANGE], 0, letter);
-}
-
-static void
-backend_died (GtkObject *object, EAddressbookView *eav)
-{
- char *message = g_strdup_printf (_("The addressbook backend for\n%s\nhas crashed. "
- "You will have to restart Evolution in order "
- "to use it again"),
- e_book_get_uri (eav->book));
- gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (eav))));
- g_free (message);
-}
-
-static void
-create_table_view (EAddressbookView *view)
-{
- ETableModel *adapter;
- GtkWidget *table;
-
- adapter = e_addressbook_table_adapter_new(view->model);
-
- /* Here we create the table. We give it the three pieces of
- the table we've created, the header, the model, and the
- initial layout. It does the rest. */
- table = e_table_scrolled_new_from_spec_file (adapter, NULL, EVOLUTION_ETSPECDIR "/e-addressbook-view.etspec", NULL);
-
- view->object = G_OBJECT(adapter);
- view->widget = table;
-
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "double_click",
- G_CALLBACK(table_double_click), view);
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "right_click",
- G_CALLBACK(table_right_click), view);
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "white_space_event",
- G_CALLBACK(table_white_space_event), view);
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "selection_change",
- G_CALLBACK(selection_changed), view);
-
- /* drag & drop signals */
- e_table_drag_source_set (E_TABLE(E_TABLE_SCROLLED(table)->table), GDK_BUTTON1_MASK,
- drag_types, num_drag_types, GDK_ACTION_MOVE);
-
- g_signal_connect (E_TABLE_SCROLLED(table)->table,
- "table_drag_data_get",
- G_CALLBACK (table_drag_data_get),
- view);
-
- gtk_table_attach(GTK_TABLE(view), table,
- 0, 1,
- 0, 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
- 0, 0);
-
- gtk_widget_show( GTK_WIDGET(table) );
-}
-
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
-static void
-treeview_row_activated(GtkTreeView *treeview,
- GtkTreePath *path, GtkTreeViewColumn *column,
- EAddressbookView *view)
-{
- EAddressbookModel *model = view->model;
- int row = gtk_tree_path_get_indices (path)[0];
- ECard *card = e_addressbook_model_get_card(model, row);
- EBook *book;
-
- g_object_get(model,
- "book", &book,
- NULL);
-
- g_assert (E_IS_BOOK (book));
-
- if (e_card_evolution_list (card))
- e_addressbook_show_contact_list_editor (book, card, FALSE, view->editable);
- else
- e_addressbook_show_contact_editor (book, card, FALSE, view->editable);
-
- g_object_unref (book);
- g_object_unref (card);
-}
-
-static void
-create_treeview_view (EAddressbookView *view)
-{
- GtkTreeModel *adapter;
- ECardSimple *simple;
- GtkWidget *treeview;
- GtkWidget *scrolled;
- int i;
-
- simple = e_card_simple_new(NULL);
-
- adapter = e_addressbook_treeview_adapter_new(view->model);
-
- scrolled = gtk_scrolled_window_new (NULL, NULL);
- treeview = gtk_tree_view_new_with_model (adapter);
-
- gtk_widget_show (treeview);
-
- gtk_container_add (GTK_CONTAINER (scrolled), treeview);
-
- for (i = 0; i < 15; i ++) {
- GtkTreeViewColumn *column =
- gtk_tree_view_column_new_with_attributes (e_card_simple_get_name (simple, i),
- gtk_cell_renderer_text_new (),
- "text", i,
- NULL);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
- }
-
- view->object = G_OBJECT(treeview);
- view->widget = scrolled;
-
- gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)), GTK_SELECTION_MULTIPLE);
- gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (treeview),
- GDK_BUTTON1_MASK,
- drag_types,
- num_drag_types,
- GDK_ACTION_MOVE);
-
- g_signal_connect(treeview, "row_activated",
- G_CALLBACK (treeview_row_activated), view);
-#if 0
- g_signal_connect(e_table_scrolled_get_table(E_TABLE_SCROLLED(table)), "right_click",
- G_CALLBACK(table_right_click), view);
-
- /* drag & drop signals */
- e_table_drag_source_set (E_TABLE(E_TABLE_SCROLLED(table)->table), GDK_BUTTON1_MASK,
- drag_types, num_drag_types, GDK_ACTION_MOVE);
-
- g_signal_connect (E_TABLE_SCROLLED(table)->table,
- "table_drag_data_get",
- G_CALLBACK (table_drag_data_get),
- view);
-#endif
-
-
- g_signal_connect(e_treeview_get_selection_model (GTK_TREE_VIEW (treeview)), "selection_changed",
- G_CALLBACK(selection_changed), view);
-
- gtk_table_attach(GTK_TABLE(view), scrolled,
- 0, 1,
- 0, 1,
- GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND,
- 0, 0);
-
- gtk_widget_show( GTK_WIDGET(scrolled) );
-
- g_object_unref (simple);
-}
-#endif
-
-static void
-change_view_type (EAddressbookView *view, EAddressbookViewType view_type)
-{
- if (view_type == view->view_type)
- return;
-
- if (view->widget) {
- gtk_widget_destroy (view->widget);
- view->widget = NULL;
- }
- view->object = NULL;
-
- switch (view_type) {
- case E_ADDRESSBOOK_VIEW_MINICARD:
- create_minicard_view (view);
- break;
- case E_ADDRESSBOOK_VIEW_TABLE:
- create_table_view (view);
- break;
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- case E_ADDRESSBOOK_VIEW_TREEVIEW:
- create_treeview_view (view);
- break;
-#endif
- default:
- g_warning ("view_type not recognized.");
- return;
- }
-
- view->view_type = view_type;
-
- command_state_change (view);
-}
-
-typedef struct {
- GtkWidget *table;
- GObject *printable;
-} EContactPrintDialogWeakData;
-
-static void
-e_contact_print_destroy(gpointer data, GObject *where_object_was)
-{
- EContactPrintDialogWeakData *weak_data = data;
- g_object_unref (weak_data->printable);
- g_object_unref (weak_data->table);
- g_free (weak_data);
-}
-
-static void
-e_contact_print_button(GtkDialog *dialog, gint response, gpointer data)
-{
- GnomePrintJob *master;
- GnomePrintContext *pc;
- EPrintable *printable = g_object_get_data(G_OBJECT(dialog), "printable");
- GtkWidget *preview;
- switch( response ) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- master = gnome_print_job_new(gnome_print_dialog_get_config ( GNOME_PRINT_DIALOG(dialog) ));
- pc = gnome_print_job_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, 72, 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 6.5 * 72,
- 5 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_job_close(master);
- gnome_print_job_print(master);
- g_object_unref (master);
- gtk_widget_destroy((GtkWidget *)dialog);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- master = gnome_print_job_new (gnome_print_dialog_get_config ( GNOME_PRINT_DIALOG(dialog) ));
- pc = gnome_print_job_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, 72, 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 6.5 * 72,
- 9 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_job_close(master);
- preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview"));
- gtk_widget_show_all(preview);
- g_object_unref (master);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_CANCEL:
- default:
- gtk_widget_destroy((GtkWidget *)dialog);
- break;
- }
-}
-
-void
-e_addressbook_view_setup_menus (EAddressbookView *view,
- BonoboUIComponent *uic)
-{
-
- g_return_if_fail (view != NULL);
- g_return_if_fail (E_IS_ADDRESSBOOK_VIEW (view));
- g_return_if_fail (uic != NULL);
- g_return_if_fail (BONOBO_IS_UI_COMPONENT (uic));
-
- init_collection ();
-
- view->uic = uic;
-
- setup_menus (view);
-}
-
-/**
- * e_addressbook_view_discard_menus:
- * @view: An addressbook view.
- *
- * Makes an addressbook view discard its GAL view menus and its views instance
- * objects. This should be called when the corresponding Bonobo component is
- * deactivated.
- **/
-void
-e_addressbook_view_discard_menus (EAddressbookView *view)
-{
- g_return_if_fail (view != NULL);
- g_return_if_fail (E_IS_ADDRESSBOOK_VIEW (view));
- g_return_if_fail (view->view_instance);
-
- if (view->view_menus) {
- gal_view_menus_unmerge (view->view_menus, NULL);
-
- g_object_unref (view->view_menus);
- view->view_menus = NULL;
- }
-
- if (view->view_instance) {
- g_object_unref (view->view_instance);
- view->view_instance = NULL;
- }
-
- view->uic = NULL;
-}
-
-void
-e_addressbook_view_print(EAddressbookView *view)
-{
- if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD) {
- char *query;
- EBook *book;
- GtkWidget *print;
-
- g_object_get (view->model,
- "query", &query,
- "book", &book,
- NULL);
- print = e_contact_print_dialog_new(book, query);
-
- g_object_unref(book);
- g_free(query);
- gtk_widget_show_all(print);
- }
- else if (view->view_type == E_ADDRESSBOOK_VIEW_TABLE) {
- GtkWidget *dialog;
- EPrintable *printable;
- ETable *etable;
- EContactPrintDialogWeakData *weak_data;
-
- dialog = gnome_print_dialog_new(NULL, "Print cards", GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES);
- gnome_print_dialog_construct_range_any(GNOME_PRINT_DIALOG(dialog), GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_SELECTION,
- NULL, NULL, NULL);
-
- g_object_get(view->widget, "table", &etable, NULL);
- printable = e_table_get_printable(etable);
- g_object_unref(etable);
- g_object_ref (view->widget);
-
- g_object_set_data (G_OBJECT (dialog), "table", view->widget);
- g_object_set_data (G_OBJECT (dialog), "printable", printable);
-
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_button), NULL);
-
- weak_data = g_new (EContactPrintDialogWeakData, 1);
-
- weak_data->table = view->widget;
- weak_data->printable = G_OBJECT (printable);
-
- g_object_weak_ref (G_OBJECT (dialog), e_contact_print_destroy, weak_data);
-
- gtk_widget_show(dialog);
- }
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (view->view_type == E_ADDRESSBOOK_VIEW_TREEVIEW) {
- /* XXX */
- }
-#endif
-}
-
-void
-e_addressbook_view_print_preview(EAddressbookView *view)
-{
- if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD) {
- char *query;
- EBook *book;
-
- g_object_get (view->model,
- "query", &query,
- "book", &book,
- NULL);
- e_contact_print_preview(book, query);
- g_object_unref(book);
- g_free(query);
- }
- else if (view->view_type == E_ADDRESSBOOK_VIEW_TABLE) {
- EPrintable *printable;
- ETable *etable;
- GnomePrintJob *master;
- GnomePrintContext *pc;
- GnomePrintConfig *config;
- GtkWidget *preview;
-
- g_object_get(view->widget, "table", &etable, NULL);
- printable = e_table_get_printable(etable);
- g_object_unref(etable);
-
- master = gnome_print_job_new(NULL);
- config = gnome_print_job_get_config (master);
- gnome_print_config_set_int (config, GNOME_PRINT_KEY_NUM_COPIES, 1);
- pc = gnome_print_job_get_context( master );
- e_printable_reset(printable);
- while (e_printable_data_left(printable)) {
- if (gnome_print_gsave(pc) == -1)
- /* FIXME */;
- if (gnome_print_translate(pc, 72, 72) == -1)
- /* FIXME */;
- e_printable_print_page(printable,
- pc,
- 6.5 * 72,
- 9 * 72,
- TRUE);
- if (gnome_print_grestore(pc) == -1)
- /* FIXME */;
- if (gnome_print_showpage(pc) == -1)
- /* FIXME */;
- }
- gnome_print_job_close(master);
- preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview"));
- gtk_widget_show_all(preview);
- g_object_unref (master);
- g_object_unref (printable);
- }
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- else if (view->view_type == E_ADDRESSBOOK_VIEW_TREEVIEW) {
- /* XXX */
- }
-#endif
-}
-
-void
-e_addressbook_view_delete_selection(EAddressbookView *view)
-{
- CardAndBook card_and_book;
-
- memset (&card_and_book, 0, sizeof (card_and_book));
- card_and_book.view = view;
-
- delete (GTK_WIDGET (view), &card_and_book);
-}
-
-static void
-invisible_destroyed (gpointer data, GObject *where_object_was)
-{
- EAddressbookView *view = data;
- view->invisible = NULL;
-}
-
-static void
-selection_get (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint info,
- guint time_stamp,
- EAddressbookView *view)
-{
- char *value;
-
- value = e_card_list_get_vcard(view->clipboard_cards);
-
- gtk_selection_data_set (selection_data, GDK_SELECTION_TYPE_STRING,
- 8, value, strlen (value));
-
-}
-
-static void
-selection_clear_event (GtkWidget *invisible,
- GdkEventSelection *event,
- EAddressbookView *view)
-{
- if (view->clipboard_cards) {
- g_list_foreach (view->clipboard_cards, (GFunc)g_object_unref, NULL);
- g_list_free (view->clipboard_cards);
- view->clipboard_cards = NULL;
- }
-}
-
-static void
-selection_received (GtkWidget *invisible,
- GtkSelectionData *selection_data,
- guint time,
- EAddressbookView *view)
-{
- if (selection_data->length < 0 || selection_data->type != GDK_SELECTION_TYPE_STRING) {
- return;
- }
- else {
- /* XXX make sure selection_data->data = \0 terminated */
- GList *card_list = e_card_load_cards_from_string_with_default_charset (selection_data->data, "ISO-8859-1");
- GList *l;
-
- if (!card_list /* it wasn't a vcard list */)
- return;
-
- for (l = card_list; l; l = l->next) {
- ECard *card = l->data;
-
- e_card_merging_book_add_card (view->book, card, NULL /* XXX */, NULL);
- }
-
- g_list_foreach (card_list, (GFunc)g_object_unref, NULL);
- g_list_free (card_list);
- }
-}
-
-static void
-add_to_list (int model_row, gpointer closure)
-{
- GList **list = closure;
- *list = g_list_prepend (*list, GINT_TO_POINTER (model_row));
-}
-
-static GList *
-get_selected_cards (EAddressbookView *view)
-{
- GList *list;
- GList *iterator;
- ESelectionModel *selection = get_selection_model (view);
-
- list = NULL;
- e_selection_model_foreach (selection, add_to_list, &list);
-
- for (iterator = list; iterator; iterator = iterator->next) {
- iterator->data = e_addressbook_model_card_at (view->model, GPOINTER_TO_INT (iterator->data));
- if (iterator->data)
- g_object_ref (iterator->data);
- }
- list = g_list_reverse (list);
- return list;
-}
-
-void
-e_addressbook_view_save_as (EAddressbookView *view)
-{
- GList *list = get_selected_cards (view);
- if (list)
- e_contact_list_save_as (_("Save as VCard"), list, NULL);
- e_free_object_list(list);
-}
-
-void
-e_addressbook_view_view (EAddressbookView *view)
-{
- GList *list = get_selected_cards (view);
- e_addressbook_show_multiple_cards (view->book, list, view->editable);
- e_free_object_list(list);
-}
-
-void
-e_addressbook_view_send (EAddressbookView *view)
-{
- GList *list = get_selected_cards (view);
- if (list)
- e_addressbook_send_card_list (list, E_ADDRESSBOOK_DISPOSITION_AS_ATTACHMENT);
- e_free_object_list(list);
-}
-
-void
-e_addressbook_view_send_to (EAddressbookView *view)
-{
- GList *list = get_selected_cards (view);
- if (list)
- e_addressbook_send_card_list (list, E_ADDRESSBOOK_DISPOSITION_AS_TO);
- e_free_object_list(list);
-}
-
-void
-e_addressbook_view_cut (EAddressbookView *view)
-{
- e_addressbook_view_copy (view);
- e_addressbook_view_delete_selection (view);
-}
-
-void
-e_addressbook_view_copy (EAddressbookView *view)
-{
- view->clipboard_cards = get_selected_cards (view);
-
- gtk_selection_owner_set (view->invisible, clipboard_atom, GDK_CURRENT_TIME);
-}
-
-void
-e_addressbook_view_paste (EAddressbookView *view)
-{
- gtk_selection_convert (view->invisible, clipboard_atom,
- GDK_SELECTION_TYPE_STRING,
- GDK_CURRENT_TIME);
-}
-
-void
-e_addressbook_view_select_all (EAddressbookView *view)
-{
- ESelectionModel *model = get_selection_model (view);
-
- g_return_if_fail (model);
-
- e_selection_model_select_all (model);
-}
-
-void
-e_addressbook_view_show_all(EAddressbookView *view)
-{
- g_object_set(view,
- "query", NULL,
- NULL);
-}
-
-void
-e_addressbook_view_stop(EAddressbookView *view)
-{
- if (view)
- e_addressbook_model_stop (view->model);
-}
-
-static void
-view_transfer_cards (EAddressbookView *view, gboolean delete_from_source)
-{
- EBook *book;
- GList *cards;
- GtkWindow *parent_window;
-
- g_object_get(view->model,
- "book", &book,
- NULL);
- cards = get_selected_cards (view);
- parent_window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view)));
-
- e_addressbook_transfer_cards (book, cards, delete_from_source, parent_window);
- g_object_unref(book);
-}
-
-void
-e_addressbook_view_copy_to_folder (EAddressbookView *view)
-{
- view_transfer_cards (view, FALSE);
-}
-
-void
-e_addressbook_view_move_to_folder (EAddressbookView *view)
-{
- view_transfer_cards (view, TRUE);
-}
-
-
-static gboolean
-e_addressbook_view_selection_nonempty (EAddressbookView *view)
-{
- ESelectionModel *selection_model;
-
- selection_model = get_selection_model (view);
- if (selection_model == NULL)
- return FALSE;
-
- return e_selection_model_selected_count (selection_model) != 0;
-}
-
-gboolean
-e_addressbook_view_can_create (EAddressbookView *view)
-{
- return view ? e_addressbook_model_editable (view->model) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_print (EAddressbookView *view)
-{
- return view && view->model ? e_addressbook_model_card_count (view->model) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_save_as (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_view (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_send (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_send_to (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_delete (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) && e_addressbook_model_editable (view->model) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_cut (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) && e_addressbook_model_editable (view->model) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_copy (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_paste (EAddressbookView *view)
-{
- return view ? e_addressbook_model_editable (view->model) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_select_all (EAddressbookView *view)
-{
- return view ? e_addressbook_model_card_count (view->model) != 0 : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_stop (EAddressbookView *view)
-{
- return view ? e_addressbook_model_can_stop (view->model) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_copy_to_folder (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) : FALSE;
-}
-
-gboolean
-e_addressbook_view_can_move_to_folder (EAddressbookView *view)
-{
- return view ? e_addressbook_view_selection_nonempty (view) && e_addressbook_model_editable (view->model) : FALSE;
-}
diff --git a/addressbook/gui/widgets/e-addressbook-view.etspec b/addressbook/gui/widgets/e-addressbook-view.etspec
deleted file mode 100644
index a0a0015d75..0000000000
--- a/addressbook/gui/widgets/e-addressbook-view.etspec
+++ /dev/null
@@ -1,51 +0,0 @@
-<ETableSpecification click-to-add="true" draw-grid="true" _click-to-add-message="* Click here to add a contact *">
- <ETableColumn model_col= "0" _title="File As" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "1" _title="Full Name" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "2" _title="Email" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "3" _title="Primary Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "4" _title="Assistant Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "5" _title="Business Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "6" _title="Callback Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "7" _title="Company Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "8" _title="Home Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col= "9" _title="Organization" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="10" _title="Business Address" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="11" _title="Home Address" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="12" _title="Mobile Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="13" _title="Car Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="14" _title="Business Fax" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="15" _title="Home Fax" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="16" _title="Business Phone 2" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="17" _title="Home Phone 2" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="18" _title="ISDN" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="19" _title="Other Phone" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="20" _title="Other Fax" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="21" _title="Pager" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="22" _title="Radio" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="23" _title="Telex" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="24" _title="TTY" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="25" _title="Other Address" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="26" _title="Email 2" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="27" _title="Email 3" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="28" _title="Web Site" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="29" _title="Department" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="30" _title="Office" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="31" _title="Title" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="32" _title="Profession" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="33" _title="Manager" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="34" _title="Assistant" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="35" _title="Nickname" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="36" _title="Spouse" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="37" _title="Note" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableColumn model_col="38" _title="Free-busy URL" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/>
- <ETableState>
- <column source="0"/>
- <column source="1"/>
- <column source="5"/>
- <column source="2"/>
- <column source="3"/>
- <grouping>
- <leaf column="0" ascending="true"/>
- </grouping>
- </ETableState>
-</ETableSpecification>
diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h
deleted file mode 100644
index dbf32811d8..0000000000
--- a/addressbook/gui/widgets/e-addressbook-view.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-addressbook-view.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_ADDRESSBOOK_VIEW_H__
-#define __E_ADDRESSBOOK_VIEW_H__
-
-#include <gtk/gtktable.h>
-#include <bonobo/bonobo-ui-component.h>
-#include <gal/menus/gal-view-instance.h>
-#include "e-addressbook-model.h"
-#include "widgets/menus/gal-view-menus.h"
-#include "addressbook/backend/ebook/e-book.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EAddressbookView - A card displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define E_TYPE_ADDRESSBOOK_VIEW (e_addressbook_view_get_type ())
-#define E_ADDRESSBOOK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_ADDRESSBOOK_VIEW, EAddressbookView))
-#define E_ADDRESSBOOK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_ADDRESSBOOK_VIEW, EAddressbookViewClass))
-#define E_IS_ADDRESSBOOK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_ADDRESSBOOK_VIEW))
-#define E_IS_ADDRESSBOOK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_ADDRESSBOOK_VIEW))
-
-typedef enum {
- E_ADDRESSBOOK_VIEW_NONE, /* initialized to this */
- E_ADDRESSBOOK_VIEW_TABLE,
- E_ADDRESSBOOK_VIEW_MINICARD
-#ifdef WITH_ADDRESSBOOK_VIEW_TREEVIEW
- ,E_ADDRESSBOOK_VIEW_TREEVIEW
-#endif
-} EAddressbookViewType;
-
-
-typedef struct _EAddressbookView EAddressbookView;
-typedef struct _EAddressbookViewClass EAddressbookViewClass;
-
-struct _EAddressbookView
-{
- GtkTable parent;
-
- /* item specific fields */
- EAddressbookViewType view_type;
-
- EAddressbookModel *model;
-
- GtkWidget *invisible;
- GList *clipboard_cards;
-
- EBook *book;
- char *query;
- guint editable : 1;
-
- GObject *object;
- GtkWidget *widget;
- GtkWidget *current_alphabet_widget;
-
- GtkWidget *vbox;
-
- /* Menus handler and the view instance */
- GalViewInstance *view_instance;
- GalViewMenus *view_menus;
- GalView *current_view;
- BonoboUIComponent *uic;
-};
-
-struct _EAddressbookViewClass
-{
- GtkTableClass parent_class;
-
- /*
- * Signals
- */
- void (*status_message) (EAddressbookView *view, const gchar *message);
- void (*search_result) (EAddressbookView *view, EBookViewStatus status);
- void (*folder_bar_message) (EAddressbookView *view, const gchar *message);
- void (*command_state_change) (EAddressbookView *view);
- void (*alphabet_state_change) (EAddressbookView *view, gunichar letter);
-};
-
-GtkWidget *e_addressbook_view_new (void);
-GType e_addressbook_view_get_type (void);
-
-void e_addressbook_view_setup_menus (EAddressbookView *view,
- BonoboUIComponent *uic);
-
-void e_addressbook_view_discard_menus (EAddressbookView *view);
-
-void e_addressbook_view_save_as (EAddressbookView *view);
-void e_addressbook_view_view (EAddressbookView *view);
-void e_addressbook_view_send (EAddressbookView *view);
-void e_addressbook_view_send_to (EAddressbookView *view);
-void e_addressbook_view_print (EAddressbookView *view);
-void e_addressbook_view_print_preview (EAddressbookView *view);
-void e_addressbook_view_delete_selection (EAddressbookView *view);
-void e_addressbook_view_cut (EAddressbookView *view);
-void e_addressbook_view_copy (EAddressbookView *view);
-void e_addressbook_view_paste (EAddressbookView *view);
-void e_addressbook_view_select_all (EAddressbookView *view);
-void e_addressbook_view_show_all (EAddressbookView *view);
-void e_addressbook_view_stop (EAddressbookView *view);
-void e_addressbook_view_copy_to_folder (EAddressbookView *view);
-void e_addressbook_view_move_to_folder (EAddressbookView *view);
-
-gboolean e_addressbook_view_can_create (EAddressbookView *view);
-gboolean e_addressbook_view_can_print (EAddressbookView *view);
-gboolean e_addressbook_view_can_save_as (EAddressbookView *view);
-gboolean e_addressbook_view_can_view (EAddressbookView *view);
-gboolean e_addressbook_view_can_send (EAddressbookView *view);
-gboolean e_addressbook_view_can_send_to (EAddressbookView *view);
-gboolean e_addressbook_view_can_delete (EAddressbookView *view);
-gboolean e_addressbook_view_can_cut (EAddressbookView *view);
-gboolean e_addressbook_view_can_copy (EAddressbookView *view);
-gboolean e_addressbook_view_can_paste (EAddressbookView *view);
-gboolean e_addressbook_view_can_select_all (EAddressbookView *view);
-gboolean e_addressbook_view_can_stop (EAddressbookView *view);
-gboolean e_addressbook_view_can_copy_to_folder (EAddressbookView *view);
-gboolean e_addressbook_view_can_move_to_folder (EAddressbookView *view);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_ADDRESSBOOK_VIEW_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-control.c b/addressbook/gui/widgets/e-minicard-control.c
deleted file mode 100644
index 7cbcfb028a..0000000000
--- a/addressbook/gui/widgets/e-minicard-control.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard-control.c
- *
- * Copyright (C) 1999, 2000, 2001, 2002, Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- */
-
-#include <config.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <bonobo/bonobo-generic-factory.h>
-#include <bonobo/bonobo-persist.h>
-#include <bonobo/bonobo-persist-stream.h>
-#include <bonobo/bonobo-stream-client.h>
-#include <gal/util/e-util.h>
-
-#include <addressbook/gui/component/addressbook.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include <addressbook/backend/ebook/e-book-util.h>
-#include <addressbook/backend/ebook/e-card.h>
-
-#include "e-minicard-control.h"
-#include "e-minicard-widget.h"
-#include "e-card-merging.h"
-
-typedef struct {
- EMinicardWidget *minicard;
- GList *card_list;
- GtkWidget *label;
-} EMinicardControl;
-
-#define MINICARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_MiniCard_Control"
-
-
-#if 0
-enum {
- PROP_RUNNING
-} MyArgs;
-
-#define RUNNING_KEY "Clock::Running"
-
-static void
-get_prop (BonoboPropertyBag *bag,
- BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- GObject *clock = user_data;
-
- switch (arg_id) {
-
- case PROP_RUNNING:
- {
- gboolean b = GPOINTER_TO_UINT (g_object_get_data (clock, RUNNING_KEY));
- BONOBO_ARG_SET_BOOLEAN (arg, b);
- break;
- }
-
- default:
- g_warning ("Unhandled arg %d", arg_id);
- break;
- }
-}
-
-static void
-set_prop (BonoboPropertyBag *bag,
- const BonoboArg *arg,
- guint arg_id,
- CORBA_Environment *ev,
- gpointer user_data)
-{
- GtkClock *clock = user_data;
-
- switch (arg_id) {
-
- case PROP_RUNNING:
- {
- guint i;
-
- i = BONOBO_ARG_GET_BOOLEAN (arg);
-
- if (i)
- gtk_clock_start (clock);
- else
- gtk_clock_stop (clock);
-
- g_object_set_data (clock, RUNNING_KEY,
- GUINT_TO_POINTER (i));
- break;
- }
-
- default:
- g_warning ("Unhandled arg %d", arg_id);
- break;
- }
-}
-#endif
-
-/*
- * Bonobo::PersistStream
- *
- * These two functions implement the Bonobo::PersistStream load and
- * save methods which allow data to be loaded into and out of the
- * BonoboObject.
- */
-static char *
-stream_read (Bonobo_Stream stream)
-{
- Bonobo_Stream_iobuf *buffer;
- CORBA_Environment ev;
- char *data = NULL;
- gint length = 0;
-
- CORBA_exception_init (&ev);
- do {
-#define READ_CHUNK_SIZE 65536
- Bonobo_Stream_read (stream, READ_CHUNK_SIZE,
- &buffer, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- if (buffer->_length <= 0)
- break;
-
- data = g_realloc (data, length + buffer->_length + 1);
-
- memcpy (data + length, buffer->_buffer, buffer->_length);
-
- length += buffer->_length;
-
- CORBA_free (buffer);
- } while (1);
-
- CORBA_free (buffer);
- CORBA_exception_free (&ev);
-
- if (data)
- data[length] = '\0';
- else
- data = g_strdup("");
-
- return data;
-} /* stream_read */
-
-/*
- * This function implements the Bonobo::PersistStream:load method.
- */
-static void
-pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
- Bonobo_Persist_ContentType type, void *data,
- CORBA_Environment *ev)
-{
- GList *list;
- char *vcard;
- EMinicardControl *minicard_control = data;
-
- if (type && g_ascii_strcasecmp (type, "text/vCard") != 0 &&
- g_ascii_strcasecmp (type, "text/x-vCard") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
- return;
- }
-
- if ((vcard = stream_read (stream)) == NULL) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_FileNotFound, NULL);
- return;
- }
-
- e_free_object_list (minicard_control->card_list);
- list = e_card_load_cards_from_string_with_default_charset(vcard, "ISO-8859-1");
- g_free(vcard);
- minicard_control->card_list = list;
- if (list)
- g_object_set(minicard_control->minicard,
- "card", list->data,
- NULL);
- if (list && list->next) {
- char *message;
- int length = g_list_length (list) - 1;
- if (length > 1) {
- message = g_strdup_printf (_("and %d other cards."), length);
- } else {
- message = g_strdup_printf (_("and one other card."));
- }
- gtk_label_set_text (GTK_LABEL (minicard_control->label), message);
- g_free (message);
- gtk_widget_show (minicard_control->label);
- } else {
- gtk_widget_hide (minicard_control->label);
- }
-} /* pstream_load */
-
-/*
- * This function implements the Bonobo::PersistStream:save method.
- */
-static void
-pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
- Bonobo_Persist_ContentType type, void *data,
- CORBA_Environment *ev)
-{
- EMinicardControl *minicard_control = data;
- char *vcard;
- int length;
-
- if (type && g_ascii_strcasecmp (type, "text/vCard") != 0 &&
- g_ascii_strcasecmp (type, "text/x-vCard") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
- return;
- }
-
- vcard = e_card_list_get_vcard(minicard_control->card_list);
- length = strlen (vcard);
- bonobo_stream_client_write (stream, vcard, length, ev);
- g_free (vcard);
-} /* pstream_save */
-
-static Bonobo_Persist_ContentTypeList *
-pstream_get_content_types (BonoboPersistStream *ps, void *closure,
- CORBA_Environment *ev)
-{
- return bonobo_persist_generate_content_types (2, "text/vCard", "text/x-vCard");
-}
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- GList *list = closure;
- if (status == E_BOOK_STATUS_SUCCESS) {
- GList *p;
- for (p = list; p; p = p->next) {
- e_card_merging_book_add_card(book, p->data, NULL, NULL);
- }
- }
- if (book)
- g_object_unref (book);
- e_free_object_list (list);
-}
-
-static void
-save_in_addressbook(GtkWidget *button, gpointer data)
-{
- EMinicardControl *minicard_control = data;
- GList *list, *p;
- EBook *book;
-
- book = e_book_new ();
-
- list = g_list_copy (minicard_control->card_list);
-
- for (p = list; p; p = p->next)
- g_object_ref (p->data);
-
- addressbook_load_default_book (book, book_open_cb, list);
-}
-
-static void
-free_struct (gpointer data, GObject *where_object_was)
-{
- EMinicardControl *minicard_control = data;
- e_free_object_list (minicard_control->card_list);
- g_free (minicard_control);
-}
-
-BonoboControl *
-e_minicard_control_new (void)
-{
-#if 0
- BonoboPropertyBag *pb;
-#endif
- BonoboControl *control;
- BonoboPersistStream *stream;
- GtkWidget *minicard;
- GtkWidget *button;
- GtkWidget *label;
- GtkWidget *vbox;
-
- EMinicardControl *minicard_control = g_new (EMinicardControl, 1);
-
-
- minicard_control->card_list = NULL;
- minicard_control->minicard = NULL;
- minicard_control->label = NULL;
-
- /* Create the control. */
-
- minicard = e_minicard_widget_new ();
- gtk_widget_show (minicard);
- minicard_control->minicard = E_MINICARD_WIDGET (minicard);
-
- /* This is intentionally not shown. */
- label = gtk_label_new ("");
- minicard_control->label = label;
-
- button = gtk_button_new_with_label(_("Save in addressbook"));
- g_signal_connect (button, "clicked",
- G_CALLBACK (save_in_addressbook), minicard_control);
- gtk_widget_show (button);
-
- vbox = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), minicard, TRUE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
- gtk_widget_show (vbox);
-
- control = bonobo_control_new (vbox);
-
- g_object_weak_ref (G_OBJECT (control), free_struct, minicard_control);
-
- stream = bonobo_persist_stream_new (pstream_load, pstream_save,
- pstream_get_content_types,
- MINICARD_CONTROL_ID,
- minicard_control);
-
-#if 0
- /* Create the properties. */
- pb = bonobo_property_bag_new (get_prop, set_prop, clock);
- bonobo_control_set_properties (control, pb);
-
- bonobo_property_bag_add (pb, "running", PROP_RUNNING,
- BONOBO_ARG_BOOLEAN, NULL,
- "Whether or not the clock is running", 0);
-#endif
-
- if (stream == NULL) {
- bonobo_object_unref (BONOBO_OBJECT (control));
- return NULL;
- }
-
- bonobo_object_add_interface (BONOBO_OBJECT (control),
- BONOBO_OBJECT (stream));
-
- return control;
-}
diff --git a/addressbook/gui/widgets/e-minicard-control.h b/addressbook/gui/widgets/e-minicard-control.h
deleted file mode 100644
index bc0d934384..0000000000
--- a/addressbook/gui/widgets/e-minicard-control.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __E_MINICARD_CONTROL_H__
-#define __E_MINICARD_CONTROL_H__
-
-#include <bonobo/bonobo-control.h>
-
-BonoboControl *e_minicard_control_new (void);
-
-#endif /* __E_MINICARD_CONTROL_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
deleted file mode 100644
index 607170aea4..0000000000
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ /dev/null
@@ -1,508 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard-label.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-minicard-label.h"
-#include "e-addressbook-marshal.h"
-
-#include <gtk/gtksignal.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include <gal/e-text/e-text.h>
-#include <gal/widgets/e-canvas.h>
-#include <gal/widgets/e-canvas-utils.h>
-#include <gdk/gdkkeysyms.h>
-
-static void e_minicard_label_init (EMinicardLabel *card);
-static void e_minicard_label_class_init (EMinicardLabelClass *klass);
-static void e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event);
-static void e_minicard_label_realize (GnomeCanvasItem *item);
-static void e_minicard_label_unrealize (GnomeCanvasItem *item);
-static void e_minicard_label_reflow(GnomeCanvasItem *item, int flags);
-static void e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style);
-
-static void e_minicard_label_resize_children( EMinicardLabel *e_minicard_label );
-
-static void set_colors (EMinicardLabel *label);
-
-static GnomeCanvasGroupClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_WIDTH,
- PROP_HEIGHT,
- PROP_HAS_FOCUS,
- PROP_FIELD,
- PROP_FIELDNAME,
- PROP_TEXT_MODEL,
- PROP_MAX_FIELD_NAME_WIDTH,
- PROP_EDITABLE
-};
-
-enum {
- STYLE_SET,
- LAST_SIGNAL
-};
-
-static guint e_minicard_label_signals [LAST_SIGNAL] = {0, };
-
-GType
-e_minicard_label_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardLabelClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_label_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardLabel),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_label_init,
- };
-
- type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicardLabel", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_minicard_label_class_init (EMinicardLabelClass *klass)
-{
- GObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
-
- object_class = G_OBJECT_CLASS (klass);
- item_class = (GnomeCanvasItemClass *) klass;
-
- klass->style_set = e_minicard_label_style_set;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->set_property = e_minicard_label_set_property;
- object_class->get_property = e_minicard_label_get_property;
- /* object_class->destroy = e_minicard_label_destroy; */
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _("Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _("Height"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HAS_FOCUS,
- g_param_spec_boolean ("has_focus",
- _("Has Focus"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FIELD,
- g_param_spec_string ("field",
- _("Field"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FIELDNAME,
- g_param_spec_string ("fieldname",
- _("Field Name"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TEXT_MODEL,
- g_param_spec_object ("text_model",
- _("Text Model"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_TEXT_MODEL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MAX_FIELD_NAME_WIDTH,
- g_param_spec_double ("max_field_name_length",
- _("Max field name length"),
- /*_( */"XXX blurb" /*)*/,
- -1.0, G_MAXDOUBLE, -1.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- e_minicard_label_signals [STYLE_SET] =
- g_signal_new ("style_set",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMinicardLabelClass, style_set),
- NULL, NULL,
- e_addressbook_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- GTK_TYPE_STYLE);
-
- /* GnomeCanvasItem method overrides */
- item_class->realize = e_minicard_label_realize;
- item_class->unrealize = e_minicard_label_unrealize;
- item_class->event = e_minicard_label_event;
-}
-
-static void
-e_minicard_label_init (EMinicardLabel *minicard_label)
-{
- minicard_label->width = 10;
- minicard_label->height = 10;
- minicard_label->rect = NULL;
- minicard_label->fieldname = NULL;
- minicard_label->field = NULL;
-
- minicard_label->max_field_name_length = -1;
-
- e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(minicard_label), e_minicard_label_reflow);
-}
-
-static void
-e_minicard_label_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- EMinicardLabel *e_minicard_label;
- GnomeCanvasItem *item;
-
- e_minicard_label = E_MINICARD_LABEL (object);
- item = GNOME_CANVAS_ITEM (object);
-
- switch (prop_id){
- case PROP_WIDTH:
- e_minicard_label->width = g_value_get_double (value);
- e_minicard_label_resize_children(e_minicard_label);
- e_canvas_item_request_reflow (item);
- break;
- case PROP_HAS_FOCUS:
- if (e_minicard_label->field && (g_value_get_boolean (value) != E_FOCUS_NONE))
- e_canvas_item_grab_focus(e_minicard_label->field, FALSE);
- break;
- case PROP_FIELD:
- gnome_canvas_item_set( e_minicard_label->field, "text", g_value_get_string (value), NULL );
- break;
- case PROP_FIELDNAME:
- gnome_canvas_item_set( e_minicard_label->fieldname, "text", g_value_get_string (value), NULL );
- break;
- case PROP_TEXT_MODEL:
- gnome_canvas_item_set( e_minicard_label->field, "model", g_value_get_object (value), NULL);
- break;
- case PROP_MAX_FIELD_NAME_WIDTH:
- e_minicard_label->max_field_name_length = g_value_get_double (value);
- break;
- case PROP_EDITABLE:
- e_minicard_label->editable = g_value_get_boolean (value);
- g_object_set (e_minicard_label->field, "editable", e_minicard_label->editable, NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_label_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EMinicardLabel *e_minicard_label;
-
- e_minicard_label = E_MINICARD_LABEL (object);
-
- switch (prop_id) {
- case PROP_WIDTH:
- g_value_set_double (value, e_minicard_label->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, e_minicard_label->height);
- break;
- case PROP_HAS_FOCUS:
- g_value_set_boolean (value, e_minicard_label->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE);
- break;
- case PROP_FIELD:
- g_object_get_property (G_OBJECT (e_minicard_label->field),
- "text", value);
- break;
- case PROP_FIELDNAME:
- g_object_get_property (G_OBJECT (e_minicard_label->fieldname),
- "text", value);
- break;
- case PROP_TEXT_MODEL:
- g_object_get_property (G_OBJECT (e_minicard_label->field),
- "model", value);
- break;
- case PROP_MAX_FIELD_NAME_WIDTH:
- g_value_set_double (value, e_minicard_label->max_field_name_length);
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_minicard_label->editable);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_label_realize (GnomeCanvasItem *item)
-{
- EMinicardLabel *e_minicard_label;
- GnomeCanvasGroup *group;
-
- e_minicard_label = E_MINICARD_LABEL (item);
- group = GNOME_CANVAS_GROUP( item );
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->realize)
- (* GNOME_CANVAS_ITEM_CLASS( parent_class )->realize) (item);
-
- e_canvas_item_request_reflow(item);
-
- e_minicard_label->rect =
- gnome_canvas_item_new( group,
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) e_minicard_label->width - 1,
- "y2", (double) e_minicard_label->height - 1,
- "outline_color", NULL,
- NULL );
- e_minicard_label->fieldname =
- gnome_canvas_item_new( group,
- e_text_get_type(),
- "anchor", GTK_ANCHOR_NW,
- "clip_width", (double) ( e_minicard_label->width / 2 - 4 ),
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "fill_color", "black",
- "draw_background", FALSE,
- "im_context", E_CANVAS (item->canvas)->im_context,
- NULL );
- e_canvas_item_move_absolute(e_minicard_label->fieldname, 2, 1);
-
- e_minicard_label->field =
- gnome_canvas_item_new( group,
- e_text_get_type(),
- "anchor", GTK_ANCHOR_NW,
- "clip_width", (double) ( ( e_minicard_label->width + 1 ) / 2 - 4 ),
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "fill_color", "black",
- "editable", e_minicard_label->editable,
- "draw_background", FALSE,
- "im_context", E_CANVAS (item->canvas)->im_context,
- NULL );
- e_canvas_item_move_absolute(e_minicard_label->field, ( e_minicard_label->width / 2 + 2), 1);
-
- set_colors (e_minicard_label);
-
- e_canvas_item_request_reflow(item);
-}
-
-static void
-e_minicard_label_unrealize (GnomeCanvasItem *item)
-{
- EMinicardLabel *e_minicard_label;
-
- e_minicard_label = E_MINICARD_LABEL (item);
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->unrealize)
- (* GNOME_CANVAS_ITEM_CLASS( parent_class )->unrealize) (item);
-}
-
-static gboolean
-e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicardLabel *e_minicard_label;
-
- e_minicard_label = E_MINICARD_LABEL (item);
-
- switch( event->type ) {
- case GDK_KEY_PRESS:
- if (event->key.keyval == GDK_Escape) {
- GnomeCanvasItem *parent;
-
- e_text_cancel_editing (E_TEXT (e_minicard_label->field));
-
- parent = GNOME_CANVAS_ITEM (e_minicard_label)->parent;
- if (parent)
- e_canvas_item_grab_focus(parent, FALSE);
- }
- break;
- case GDK_FOCUS_CHANGE: {
- GdkEventFocus *focus_event = (GdkEventFocus *) event;
-
- e_minicard_label->has_focus = focus_event->in;
- set_colors (e_minicard_label);
-
- g_object_set (e_minicard_label->field,
- "handle_popup", e_minicard_label->has_focus,
- NULL);
- break;
- }
- case GDK_BUTTON_PRESS:
- case GDK_BUTTON_RELEASE:
- case GDK_MOTION_NOTIFY:
- case GDK_ENTER_NOTIFY:
- case GDK_LEAVE_NOTIFY: {
- gboolean return_val;
- g_signal_emit_by_name(e_minicard_label->field, "event", event, &return_val);
- return return_val;
- }
- default:
- break;
- }
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event)
- return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event);
- else
- return 0;
-}
-
-static void
-e_minicard_label_resize_children(EMinicardLabel *e_minicard_label)
-{
- double left_width;
- if (e_minicard_label->max_field_name_length != -1 && ((e_minicard_label->width / 2) - 4 > e_minicard_label->max_field_name_length))
- left_width = e_minicard_label->max_field_name_length;
- else
- left_width = e_minicard_label->width / 2 - 4;
-
- gnome_canvas_item_set( e_minicard_label->fieldname,
- "clip_width", (double) MAX ( left_width, 0 ),
- NULL );
- gnome_canvas_item_set( e_minicard_label->field,
- "clip_width", (double) MAX ( e_minicard_label->width - 8 - left_width, 0 ),
- NULL );
-}
-
-static void
-set_colors (EMinicardLabel *label)
-{
- if ( (GTK_OBJECT_FLAGS( label ) & GNOME_CANVAS_ITEM_REALIZED) ) {
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (label)->canvas);
- GtkStyle *style = gtk_widget_get_style (canvas);
- if (label->has_focus) {
- gnome_canvas_item_set (label->rect,
- "outline_color_gdk", &style->mid[GTK_STATE_SELECTED],
- "fill_color_gdk", &style->bg[GTK_STATE_NORMAL],
- NULL);
-
- gnome_canvas_item_set (label->field,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
-
- gnome_canvas_item_set (label->fieldname,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
- }
- else {
- gnome_canvas_item_set (label->rect,
- "outline_color_gdk", NULL,
- "fill_color_gdk", NULL,
- NULL);
-
- gnome_canvas_item_set (label->field,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
-
- gnome_canvas_item_set (label->fieldname,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
- }
- }
-}
-
-static void
-e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style)
-{
- set_colors (label);
-}
-
-static void
-e_minicard_label_reflow(GnomeCanvasItem *item, int flags)
-{
- EMinicardLabel *e_minicard_label = E_MINICARD_LABEL(item);
-
- gint old_height;
- gdouble text_height;
- gdouble left_width;
-
- old_height = e_minicard_label->height;
-
- g_object_get(e_minicard_label->fieldname,
- "text_height", &text_height,
- NULL);
-
- e_minicard_label->height = text_height;
-
-
- g_object_get(e_minicard_label->field,
- "text_height", &text_height,
- NULL);
-
- if (e_minicard_label->height < text_height)
- e_minicard_label->height = text_height;
- e_minicard_label->height += 3;
-
- gnome_canvas_item_set( e_minicard_label->rect,
- "x2", (double) e_minicard_label->width - 1,
- "y2", (double) e_minicard_label->height - 1,
- NULL );
-
- gnome_canvas_item_set( e_minicard_label->fieldname,
- "clip_height", (double) e_minicard_label->height - 3,
- NULL );
-
- if (e_minicard_label->max_field_name_length != -1 && ((e_minicard_label->width / 2) - 4 > e_minicard_label->max_field_name_length))
- left_width = e_minicard_label->max_field_name_length;
- else
- left_width = e_minicard_label->width / 2 - 4;
-
- e_canvas_item_move_absolute(e_minicard_label->field, left_width + 6, 1);
-
- if (old_height != e_minicard_label->height)
- e_canvas_item_request_parent_reflow(item);
-}
-
-GnomeCanvasItem *
-e_minicard_label_new(GnomeCanvasGroup *parent)
-{
- GnomeCanvasItem *item = gnome_canvas_item_new(parent, e_minicard_label_get_type(), NULL);
- return item;
-}
-
diff --git a/addressbook/gui/widgets/e-minicard-label.h b/addressbook/gui/widgets/e-minicard-label.h
deleted file mode 100644
index d914cb30bb..0000000000
--- a/addressbook/gui/widgets/e-minicard-label.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-label.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_LABEL_H__
-#define __E_MINICARD_LABEL_H__
-
-#include <glib.h>
-#include <libgnomecanvas/gnome-canvas.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EMinicardLabel - A label doing focus with non-marching ants.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * width double RW width of the label
- * height double R height of the label
- * field string RW text in the field label
- * fieldname string RW text in the fieldname label
- */
-
-#define E_TYPE_MINICARD_LABEL (e_minicard_label_get_type ())
-#define E_MINICARD_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_LABEL, EMinicardLabel))
-#define E_MINICARD_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_LABEL, EMiniCardLabelClass))
-#define E_IS_MINICARD_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_LABEL))
-#define E_IS_MINICARD_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_LABEL))
-
-
-typedef struct _EMinicardLabel EMinicardLabel;
-typedef struct _EMinicardLabelClass EMinicardLabelClass;
-
-struct _EMinicardLabel
-{
- GnomeCanvasGroup parent;
-
- /* item specific fields */
- double width;
- double height;
- double max_field_name_length;
- guint editable : 1;
- GnomeCanvasItem *fieldname;
- GnomeCanvasItem *field;
- GnomeCanvasItem *rect;
-
- gboolean has_focus;
-};
-
-struct _EMinicardLabelClass
-{
- GnomeCanvasGroupClass parent_class;
-
- void (* style_set) (EMinicardLabel *label, GtkStyle *previous_style);
-};
-
-
-GType e_minicard_label_get_type (void);
-GnomeCanvasItem *e_minicard_label_new(GnomeCanvasGroup *parent);
-void e_minicard_label_construct (GnomeCanvasItem *item);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_MINICARD_LABEL_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c
deleted file mode 100644
index c90a581975..0000000000
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ /dev/null
@@ -1,449 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard-view-widget.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include <gtk/gtksignal.h>
-#include <gal/widgets/e-canvas-background.h>
-#include <gal/widgets/e-canvas.h>
-#include <libgnome/gnome-i18n.h>
-
-#include "e-addressbook-marshal.h"
-#include "e-minicard-view-widget.h"
-
-static void e_minicard_view_widget_init (EMinicardViewWidget *widget);
-static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass);
-static void e_minicard_view_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_view_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_minicard_view_widget_dispose (GObject *object);
-static void e_minicard_view_widget_reflow (ECanvas *canvas);
-static void e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
-static void e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style);
-static void e_minicard_view_widget_realize (GtkWidget *widget);
-static gboolean e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event);
-
-static ECanvasClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE,
- PROP_COLUMN_WIDTH
-};
-
-enum {
- SELECTION_CHANGE,
- COLUMN_WIDTH_CHANGED,
- RIGHT_CLICK,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = {0, };
-
-GType
-e_minicard_view_widget_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardViewWidgetClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_view_widget_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardViewWidget),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_view_widget_init,
- };
-
- type = g_type_register_static (e_canvas_get_type (), "EMinicardViewWidget", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_minicard_view_widget_class_init (EMinicardViewWidgetClass *klass)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- ECanvasClass *canvas_class;
-
- object_class = (GObjectClass*) klass;
- widget_class = GTK_WIDGET_CLASS (klass);
- canvas_class = E_CANVAS_CLASS (klass);
-
- parent_class = gtk_type_class (e_canvas_get_type ());
-
- object_class->set_property = e_minicard_view_widget_set_property;
- object_class->get_property = e_minicard_view_widget_get_property;
- object_class->dispose = e_minicard_view_widget_dispose;
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_COLUMN_WIDTH,
- g_param_spec_double ("column_width",
- _("Column Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 150.0,
- G_PARAM_READWRITE));
-
- signals [SELECTION_CHANGE] =
- g_signal_new ("selection_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewWidgetClass, selection_change),
- NULL, NULL,
- e_addressbook_marshal_NONE__NONE,
- G_TYPE_NONE, 0);
-
- signals [COLUMN_WIDTH_CHANGED] =
- g_signal_new ("column_width_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewWidgetClass, column_width_changed),
- NULL, NULL,
- e_addressbook_marshal_NONE__DOUBLE,
- G_TYPE_NONE, 1, G_TYPE_DOUBLE);
-
- signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewWidgetClass, right_click),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- widget_class->style_set = e_minicard_view_widget_style_set;
- widget_class->realize = e_minicard_view_widget_realize;
- widget_class->size_allocate = e_minicard_view_widget_size_allocate;
- widget_class->focus_in_event = e_minicard_view_widget_real_focus_in_event;
-
- canvas_class->reflow = e_minicard_view_widget_reflow;
-
- klass->selection_change = NULL;
- klass->column_width_changed = NULL;
- klass->right_click = NULL;
-
-}
-
-static gboolean
-e_minicard_view_widget_real_focus_in_event(GtkWidget *widget, GdkEventFocus *event)
-{
- GnomeCanvas *canvas;
- EMinicardViewWidget *view;
-
- canvas = GNOME_CANVAS (widget);
- view = E_MINICARD_VIEW_WIDGET(widget);
-
- if (!canvas->focused_item) {
- EReflow *reflow = E_REFLOW (view->emv);
- if (reflow->count) {
- int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), 0);
-
- if (unsorted != -1)
- canvas->focused_item = reflow->items [unsorted];
- }
- }
-
- return GTK_WIDGET_CLASS(parent_class)->focus_in_event (widget, event);
-}
-
-static void
-e_minicard_view_widget_init (EMinicardViewWidget *view)
-{
- view->emv = NULL;
-
- view->book = NULL;
- view->query = NULL;
- view->editable = FALSE;
- view->column_width = 150;
-}
-
-GtkWidget *
-e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter)
-{
- EMinicardViewWidget *widget = E_MINICARD_VIEW_WIDGET (g_object_new (e_minicard_view_widget_get_type (), NULL));
-
- widget->adapter = adapter;
- g_object_ref (widget->adapter);
-
- return GTK_WIDGET (widget);
-}
-
-static void
-e_minicard_view_widget_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EMinicardViewWidget *emvw;
-
- emvw = E_MINICARD_VIEW_WIDGET (object);
-
- switch (prop_id){
- case PROP_BOOK:
- if (emvw->book)
- g_object_unref (emvw->book);
- if (g_value_get_object (value)) {
- emvw->book = E_BOOK(g_value_get_object (value));
- if (emvw->book)
- g_object_ref(emvw->book);
- } else
- emvw->book = NULL;
- if (emvw->emv)
- g_object_set(emvw->emv,
- "book", emvw->book,
- NULL);
- break;
- case PROP_QUERY:
- emvw->query = g_strdup(g_value_get_string (value));
- if (emvw->emv)
- g_object_set(emvw->emv,
- "query", emvw->query,
- NULL);
- break;
- case PROP_EDITABLE:
- emvw->editable = g_value_get_boolean (value);
- if (emvw->emv)
- g_object_set (emvw->emv,
- "editable", emvw->editable,
- NULL);
- break;
- case PROP_COLUMN_WIDTH:
- emvw->column_width = g_value_get_double (value);
- if (emvw->emv) {
- g_object_set (emvw->emv,
- "column_width", emvw->column_width,
- NULL);
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_widget_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EMinicardViewWidget *emvw;
-
- emvw = E_MINICARD_VIEW_WIDGET (object);
-
- switch (prop_id) {
- case PROP_BOOK:
- g_value_set_object (value, emvw->book);
- break;
- case PROP_QUERY:
- g_value_set_string (value, emvw->query);
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, emvw->editable);
- break;
- case PROP_COLUMN_WIDTH:
- g_value_set_double (value, emvw->column_width);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_widget_dispose (GObject *object)
-{
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(object);
-
- if (view->book) {
- g_object_unref (view->book);
- view->book = NULL;
- }
- if (view->query) {
- g_free(view->query);
- view->query = NULL;
- }
-
- if (view->adapter) {
- g_object_unref (view->adapter);
- view->adapter = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static void
-selection_change (ESelectionModel *esm, EMinicardViewWidget *widget)
-{
- g_signal_emit (widget,
- signals [SELECTION_CHANGE], 0);
-}
-
-static void
-column_width_changed (ESelectionModel *esm, double width, EMinicardViewWidget *widget)
-{
- g_signal_emit (widget,
- signals [COLUMN_WIDTH_CHANGED], 0, width);
-}
-
-static guint
-right_click (EMinicardView *view, GdkEvent *event, EMinicardViewWidget *widget)
-{
- guint ret_val;
- g_signal_emit (widget,
- signals [RIGHT_CLICK], 0,
- event, &ret_val);
- return ret_val;
-}
-
-static void
-e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style)
-{
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
-
- if (view->background)
- gnome_canvas_item_set (view->background,
- "fill_color_gdk", &widget->style->base[GTK_STATE_NORMAL],
- NULL );
-
- if (GTK_WIDGET_CLASS(parent_class)->style_set)
- GTK_WIDGET_CLASS(parent_class)->style_set (widget, previous_style);
-}
-
-static void
-e_minicard_view_widget_realize (GtkWidget *widget)
-{
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
- GtkStyle *style = gtk_widget_get_style (widget);
-
- view->background = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(view) ),
- e_canvas_background_get_type(),
- "fill_color_gdk", &style->base[GTK_STATE_NORMAL],
- NULL );
-
- view->emv = gnome_canvas_item_new(
- gnome_canvas_root( GNOME_CANVAS(view) ),
- e_minicard_view_get_type(),
- "height", (double) 100,
- "minimum_width", (double) 100,
- "adapter", view->adapter,
- "column_width", view->column_width,
- NULL );
-
- g_signal_connect (E_REFLOW(view->emv)->selection,
- "selection_changed",
- G_CALLBACK (selection_change), view);
- g_signal_connect (view->emv,
- "column_width_changed",
- G_CALLBACK (column_width_changed), view);
- g_signal_connect (view->emv,
- "right_click",
- G_CALLBACK (right_click), view);
-
- if (GTK_WIDGET_CLASS(parent_class)->realize)
- GTK_WIDGET_CLASS(parent_class)->realize (widget);
-}
-
-static void
-e_minicard_view_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
-{
- if (GTK_WIDGET_CLASS(parent_class)->size_allocate)
- GTK_WIDGET_CLASS(parent_class)->size_allocate (widget, allocation);
-
- if (GTK_WIDGET_REALIZED(widget)) {
- double width;
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
-
- gnome_canvas_item_set( view->emv,
- "height", (double) allocation->height,
- NULL );
- gnome_canvas_item_set( view->emv,
- "minimum_width", (double) allocation->width,
- NULL );
- g_object_get(view->emv,
- "width", &width,
- NULL);
- width = MAX(width, allocation->width);
- gnome_canvas_set_scroll_region (GNOME_CANVAS (view), 0, 0, width - 1, allocation->height - 1);
- }
-}
-
-static void
-e_minicard_view_widget_reflow(ECanvas *canvas)
-{
- double width;
- EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(canvas);
-
- if (E_CANVAS_CLASS(parent_class)->reflow)
- E_CANVAS_CLASS(parent_class)->reflow (canvas);
-
- g_object_get(view->emv,
- "width", &width,
- NULL);
- width = MAX(width, GTK_WIDGET(canvas)->allocation.width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS(canvas), 0, 0, width - 1, GTK_WIDGET(canvas)->allocation.height - 1);
-}
-
-ESelectionModel *
-e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view)
-{
- if (view->emv)
- return E_SELECTION_MODEL (E_REFLOW (view->emv)->selection);
- else
- return NULL;
-}
-
-EMinicardView *
-e_minicard_view_widget_get_view (EMinicardViewWidget *view)
-{
- if (view->emv)
- return E_MINICARD_VIEW (view->emv);
- else
- return NULL;
-}
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h
deleted file mode 100644
index 4e2da4cedf..0000000000
--- a/addressbook/gui/widgets/e-minicard-view-widget.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-view-widget.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_VIEW_WIDGET_H__
-#define __E_MINICARD_VIEW_WIDGET_H__
-
-#include <gal/widgets/e-canvas.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "e-minicard-view.h"
-
-G_BEGIN_DECLS
-
-#define E_TYPE_MINICARD_VIEW_WIDGET (e_minicard_view_widget_get_type ())
-#define E_MINICARD_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_VIEW_WIDGET, EMinicardViewWidget))
-#define E_MINICARD_VIEW_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_VIEW_WIDGET, EMinicardViewWidgetClass))
-#define E_IS_MINICARD_VIEW_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_VIEW_WIDGET))
-#define E_IS_MINICARD_VIEW_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_VIEW_WIDGET))
-
-
-typedef struct _EMinicardViewWidget EMinicardViewWidget;
-typedef struct _EMinicardViewWidgetClass EMinicardViewWidgetClass;
-
-struct _EMinicardViewWidget
-{
- ECanvas parent;
-
- GnomeCanvasItem *background;
- GnomeCanvasItem *emv;
-
- EAddressbookReflowAdapter *adapter;
-
- EBook *book;
- char *query;
- guint editable : 1;
-
- double column_width;
-};
-
-struct _EMinicardViewWidgetClass
-{
- ECanvasClass parent_class;
- void (*selection_change) (EMinicardViewWidget *emvw);
- void (*column_width_changed) (EMinicardViewWidget *emvw, double width);
- guint (*right_click) (EMinicardViewWidget *emvw);
-};
-
-
-GType e_minicard_view_widget_get_type (void);
-GtkWidget *e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter);
-
-/* Get parts of the view widget. */
-ESelectionModel *e_minicard_view_widget_get_selection_model (EMinicardViewWidget *view);
-EMinicardView *e_minicard_view_widget_get_view (EMinicardViewWidget *view);
-
-G_END_DECLS
-
-#endif /* __E_MINICARD_VIEW_WIDGET_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
deleted file mode 100644
index 18c4049e65..0000000000
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard-view.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-
-#include "e-minicard-view.h"
-
-#include "e-addressbook-util.h"
-
-#include "e-addressbook-marshal.h"
-#include <gtk/gtkselection.h>
-#include <gtk/gtkdnd.h>
-#include <gal/widgets/e-canvas.h>
-#include <libgnome/gnome-i18n.h>
-#include <string.h>
-
-static void e_minicard_view_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- EMinicardView *view);
-
-static EReflowClass *parent_class = NULL;
-#define PARENT_TYPE (E_REFLOW_TYPE)
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_ADAPTER,
- PROP_BOOK,
- PROP_QUERY,
- PROP_EDITABLE
-};
-
-
-enum {
- RIGHT_CLICK,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = {0, };
-
-enum DndTargetType {
- DND_TARGET_TYPE_VCARD_LIST,
-};
-#define VCARD_LIST_TYPE "text/x-vcard"
-static GtkTargetEntry drag_types[] = {
- { VCARD_LIST_TYPE, 0, DND_TARGET_TYPE_VCARD_LIST }
-};
-static gint num_drag_types = sizeof(drag_types) / sizeof(drag_types[0]);
-
-static void
-e_minicard_view_drag_data_get(GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- EMinicardView *view)
-{
- if (!E_IS_MINICARD_VIEW(view))
- return;
-
- switch (info) {
- case DND_TARGET_TYPE_VCARD_LIST: {
- char *value;
-
- value = e_card_list_get_vcard(view->drag_list);
-
- gtk_selection_data_set (selection_data,
- selection_data->target,
- 8,
- value, strlen (value));
- break;
- }
- }
-
- g_list_foreach (view->drag_list, (GFunc)g_object_unref, NULL);
- g_list_free (view->drag_list);
- view->drag_list = NULL;
-}
-
-static int
-e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, GdkEvent *event, EMinicardView *view)
-{
- GdkDragContext *context;
- GtkTargetList *target_list;
- GdkDragAction actions = GDK_ACTION_MOVE | GDK_ACTION_COPY;
-
- view->drag_list = e_minicard_view_get_card_list (view);
-
- g_print ("dragging %d card(s)\n", g_list_length (view->drag_list));
-
- target_list = gtk_target_list_new (drag_types, num_drag_types);
-
- context = gtk_drag_begin (GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas),
- target_list, actions, 1/*XXX*/, event);
-
- if (!view->canvas_drag_data_get_id)
- view->canvas_drag_data_get_id = g_signal_connect (GNOME_CANVAS_ITEM (view)->canvas,
- "drag_data_get",
- G_CALLBACK (e_minicard_view_drag_data_get),
- view);
-
- gtk_drag_set_icon_default (context);
-
- return TRUE;
-}
-
-static void
-set_empty_message (EMinicardView *view)
-{
- char *empty_message;
- gboolean editable = FALSE;
-
- if (view->adapter) {
- g_object_get (view->adapter,
- "editable", &editable,
- NULL);
- }
-
- if (editable)
- empty_message = _("\n\nThere are no items to show in this view.\n\n"
- "Double-click here to create a new Contact.");
- else
- empty_message = _("\n\nThere are no items to show in this view.");
-
- g_object_set (view,
- "empty_message", empty_message,
- NULL);
-}
-
-static void
-writable_status_change (EAddressbookModel *model, gboolean writable, EMinicardView *view)
-{
- set_empty_message (view);
-}
-
-static void
-adapter_changed (EMinicardView *view)
-{
- set_empty_message (view);
-
- g_signal_connect (view->adapter, "drag_begin",
- G_CALLBACK (e_minicard_view_drag_begin), view);
-}
-
-static void
-e_minicard_view_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EMinicardView *view;
-
- view = E_MINICARD_VIEW (object);
-
- switch (prop_id){
- case PROP_ADAPTER:
- if (view->adapter) {
- if (view->writable_status_id) {
- EAddressbookModel *model;
- g_object_get (view->adapter,
- "model", &model,
- NULL);
- if (model) {
- g_signal_handler_disconnect (model, view->writable_status_id);
- g_object_unref (model);
- }
- }
-
- g_object_unref (view->adapter);
- }
- view->writable_status_id = 0;
- view->adapter = g_value_get_object (value);
- g_object_ref (view->adapter);
- adapter_changed (view);
- g_object_set (view,
- "model", view->adapter,
- NULL);
- if (view->adapter) {
- EAddressbookModel *model;
- g_object_get (view->adapter,
- "model", &model,
- NULL);
- if (model) {
- view->writable_status_id =
- g_signal_connect (model, "writable_status",
- G_CALLBACK (writable_status_change), view);
- }
-
- }
- break;
- case PROP_BOOK:
- g_object_set (view->adapter,
- "book", g_value_get_object (value),
- NULL);
- set_empty_message (view);
- break;
- case PROP_QUERY:
- g_object_set (view->adapter,
- "query", g_value_get_string (value),
- NULL);
- break;
- case PROP_EDITABLE:
- g_object_set (view->adapter,
- "editable", g_value_get_boolean (value),
- NULL);
- set_empty_message (view);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EMinicardView *view;
-
- view = E_MINICARD_VIEW (object);
-
- switch (prop_id) {
- case PROP_ADAPTER:
- g_value_set_object (value, view->adapter);
- break;
- case PROP_BOOK:
- g_object_get_property (G_OBJECT (view->adapter),
- "book", value);
- break;
- case PROP_QUERY:
- g_object_get_property (G_OBJECT (view->adapter),
- "query", value);
- break;
- case PROP_EDITABLE:
- g_object_get_property (G_OBJECT (view->adapter),
- "editable", value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_view_dispose (GObject *object)
-{
- EMinicardView *view = E_MINICARD_VIEW(object);
-
- if (view->canvas_drag_data_get_id) {
- g_signal_handler_disconnect (GNOME_CANVAS_ITEM (view)->canvas,
- view->canvas_drag_data_get_id);
- view->canvas_drag_data_get_id = 0;
- }
-
- if (view->adapter) {
- if (view->writable_status_id) {
- EAddressbookModel *model;
- g_object_get (view->adapter,
- "model", &model,
- NULL);
- if (model) {
- g_signal_handler_disconnect (model, view->writable_status_id);
- g_object_unref (model);
- }
- }
-
- g_object_unref (view->adapter);
- }
- view->writable_status_id = 0;
- view->adapter = NULL;
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose (object);
-}
-
-static guint
-e_minicard_view_right_click (EMinicardView *view, GdkEvent *event)
-{
- guint ret_val = 0;
- g_signal_emit (view, signals[RIGHT_CLICK], 0,
- event, &ret_val);
- return ret_val;
-}
-
-static gboolean
-e_minicard_view_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicardView *view;
-
- view = E_MINICARD_VIEW (item);
-
- switch( event->type ) {
- case GDK_2BUTTON_PRESS:
- if (((GdkEventButton *)event)->button == 1) {
- gboolean editable;
-
- g_object_get(view->adapter, "editable", &editable, NULL);
-
- if (editable) {
- EBook *book;
- g_object_get(view, "book", &book, NULL);
-
- if (book && E_IS_BOOK (book)) {
- e_addressbook_show_contact_editor (book, e_card_new(""), TRUE, editable);
- g_object_unref (book);
- }
- }
- return TRUE;
- }
- case GDK_BUTTON_PRESS:
- if (event->button.button == 3) {
- e_minicard_view_right_click (view, event);
- }
- break;
- default:
- break;
- }
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->event)
- return GNOME_CANVAS_ITEM_CLASS(parent_class)->event(item, event);
- else
- return FALSE;
-}
-
-static gint
-e_minicard_view_selection_event (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicardView *view;
- int return_val = FALSE;
-
- view = E_MINICARD_VIEW (reflow);
- if (parent_class->selection_event) {
- return_val = parent_class->selection_event (reflow, item, event);
- }
-
- switch (event->type) {
- case GDK_FOCUS_CHANGE:
- if (event->focus_change.in) {
- int i;
- for (i = 0; i < reflow->count; i++) {
- if (reflow->items[i] == item) {
- e_selection_model_maybe_do_something(reflow->selection, i, 0, 0);
- break;
- }
- }
- }
- break;
- case GDK_BUTTON_PRESS:
- if (event->button.button == 3) {
- return_val = e_minicard_view_right_click (view, event);
- if (!return_val)
- e_selection_model_right_click_up(reflow->selection);
- }
- break;
- default:
- break;
- }
- return return_val;
-}
-
-typedef struct {
- EMinicardView *view;
- EBookCallback cb;
- gpointer closure;
-} ViewCbClosure;
-
-static void
-do_remove (int i, gpointer user_data)
-{
- EBook *book;
- ECard *card;
- ViewCbClosure *viewcbclosure = user_data;
- EMinicardView *view = viewcbclosure->view;
- EBookCallback cb = viewcbclosure->cb;
- gpointer closure = viewcbclosure->closure;
-
- g_object_get (view->adapter,
- "book", &book,
- NULL);
-
- card = e_addressbook_reflow_adapter_get_card (view->adapter, i);
-
- e_book_remove_card(book, card, cb, closure);
-
- g_object_unref (card);
- g_object_unref (book);
-}
-
-#if 0
-static int
-compare_to_utf_str (EMinicard *card, const char *utf_str)
-{
- g_return_val_if_fail(card != NULL, 0);
- g_return_val_if_fail(E_IS_MINICARD(card), 0);
-
- if (g_unichar_isdigit (g_utf8_get_char (utf_str))) {
- return 1;
- }
-
- if (card->card) {
- char *file_as;
- g_object_get(card->card,
- "file_as", &file_as,
- NULL);
- if (file_as) {
- int cmp = g_utf8_strcasecmp (file_as, utf_str);
- g_free (file_as);
- return cmp;
- }
- }
- return 0;
-}
-#endif
-
-static void
-e_minicard_view_class_init (EMinicardViewClass *klass)
-{
- GObjectClass *object_class;
- GnomeCanvasItemClass *item_class;
- EReflowClass *reflow_class;
-
- object_class = G_OBJECT_CLASS (klass);
- item_class = (GnomeCanvasItemClass *) klass;
- reflow_class = (EReflowClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->set_property = e_minicard_view_set_property;
- object_class->get_property = e_minicard_view_get_property;
- object_class->dispose = e_minicard_view_dispose;
-
- g_object_class_install_property (object_class, PROP_ADAPTER,
- g_param_spec_object ("adapter",
- _("Adapter"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_ADDRESSBOOK_REFLOW_ADAPTER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_BOOK,
- g_param_spec_object ("book",
- _("Book"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_BOOK,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_QUERY,
- g_param_spec_string ("query",
- _("Query"),
- /*_( */"XXX blurb" /*)*/,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- signals [RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardViewClass, right_click),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- item_class->event = e_minicard_view_event;
-
- reflow_class->selection_event = e_minicard_view_selection_event;
- /* GnomeCanvasItem method overrides */
-}
-
-static void
-e_minicard_view_init (EMinicardView *view)
-{
- view->adapter = NULL;
- view->canvas_drag_data_get_id = 0;
- view->writable_status_id = 0;
-
- set_empty_message (view);
-}
-
-GType
-e_minicard_view_get_type (void)
-{
- static GType reflow_type = 0;
-
- if (!reflow_type) {
- static const GTypeInfo reflow_info = {
- sizeof (EMinicardViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_view_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_view_init,
- };
-
- reflow_type = g_type_register_static (PARENT_TYPE, "EMinicardView", &reflow_info, 0);
- }
-
- return reflow_type;
-}
-
-void
-e_minicard_view_remove_selection(EMinicardView *view,
- EBookCallback cb,
- gpointer closure)
-{
- ViewCbClosure viewcbclosure;
- viewcbclosure.view = view;
- viewcbclosure.cb = cb;
- viewcbclosure.closure = closure;
-
- e_selection_model_foreach (E_REFLOW (view)->selection,
- do_remove,
- &viewcbclosure);
-}
-
-void
-e_minicard_view_jump_to_letter (EMinicardView *view,
- gunichar letter)
-{
-#if 0
- char uft_str[6 + 1];
-
- utf_str [g_unichar_to_utf8 (letter, utf_str)] = '\0';
- e_reflow_sorted_jump (E_REFLOW_SORTED (view),
- (GCompareFunc) compare_to_utf_str,
- utf_str);
-#endif
-}
-
-typedef struct {
- GList *list;
- EAddressbookReflowAdapter *adapter;
-} ModelAndList;
-
-static void
-add_to_list (int index, gpointer closure)
-{
- ModelAndList *mal = closure;
- mal->list = g_list_prepend (mal->list, e_addressbook_reflow_adapter_get_card (mal->adapter, index));
-}
-
-GList *
-e_minicard_view_get_card_list (EMinicardView *view)
-{
- ModelAndList mal;
-
- mal.adapter = view->adapter;
- mal.list = NULL;
-
- e_selection_model_foreach (E_REFLOW (view)->selection, add_to_list, &mal);
-
- mal.list = g_list_reverse (mal.list);
- return mal.list;
-}
diff --git a/addressbook/gui/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h
deleted file mode 100644
index afd432fd8e..0000000000
--- a/addressbook/gui/widgets/e-minicard-view.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-view.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_VIEW_H__
-#define __E_MINICARD_VIEW_H__
-
-#include "e-minicard.h"
-
-#include <gal/widgets/e-reflow.h>
-#include <gal/widgets/e-selection-model-simple.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "e-addressbook-reflow-adapter.h"
-
-G_BEGIN_DECLS
-
-/* EMinicardView - A canvas item container.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * book EBook RW book to query
- * query string RW query string
- *
- * From EReflowSorted: (you should really know what you're doing if you set these.)
- * compare_func GCompareFunc RW compare function
- * string_func EReflowStringFunc RW string function
- *
- * From EReflow:
- * minimum_width double RW minimum width of the reflow. width >= minimum_width
- * width double R width of the reflow
- * height double RW height of the reflow
- */
-
-#define E_TYPE_MINICARD_VIEW (e_minicard_view_get_type ())
-#define E_MINICARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_VIEW, EMinicardView))
-#define E_MINICARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_VIEW, EMinicardViewClass))
-#define E_IS_MINICARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_VIEW))
-#define E_IS_MINICARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_VIEW))
-
-
-typedef struct _EMinicardView EMinicardView;
-typedef struct _EMinicardViewClass EMinicardViewClass;
-
-struct _EMinicardView
-{
- EReflow parent;
-
- EAddressbookReflowAdapter *adapter;
-
- /* item specific fields */
-
- GList *drag_list;
-
- guint canvas_drag_data_get_id;
-
- guint writable_status_id;
-};
-
-struct _EMinicardViewClass
-{
- EReflowClass parent_class;
-
- void (*right_click) (EMinicardView *view, GdkEvent *event);
-};
-
-GType e_minicard_view_get_type (void);
-void e_minicard_view_remove_selection (EMinicardView *view,
- EBookCallback cb,
- gpointer closure);
-void e_minicard_view_jump_to_letter (EMinicardView *view,
- gunichar letter);
-GList *e_minicard_view_get_card_list (EMinicardView *view);
-
-
-G_END_DECLS
-
-#endif /* __E_MINICARD_VIEW_H__ */
diff --git a/addressbook/gui/widgets/e-minicard-widget-test.c b/addressbook/gui/widgets/e-minicard-widget-test.c
deleted file mode 100644
index 9a8d27d21c..0000000000
--- a/addressbook/gui/widgets/e-minicard-widget-test.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* test-minicard.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#define TEST_VCARD \
-"BEGIN:VCARD
-" \
-"FN:Nat
-" \
-"N:Friedman;Nat;D;Mr.
-" \
-"ORG:Ximian, Inc.
-" \
-"TITLE:Head Geek
-" \
-"ROLE:Programmer/Executive
-" \
-"BDAY:1977-08-06
-" \
-"TEL;WORK:617 679 1984
-" \
-"TEL;CELL:123 456 7890
-" \
-"EMAIL;INTERNET:nat@nat.org
-" \
-"EMAIL;INTERNET:nat@ximian.com
-" \
-"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;
-" \
-"ADR;HOME;POSTAL;INTL:P.O. Box 202;;;Any Town 2;MI;12344-4321;USA
-" \
-"END:VCARD
-" \
-"
-"
-
-#include "config.h"
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-init.h>
-#include "e-minicard-widget.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-
-static void destroy_callback(gpointer data, GObject *where_object_was)
-{
- exit(0);
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Minicard Widget Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the minicard widget" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
- GtkWidget *minicard;
- ECard *card;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_init( "Minicard Widget Test", VERSION, argc, argv);
- app = gnome_app_new("Minicard Widget Test", NULL);
-
- minicard = e_minicard_widget_new();
- card = e_card_new(TEST_VCARD);
- g_object_set(minicard,
- "card", card,
- NULL);
-
- gnome_app_set_contents( GNOME_APP( app ), minicard );
-
- /* Connect the signals */
- g_object_weak_ref (app, destroy_callback, app);
-
- gtk_widget_show_all( app );
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/gui/widgets/e-minicard-widget.c b/addressbook/gui/widgets/e-minicard-widget.c
deleted file mode 100644
index e8f33673c3..0000000000
--- a/addressbook/gui/widgets/e-minicard-widget.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-table-field-chooser.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include "e-minicard-widget.h"
-#include "e-minicard.h"
-
-static void e_minicard_widget_init (EMinicardWidget *card);
-static void e_minicard_widget_class_init (EMinicardWidgetClass *klass);
-static void e_minicard_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_minicard_widget_dispose (GObject *object);
-static void e_minicard_widget_size_request (GtkWidget *widget, GtkRequisition *requisition);
-static void e_minicard_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation);
-static void e_minicard_widget_reflow (ECanvas *canvas);
-
-static ECanvasClass *parent_class = NULL;
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_CARD,
-};
-
-GType
-e_minicard_widget_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardWidgetClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_widget_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicardWidget),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_widget_init,
- };
-
- type = g_type_register_static (e_canvas_get_type (), "EMinicardWidget", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_minicard_widget_class_init (EMinicardWidgetClass *klass)
-{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
- ECanvasClass *ecanvas_class;
-
- object_class = G_OBJECT_CLASS(klass);
- widget_class = GTK_WIDGET_CLASS(klass);
- ecanvas_class = E_CANVAS_CLASS(klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->set_property = e_minicard_widget_set_property;
- object_class->get_property = e_minicard_widget_get_property;
- object_class->dispose = e_minicard_widget_dispose;
-
- widget_class->size_request = e_minicard_widget_size_request;
- widget_class->size_allocate = e_minicard_widget_size_allocate;
-
- ecanvas_class->reflow = e_minicard_widget_reflow;
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("Card"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
-}
-
-static void
-e_minicard_widget_size_request(GtkWidget *widget, GtkRequisition *requisition)
-{
- double height;
- EMinicardWidget *emw = E_MINICARD_WIDGET(widget);
- g_object_get(emw->item,
- "height", &height,
- NULL);
- if (height <= 0)
- height = 1;
- widget->requisition.height = height;
- widget->requisition.width = 200;
- requisition->height = height;
- requisition->width = 200;
-}
-
-static void
-e_minicard_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
-{
- double height;
- EMinicardWidget *emw = E_MINICARD_WIDGET(widget);
- gnome_canvas_item_set( emw->item,
- "width", (double) allocation->width,
- NULL );
- g_object_get(emw->item,
- "height", &height,
- NULL);
- height = MAX(height, allocation->height);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( emw ), 0, 0, allocation->width - 1, height - 1);
- gnome_canvas_item_set( emw->rect,
- "x2", (double) allocation->width,
- "y2", (double) height,
- NULL );
- if (GTK_WIDGET_CLASS(parent_class)->size_allocate)
- GTK_WIDGET_CLASS(parent_class)->size_allocate(widget, allocation);
-}
-
-static void e_minicard_widget_reflow(ECanvas *canvas)
-{
- double height;
- EMinicardWidget *emw = E_MINICARD_WIDGET(canvas);
- g_object_get(emw->item,
- "height", &height,
- NULL);
-
- height = MAX(height, GTK_WIDGET(emw)->allocation.height);
-
- gnome_canvas_set_scroll_region (GNOME_CANVAS(emw), 0, 0, GTK_WIDGET(emw)->allocation.width - 1, height - 1);
- gnome_canvas_item_set( emw->rect,
- "x2", (double) GTK_WIDGET(emw)->allocation.width,
- "y2", (double) height,
- NULL );
-
- gtk_widget_queue_resize(GTK_WIDGET(canvas));
-}
-
-static void
-e_minicard_widget_init (EMinicardWidget *emw)
-{
- emw->rect = gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(emw)),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
-
- emw->item = gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(emw)),
- e_minicard_get_type(),
- "width", (double) 100,
- NULL );
-
-#if PENDING_PORT_WORK
- /* XXX this crashes since the canvas has no h/v adjustments. */
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( emw ),
- 0, 0,
- 100, 100 );
-#endif
- emw->card = NULL;
-}
-
-static void
-e_minicard_widget_dispose (GObject *object)
-{
- EMinicardWidget *emw = E_MINICARD_WIDGET(object);
-
- if (emw->card) {
- g_object_unref (emw->card);
- emw->card = NULL;
- }
-
- if (G_OBJECT_CLASS(parent_class)->dispose)
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-GtkWidget*
-e_minicard_widget_new (void)
-{
- GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_MINICARD_WIDGET, NULL));
- return widget;
-}
-
-static void
-e_minicard_widget_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EMinicardWidget *emw = E_MINICARD_WIDGET(object);
- gpointer ptr;
-
- switch (prop_id){
- case PROP_CARD:
- ptr = g_value_get_object (value);
- e_minicard_widget_set_card (emw, ptr ? E_CARD (ptr) : NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_widget_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- EMinicardWidget *emw = E_MINICARD_WIDGET(object);
-
- switch (prop_id) {
- case PROP_CARD:
- if (emw->card)
- g_value_set_object (value, emw->card);
- else
- g_value_set_object (value, NULL);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-void
-e_minicard_widget_set_card (EMinicardWidget *emw, ECard *card)
-{
- g_return_if_fail (emw && E_IS_MINICARD_WIDGET (emw));
- g_return_if_fail (card == NULL || E_IS_CARD (card));
-
- if (card != emw->card) {
-
- if (emw->card)
- g_object_unref (emw->card);
-
- emw->card = card;
-
- if (emw->card)
- g_object_ref (emw->card);
-
- if (emw->item)
- g_object_set (emw->item,
- "card", emw->card,
- NULL);
- }
-}
diff --git a/addressbook/gui/widgets/e-minicard-widget.h b/addressbook/gui/widgets/e-minicard-widget.h
deleted file mode 100644
index 829ad8f77d..0000000000
--- a/addressbook/gui/widgets/e-minicard-widget.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard-widget.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_WIDGET_H__
-#define __E_MINICARD_WIDGET_H__
-
-#include <gal/widgets/e-canvas.h>
-#include "addressbook/backend/ebook/e-card.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EMinicardWidget - A card displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- */
-
-#define E_TYPE_MINICARD_WIDGET (e_minicard_widget_get_type ())
-#define E_MINICARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD_WIDGET, EMinicardWidget))
-#define E_MINICARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD_WIDGET, EMinicardWidgetClass))
-#define E_IS_MINICARD_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD_WIDGET))
-#define E_IS_MINICARD_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD_WIDGET))
-
-
-typedef struct _EMinicardWidget EMinicardWidget;
-typedef struct _EMinicardWidgetClass EMinicardWidgetClass;
-
-struct _EMinicardWidget
-{
- ECanvas parent;
-
- /* item specific fields */
- GnomeCanvasItem *item;
-
- GnomeCanvasItem *rect;
- ECard *card;
-};
-
-struct _EMinicardWidgetClass
-{
- ECanvasClass parent_class;
-};
-
-
-GtkWidget *e_minicard_widget_new(void);
-GType e_minicard_widget_get_type (void);
-
-void e_minicard_widget_set_card (EMinicardWidget *, ECard *);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_MINICARD_WIDGET_H__ */
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
deleted file mode 100644
index 7ce6d2f518..0000000000
--- a/addressbook/gui/widgets/e-minicard.c
+++ /dev/null
@@ -1,1093 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-minicard.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include <string.h>
-#include <glib.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtkmain.h>
-#include <gdk/gdkkeysyms.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
-#include <libgnomecanvas/gnome-canvas-pixbuf.h>
-#include <gal/e-text/e-text.h>
-#include <gal/util/e-util.h>
-#include <gal/widgets/e-canvas-utils.h>
-#include <gal/widgets/e-canvas.h>
-#include "addressbook/backend/ebook/e-book.h"
-#include "e-addressbook-marshal.h"
-#include "e-addressbook-util.h"
-#include "e-minicard.h"
-#include "e-minicard-label.h"
-#include "e-minicard-view.h"
-#include "e-contact-editor.h"
-#include "e-card-merging.h"
-#include "ebook/e-destination.h"
-
-static void e_minicard_init (EMinicard *card);
-static void e_minicard_class_init (EMinicardClass *klass);
-static void e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-static void e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
-static void e_minicard_dispose (GObject *object);
-static void e_minicard_finalize (GObject *object);
-static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
-static void e_minicard_realize (GnomeCanvasItem *item);
-static void e_minicard_unrealize (GnomeCanvasItem *item);
-static void e_minicard_reflow ( GnomeCanvasItem *item, int flags );
-static void e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style);
-
-static void e_minicard_resize_children( EMinicard *e_minicard );
-static void remodel( EMinicard *e_minicard );
-
-static gint e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event);
-
-static GnomeCanvasGroupClass *parent_class = NULL;
-
-typedef struct _EMinicardField EMinicardField;
-
-struct _EMinicardField {
- ECardSimpleField field;
- GnomeCanvasItem *label;
-};
-
-#define d(x)
-
-#define LIST_ICON_FILENAME "contact-list-16.png"
-
-#define E_MINICARD_FIELD(field) ((EMinicardField *)(field))
-
-static void
-e_minicard_field_destroy(EMinicardField *field)
-{
- gtk_object_destroy(GTK_OBJECT(field->label));
- g_free(field);
-}
-
-/* The arguments we take */
-enum {
- PROP_0,
- PROP_WIDTH,
- PROP_HEIGHT,
- PROP_HAS_FOCUS,
- PROP_SELECTED,
- PROP_HAS_CURSOR,
- PROP_EDITABLE,
- PROP_CARD
-};
-
-enum {
- SELECTED,
- DRAG_BEGIN,
- STYLE_SET,
- LAST_SIGNAL
-};
-
-static guint e_minicard_signals [LAST_SIGNAL] = {0, };
-
-GType
-e_minicard_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (EMinicardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) e_minicard_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EMinicard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) e_minicard_init,
- };
-
- type = g_type_register_static (gnome_canvas_group_get_type (), "EMinicard", &info, 0);
- }
-
- return type;
-}
-
-static void
-e_minicard_class_init (EMinicardClass *klass)
-{
- GObjectClass *object_class = (GObjectClass*) klass;
- GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) klass;
-
- object_class->set_property = e_minicard_set_property;
- object_class->get_property = e_minicard_get_property;
- object_class->dispose = e_minicard_dispose;
- object_class->finalize = e_minicard_finalize;
-
- klass->style_set = e_minicard_style_set;
-
- parent_class = gtk_type_class (gnome_canvas_group_get_type ());
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- _("Width"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- _("Height"),
- /*_( */"XXX blurb" /*)*/,
- 0.0, G_MAXDOUBLE, 10.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_HAS_FOCUS,
- /* XXX should be _enum */
- g_param_spec_int ("has_focus",
- _("Has Focus"),
- /*_( */"XXX blurb" /*)*/,
- E_MINICARD_FOCUS_TYPE_START, E_MINICARD_FOCUS_TYPE_END,
- E_MINICARD_FOCUS_TYPE_START,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_SELECTED,
- g_param_spec_boolean ("selected",
- _("Selected"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HAS_CURSOR,
- g_param_spec_boolean ("has_cursor",
- _("Has Cursor"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- _("Editable"),
- /*_( */"XXX blurb" /*)*/,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_CARD,
- g_param_spec_object ("card",
- _("Card"),
- /*_( */"XXX blurb" /*)*/,
- E_TYPE_CARD,
- G_PARAM_READWRITE));
-
- e_minicard_signals [SELECTED] =
- g_signal_new ("selected",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardClass, selected),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- e_minicard_signals [DRAG_BEGIN] =
- g_signal_new ("drag_begin",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EMinicardClass, drag_begin),
- NULL, NULL,
- e_addressbook_marshal_INT__POINTER,
- G_TYPE_INT, 1, G_TYPE_POINTER);
-
- e_minicard_signals [STYLE_SET] =
- g_signal_new ("style_set",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EMinicardClass, style_set),
- NULL, NULL,
- e_addressbook_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- GTK_TYPE_STYLE);
-
- /* GnomeCanvasItem method overrides */
- item_class->realize = e_minicard_realize;
- item_class->unrealize = e_minicard_unrealize;
- item_class->event = e_minicard_event;
-
- klass->selected = NULL;
-}
-
-static void
-e_minicard_init (EMinicard *minicard)
-{
- /* minicard->card = NULL;*/
- minicard->rect = NULL;
- minicard->fields = NULL;
- minicard->width = 10;
- minicard->height = 10;
- minicard->has_focus = FALSE;
- minicard->selected = FALSE;
- minicard->editable = FALSE;
- minicard->has_cursor = FALSE;
-
- minicard->card = NULL;
- minicard->simple = e_card_simple_new(NULL);
-
- minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME, NULL);
- minicard->list_icon_size = gdk_pixbuf_get_height (minicard->list_icon_pixbuf);
-
- minicard->editor = NULL;
-
- minicard->changed = FALSE;
-
- e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(minicard), e_minicard_reflow);
-}
-
-static void
-set_selected (EMinicard *minicard, gboolean selected)
-{
- GtkWidget *canvas = GTK_WIDGET(GNOME_CANVAS_ITEM(minicard)->canvas);
- if (selected) {
- gnome_canvas_item_set (minicard->rect,
- "outline_color_gdk", &canvas->style->bg[GTK_STATE_ACTIVE],
- NULL);
- gnome_canvas_item_set (minicard->header_rect,
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_SELECTED],
- NULL);
- gnome_canvas_item_set (minicard->header_text,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_SELECTED],
- NULL);
- } else {
- gnome_canvas_item_set (minicard->rect,
- "outline_color", NULL,
- NULL);
- gnome_canvas_item_set (minicard->header_rect,
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL],
- NULL);
- gnome_canvas_item_set (minicard->header_text,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
- NULL);
- }
- minicard->selected = selected;
-}
-
-static void
-set_has_cursor (EMinicard *minicard, gboolean has_cursor)
-{
- if (!minicard->has_focus && has_cursor)
- e_canvas_item_grab_focus(GNOME_CANVAS_ITEM (minicard), FALSE);
- minicard->has_cursor = has_cursor;
-}
-
-
-static void
-e_minicard_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
-{
- GnomeCanvasItem *item;
- EMinicard *e_minicard;
- GList *l;
-
- item = GNOME_CANVAS_ITEM (object);
- e_minicard = E_MINICARD (object);
-
- switch (prop_id){
- case PROP_WIDTH:
- if (e_minicard->width != g_value_get_double (value)) {
- e_minicard->width = g_value_get_double (value);
- e_minicard_resize_children(e_minicard);
- if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED )
- e_canvas_item_request_reflow(item);
- }
- break;
- case PROP_HAS_FOCUS:
- if (e_minicard->fields) {
- if ( g_value_get_int(value) == E_FOCUS_START ||
- g_value_get_int(value) == E_FOCUS_CURRENT) {
- gnome_canvas_item_set(E_MINICARD_FIELD(e_minicard->fields->data)->label,
- "has_focus", g_value_get_int (value),
- NULL);
- } else if ( g_value_get_int (value) == E_FOCUS_END ) {
- gnome_canvas_item_set(E_MINICARD_FIELD(g_list_last(e_minicard->fields)->data)->label,
- "has_focus", g_value_get_int (value),
- NULL);
- }
- }
- else {
- if (!e_minicard->has_focus)
- e_canvas_item_grab_focus(item, FALSE);
- }
- break;
- case PROP_SELECTED:
- if (e_minicard->selected != g_value_get_boolean (value))
- set_selected (e_minicard, g_value_get_boolean (value));
- break;
- case PROP_EDITABLE:
- e_minicard->editable = g_value_get_boolean (value);
- for (l = e_minicard->fields; l; l = l->next)
- g_object_set (E_MINICARD_FIELD (l->data)->label,
- "editable", e_minicard->editable,
- NULL);
- break;
- case PROP_HAS_CURSOR:
- d(g_print("%s: PROP_HAS_CURSOR\n", G_GNUC_FUNCTION));
- if (e_minicard->has_cursor != g_value_get_boolean (value))
- set_has_cursor (e_minicard, g_value_get_boolean (value));
- break;
- case PROP_CARD:
- if (e_minicard->card)
- g_object_unref (e_minicard->card);
- e_minicard->card = E_CARD(g_value_get_object (value));
- if (e_minicard->card)
- g_object_ref (e_minicard->card);
- g_object_set(e_minicard->simple,
- "card", e_minicard->card,
- NULL);
- remodel(e_minicard);
- e_canvas_item_request_reflow(item);
- e_minicard->changed = FALSE;
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
-{
- EMinicard *e_minicard;
-
- e_minicard = E_MINICARD (object);
-
- switch (prop_id) {
- case PROP_WIDTH:
- g_value_set_double (value, e_minicard->width);
- break;
- case PROP_HEIGHT:
- g_value_set_double (value, e_minicard->height);
- break;
- case PROP_HAS_FOCUS:
- g_value_set_int (value, e_minicard->has_focus ? E_FOCUS_CURRENT : E_FOCUS_NONE);
- break;
- case PROP_SELECTED:
- g_value_set_boolean (value, e_minicard->selected);
- break;
- case PROP_HAS_CURSOR:
- g_value_set_boolean (value, e_minicard->has_cursor);
- break;
- case PROP_EDITABLE:
- g_value_set_boolean (value, e_minicard->editable);
- break;
- case PROP_CARD:
- e_card_simple_sync_card(e_minicard->simple);
- g_value_set_object (value, e_minicard->card);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-e_minicard_dispose (GObject *object)
-{
- EMinicard *e_minicard;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_MINICARD (object));
-
- e_minicard = E_MINICARD (object);
-
- if (e_minicard->fields) {
- g_list_foreach(e_minicard->fields, (GFunc) e_minicard_field_destroy, NULL);
- g_list_free(e_minicard->fields);
- e_minicard->fields = NULL;
- }
-
- if (e_minicard->list_icon_pixbuf) {
- gdk_pixbuf_unref (e_minicard->list_icon_pixbuf);
- e_minicard->list_icon_pixbuf = NULL;
- }
-
- if (G_OBJECT_CLASS (parent_class)->dispose)
- (* G_OBJECT_CLASS (parent_class)->dispose) (object);
-}
-
-
-
-static void
-e_minicard_finalize (GObject *object)
-{
- EMinicard *e_minicard;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (E_IS_MINICARD (object));
-
- e_minicard = E_MINICARD (object);
-
- if (e_minicard->card)
- g_object_unref (e_minicard->card);
- if (e_minicard->simple)
- g_object_unref (e_minicard->simple);
-
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
-}
-
-static void
-e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style)
-{
- if ( (GTK_OBJECT_FLAGS( minicard ) & GNOME_CANVAS_ITEM_REALIZED) )
- set_selected (minicard, minicard->selected);
-}
-
-static void
-e_minicard_realize (GnomeCanvasItem *item)
-{
- EMinicard *e_minicard;
- GnomeCanvasGroup *group;
- GtkWidget *canvas;
-
- e_minicard = E_MINICARD (item);
- group = GNOME_CANVAS_GROUP( item );
- canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas);
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize)
- (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item);
-
- e_minicard->rect =
- gnome_canvas_item_new( group,
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) MAX (e_minicard->width - 1, 0),
- "y2", (double) MAX (e_minicard->height - 1, 0),
- "outline_color", NULL,
- NULL );
-
- e_minicard->header_rect =
- gnome_canvas_item_new( group,
- gnome_canvas_rect_get_type(),
- "x1", (double) 2,
- "y1", (double) 2,
- "x2", (double) MAX (e_minicard->width - 3, 0),
- "y2", (double) MAX (e_minicard->height - 3, 0),
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL],
- NULL );
-
- e_minicard->header_text =
- gnome_canvas_item_new( group,
- e_text_get_type(),
- "anchor", GTK_ANCHOR_NW,
- "width", (double) MAX( e_minicard->width - 12, 0 ),
- "clip", TRUE,
- "use_ellipsis", TRUE,
- "fill_color_gdk", &canvas->style->fg[GTK_STATE_NORMAL],
- "text", "",
- "draw_background", FALSE,
- NULL );
-
- e_canvas_item_move_absolute(e_minicard->header_text, 6, 6);
-
- e_minicard->list_icon =
- gnome_canvas_item_new ( group,
- gnome_canvas_pixbuf_get_type(),
- "pixbuf", e_minicard->list_icon_pixbuf,
- NULL);
-
- set_selected (e_minicard, e_minicard->selected);
-
- remodel(e_minicard);
- e_canvas_item_request_reflow(item);
-}
-
-static void
-e_minicard_unrealize (GnomeCanvasItem *item)
-{
- EMinicard *e_minicard;
-
- e_minicard = E_MINICARD (item);
-
- if (GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize)
- (* GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize) (item);
-}
-
-static void
-card_modified_cb (EBook* book, EBookStatus status, gpointer user_data)
-{
- d(g_print ("%s: %s(): a card was modified\n", __FILE__, G_GNUC_FUNCTION));
- if (status != E_BOOK_STATUS_SUCCESS)
- e_addressbook_error_dialog (_("Error modifying card"), status);
-}
-
-/* Callback used when the contact editor is closed */
-static void
-editor_closed_cb (GtkObject *editor, gpointer data)
-{
- EMinicard *minicard = data;
- g_object_unref (editor);
- minicard->editor = NULL;
-}
-
-static gboolean
-e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
-{
- EMinicard *e_minicard;
- GtkWidget *canvas;
-
- e_minicard = E_MINICARD (item);
- canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas);
-
- switch( event->type ) {
- case GDK_FOCUS_CHANGE:
- {
- GdkEventFocus *focus_event = (GdkEventFocus *) event;
- d(g_print("%s: GDK_FOCUS_CHANGE: %s\n", G_GNUC_FUNCTION, focus_event->in?"in":"out"));
- if (focus_event->in) {
- /* Chris: When EMinicard gets the cursor, if it doesn't have the focus, it should take it. */
- e_minicard->has_focus = TRUE;
- if (!e_minicard->selected) {
- e_minicard_selected(e_minicard, event);
- }
- } else {
- EBook *book = NULL;
-
- if (e_minicard->changed) {
-
- e_card_simple_sync_card(e_minicard->simple);
-
- if (E_IS_MINICARD_VIEW(GNOME_CANVAS_ITEM(e_minicard)->parent)) {
-
- g_object_get(GNOME_CANVAS_ITEM(e_minicard)->parent,
- "book", &book,
- NULL);
-
- }
-
- if (book) {
-
- /* Add the card in the contact editor to our ebook */
- e_card_merging_book_commit_card (book,
- e_minicard->card,
- card_modified_cb,
- NULL);
- g_object_unref(book);
- } else {
- remodel(e_minicard);
- e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(e_minicard));
- }
- e_minicard->changed = FALSE;
- }
- e_minicard->has_focus = FALSE;
- }
- }
- break;
- case GDK_BUTTON_PRESS: {
- if (1 <= event->button.button && event->button.button <= 2) {
- int ret_val = e_minicard_selected(e_minicard, event);
- GdkEventMask mask = ((1 << (4 + event->button.button)) |
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK);
-
- e_canvas_item_grab_focus(item, TRUE);
-
- if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (e_minicard),
- mask, NULL, event->button.time)) {
- return FALSE;
- }
- gtk_grab_add (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas));
- e_minicard->button_x = event->button.x;
- e_minicard->button_y = event->button.y;
- e_minicard->drag_button = event->button.button;
- e_minicard->drag_button_down = TRUE;
- return ret_val;
- } else if (event->button.button == 3) {
- int ret_val = e_minicard_selected(e_minicard, event);
- if (ret_val != 0)
- return ret_val;
- }
- break;
- }
- case GDK_BUTTON_RELEASE:
- e_minicard_selected(e_minicard, event);
- if (e_minicard->drag_button == event->button.button) {
- e_minicard->drag_button = 0;
- e_minicard->drag_button_down = FALSE;
- e_minicard->button_x = -1;
- e_minicard->button_y = -1;
-
- if (GTK_WIDGET_HAS_GRAB (GNOME_CANVAS_ITEM (e_minicard)->canvas)) {
- gtk_grab_remove (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas));
- gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (e_minicard), event->button.time);
- }
- }
- break;
- case GDK_MOTION_NOTIFY:
- if (e_minicard->drag_button_down && event->motion.state & GDK_BUTTON1_MASK) {
- if (MAX (abs (e_minicard->button_x - event->motion.x),
- abs (e_minicard->button_y - event->motion.y)) > 3) {
- gint ret_val;
-
- ret_val = e_minicard_drag_begin(e_minicard, event);
-
- e_minicard->drag_button_down = FALSE;
-
- return ret_val;
- }
- }
- break;
- case GDK_2BUTTON_PRESS:
- if (event->button.button == 1 && E_IS_MINICARD_VIEW(item->parent)) {
- if (e_minicard->editor) {
- if (e_card_evolution_list (e_minicard->card))
- e_contact_list_editor_raise (E_CONTACT_LIST_EDITOR(e_minicard->editor));
- else
- e_contact_editor_raise(E_CONTACT_EDITOR(e_minicard->editor));
- } else {
- EBook *book = NULL;
- if (E_IS_MINICARD_VIEW(item->parent)) {
- g_object_get(item->parent,
- "book", &book,
- NULL);
- }
-
- if (book != NULL) {
- if (e_card_evolution_list (e_minicard->card)) {
- EContactListEditor *editor = e_addressbook_show_contact_list_editor (book, e_minicard->card,
- FALSE, e_minicard->editable);
- e_minicard->editor = G_OBJECT (editor);
- }
- else {
- EContactEditor *editor = e_addressbook_show_contact_editor (book, e_minicard->card,
- FALSE, e_minicard->editable);
- e_minicard->editor = G_OBJECT (editor);
- }
- g_object_ref (e_minicard->editor);
-
- g_signal_connect (e_minicard->editor, "editor_closed",
- G_CALLBACK (editor_closed_cb), e_minicard);
-
- g_object_unref (book);
- }
- }
- return TRUE;
- }
- break;
- case GDK_KEY_PRESS:
- if (event->key.keyval == GDK_Tab ||
- event->key.keyval == GDK_KP_Tab ||
- event->key.keyval == GDK_ISO_Left_Tab) {
- GList *list;
- for (list = e_minicard->fields; list; list = list->next) {
- EMinicardField *field = E_MINICARD_FIELD(list->data);
- GnomeCanvasItem *item = field->label;
- EFocus has_focus;
- g_object_get(item,
- "has_focus", &has_focus,
- NULL);
- if (has_focus != E_FOCUS_NONE) {
- if (event->key.state & GDK_SHIFT_MASK)
- list = list->prev;
- else
- list = list->next;
- if (list) {
- EMinicardField *field = E_MINICARD_FIELD(list->data);
- GnomeCanvasItem *item = field->label;
- gnome_canvas_item_set(item,
- "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START,
- NULL);
- return 1;
- } else {
- return 0;
- }
- }
- }
- }
- default:
- break;
- }
-
- if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event)
- return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event);
- else
- return 0;
-}
-
-static void
-e_minicard_resize_children( EMinicard *e_minicard )
-{
- GList *list;
-
- if (e_minicard->header_text) {
- gnome_canvas_item_set( e_minicard->header_text,
- "width", ((double) e_minicard->width - 12
- - (e_card_evolution_list (e_minicard->card) ? e_minicard->list_icon_size : 0.0)),
- NULL );
- }
- if (e_minicard->list_icon) {
- e_canvas_item_move_absolute(e_minicard->list_icon,
- e_minicard->width - e_minicard->list_icon_size - 3,
- 3);
- }
- for ( list = e_minicard->fields; list; list = g_list_next( list ) ) {
- gnome_canvas_item_set( E_MINICARD_FIELD( list->data )->label,
- "width", (double) e_minicard->width - 4.0,
- NULL );
- }
-}
-
-static void
-field_changed (EText *text, EMinicard *e_minicard)
-{
- ECardSimpleType type;
- char *string;
- char *new_string;
- gboolean is_list = FALSE;
-
- type = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(text),
- "EMinicard:field"));
- g_object_get(text,
- "text", &string,
- NULL);
-
- /*
- * If the card is coresponding with a contact list and the field be
- * changed is e-mail address, should wrap it before write it back.
- */
- new_string = (char*)e_card_simple_get_const (e_minicard->simple,
- E_CARD_SIMPLE_FIELD_IS_LIST);
-
- is_list = (NULL != new_string);
-
- if (is_list && (E_CARD_SIMPLE_FIELD_EMAIL == type ||
- E_CARD_SIMPLE_FIELD_EMAIL_2 == type ||
- E_CARD_SIMPLE_FIELD_EMAIL_3 == type)) {
- if (string && *string) {
- EDestination *dest = e_destination_new ();
- if (dest != NULL){
- e_destination_set_email (dest, string);
- new_string = e_destination_export(dest);
- g_free(string);
- string=new_string;
- g_object_unref (dest);
- }
- }
- }
-
- e_card_simple_set(e_minicard->simple,
- type,
- string);
- g_free(string);
- e_minicard->changed = TRUE;
-}
-
-static void
-field_activated (EText *text, EMinicard *e_minicard)
-{
- e_text_stop_editing (text);
- e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (e_minicard), FALSE);
-}
-
-static void
-add_field (EMinicard *e_minicard, ECardSimpleField field, gdouble left_width)
-{
- GnomeCanvasItem *new_item;
- GnomeCanvasGroup *group;
- ECardSimpleType type;
- EMinicardField *minicard_field;
- char *name;
- char *string;
-
- group = GNOME_CANVAS_GROUP( e_minicard );
-
- type = e_card_simple_type(e_minicard->simple, field);
- name = g_strdup_printf("%s:", e_card_simple_get_name(e_minicard->simple, field));
- string = e_card_simple_get(e_minicard->simple, field);
-
- /* Magically convert embedded XML into an address. */
- if (!strncmp (string, "<?xml", 5)) {
- EDestination *dest = e_destination_import (string);
- if (dest != NULL) {
- gchar *new_string = g_strdup (e_destination_get_textrep (dest, TRUE));
- g_free (string);
- string = new_string;
- g_object_unref (dest);
- }
- }
-
- new_item = e_minicard_label_new(group);
- gnome_canvas_item_set( new_item,
- "width", e_minicard->width - 4.0,
- "fieldname", name,
- "field", string,
- "max_field_name_length", left_width,
- "editable", e_minicard->editable,
- NULL );
- g_signal_connect(E_MINICARD_LABEL(new_item)->field,
- "changed", G_CALLBACK (field_changed), e_minicard);
- g_signal_connect(E_MINICARD_LABEL(new_item)->field,
- "activate", G_CALLBACK (field_activated), e_minicard);
- g_object_set(E_MINICARD_LABEL(new_item)->field,
- "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->simple, field),
- NULL);
- g_object_set_data(G_OBJECT (E_MINICARD_LABEL(new_item)->field),
- "EMinicard:field",
- GINT_TO_POINTER(field));
-
- minicard_field = g_new(EMinicardField, 1);
- minicard_field->field = field;
- minicard_field->label = new_item;
-
- e_minicard->fields = g_list_append( e_minicard->fields, minicard_field);
- e_canvas_item_move_absolute(new_item, 2, e_minicard->height);
- g_free(name);
- g_free(string);
-}
-
-static int
-get_left_width(EMinicard *e_minicard)
-{
- gchar *name;
- ECardSimpleField field;
- int width = -1;
- PangoLayout *layout;
-
- layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas), "");
- for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST; field++) {
- int this_width;
- name = g_strdup_printf("%s:", e_card_simple_get_name(e_minicard->simple, field));
- pango_layout_set_text (layout, name, -1);
- pango_layout_get_pixel_size (layout, &this_width, NULL);
- if (width < this_width)
- width = this_width;
- g_free(name);
- }
- g_object_unref (layout);
- return width;
-}
-
-static void
-remodel( EMinicard *e_minicard )
-{
- int count = 0;
- if ( !(GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED) )
- return;
- if (e_minicard->simple) {
- ECardSimpleField field;
- GList *list;
- char *file_as;
- int left_width = -1;
-
- if (e_minicard->header_text) {
- file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
- gnome_canvas_item_set( e_minicard->header_text,
- "text", file_as ? file_as : "",
- NULL );
- g_free(file_as);
- }
-
- if (e_minicard->card && e_card_evolution_list (e_minicard->card) ) {
- gnome_canvas_item_show (e_minicard->list_icon);
- }
- else {
- gnome_canvas_item_hide (e_minicard->list_icon);
- }
-
- list = e_minicard->fields;
- e_minicard->fields = NULL;
-
- for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING && count < 5; field++) {
- EMinicardField *minicard_field = NULL;
-
- if (list)
- minicard_field = list->data;
- if (minicard_field && minicard_field->field == field) {
- GList *this_list = list;
- char *string;
-
- string = e_card_simple_get(e_minicard->simple, field);
- if (string && *string) {
- /* Magically convert embedded XML into an address. */
- if (!strncmp (string, "<?xml", 4)) {
- EDestination *dest = e_destination_import (string);
- if (dest != NULL) {
- gchar *new_string = g_strdup (e_destination_get_textrep (dest, TRUE));
- g_free (string);
- string = new_string;
- g_object_unref (dest);
- }
- }
-
- e_minicard->fields = g_list_append(e_minicard->fields, minicard_field);
- g_object_set(minicard_field->label,
- "field", string,
- NULL);
- count ++;
- } else {
- e_minicard_field_destroy(minicard_field);
- }
- list = g_list_remove_link(list, this_list);
- g_list_free_1(this_list);
- g_free(string);
- } else {
- char *string;
- if (left_width == -1) {
- left_width = get_left_width(e_minicard);
- }
-
- string = e_card_simple_get(e_minicard->simple, field);
- if (string && *string) {
- add_field(e_minicard, field, left_width);
- count++;
- }
- g_free(string);
- }
- }
-
- g_list_foreach(list, (GFunc) e_minicard_field_destroy, NULL);
- g_list_free(list);
- }
-}
-
-static void
-e_minicard_reflow( GnomeCanvasItem *item, int flags )
-{
- EMinicard *e_minicard = E_MINICARD(item);
- if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED ) {
- GList *list;
- gdouble text_height;
- gint old_height;
-
- old_height = e_minicard->height;
-
- g_object_get( e_minicard->header_text,
- "text_height", &text_height,
- NULL );
-
- e_minicard->height = text_height + 10.0;
-
- gnome_canvas_item_set( e_minicard->header_rect,
- "y2", text_height + 9.0,
- NULL );
-
- for(list = e_minicard->fields; list; list = g_list_next(list)) {
- EMinicardField *field = E_MINICARD_FIELD(list->data);
- GnomeCanvasItem *item = field->label;
- g_object_get (item,
- "height", &text_height,
- NULL);
- e_canvas_item_move_absolute(item, 2, e_minicard->height);
- e_minicard->height += text_height;
- }
- e_minicard->height += 2;
-
- gnome_canvas_item_set( e_minicard->rect,
- "x2", (double) e_minicard->width - 1.0,
- "y2", (double) e_minicard->height - 1.0,
- NULL );
- gnome_canvas_item_set( e_minicard->header_rect,
- "x2", (double) e_minicard->width - 3.0,
- NULL );
-
- if (old_height != e_minicard->height)
- e_canvas_item_request_parent_reflow(item);
- }
-}
-
-const char *
-e_minicard_get_card_id (EMinicard *minicard)
-{
- g_return_val_if_fail(minicard != NULL, NULL);
- g_return_val_if_fail(E_IS_MINICARD(minicard), NULL);
-
- if (minicard->card) {
- return e_card_get_id(minicard->card);
- } else {
- return "";
- }
-}
-
-int
-e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2)
-{
- int cmp = 0;
-
- g_return_val_if_fail(minicard1 != NULL, 0);
- g_return_val_if_fail(E_IS_MINICARD(minicard1), 0);
- g_return_val_if_fail(minicard2 != NULL, 0);
- g_return_val_if_fail(E_IS_MINICARD(minicard2), 0);
-
- if (minicard1->card && minicard2->card) {
- char *file_as1, *file_as2;
-
- g_object_get(minicard1->card,
- "file_as", &file_as1,
- NULL);
- g_object_get(minicard2->card,
- "file_as", &file_as2,
- NULL);
-
- if (file_as1 && file_as2)
- cmp = g_utf8_collate(file_as1, file_as2);
- else if (file_as1)
- cmp = -1;
- else if (file_as2)
- cmp = 1;
- else
- cmp = strcmp(e_minicard_get_card_id(minicard1), e_minicard_get_card_id(minicard2));
-
- g_free (file_as1);
- g_free (file_as2);
- }
-
- return cmp;
-}
-
-int
-e_minicard_selected (EMinicard *minicard, GdkEvent *event)
-{
- gint ret_val = 0;
- GnomeCanvasItem *item = GNOME_CANVAS_ITEM (minicard);
- if (item->parent) {
- guint signal_id = g_signal_lookup ("selection_event", G_OBJECT_TYPE (item->parent));
- /* We should probably check the signature here, but I
- * don't think it's worth the time required to code
- * it.
- */
- if (signal_id != 0) {
- g_signal_emit(item->parent,
- signal_id, 0,
- item, event, &ret_val);
- }
- }
- return ret_val;
-}
-
-static gint
-e_minicard_drag_begin (EMinicard *minicard, GdkEvent *event)
-{
- gint ret_val = 0;
- GnomeCanvasItem *parent;
- g_signal_emit (minicard,
- e_minicard_signals[DRAG_BEGIN], 0,
- event, &ret_val);
-
- parent = GNOME_CANVAS_ITEM (minicard)->parent;
- if (parent && E_IS_REFLOW (parent)) {
- E_REFLOW (parent)->maybe_in_drag = FALSE;
- }
- return ret_val;
-}
diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h
deleted file mode 100644
index ac0f82e46c..0000000000
--- a/addressbook/gui/widgets/e-minicard.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-minicard.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-#ifndef __E_MINICARD_H__
-#define __E_MINICARD_H__
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include "addressbook/gui/contact-editor/e-contact-editor.h"
-#include <libgnomecanvas/gnome-canvas.h>
-#include "addressbook/backend/ebook/e-card.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EMinicard - A small card displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * width double RW width of the card
- * height double R height of the card
- * card ECard* RW Pointer to the ECard
- */
-
-#define E_TYPE_MINICARD (e_minicard_get_type ())
-#define E_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD, EMinicard))
-#define E_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD, EMinicardClass))
-#define E_IS_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD))
-#define E_IS_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD))
-
-
-typedef struct _EMinicard EMinicard;
-typedef struct _EMinicardClass EMinicardClass;
-typedef enum _EMinicardFocusType EMinicardFocusType;
-
-enum _EMinicardFocusType {
- E_MINICARD_FOCUS_TYPE_START,
- E_MINICARD_FOCUS_TYPE_END
-};
-
-struct _EMinicard
-{
- GnomeCanvasGroup parent;
-
- /* item specific fields */
- ECard *card;
- ECardSimple *simple;
-
- GnomeCanvasItem *rect;
- GnomeCanvasItem *header_rect;
- GnomeCanvasItem *header_text;
- GnomeCanvasItem *list_icon;
-
- GdkPixbuf *list_icon_pixbuf;
- double list_icon_size;
-
- GObject *editor;
-
- GList *fields; /* Of type EMinicardField */
- guint needs_remodeling : 1;
-
- guint changed : 1;
-
- guint selected : 1;
- guint has_cursor : 1;
-
- guint has_focus : 1;
-
- guint editable : 1;
-
- guint drag_button_down : 1;
- gint drag_button;
-
- gint button_x;
- gint button_y;
-
- double width;
- double height;
-};
-
-struct _EMinicardClass
-{
- GnomeCanvasGroupClass parent_class;
-
- gint (* selected) (EMinicard *minicard, GdkEvent *event);
- gint (* drag_begin) (EMinicard *minicard, GdkEvent *event);
-
- void (* style_set) (EMinicard *minicard, GtkStyle *previous_style);
-};
-
-
-GType e_minicard_get_type (void);
-const char *e_minicard_get_card_id (EMinicard *minicard);
-int e_minicard_compare (EMinicard *minicard1,
- EMinicard *minicard2);
-
-int e_minicard_selected (EMinicard *minicard,
- GdkEvent *event);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_MINICARD_H__ */
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c
deleted file mode 100644
index 212ac79b53..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-minicard.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-minicard.c: A View Factory
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include "gal-view-factory-minicard.h"
-#include "gal-view-minicard.h"
-#include "gal/util/e-util.h"
-
-#define PARENT_TYPE GAL_VIEW_FACTORY_TYPE
-
-static GalViewFactoryClass *gal_view_factory_minicard_parent_class;
-
-static const char *
-gal_view_factory_minicard_get_title (GalViewFactory *factory)
-{
- return _("Card View");
-}
-
-static GalView *
-gal_view_factory_minicard_new_view (GalViewFactory *factory,
- const char *name)
-{
- return gal_view_minicard_new(name);
-}
-
-static const char *
-gal_view_factory_minicard_get_type_code (GalViewFactory *factory)
-{
- return "minicard";
-}
-
-static void
-gal_view_factory_minicard_class_init (GObjectClass *object_class)
-{
- GalViewFactoryClass *view_factory_class = GAL_VIEW_FACTORY_CLASS(object_class);
- gal_view_factory_minicard_parent_class = g_type_class_ref (PARENT_TYPE);
-
- view_factory_class->get_title = gal_view_factory_minicard_get_title;
- view_factory_class->new_view = gal_view_factory_minicard_new_view;
- view_factory_class->get_type_code = gal_view_factory_minicard_get_type_code;
-}
-
-static void
-gal_view_factory_minicard_init (GalViewFactoryMinicard *factory)
-{
-}
-
-/**
- * gal_view_minicard_new
- *
- * A new GalViewFactory for creating Minicard views. Create one of
- * these and pass it to GalViewCollection for use.
- *
- * Returns: The new GalViewFactoryMinicard.
- */
-GalViewFactory *
-gal_view_factory_minicard_new (void)
-{
- return gal_view_factory_minicard_construct (g_object_new (GAL_TYPE_VIEW_FACTORY_MINICARD, NULL));
-}
-
-/**
- * gal_view_minicard_construct
- * @factory: The factory to construct
- *
- * constructs the GalViewFactoryMinicard. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewFactoryMinicard.
- */
-GalViewFactory *
-gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory)
-{
- return GAL_VIEW_FACTORY(factory);
-}
-
-E_MAKE_TYPE(gal_view_factory_minicard, "GalViewFactoryMinicard", GalViewFactoryMinicard, gal_view_factory_minicard_class_init, gal_view_factory_minicard_init, PARENT_TYPE)
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.h b/addressbook/gui/widgets/gal-view-factory-minicard.h
deleted file mode 100644
index 02eea99e47..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-minicard.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-minicard.c: A View Factory
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_FACTORY_MINICARD_H_
-#define _GAL_VIEW_FACTORY_MINICARD_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view-factory.h>
-
-#define GAL_TYPE_VIEW_FACTORY_MINICARD (gal_view_factory_minicard_get_type ())
-#define GAL_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicard))
-#define GAL_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicardClass))
-#define GAL_IS_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_FACTORY_MINICARD))
-#define GAL_IS_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_FACTORY_MINICARD))
-
-typedef struct {
- GalViewFactory base;
-} GalViewFactoryMinicard;
-
-typedef struct {
- GalViewFactoryClass parent_class;
-} GalViewFactoryMinicardClass;
-
-/* Standard functions */
-GType gal_view_factory_minicard_get_type (void);
-GalViewFactory *gal_view_factory_minicard_new (void);
-GalViewFactory *gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory);
-
-#endif /* _GAL_VIEW_FACTORY_MINICARD_H_ */
diff --git a/addressbook/gui/widgets/gal-view-factory-treeview.c b/addressbook/gui/widgets/gal-view-factory-treeview.c
deleted file mode 100644
index b14c8dec59..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-treeview.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8
- -*- */
-/*
- * gal-view-factory-treeview.c: A View Factory
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
-#include "gal-view-factory-treeview.h"
-#include "gal-view-treeview.h"
-
-#define PARENT_TYPE GAL_VIEW_FACTORY_TYPE
-
-static GalViewFactoryClass *gal_view_factory_treeview_parent_class;
-
-static const char *
-gal_view_factory_treeview_get_title (GalViewFactory *factory)
-{
- return _("GTK Tree View");
-}
-
-static GalView *
-gal_view_factory_treeview_new_view (GalViewFactory *factory,
- const char *name)
-{
- return gal_view_treeview_new(name);
-}
-
-static const char *
-gal_view_factory_treeview_get_type_code (GalViewFactory *factory)
-{
- return "treeview";
-}
-
-static void
-gal_view_factory_treeview_class_init (GObjectClass *object_class)
-{
- GalViewFactoryClass *view_factory_class = GAL_VIEW_FACTORY_CLASS(object_class);
- gal_view_factory_treeview_parent_class = g_type_class_ref (PARENT_TYPE);
-
- view_factory_class->get_title = gal_view_factory_treeview_get_title;
- view_factory_class->new_view = gal_view_factory_treeview_new_view;
- view_factory_class->get_type_code = gal_view_factory_treeview_get_type_code;
-}
-
-static void
-gal_view_factory_treeview_init (GalViewFactoryTreeView *factory)
-{
-}
-
-/**
- * gal_view_treeview_new
- *
- * A new GalViewFactory for creating TreeView views. Create one of
- * these and pass it to GalViewCollection for use.
- *
- * Returns: The new GalViewFactoryTreeView.
- */
-GalViewFactory *
-gal_view_factory_treeview_new (void)
-{
- return gal_view_factory_treeview_construct (g_object_new (GAL_TYPE_VIEW_FACTORY_TREEVIEW, NULL));
-}
-
-/**
- * gal_view_treeview_construct
- * @factory: The factory to construct
- *
- * constructs the GalViewFactoryTreeView. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewFactoryTreeView.
- */
-GalViewFactory *
-gal_view_factory_treeview_construct (GalViewFactoryTreeView *factory)
-{
- return GAL_VIEW_FACTORY(factory);
-}
-
-E_MAKE_TYPE(gal_view_factory_treeview, "GalViewFactoryTreeView", GalViewFactoryTreeView, gal_view_factory_treeview_class_init, gal_view_factory_treeview_init, PARENT_TYPE)
diff --git a/addressbook/gui/widgets/gal-view-factory-treeview.h b/addressbook/gui/widgets/gal-view-factory-treeview.h
deleted file mode 100644
index 4795c6d3aa..0000000000
--- a/addressbook/gui/widgets/gal-view-factory-treeview.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-factory-treeview.c: A View Factory
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_FACTORY_TREEVIEW_H_
-#define _GAL_VIEW_FACTORY_TREEVIEW_H_
-
-#include <gtk/gtkobject.h>
-#include <gal/menus/gal-view-factory.h>
-
-#define GAL_TYPE_VIEW_FACTORY_TREEVIEW (gal_view_factory_treeview_get_type ())
-#define GAL_VIEW_FACTORY_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_FACTORY_TREEVIEW, GalViewFactoryTreeView))
-#define GAL_VIEW_FACTORY_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_FACTORY_TREEVIEW, GalViewFactoryTreeViewClass))
-#define GAL_IS_VIEW_FACTORY_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_FACTORY_TREEVIEW))
-#define GAL_IS_VIEW_FACTORY_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_FACTORY_TREEVIEW))
-
-typedef struct {
- GalViewFactory base;
-} GalViewFactoryTreeView;
-
-typedef struct {
- GalViewFactoryClass parent_class;
-} GalViewFactoryTreeViewClass;
-
-/* Standard functions */
-GType gal_view_factory_treeview_get_type (void);
-GalViewFactory *gal_view_factory_treeview_new (void);
-GalViewFactory *gal_view_factory_treeview_construct (GalViewFactoryTreeView *factory);
-
-#endif /* _GAL_VIEW_FACTORY_TREEVIEW_H_ */
diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c
deleted file mode 100644
index 08818f9ee3..0000000000
--- a/addressbook/gui/widgets/gal-view-minicard.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-minicard.c: An Minicard View
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include "gal-view-minicard.h"
-#include <libxml/parser.h>
-#include <gal/util/e-xml-utils.h>
-
-#define PARENT_TYPE gal_view_get_type ()
-#define d(x) x
-
-static GalViewClass *gal_view_minicard_parent_class;
-
-static void
-gal_view_minicard_edit (GalView *view, GtkWindow *parent_window)
-{
- /* GalViewMinicard *minicard_view = GAL_VIEW_MINICARD(view); */
-}
-
-static void
-gal_view_minicard_load (GalView *view,
- const char *filename)
-{
- xmlDoc *doc;
- doc = xmlParseFile (filename);
- if (doc) {
- xmlNode *root = xmlDocGetRootElement(doc);
- GAL_VIEW_MINICARD (view)->column_width = e_xml_get_double_prop_by_name_with_default (root, "column_width", 150);
- xmlFreeDoc(doc);
- }
-}
-
-static void
-gal_view_minicard_save (GalView *view,
- const char *filename)
-{
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc("1.0");
- root = xmlNewNode (NULL, "EMinicardViewState");
- e_xml_set_double_prop_by_name (root, "column_width", GAL_VIEW_MINICARD (view)->column_width);
- xmlDocSetRootElement(doc, root);
- xmlSaveFile(filename, doc);
- xmlFreeDoc(doc);
-}
-
-static const char *
-gal_view_minicard_get_title (GalView *view)
-{
- return GAL_VIEW_MINICARD(view)->title;
-}
-
-static void
-gal_view_minicard_set_title (GalView *view,
- const char *title)
-{
- g_free(GAL_VIEW_MINICARD(view)->title);
- GAL_VIEW_MINICARD(view)->title = g_strdup(title);
-}
-
-static const char *
-gal_view_minicard_get_type_code (GalView *view)
-{
- return "minicard";
-}
-
-static GalView *
-gal_view_minicard_clone (GalView *view)
-{
- GalViewMinicard *gvm, *new;
-
- gvm = GAL_VIEW_MINICARD(view);
-
- new = g_object_new (GAL_TYPE_VIEW_MINICARD, NULL);
- new->title = g_strdup (gvm->title);
- new->column_width = gvm->column_width;
-
- return GAL_VIEW(new);
-}
-
-static void
-gal_view_minicard_dispose (GObject *object)
-{
- GalViewMinicard *view = GAL_VIEW_MINICARD(object);
- gal_view_minicard_detach (view);
- g_free(view->title);
-}
-
-static void
-gal_view_minicard_class_init (GObjectClass *object_class)
-{
- GalViewClass *gal_view_class = GAL_VIEW_CLASS(object_class);
- gal_view_minicard_parent_class = g_type_class_ref (PARENT_TYPE);
-
- gal_view_class->edit = gal_view_minicard_edit ;
- gal_view_class->load = gal_view_minicard_load ;
- gal_view_class->save = gal_view_minicard_save ;
- gal_view_class->get_title = gal_view_minicard_get_title ;
- gal_view_class->set_title = gal_view_minicard_set_title ;
- gal_view_class->get_type_code = gal_view_minicard_get_type_code;
- gal_view_class->clone = gal_view_minicard_clone ;
-
- object_class->dispose = gal_view_minicard_dispose ;
-}
-
-static void
-gal_view_minicard_init (GalViewMinicard *gvm)
-{
- gvm->title = NULL;
- gvm->column_width = 150.0;
-
- gvm->emvw = NULL;
- gvm->emvw_column_width_changed_id = 0;
-}
-
-/**
- * gal_view_minicard_new
- * @title: The name of the new view.
- *
- * Returns a new GalViewMinicard. This is primarily for use by
- * GalViewFactoryMinicard.
- *
- * Returns: The new GalViewMinicard.
- */
-GalView *
-gal_view_minicard_new (const gchar *title)
-{
- return gal_view_minicard_construct (g_object_new (GAL_TYPE_VIEW_MINICARD, NULL), title);
-}
-
-/**
- * gal_view_minicard_construct
- * @view: The view to construct.
- * @title: The name of the new view.
- *
- * constructs the GalViewMinicard. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewMinicard.
- */
-GalView *
-gal_view_minicard_construct (GalViewMinicard *view,
- const gchar *title)
-{
- view->title = g_strdup(title);
- return GAL_VIEW(view);
-}
-
-GType
-gal_view_minicard_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (GalViewMinicardClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gal_view_minicard_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GalViewMinicard),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gal_view_minicard_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalViewMinicard", &info, 0);
- }
-
- return type;
-}
-
-static void
-column_width_changed (EMinicardViewWidget *w, double width, GalViewMinicard *view)
-{
- d(g_print("%s: Old width = %f, New width = %f\n", G_GNUC_FUNCTION, view->column_width, width));
- if (view->column_width != width) {
- view->column_width = width;
- gal_view_changed(GAL_VIEW(view));
- }
-}
-
-void
-gal_view_minicard_attach (GalViewMinicard *view, EMinicardViewWidget *emvw)
-{
- gal_view_minicard_detach (view);
-
- view->emvw = emvw;
-
- g_object_ref (view->emvw);
-
- g_object_set (view->emvw,
- "column_width", view->column_width,
- NULL);
-
- view->emvw_column_width_changed_id =
- g_signal_connect(view->emvw, "column_width_changed",
- G_CALLBACK (column_width_changed), view);
-}
-
-void
-gal_view_minicard_detach (GalViewMinicard *view)
-{
- if (view->emvw == NULL)
- return;
- if (view->emvw_column_width_changed_id) {
- g_signal_handler_disconnect (view->emvw,
- view->emvw_column_width_changed_id);
- view->emvw_column_width_changed_id = 0;
- }
- g_object_unref (view->emvw);
- view->emvw = NULL;
-}
diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h
deleted file mode 100644
index e586012f73..0000000000
--- a/addressbook/gui/widgets/gal-view-minicard.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-minicard.h: An Minicard View
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_MINICARD_H_
-#define _GAL_VIEW_MINICARD_H_
-
-#include <gal/menus/gal-view.h>
-#include <e-minicard-view-widget.h>
-
-#define GAL_TYPE_VIEW_MINICARD (gal_view_minicard_get_type ())
-#define GAL_VIEW_MINICARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_MINICARD, GalViewMinicard))
-#define GAL_VIEW_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_MINICARD, GalViewMinicardClass))
-#define GAL_IS_VIEW_MINICARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_MINICARD))
-#define GAL_IS_VIEW_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_MINICARD))
-
-typedef struct {
- GalView base;
-
- char *title;
- double column_width;
-
- EMinicardViewWidget *emvw;
- guint emvw_column_width_changed_id;
-} GalViewMinicard;
-
-typedef struct {
- GalViewClass parent_class;
-} GalViewMinicardClass;
-
-/* Standard functions */
-GType gal_view_minicard_get_type (void);
-GalView *gal_view_minicard_new (const gchar *title);
-GalView *gal_view_minicard_construct (GalViewMinicard *view,
- const gchar *title);
-void gal_view_minicard_attach (GalViewMinicard *view,
- EMinicardViewWidget *emvw);
-void gal_view_minicard_detach (GalViewMinicard *view);
-
-#endif /* _GAL_VIEW_MINICARD_H_ */
diff --git a/addressbook/gui/widgets/gal-view-treeview.c b/addressbook/gui/widgets/gal-view-treeview.c
deleted file mode 100644
index f43b3add75..0000000000
--- a/addressbook/gui/widgets/gal-view-treeview.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-treeview.c: An TreeView View
- *
- * Authors:
- * Chris Lahey <clahey@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#include <config.h>
-#include "gal-view-treeview.h"
-#include <libxml/parser.h>
-#include <gal/util/e-xml-utils.h>
-
-#define PARENT_TYPE gal_view_get_type ()
-#define d(x) x
-
-static GalViewClass *gal_view_treeview_parent_class;
-
-static void
-gal_view_treeview_edit (GalView *view, GtkWindow *parent_window)
-{
- /* GalViewTreeView *treeview_view = GAL_VIEW_TREEVIEW(view); */
-}
-
-static void
-gal_view_treeview_load (GalView *view,
- const char *filename)
-{
-#if 0
- xmlDoc *doc;
- doc = xmlParseFile (filename);
- if (doc) {
- xmlNode *root = xmlDocGetRootElement(doc);
- GAL_VIEW_TREEVIEW (view)->column_width = e_xml_get_double_prop_by_name_with_default (root, "column_width", 150);
- xmlFreeDoc(doc);
- }
-#endif
-}
-
-static void
-gal_view_treeview_save (GalView *view,
- const char *filename)
-{
-#if 0
- xmlDoc *doc;
- xmlNode *root;
-
- doc = xmlNewDoc("1.0");
- root = xmlNewNode (NULL, "ETreeViewViewState");
- e_xml_set_double_prop_by_name (root, "column_width", GAL_VIEW_TREEVIEW (view)->column_width);
- xmlDocSetRootElement(doc, root);
- xmlSaveFile(filename, doc);
- xmlFreeDoc(doc);
-#endif
-}
-
-static const char *
-gal_view_treeview_get_title (GalView *view)
-{
- return GAL_VIEW_TREEVIEW(view)->title;
-}
-
-static void
-gal_view_treeview_set_title (GalView *view,
- const char *title)
-{
- g_free(GAL_VIEW_TREEVIEW(view)->title);
- GAL_VIEW_TREEVIEW(view)->title = g_strdup(title);
-}
-
-static const char *
-gal_view_treeview_get_type_code (GalView *view)
-{
- return "treeview";
-}
-
-static GalView *
-gal_view_treeview_clone (GalView *view)
-{
- GalViewTreeView *gvm, *new;
-
- gvm = GAL_VIEW_TREEVIEW(view);
-
- new = g_object_new (GAL_TYPE_VIEW_TREEVIEW, NULL);
- new->title = g_strdup (gvm->title);
-
- return GAL_VIEW(new);
-}
-
-static void
-gal_view_treeview_dispose (GObject *object)
-{
- GalViewTreeView *view = GAL_VIEW_TREEVIEW(object);
- gal_view_treeview_detach (view);
- g_free(view->title);
-}
-
-static void
-gal_view_treeview_class_init (GObjectClass *object_class)
-{
- GalViewClass *gal_view_class = GAL_VIEW_CLASS(object_class);
- gal_view_treeview_parent_class = g_type_class_ref (PARENT_TYPE);
-
- gal_view_class->edit = gal_view_treeview_edit ;
- gal_view_class->load = gal_view_treeview_load ;
- gal_view_class->save = gal_view_treeview_save ;
- gal_view_class->get_title = gal_view_treeview_get_title ;
- gal_view_class->set_title = gal_view_treeview_set_title ;
- gal_view_class->get_type_code = gal_view_treeview_get_type_code;
- gal_view_class->clone = gal_view_treeview_clone ;
-
- object_class->dispose = gal_view_treeview_dispose ;
-}
-
-static void
-gal_view_treeview_init (GalViewTreeView *gvm)
-{
- gvm->title = NULL;
-
- gvm->tree = NULL;
-}
-
-/**
- * gal_view_treeview_new
- * @title: The name of the new view.
- *
- * Returns a new GalViewTreeView. This is primarily for use by
- * GalViewFactoryTreeView.
- *
- * Returns: The new GalViewTreeView.
- */
-GalView *
-gal_view_treeview_new (const gchar *title)
-{
- return gal_view_treeview_construct (g_object_new (GAL_TYPE_VIEW_TREEVIEW, NULL), title);
-}
-
-/**
- * gal_view_treeview_construct
- * @view: The view to construct.
- * @title: The name of the new view.
- *
- * constructs the GalViewTreeView. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewTreeView.
- */
-GalView *
-gal_view_treeview_construct (GalViewTreeView *view,
- const gchar *title)
-{
- view->title = g_strdup(title);
- return GAL_VIEW(view);
-}
-
-GType
-gal_view_treeview_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo info = {
- sizeof (GalViewTreeViewClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gal_view_treeview_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GalViewTreeView),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gal_view_treeview_init,
- };
-
- type = g_type_register_static (PARENT_TYPE, "GalViewTreeView", &info, 0);
- }
-
- return type;
-}
-
-#if 0
-static void
-column_width_changed (ETable *table, double width, GalViewMinicard *view)
-{
- d(g_print("%s: Old width = %f, New width = %f\n", G_GNUC_FUNCTION, view->column_width, width));
- if (view->column_width != width) {
- view->column_width = width;
- gal_view_changed(GAL_VIEW(view));
- }
-}
-#endif
-
-void
-gal_view_treeview_attach (GalViewTreeView *view, GtkTreeView *tree)
-{
-#if 0
- gal_view_treeview_detach (view);
-
- view->emvw = emvw;
-
- g_object_ref (view->emvw);
-
- g_object_set (view->emvw,
- "column_width", view->column_width,
- NULL);
-
- view->emvw_column_width_changed_id =
- g_signal_connect(view->emvw, "column_width_changed",
- G_CALLBACK (column_width_changed), view);
-#endif
-}
-
-void
-gal_view_treeview_detach (GalViewTreeView *view)
-{
-#if 0
- if (view->emvw == NULL)
- return;
- if (view->emvw_column_width_changed_id) {
- g_signal_handler_disconnect (view->emvw,
- view->emvw_column_width_changed_id);
- view->emvw_column_width_changed_id = 0;
- }
- g_object_unref (view->emvw);
- view->emvw = NULL;
-#endif
-}
diff --git a/addressbook/gui/widgets/gal-view-treeview.h b/addressbook/gui/widgets/gal-view-treeview.h
deleted file mode 100644
index a0313856a6..0000000000
--- a/addressbook/gui/widgets/gal-view-treeview.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * gal-view-treeview.h: An TreeView View
- *
- * Authors:
- * Chris Toshok <toshok@ximian.com>
- *
- * (C) 2000, 2001 Ximian, Inc.
- */
-#ifndef _GAL_VIEW_TREEVIEW_H_
-#define _GAL_VIEW_TREEVIEW_H_
-
-#include <gal/menus/gal-view.h>
-#include <gtk/gtktreeview.h>
-
-#define GAL_TYPE_VIEW_TREEVIEW (gal_view_treeview_get_type ())
-#define GAL_VIEW_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_TREEVIEW, GalViewTreeView))
-#define GAL_VIEW_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_TREEVIEW, GalViewTreeViewClass))
-#define GAL_IS_VIEW_TREEVIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_TREEVIEW))
-#define GAL_IS_VIEW_TREEVIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_TREEVIEW))
-
-typedef struct {
- GalView base;
-
- char *title;
-
- GtkTreeView *tree;
-} GalViewTreeView;
-
-typedef struct {
- GalViewClass parent_class;
-} GalViewTreeViewClass;
-
-/* Standard functions */
-GType gal_view_treeview_get_type (void);
-GalView *gal_view_treeview_new (const gchar *title);
-GalView *gal_view_treeview_construct (GalViewTreeView *view,
- const gchar *title);
-void gal_view_treeview_attach (GalViewTreeView *view,
- GtkTreeView *tree);
-void gal_view_treeview_detach (GalViewTreeView *view);
-
-#endif /* _GAL_VIEW_TREEVIEW_H_ */
diff --git a/addressbook/gui/widgets/test-minicard-label.c b/addressbook/gui/widgets/test-minicard-label.c
deleted file mode 100644
index c109497628..0000000000
--- a/addressbook/gui/widgets/test-minicard-label.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* test-minicard-label.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-canvas-rect-ellipse.h>
-#include <libgnomeui/gnome-init.h>
-#include <gal/widgets/e-canvas.h>
-#include "e-minicard-label.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GnomeCanvasItem *label;
-GnomeCanvasItem *rect;
-
-static void destroy_callback(gpointer data, GObject *where_object_was)
-{
- exit(0);
-}
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpointer data)
-{
- gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, allocation->width, allocation->height );
- gnome_canvas_item_set( label,
- "width", (double) allocation->width,
- "height", (double) allocation->height,
- NULL );
- gnome_canvas_item_set( rect,
- "x2", (double) allocation->width,
- "y2", (double) allocation->height,
- NULL );
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Minicard Label Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the minicard label canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-static void button_press_callback( GtkWidget *widget, gpointer data )
-{
- gnome_canvas_item_grab_focus( label );
-}
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
- GtkWidget *canvas;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_init( "Minicard Label Test", VERSION, argc, argv);
- app = gnome_app_new("Minicard Label Test", NULL);
-
- canvas = e_canvas_new();
- rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
- label = e_minicard_label_new(gnome_canvas_root( GNOME_CANVAS( canvas ) ));
- gnome_canvas_item_set( label,
- "width", (double) 100,
- "height", (double) 100,
- "fieldname", "Full Name:",
- "field", "Christopher James Lahey",
- NULL );
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( canvas ),
- 0, 0,
- 100, 100 );
-
- gnome_app_set_contents( GNOME_APP( app ), canvas );
-
-
- /* Connect the signals */
- g_object_weak_ref (app, destroy_callback, app);
-
- g_signal_connect( canvas , "size_allocate",
- G_CALLBACK ( allocate_callback ),
- ( gpointer ) app );
-
- g_signal_connect( canvas , "button_press_event",
- G_CALLBACK ( button_press_callback ),
- ( gpointer ) app );
-
- gtk_widget_show_all( app );
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/gui/widgets/test-minicard-view.c b/addressbook/gui/widgets/test-minicard-view.c
deleted file mode 100644
index 14ede54208..0000000000
--- a/addressbook/gui/widgets/test-minicard-view.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* test-reflow.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <libgnorba/gnorba.h>
-#include <e-util/e-canvas.h>
-#include "e-minicard-view.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GnomeCanvasItem *reflow;
-GnomeCanvasItem *rect;
-GtkAllocation last_alloc;
-
-CORBA_Environment ev;
-CORBA_ORB orb;
-
-static void
-init_bonobo (int argc, char **argv)
-{
-
- gnome_CORBA_init_with_popt_table (
- "Reflow Test", VERSION,
- &argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
-
- orb = gnome_CORBA_ORB ();
-
- if (bonobo_init (orb, NULL, NULL) == FALSE)
- g_error (_("Could not initialize Bonobo"));
-
-}
-
-static void destroy_callback(gpointer data, GObject *where_object_was)
-{
- exit(0);
-}
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpointer data)
-{
- double width;
- last_alloc = *allocation;
- gnome_canvas_item_set( reflow,
- "height", (double) allocation->height,
- NULL );
- gnome_canvas_item_set( reflow,
- "minimum_width", (double) allocation->width,
- NULL );
- g_object_get(reflow,
- "width", &width,
- NULL);
- width = MAX(width, allocation->width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, width, allocation->height );
- gnome_canvas_item_set( rect,
- "x2", (double) width,
- "y2", (double) allocation->height,
- NULL );
-}
-
-static void resize(GnomeCanvas *canvas, gpointer data)
-{
- double width;
- g_object_get(reflow,
- "width", &width,
- NULL);
- width = MAX(width, last_alloc.width);
- gnome_canvas_set_scroll_region(canvas , 0, 0, width, last_alloc.height );
- gnome_canvas_item_set( rect,
- "x2", (double) width,
- "y2", (double) last_alloc.height,
- NULL );
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Reflow Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the reflow canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-static void
-book_open_cb (EBook *book, EBookStatus status, gpointer closure)
-{
- if (status == E_BOOK_STATUS_SUCCESS)
- gnome_canvas_item_set(reflow,
- "book", book,
- NULL);
-}
-
-static gboolean
-ebook_create (gpointer data)
-{
- EBook *book;
-
- book = e_book_new ();
-
- if (!book) {
- printf ("%s: %s(): Couldn't create EBook, bailing.\n",
- __FILE__,
- G_GNUC_FUNCTION);
- return FALSE;
- }
-
-
- e_book_load_uri (book, "file:/tmp/test.db", book_open_cb, NULL);
-
- return FALSE;
-}
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
- GtkWidget *canvas;
- GtkWidget *vbox;
- GtkWidget *scrollbar;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- CORBA_exception_init (&ev);
- init_bonobo (argc, argv);
-
- app = gnome_app_new("Reflow Test", NULL);
-
- vbox = gtk_vbox_new(FALSE, 0);
-
- canvas = e_canvas_new();
- rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
- reflow = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- e_minicard_view_get_type(),
- "height", (double) 100,
- "minimum_width", (double) 100,
- NULL );
- g_signal_connect( canvas, "reflow",
- G_CALLBACK ( resize ),
- ( gpointer ) app);
-
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( canvas ),
- 0, 0,
- 100, 100 );
-
- gtk_box_pack_start(GTK_BOX(vbox), canvas, TRUE, TRUE, 0);
-
- scrollbar = gtk_hscrollbar_new(gtk_layout_get_hadjustment(GTK_LAYOUT(canvas)));
-
- gtk_box_pack_start(GTK_BOX(vbox), scrollbar, FALSE, FALSE, 0);
-
- gnome_app_set_contents( GNOME_APP( app ), vbox );
-
- /* Connect the signals */
- g_object_weak_ref (app, destroy_callback, app);
-
- g_signal_connect( canvas, "size_allocate",
- G_CALLBACK ( allocate_callback ),
- ( gpointer ) app );
-
- gtk_widget_show_all( app );
- gdk_window_set_back_pixmap( GTK_LAYOUT(canvas)->bin_window, NULL, FALSE);
-
- g_idle_add (ebook_create, NULL);
-
- bonobo_main ();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/gui/widgets/test-minicard.c b/addressbook/gui/widgets/test-minicard.c
deleted file mode 100644
index 822362d972..0000000000
--- a/addressbook/gui/widgets/test-minicard.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* test-minicard.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#include "config.h"
-
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-init.h>
-#include <libgnomeui/gnome-canvas-rect-ellipse.h>
-
-#include "e-minicard.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GnomeCanvasItem *card;
-GnomeCanvasItem *rect;
-
-static void destroy_callback(gpointer data, GObject *where_object_was)
-{
- exit(0);
-}
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpointer data)
-{
- gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, allocation->width, allocation->height );
- gnome_canvas_item_set( card,
- "width", (double) allocation->width,
- NULL );
- gnome_canvas_item_set( rect,
- "x2", (double) allocation->width,
- "y2", (double) allocation->height,
- NULL );
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Minicard Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the minicard canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
- GtkWidget *canvas;
- int i;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_init( "Minicard Test", VERSION, argc, argv);
- app = gnome_app_new("Minicard Test", NULL);
-
- canvas = gnome_canvas_new();
- rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
- for ( i = 0; i < 1; i++ )
- {
- card = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- e_minicard_get_type(),
- "width", (double) 100,
- NULL );
- }
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( canvas ),
- 0, 0,
- 100, 100 );
-
- gnome_app_set_contents( GNOME_APP( app ), canvas );
-
- /* Connect the signals */
- g_object_weak_ref (app, destroy_callback, app);
-
- g_signal_connect( canvas, "size_allocate",
- G_CALLBACK( allocate_callback ),
- ( gpointer ) app );
-
- gtk_widget_show_all( app );
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/gui/widgets/test-reflow.c b/addressbook/gui/widgets/test-reflow.c
deleted file mode 100644
index 66f003fe2c..0000000000
--- a/addressbook/gui/widgets/test-reflow.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* test-reflow.c
- *
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#define TEST_VCARD \
-"BEGIN:VCARD
-" \
-"FN:Nat
-" \
-"N:Friedman;Nat;D;Mr.
-" \
-"TITLE:Head Geek
-" \
-"BDAY:1977-08-06
-" \
-"TEL;WORK:617 679 1984
-" \
-"TEL;CELL:123 456 7890
-" \
-"EMAIL;INTERNET:nat@nat.org
-" \
-"EMAIL;INTERNET:nat@ximian.com
-" \
-"ADR;WORK;POSTAL:P.O. Box 101;;;Any Town;CA;91921-1234;
-" \
-"ADR;HOME;POSTAL;INTL:P.O. Box 202;;;Any Town 2;MI;12344-4321;USA
-" \
-"END:VCARD
-" \
-"
-"
-
-
-#include "config.h"
-
-#include <gtk/gtkmain.h>
-#include <gtk/gtkvbox.h>
-#include <libgnomeui/gnome-canvas-rect-ellipse.h>
-#include <libgnomeui/gnome-init.h>
-#include <gal/widgets/e-canvas.h>
-#include <gal/widgets/e-reflow.h>
-#include <gal/widgets/e-scroll-frame.h>
-
-#include "e-minicard.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GnomeCanvasItem *reflow;
-GnomeCanvasItem *rect;
-GtkAllocation last_alloc;
-
-static void destroy_callback(gpointer data, GObject *where_object_was)
-{
- exit(0);
-}
-
-static void allocate_callback(GtkWidget *canvas, GtkAllocation *allocation, gpointer data)
-{
- double width;
- last_alloc = *allocation;
- gnome_canvas_item_set( reflow,
- "height", (double) allocation->height,
- NULL );
- gnome_canvas_item_set( reflow,
- "minimum_width", (double) allocation->width,
- NULL );
- g_object_get(reflow,
- "width", &width,
- NULL);
- width = MAX(width, allocation->width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS( canvas ), 0, 0, width - 1, allocation->height - 1);
- gnome_canvas_item_set( rect,
- "x2", (double) width,
- "y2", (double) allocation->height,
- NULL );
-}
-
-static void resize(GnomeCanvas *canvas, gpointer data)
-{
- double width;
- g_object_get(reflow,
- "width", &width,
- NULL);
- width = MAX(width, last_alloc.width);
- gnome_canvas_set_scroll_region(canvas , 0, 0, width - 1, last_alloc.height - 1);
- gnome_canvas_item_set( rect,
- "x2", (double) width,
- "y2", (double) last_alloc.height,
- NULL );
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Reflow Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the reflow canvas item" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
- GtkWidget *canvas;
- GtkWidget *vbox;
- GtkWidget *scrollframe;
- int i;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_init( "Reflow Test", VERSION, argc, argv);
- app = gnome_app_new("Reflow Test", NULL);
-
- vbox = gtk_vbox_new(FALSE, 0);
-
- canvas = e_canvas_new();
- rect = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- gnome_canvas_rect_get_type(),
- "x1", (double) 0,
- "y1", (double) 0,
- "x2", (double) 100,
- "y2", (double) 100,
- "fill_color", "white",
- NULL );
- reflow = gnome_canvas_item_new( gnome_canvas_root( GNOME_CANVAS( canvas ) ),
- e_reflow_get_type(),
- "height", (double) 100,
- "minimum_width", (double) 100,
- NULL );
- g_signal_connect( canvas, "reflow",
- G_CALLBACK ( resize ),
- ( gpointer ) app);
- for ( i = 0; i < 200; i++ )
- {
- GnomeCanvasItem *item;
- ECard *card = e_card_new (TEST_VCARD);
- item = gnome_canvas_item_new( GNOME_CANVAS_GROUP(reflow),
- e_minicard_get_type(),
- "card", card,
- NULL);
- e_reflow_add_item(E_REFLOW(reflow), item, NULL);
- }
- gnome_canvas_set_scroll_region ( GNOME_CANVAS( canvas ),
- 0, 0,
- 100, 100 );
-
- scrollframe = e_scroll_frame_new (gtk_layout_get_hadjustment(GTK_LAYOUT(canvas)),
- gtk_layout_get_vadjustment(GTK_LAYOUT(canvas)));
- e_scroll_frame_set_policy (E_SCROLL_FRAME (scrollframe),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_NEVER);
-
- gtk_container_add (GTK_CONTAINER (scrollframe), canvas);
-
- gnome_app_set_contents( GNOME_APP( app ), scrollframe );
-
- /* Connect the signals */
- g_object_weak_ref (app, destroy_callback, app);
-
- g_signal_connect( canvas, "size_allocate",
- G_CALLBACK ( allocate_callback ),
- ( gpointer ) app );
-
- gtk_widget_show_all( app );
- gdk_window_set_back_pixmap( GTK_LAYOUT(canvas)->bin_window, NULL, FALSE);
-
- gtk_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/printing/.cvsignore b/addressbook/printing/.cvsignore
deleted file mode 100644
index 96194f7fd7..0000000000
--- a/addressbook/printing/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-.deps
-.libs
-.pure
-Makefile
-Makefile.in
-*.lo
-*.la
-contact-print-test
-contact-print-style-editor-test
diff --git a/addressbook/printing/Makefile.am b/addressbook/printing/Makefile.am
deleted file mode 100644
index b28d841ec2..0000000000
--- a/addressbook/printing/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-ecpsdir = $(privdatadir)/ecps
-ecps_DATA = \
- smallbook.ecps \
- medbook.ecps \
- phonelist.ecps
-
-glade_DATA = \
- e-contact-print.glade
-
-INCLUDES = \
- $(GNOME_INCLUDEDIR) \
- -DG_LOG_DOMAIN=\"addressbook-printing\" \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -I$(top_srcdir) \
- -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_ECPSDIR=\""$(ecpsdir)"\" \
- $(EVOLUTION_ADDRESSBOOK_CFLAGS)
-
-noinst_LTLIBRARIES = \
- libecontactprint.la
-
-libecontactprint_la_SOURCES = \
- e-contact-print-envelope.c \
- e-contact-print-envelope.h \
- e-contact-print-style-editor.c \
- e-contact-print-style-editor.h \
- e-contact-print-types.h \
- e-contact-print.c \
- e-contact-print.h
-
-noinst_PROGRAMS = \
- contact-print-test \
- contact-print-style-editor-test
-
-contact_print_test_SOURCES = \
- test-print.c
-
-contact_print_test_LDADD = \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- libecontactprint.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-contact_print_style_editor_test_SOURCES = \
- test-contact-print-style-editor.c
-
-contact_print_style_editor_test_LDADD = \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- libecontactprint.la \
- $(EVOLUTION_ADDRESSBOOK_LIBS)
-
-
-
-EXTRA_DIST = \
- $(glade_DATA) \
- $(ecps_DATA)
diff --git a/addressbook/printing/e-contact-print-envelope.c b/addressbook/printing/e-contact-print-envelope.c
deleted file mode 100644
index 33e7361605..0000000000
--- a/addressbook/printing/e-contact-print-envelope.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-envelope.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "addressbook/printing/e-contact-print-envelope.h"
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <time.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-#include "addressbook/backend/ebook/e-card.h"
-#include "addressbook/backend/ebook/e-card-simple.h"
-
-#define ENVELOPE_HEIGHT (72.0 * 4.0)
-#define ENVELOPE_WIDTH (72.0 * 9.5)
-
-typedef struct {
- int start;
- int length;
-} EcpeLine;
-
-static void
-startset(void *pointer, EcpeLine **iterator)
-{
- (*iterator)--;
- (*iterator)->start = GPOINTER_TO_INT(pointer);
-}
-
-static void
-lengthset(void *pointer, EcpeLine **iterator)
-{
- (*iterator)--;
- (*iterator)->length = GPOINTER_TO_INT(pointer);
-}
-
-static EcpeLine *
-ecpe_break(char *address)
-{
- int i;
- int length = 0;
- int laststart = 0;
- GList *startlist = NULL;
- GList *lengthlist = NULL;
- EcpeLine *ret_val;
- EcpeLine *iterator;
-
- for (i = 0; address[i]; i++) {
- if (address[i] == '\n') {
- startlist = g_list_prepend (startlist, GINT_TO_POINTER(laststart));
- lengthlist = g_list_prepend (lengthlist, GINT_TO_POINTER(i - laststart));
- length ++;
- laststart = i + 1;
- }
- }
- startlist = g_list_prepend (startlist, GINT_TO_POINTER(laststart));
- lengthlist = g_list_prepend (lengthlist, GINT_TO_POINTER(i - laststart));
- length ++;
-
- ret_val = g_new(EcpeLine, length + 1);
-
- iterator = ret_val + length;
- g_list_foreach(startlist, (GFunc) startset, &iterator);
- g_list_free(startlist);
-
- iterator = ret_val + length;
- g_list_foreach(lengthlist, (GFunc) lengthset, &iterator);
- g_list_free(lengthlist);
-
- ret_val[length].start = -1;
- ret_val[length].length = -1;
-
- return ret_val;
-}
-
-static void
-ecpe_linelist_dimensions(GnomeFont *font, char *address, EcpeLine *linelist, double *widthp, double *heightp)
-{
- double width = 0;
- int i;
- if (widthp) {
- for (i = 0; linelist[i].length != -1; i++) {
- width = MAX(width, gnome_font_get_width_utf8_sized (font, address + linelist[i].start, linelist[i].length));
- }
- *widthp = width;
- } else {
- for (i = 0; linelist[i].length != -1; i++)
- /* Intentionally empty */;
- }
- if (heightp) {
- *heightp = gnome_font_get_size(font) * i;
- }
-}
-
-static void
-ecpe_linelist_print(GnomePrintContext *pc, GnomeFont *font, char *address, EcpeLine *linelist, double x, double y)
-{
- int i;
- gnome_print_setfont(pc, font);
- for (i = 0; linelist[i].length != -1; i++) {
- gnome_print_moveto(pc, x, y + gnome_font_get_ascender(font));
- gnome_print_show_sized (pc, address + linelist[i].start, linelist[i].length);
- y -= gnome_font_get_size(font);
- }
-}
-
-static gint
-e_contact_print_envelope_close(GnomeDialog *dialog, gpointer data)
-{
- return FALSE;
-}
-
-static void
-ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return)
-{
- ECardSimple *card = e_card_simple_new(ecard);
- char *address;
- EcpeLine *linelist;
- double x;
- double y;
- GnomeFont *font;
-
-
- gnome_print_rotate(pc, 90);
- gnome_print_translate(pc, 72.0 * 11.0 - ENVELOPE_WIDTH, -72.0 * 8.5 + (72.0 * 8.5 - ENVELOPE_HEIGHT) / 2);
-
- address = e_card_simple_get(card, E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS);
- linelist = ecpe_break(address);
- if (as_return)
- font = gnome_font_find ("Helvetica", 9);
- else
- font = gnome_font_find ("Helvetica", 12);
- ecpe_linelist_dimensions(font, address, linelist, NULL, &y);
- if (as_return) {
- x = 36;
- y = ENVELOPE_HEIGHT - 36;
- } else {
- x = ENVELOPE_WIDTH / 2;
- y = (ENVELOPE_HEIGHT - y) / 2;
- }
- ecpe_linelist_print(pc, font, address, linelist, x, y);
- g_object_unref(font);
- g_free(linelist);
-
- g_free(address);
-
- gnome_print_showpage(pc);
- gnome_print_context_close(pc);
-
- g_object_unref(card);
-}
-
-static void
-e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data)
-{
- GnomePrintJob *master;
- GnomePrintContext *pc;
- GnomePrintConfig *config;
- ECard *card = NULL;
- GtkWidget *preview;
-
- card = g_object_get_data(G_OBJECT(dialog), "card");
-
- switch( button ) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (dialog));
- master = gnome_print_job_new (config);
- pc = gnome_print_job_get_context( master );
-
- ecpe_print(pc, card, FALSE);
-
- gnome_print_job_print(master);
- gnome_dialog_close(dialog);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG (dialog));
- master = gnome_print_job_new (config);
- pc = gnome_print_job_get_context( master );
-
- ecpe_print(pc, card, FALSE);
-
- preview = GTK_WIDGET(gnome_print_job_preview_new(master, "Print Preview"));
- gtk_widget_show_all(preview);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_CANCEL:
- g_object_unref(card);
- gnome_dialog_close(dialog);
- break;
- }
-}
-
-GtkWidget *
-e_contact_print_envelope_dialog_new(ECard *card)
-{
- GtkWidget *dialog;
-
- dialog = gnome_print_dialog_new(NULL, _("Print envelope"), GNOME_PRINT_DIALOG_COPIES);
-
- card = e_card_duplicate(card);
- g_object_set_data(G_OBJECT(dialog), "card", card);
- g_signal_connect(dialog,
- "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_envelope_close), NULL);
- return dialog;
-}
-
-/* FIXME: Print all the contacts selected. */
-GtkWidget *
-e_contact_print_envelope_list_dialog_new(GList *list)
-{
- GtkWidget *dialog;
- ECard *card;
-
- if (list == NULL)
- return NULL;
-
- dialog = gnome_print_dialog_new(NULL, _("Print envelope"), GNOME_PRINT_DIALOG_COPIES);
-
- card = e_card_duplicate(list->data);
- g_object_set_data(G_OBJECT(dialog), "card", card);
- g_signal_connect(dialog,
- "clicked", G_CALLBACK(e_contact_print_envelope_button), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_envelope_close), NULL);
- return dialog;
-}
diff --git a/addressbook/printing/e-contact-print-envelope.h b/addressbook/printing/e-contact-print-envelope.h
deleted file mode 100644
index 4302c4c5d7..0000000000
--- a/addressbook/printing/e-contact-print-envelope.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-envelope.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CONTACT_PRINT_ENVELOPE_H
-#define E_CONTACT_PRINT_ENVELOPE_H
-
-#include <addressbook/backend/ebook/e-card.h>
-#include <gtk/gtkwidget.h>
-#include "e-contact-print-types.h"
-
-GtkWidget *e_contact_print_envelope_dialog_new(ECard *card);
-GtkWidget *e_contact_print_envelope_list_dialog_new(GList *list);
-
-#endif /* E_CONTACT_PRINT_ENVELOPE_H */
diff --git a/addressbook/printing/e-contact-print-style-editor.c b/addressbook/printing/e-contact-print-style-editor.c
deleted file mode 100644
index 9267fc0c99..0000000000
--- a/addressbook/printing/e-contact-print-style-editor.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-style-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "e-contact-print-style-editor.h"
-
-static void e_contact_print_style_editor_init (EContactPrintStyleEditor *card);
-static void e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *klass);
-static void e_contact_print_style_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
-static void e_contact_print_style_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
-static void e_contact_print_style_editor_destroy (GtkObject *object);
-
-static GtkVBoxClass *parent_class = NULL;
-
-
-/* The arguments we take */
-enum {
- ARG_0,
- ARG_CARD
-};
-
-GtkType
-e_contact_print_style_editor_get_type (void)
-{
- static GtkType contact_print_style_editor_type = 0;
-
- if (!contact_print_style_editor_type)
- {
- static const GtkTypeInfo contact_print_style_editor_info =
- {
- "EContactPrintStyleEditor",
- sizeof (EContactPrintStyleEditor),
- sizeof (EContactPrintStyleEditorClass),
- (GtkClassInitFunc) e_contact_print_style_editor_class_init,
- (GtkObjectInitFunc) e_contact_print_style_editor_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- contact_print_style_editor_type = gtk_type_unique (gtk_vbox_get_type (), &contact_print_style_editor_info);
- }
-
- return contact_print_style_editor_type;
-}
-
-static void
-e_contact_print_style_editor_class_init (EContactPrintStyleEditorClass *klass)
-{
- GtkObjectClass *object_class;
- GtkVBoxClass *vbox_class;
-
- object_class = (GtkObjectClass*) klass;
- vbox_class = (GtkVBoxClass *) klass;
-
- parent_class = gtk_type_class (gtk_vbox_get_type ());
-
- object_class->set_arg = e_contact_print_style_editor_set_arg;
- object_class->get_arg = e_contact_print_style_editor_get_arg;
- object_class->destroy = e_contact_print_style_editor_destroy;
-}
-
-#if 0
-static void
-_add_image(GtkTable *table, gchar *image, int left, int right, int top, int bottom)
-{
- gtk_table_attach(table,
- gtk_widget_new(gtk_alignment_get_type(),
- "child", gnome_pixmap_new_from_file(image),
- "xalign", (double) 0,
- "yalign", (double) 0,
- "xscale", (double) 0,
- "yscale", (double) 0,
- NULL),
- left, right, top, bottom,
- GTK_FILL, GTK_FILL,
- 0, 0);
-}
-#endif
-
-static void
-e_contact_print_style_editor_init (EContactPrintStyleEditor *e_contact_print_style_editor)
-{
- GladeXML *gui;
-
- /* e_contact_print_style_editor->card = NULL;*/
- gui = glade_xml_new (EVOLUTION_GLADEDIR "/e-contact-print.glade", NULL, NULL);
- e_contact_print_style_editor->gui = gui;
- gtk_widget_reparent(glade_xml_get_widget(gui, "vbox-contact-print-style-editor"),
- GTK_WIDGET(e_contact_print_style_editor));
-}
-
-void
-e_contact_print_style_editor_destroy (GtkObject *object)
-{
- EContactPrintStyleEditor *e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR(object);
- g_object_unref(e_contact_print_style_editor->gui);
-}
-
-GtkWidget*
-e_contact_print_style_editor_new (char *filename)
-{
- GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_print_style_editor_get_type ()));
- return widget;
-}
-
-static void
-e_contact_print_style_editor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
-{
- EContactPrintStyleEditor *e_contact_print_style_editor;
-
- e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR (o);
-
- switch (arg_id){
- default:
- break;
- }
-}
-
-static void
-e_contact_print_style_editor_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
-{
- EContactPrintStyleEditor *e_contact_print_style_editor;
-
- e_contact_print_style_editor = E_CONTACT_PRINT_STYLE_EDITOR (object);
-
- switch (arg_id) {
- default:
- arg->type = GTK_TYPE_INVALID;
- break;
- }
-}
diff --git a/addressbook/printing/e-contact-print-style-editor.h b/addressbook/printing/e-contact-print-style-editor.h
deleted file mode 100644
index e4604d551c..0000000000
--- a/addressbook/printing/e-contact-print-style-editor.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* e-contact-print-style-editor.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __E_CONTACT_PRINT_STYLE_EDITOR_H__
-#define __E_CONTACT_PRINT_STYLE_EDITOR_H__
-
-#include <gtk/gtkvbox.h>
-#include <glade/glade.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-/* EContactPrintStyleEditor - A dialog displaying information about a contact.
- *
- * The following arguments are available:
- *
- * name type read/write description
- * --------------------------------------------------------------------------------
- * card ECard * R The card currently being edited
- */
-
-#define E_CONTACT_PRINT_STYLE_EDITOR_TYPE (e_contact_print_style_editor_get_type ())
-#define E_CONTACT_PRINT_STYLE_EDITOR(obj) (GTK_CHECK_CAST ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditor))
-#define E_CONTACT_PRINT_STYLE_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_CONTACT_PRINT_STYLE_EDITOR_TYPE, EContactPrintStyleEditorClass))
-#define E_IS_MINICARD(obj) (GTK_CHECK_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE))
-#define E_IS_MINICARD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_CONTACT_PRINT_STYLE_EDITOR_TYPE))
-
-
-typedef struct _EContactPrintStyleEditor EContactPrintStyleEditor;
-typedef struct _EContactPrintStyleEditorClass EContactPrintStyleEditorClass;
-
-struct _EContactPrintStyleEditor
-{
- GtkVBox parent;
-
- /* item specific fields */
- GladeXML *gui;
-};
-
-struct _EContactPrintStyleEditorClass
-{
- GtkVBoxClass parent_class;
-};
-
-
-GtkWidget *e_contact_print_style_editor_new(char *filename);
-GtkType e_contact_print_style_editor_get_type (void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __E_CONTACT_PRINT_STYLE_EDITOR_H__ */
diff --git a/addressbook/printing/e-contact-print-types.h b/addressbook/printing/e-contact-print-types.h
deleted file mode 100644
index b7082b41f6..0000000000
--- a/addressbook/printing/e-contact-print-types.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print-types.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CONTACT_PRINT_TYPES_H
-#define E_CONTACT_PRINT_TYPES_H
-
-#include <glib.h>
-#include <libgnomeprint/gnome-font.h>
-
-typedef struct _EContactPrintStyle EContactPrintStyle;
-typedef enum _EContactPrintType EContactPrintType;
-
-enum _EContactPrintType {
- E_CONTACT_PRINT_TYPE_CARDS,
- E_CONTACT_PRINT_TYPE_MEMO_STYLE,
- E_CONTACT_PRINT_TYPE_PHONE_LIST
-};
-
-struct _EContactPrintStyle
-{
- gchar *title;
- EContactPrintType type;
- gboolean sections_start_new_page;
- guint num_columns;
- guint blank_forms;
- gboolean letter_tabs;
- gboolean letter_headings;
- GnomeFont *headings_font;
- GnomeFont *body_font;
- gboolean print_using_grey;
- gint paper_type;
- gdouble paper_width;
- gdouble paper_height;
- gint paper_source;
- gdouble top_margin;
- gdouble left_margin;
- gdouble bottom_margin;
- gdouble right_margin;
- gint page_size;
- gdouble page_width;
- gdouble page_height;
- gboolean orientation_portrait;
- GnomeFont *header_font;
- gchar *left_header;
- gchar *center_header;
- gchar *right_header;
- GnomeFont *footer_font;
- gchar *left_footer;
- gchar *center_footer;
- gchar *right_footer;
- gboolean reverse_on_even_pages;
-};
-
-#endif /* E_CONTACT_PRINT_TYPES_H */
-
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
deleted file mode 100644
index b239b87847..0000000000
--- a/addressbook/printing/e-contact-print.c
+++ /dev/null
@@ -1,1236 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <config.h>
-#include "e-contact-print.h"
-
-#include <ctype.h>
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <glib.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-font.h>
-#include <libgnomeprint/gnome-print-job.h>
-#include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprintui/gnome-print-job-preview.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include <addressbook/backend/ebook/e-card.h>
-#include <addressbook/backend/ebook/e-card-simple.h>
-#include <addressbook/backend/ebook/e-destination.h>
-
-#define SCALE 5
-#define HYPHEN_PIXELS 20
-#define HYPHEN_PENALTY ( (SCALE) * (SCALE) * (HYPHEN_PIXELS) * (HYPHEN_PIXELS) )
-
-typedef struct _EContactPrintContext EContactPrintContext;
-
-struct _EContactPrintContext
-{
- GnomePrintContext *pc;
- GnomePrintJob *master;
- gdouble x;
- gdouble y;
- gint column;
- EContactPrintStyle *style;
- gboolean first_section;
- gchar first_char_on_page;
- gchar last_char_on_page;
- GnomeFont *letter_heading_font;
- GnomeFont *letter_tab_font;
- char *character;
- gboolean first_contact;
-
- gboolean uses_book;
- int type;
- EBook *book;
- gchar *query;
-
- GList *cards;
-};
-
-static gint
-e_contact_divide_text(GnomePrintContext *pc, GnomeFont *font, double width, const gchar *text, GList **return_val /* Of type char[] */)
-{
- if ( width == -1 || gnome_font_get_width_utf8(font, text) <= width ) {
- if ( return_val ) {
- *return_val = g_list_append(*return_val, g_strdup(text));
- }
- return 1;
- } else {
-#if 1
- int i, l;
- double x = 0;
- int lastend = 0;
- int linestart = 0;
- int firstword = 1;
- int linecount = 0;
- l = strlen(text);
- for ( i = 0; i < l; i++ ) {
- if ( text[i] == ' ' ) {
- if ( (!firstword) && x + gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend) > width ) {
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, lastend - linestart));
- }
- x = gnome_font_get_width_utf8(font, " ");
- linestart = lastend + 1;
- x += gnome_font_get_width_utf8_sized(font, text + linestart, i - linestart);
- lastend = i;
- linecount ++;
- } else {
- x += gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend);
- lastend = i;
- }
- firstword = 0;
- } else if ( text[i] == '\n' ) {
- if ( (!firstword) && x + gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend) > width ) {
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, lastend - linestart));
- }
- linestart = lastend + 1;
- lastend = i;
- linecount ++;
- }
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, i - linestart));
- }
- linestart = i + 1;
- lastend = i + 1;
- linecount ++;
- x = gnome_font_get_width_utf8(font, " ");
-
- firstword = 1;
- }
- }
- if ( (!firstword) && x + gnome_font_get_width_utf8_sized(font, text + lastend, i - lastend) > width ) {
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, lastend - linestart));
- }
- linestart = lastend + 1;
- lastend = i;
- linecount ++;
- }
- if (return_val) {
- *return_val = g_list_append(*return_val, g_strndup(text + linestart, i - linestart));
- }
- linecount ++;
- return(linecount);
-#else
- HnjBreak *breaks;
- gint *result;
- gint *is;
- gint n_breaks = 0, n_actual_breaks = 0;
- gint i;
- gint l;
- gchar *hyphenation;
- double x = - gnome_font_get_width_utf8(font, " ") * SCALE;
- HnjParams hnjparams;
-
- hnjparams.set_width = width * SCALE + x;
- hnjparams.max_neg_space = 0;
- hnjparams.tab_width = 0;
-
- l = strlen(text);
-
- /* find possible line breaks. */
- for (i = 0; i < l; i++) {
- if (text[i] == '-')
- n_breaks++;
- else if (text[i] == ' ')
- n_breaks++;
-#if 0
- else if (hyphenation[i] & 1)
- n_breaks++;
-#endif
- }
-
- breaks = g_new( HnjBreak, n_breaks + 1 );
- result = g_new( gint, n_breaks + 1 );
- is = g_new( gint, n_breaks + 1 );
- n_breaks = 0;
- /* find possible line breaks. */
-
- for (i = 0; i < l; i++) {
- if ( text[i] == '-' ) {
- x += gnome_font_get_width(font, text[i]) * SCALE;
- breaks[n_breaks].x0 = x;
- breaks[n_breaks].x1 = x;
- breaks[n_breaks].penalty = HYPHEN_PENALTY;
- breaks[n_breaks].flags = HNJ_JUST_FLAG_ISHYPHEN;
- is[n_breaks] = i + 1;
- n_breaks++;
- } else if ( text[i] == ' ' ) {
- breaks[ n_breaks ].x0 = x;
- x += gnome_font_get_width(font, text[i]) * SCALE;
- breaks[ n_breaks ].x1 = x;
- breaks[ n_breaks ].penalty = 0;
- breaks[ n_breaks ].flags = HNJ_JUST_FLAG_ISSPACE;
- is[ n_breaks ] = i + 1;
- n_breaks++;
-#if 0
- } else if (word->hyphenation[i] & 1) {
- breaks[n_breaks].x0 = x + gnome_font_get_width(font, '-') * SCALE;
- breaks[n_breaks].x1 = x;
- breaks[n_breaks].penalty = HYPHEN_PENALTY;
- breaks[n_breaks].flags = HNJ_JUST_FLAG_ISHYPHEN;
- is[n_breaks] = i + 1;
- n_breaks++;
-#endif
- } else
- x += gnome_font_get_width(font, text[i]) * SCALE;
-
- }
- is[n_breaks] = i;
- breaks[n_breaks].flags = 0;
- n_breaks++;
-
- /* Calculate optimal line breaks. */
- n_actual_breaks = hnj_hs_just (breaks, n_breaks,
- &hnjparams, result);
-
- if ( return_val ) {
- gchar *next_val;
- if ( breaks[result[0]].flags == HNJ_JUST_FLAG_ISHYPHEN && text[is[result[0]]] != '-' ) {
- next_val = g_new(gchar, is[result[0]] + 2);
- strncpy(next_val, text, is[result[0]]);
- next_val[is[result[0]]] = 0;
- strcat(next_val, "-");
- } else {
- next_val = g_new(gchar, is[result[0]] + 1);
- strncpy(next_val, text, is[result[0]]);
- next_val[is[result[0]]] = 0;
- }
- *return_val = g_list_append(*return_val, next_val);
-
- for ( i = 1; i < n_actual_breaks; i++ ) {
- if ( (breaks[result[i]].flags & HNJ_JUST_FLAG_ISHYPHEN) && (text[is[result[i]]] != '-') ) {
- next_val = g_new(gchar, is[result[i]] - is[result[i - 1]] + 2);
- strncpy(next_val, text + is[result[i - 1]], is[result[i]] - is[result[i - 1]]);
- next_val[is[result[i]] - is[result[i - 1]]] = 0;
- strcat(next_val, "-");
- } else {
- next_val = g_new(gchar, is[result[i]] - is[result[i - 1]] + 1);
- strncpy(next_val, text + is[result[i - 1]], is[result[i]] - is[result[i - 1]]);
- next_val[is[result[i]] - is[result[i - 1]]] = 0;
- }
- *return_val = g_list_append(*return_val, next_val);
- }
- }
-
- g_free (breaks);
- g_free (result);
- g_free (is);
- return n_actual_breaks;
-#endif
- }
-}
-
-static void
-e_contact_output(GnomePrintContext *pc, GnomeFont *font, double x, double y, double width, const gchar *text)
-{
- GList *list = NULL, *list_start;
- int first_line = 1;
- gnome_print_gsave(pc);
- gnome_print_setfont(pc, font);
- e_contact_divide_text(pc, font, width, text, &list);
- for ( list_start = list; list; list = g_list_next(list)) {
- y -= gnome_font_get_ascender(font);
- gnome_print_moveto(pc, x, y);
- gnome_print_show(pc, (char *)list->data);
- y -= gnome_font_get_descender(font);
- y -= .2 * gnome_font_get_size (font);
- if ( first_line ) {
- x += gnome_font_get_width_utf8(font, " ");
- first_line = 0;
- }
- }
- g_list_foreach( list_start, (GFunc) g_free, NULL );
- g_list_free( list_start );
- gnome_print_grestore(pc);
-}
-
-static gdouble
-e_contact_text_height(GnomePrintContext *pc, GnomeFont *font, double width, gchar *text)
-{
- int line_count = e_contact_divide_text(pc, font, width, text, NULL);
- return line_count * (gnome_font_get_ascender(font) + gnome_font_get_descender(font)) +
- (line_count - 1) * .2 * gnome_font_get_size (font);
-}
-
-#if 0
-static void
-e_contact_output_and_advance(EContactPrintContext *ctxt, GnomeFont *font, double x, double width, gchar *text)
-{
- ctxt->y -= .1 * gnome_font_get_size (font);
- e_contact_output(ctxt->pc, font, x, ctxt->y, width, text);
- ctxt->y -= e_contact_text_height(ctxt->pc, font, width, text);
- ctxt->y -= .1 * gnome_font_get_size (font);
-}
-#endif
-
-static void
-e_contact_rectangle(GnomePrintContext *pc,
- gdouble x0,
- gdouble y0,
- gdouble x1,
- gdouble y1,
- gdouble r,
- gdouble g,
- gdouble b)
-{
- gnome_print_gsave(pc);
- gnome_print_setrgbcolor(pc, r, g, b);
- gnome_print_moveto(pc, x0, y0);
- gnome_print_lineto(pc, x1, y0);
- gnome_print_lineto(pc, x1, y1);
- gnome_print_lineto(pc, x0, y1);
- gnome_print_lineto(pc, x0, y0);
- gnome_print_fill(pc);
- gnome_print_grestore(pc);
-}
-
-static double
-e_contact_get_letter_tab_width (EContactPrintContext *ctxt)
-{
- return gnome_font_get_width_utf8(ctxt->letter_tab_font, "123") + 4 + 18;
-}
-
-static double
-e_contact_print_letter_tab (EContactPrintContext *ctxt)
-{
- unsigned char character;
- gdouble x, y;
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble tab_height, tab_width;
- gdouble font_size;
- tab_height = 72 * (ctxt->style->page_height - ctxt->style->top_margin - ctxt->style->bottom_margin) / 27.0;
- font_size = tab_height / 2;
- tab_width = e_contact_get_letter_tab_width(ctxt) - 18;
- x = page_width + 72 * (ctxt->style->left_margin) - tab_width;
- y = 72 * (ctxt->style->page_height - ctxt->style->top_margin);
-
-
- gnome_print_gsave( ctxt->pc );
- if ( ctxt->style->print_using_grey )
- e_contact_rectangle( ctxt->pc, x, 72 * (ctxt->style->page_height - ctxt->style->top_margin), x + tab_width, ctxt->style->bottom_margin * 72, .85, .85, .85 );
- for ( character = 'A' - 1; character <= 'Z'; character ++ ) {
- char string[] = "123";
- if ( character >= 'A' ) {
- string[0] = tolower(character);
- string[1] = 0;
- }
- if ( character >= ctxt->first_char_on_page && character <= ctxt->last_char_on_page ) {
- e_contact_rectangle( ctxt->pc, x + 1, y - 1, x + tab_width - 1, y - (tab_height - 1), 0, 0, 0 );
- gnome_print_setrgbcolor( ctxt->pc, 1, 1, 1 );
- e_contact_output( ctxt->pc, ctxt->letter_tab_font, x + tab_width / 2 - gnome_font_get_width_utf8(ctxt->letter_tab_font, string) / 2, y - (tab_height - font_size) / 2, -1, string );
- } else {
- gnome_print_setrgbcolor( ctxt->pc, 0, 0, 0 );
- e_contact_output( ctxt->pc, ctxt->letter_tab_font, x + tab_width / 2 - gnome_font_get_width_utf8(ctxt->letter_tab_font, string) / 2, y - (tab_height - font_size) / 2, -1, string );
- }
- y -= tab_height;
- }
- gnome_print_grestore( ctxt->pc );
- return gnome_font_get_width_utf8(ctxt->style->body_font, "123") + gnome_font_get_size (ctxt->style->body_font) / 5;
-}
-
-static double
-e_contact_get_letter_heading_height (EContactPrintContext *ctxt)
-{
- gdouble ascender, descender;
- ascender = gnome_font_get_ascender(ctxt->letter_heading_font);
- descender = gnome_font_get_descender(ctxt->letter_heading_font);
- return ascender + descender + 9;
-}
-
-static void
-e_contact_print_letter_heading (EContactPrintContext *ctxt, gchar *character)
-{
- gdouble ascender, descender;
- gdouble width;
-
- width = gnome_font_get_width_utf8(ctxt->letter_heading_font, "m") * 1.7;
- ascender = gnome_font_get_ascender(ctxt->letter_heading_font);
- descender = gnome_font_get_descender(ctxt->letter_heading_font);
- gnome_print_gsave( ctxt->pc );
- e_contact_rectangle( ctxt->pc, ctxt->x, ctxt->y, ctxt->x + width, ctxt->y - (ascender + descender + 6), 0, 0, 0);
- gnome_print_setrgbcolor(ctxt->pc, 1, 1, 1);
- ctxt->y -= 4;
- e_contact_output(ctxt->pc, ctxt->letter_heading_font, ctxt->x + (width - gnome_font_get_width_utf8(ctxt->letter_heading_font, character))/ 2, ctxt->y, -1, character);
- ctxt->y -= ascender + descender;
- ctxt->y -= 2;
- ctxt->y -= 3;
- gnome_print_grestore( ctxt->pc );
-}
-
-static void
-e_contact_start_new_page(EContactPrintContext *ctxt)
-{
- ctxt->x = ctxt->style->left_margin * 72;
- ctxt->y = (ctxt->style->page_height - ctxt->style->top_margin) * 72;
- ctxt->column = 0;
- if ( ctxt->style->letter_tabs )
- e_contact_print_letter_tab(ctxt);
- gnome_print_showpage(ctxt->pc);
-
- gnome_print_beginpage (ctxt->pc, NULL);
-
- ctxt->first_char_on_page = ctxt->last_char_on_page + 1;
-}
-
-static double
-e_contact_get_card_size(ECardSimple *simple, EContactPrintContext *ctxt)
-{
- gdouble height = 0;
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_width;
- char *file_as;
- gint field;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
- column_width = (page_width + 18) / ctxt->style->num_columns - 18;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- g_object_get(simple->card,
- "file_as", &file_as,
- NULL);
- height += e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as);
- g_free (file_as);
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; field++) {
- char *string;
- string = e_card_simple_get(simple, field);
- if (string && *string) {
- double xoff = 0;
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, e_card_simple_get_name(simple, field));
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, ": ");
- height += e_contact_text_height(ctxt->pc, ctxt->style->body_font, column_width - xoff, string);
- height += .2 * gnome_font_get_size (ctxt->style->body_font);
- }
- g_free(string);
- }
- height += gnome_font_get_size (ctxt->style->headings_font) * .4;
-
- /* g_message ("%s %g", e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_FILE_AS), height); */
- return height;
-}
-
-
-static void
-e_contact_print_card (ECardSimple *simple, EContactPrintContext *ctxt)
-{
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_width;
- char *file_as;
- int field;
-
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
- column_width = (page_width + 18) / ctxt->style->num_columns - 18;
-
- gnome_print_gsave(ctxt->pc);
-
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- g_object_get(simple->card,
- "file_as", &file_as,
- NULL);
- if (ctxt->style->print_using_grey)
- e_contact_rectangle(ctxt->pc, ctxt->x, ctxt->y + gnome_font_get_size (ctxt->style->headings_font) * .3, ctxt->x + column_width, ctxt->y - e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as) - gnome_font_get_size (ctxt->style->headings_font) * .3, .85, .85, .85);
- e_contact_output(ctxt->pc, ctxt->style->headings_font, ctxt->x + 2, ctxt->y, column_width - 4, file_as);
- ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as);
- g_free (file_as);
-
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; field++) {
- char *string;
- string = e_card_simple_get(simple, field);
-
- if (string && !strncmp (string, "<?xml", 4)) {
- EDestination *dest = e_destination_import (string);
- if (dest != NULL) {
- gchar *new_string = g_strdup (e_destination_get_address (dest));
- g_free (string);
- string = new_string;
- g_object_unref (dest);
- }
- }
-
- if (string && *string) {
- double xoff = 0;
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, -1, e_card_simple_get_name(simple, field));
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, e_card_simple_get_name(simple, field));
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, -1, ": ");
- xoff += gnome_font_get_width_utf8(ctxt->style->body_font, ": ");
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, column_width - xoff, string);
- ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->body_font, column_width - xoff, string);
- ctxt->y -= .2 * gnome_font_get_size (ctxt->style->body_font);
- }
- g_free(string);
- }
-
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .4;
- gnome_print_grestore(ctxt->pc);
-}
-
-static void
-e_contact_start_new_column (EContactPrintContext *ctxt)
-{
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_offset;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
- column_offset = (page_width + 18) / ctxt->style->num_columns;
- ctxt->column ++;
- if (ctxt->column >= ctxt->style->num_columns) {
- e_contact_start_new_page(ctxt);
- ctxt->column = 0;
- }
- ctxt->x = (72 * ctxt->style->left_margin) + column_offset * ctxt->column;
- ctxt->y = 72 * (ctxt->style->page_height - ctxt->style->top_margin);
-}
-
-static void
-complete_sequence(EBookView *book_view, EBookViewStatus status, EContactPrintContext *ctxt)
-{
- GList *cards = ctxt->cards;
-
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
-
- ctxt->first_contact = TRUE;
- ctxt->character = NULL;
- ctxt->y = (ctxt->style->page_height - ctxt->style->top_margin) * 72;
- ctxt->x = (ctxt->style->left_margin) * 72;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
-
- ctxt->first_char_on_page = 'A' - 1;
-
- gnome_print_beginpage (ctxt->pc, NULL);
-
- for(; cards; cards = cards->next) {
- ECard *card = cards->data;
- ECardSimple *simple = e_card_simple_new(card);
- guchar *file_as;
- gchar *letter_str = NULL;
-
- g_object_get(card,
- "file_as", &file_as,
- NULL);
- if (file_as != NULL) {
- letter_str = g_strndup (file_as, g_utf8_next_char (file_as) - (gchar *) file_as);
- }
- if ( file_as && (!ctxt->character || g_utf8_collate (ctxt->character, letter_str) != 0) ) {
- g_free (ctxt->character);
- ctxt->character = g_strdup (letter_str);
- if (ctxt->style->sections_start_new_page && ! ctxt->first_contact) {
- e_contact_start_new_page(ctxt);
- }
- else if ((!ctxt->first_contact) && (ctxt->y - e_contact_get_letter_heading_height(ctxt) - e_contact_get_card_size(simple, ctxt) < ctxt->style->bottom_margin * 72))
- e_contact_start_new_column(ctxt);
- if ( ctxt->style->letter_headings )
- e_contact_print_letter_heading(ctxt, ctxt->character);
- ctxt->first_section = FALSE;
- }
- else if ( (!ctxt->first_contact) && (ctxt->y - e_contact_get_card_size(simple, ctxt) < ctxt->style->bottom_margin * 72)) {
- e_contact_start_new_column(ctxt);
- if ( ctxt->style->letter_headings )
- e_contact_print_letter_heading(ctxt, ctxt->character);
- }
- g_free (letter_str);
- ctxt->last_char_on_page = toupper(*file_as);
- if ( ctxt->last_char_on_page < ctxt->first_char_on_page )
- ctxt->first_char_on_page = ctxt->last_char_on_page;
- e_contact_print_card(simple, ctxt);
- ctxt->first_contact = FALSE;
- g_object_unref(simple);
- }
- ctxt->last_char_on_page = 'Z';
- if ( ctxt->style->letter_tabs )
- e_contact_print_letter_tab(ctxt);
- gnome_print_showpage(ctxt->pc);
- gnome_print_context_close(ctxt->pc);
- g_free(ctxt->character);
- if (book_view)
- g_object_unref(book_view);
- if (ctxt->type == GNOME_PRINT_DIALOG_RESPONSE_PREVIEW) {
- GtkWidget *preview;
- preview = GTK_WIDGET(gnome_print_job_preview_new(ctxt->master, "Print Preview"));
- gtk_widget_show_all(preview);
- } else {
- gnome_print_job_print(ctxt->master);
- }
- g_object_unref(ctxt->pc);
- g_object_unref(ctxt->master);
- if (ctxt->book)
- g_object_unref(ctxt->book);
- g_free(ctxt->query);
- g_list_foreach(ctxt->cards, (GFunc) g_object_unref, NULL);
- g_list_free(ctxt->cards);
- g_object_unref(ctxt->style->headings_font);
- g_object_unref(ctxt->style->body_font);
- g_object_unref(ctxt->style->header_font);
- g_object_unref(ctxt->style->footer_font);
- g_object_unref(ctxt->letter_heading_font);
- g_object_unref(ctxt->letter_tab_font);
- g_free(ctxt->style);
- g_free(ctxt);
-}
-
-static int
-card_compare (ECard *card1, ECard *card2) {
- int cmp = 0;
-
- if (card1 && card2) {
- char *file_as1, *file_as2;
-
- g_object_get(card1,
- "file_as", &file_as1,
- NULL);
- g_object_get(card2,
- "file_as", &file_as2,
- NULL);
- if (file_as1 && file_as2)
- cmp = g_utf8_collate(file_as1, file_as2);
- else if (file_as1)
- cmp = -1;
- else if (file_as2)
- cmp = 1;
- else
- cmp = strcmp(e_card_get_id(card1), e_card_get_id(card2));
-
- g_free (file_as2);
- g_free (file_as1);
-
- }
- return cmp;
-}
-
-static void
-create_card(EBookView *book_view, const GList *cards, EContactPrintContext *ctxt)
-{
- for(; cards; cards = cards->next) {
- ECard *card = cards->data;
- g_object_ref(card);
- ctxt->cards = g_list_insert_sorted(ctxt->cards, card, (GCompareFunc) card_compare);
- }
-}
-
-static void
-book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, EContactPrintContext *ctxt)
-{
- g_object_ref(book_view);
-
- g_signal_connect(book_view,
- "card_added",
- G_CALLBACK(create_card),
- ctxt);
-
- g_signal_connect(book_view,
- "sequence_complete",
- G_CALLBACK(complete_sequence),
- ctxt);
-}
-
-static void
-e_contact_do_print_cards (EBook *book, char *query, EContactPrintContext *ctxt)
-{
- e_book_get_book_view(book, query, (EBookBookViewCallback) book_view_loaded, ctxt);
-}
-
-#if 0
-static double
-e_contact_get_phone_list_size(ECardSimple *simple, EContactPrintContext *ctxt)
-{
- double height = 0;
- int field;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- height += gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; field++) {
- char *string;
- string = e_card_simple_get(simple, field);
- if (string && *string) {
- if ( 1 ) /* field is a phone field. */ {
- gchar *field = string;
- height += e_contact_text_height(ctxt->pc, ctxt->style->body_font, 100, field);
- height += .2 * gnome_font_get_size (ctxt->style->body_font);
- }
- }
- g_free(string);
- }
- height += gnome_font_get_size (ctxt->style->headings_font) * .4;
- return height;
-}
-
-
-static void
-e_contact_print_phone_list (ECard *card, EContactPrintContext *ctxt)
-{
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_width;
- double xoff, dotwidth;
- int dotcount;
- char *dots;
- int i;
- char *file_as;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
- column_width = (page_width + 18) / ctxt->style->num_columns - 18;
-
- gnome_print_gsave(ctxt->pc);
-
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2;
-
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x, ctxt->y, -1, e_card_get_string_fileas(card));
-
- xoff = column_width - 9 * gnome_font_get_size (ctxt->style->body_font);
- dotwidth = xoff -
- gnome_font_get_width_utf8(ctxt->style->body_font, e_card_get_string_fileas(card)) -
- gnome_font_get_width_utf8(ctxt->style->body_font, " ");
- dotcount = dotwidth / gnome_font_get_width(ctxt->style->body_font, '.');
- dots = g_new(gchar, dotcount + 1);
- for (i = 0; i < dotcount; i++)
- dots[i] = '.';
- dots[dotcount] = 0;
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff - dotcount * gnome_font_get_width(ctxt->style->body_font, '.'), ctxt->y, -1, dots);
- g_free(dots);
-
- for(; shown_fields; shown_fields = g_list_next(shown_fields)) {
- if ( 1 ) /* field is a phone field. */ {
- gchar *field = e_card_get_string(card, shown_fields->data);
- e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, -1, shown_fields->data);
- e_contact_output(ctxt->pc, ctxt->style->body_font,
- ctxt->x + column_width - gnome_font_get_width_utf8(ctxt->style->body_font,
- field),
- ctxt->y,
- -1,
- field);
- ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->body_font, 100, field);
- ctxt->y -= .2 * gnome_font_get_size (ctxt->style->body_font);
- }
- }
- ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .4;
- gnome_print_grestore(ctxt->pc);
-}
-
-static void
-e_contact_do_print_phone_list (EBook *book, char *query, EContactPrintContext *ctxt)
-{
- ECard *card = NULL;
- int i;
- gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin);
- gdouble column_width;
- ctxt->first_contact = TRUE;
- ctxt->character = NULL;
- ctxt->y = (ctxt->style->page_height - ctxt->style->top_margin) * 72;
- ctxt->x = (ctxt->style->left_margin) * 72;
- if ( ctxt->style->letter_tabs )
- page_width -= e_contact_get_letter_tab_width(ctxt);
-
- ctxt->first_char_on_page = 'A' - 1;
-
- column_width = (page_width + 18) / ctxt->style->num_columns - 18;
- /*
- for(card = e_book_get_first(book); card; card = e_book_get_next(book)) {
- */
- for (i=0; i < 30; i++) {
- guchar *file_as = e_card_get_string_fileas(card);
- if ( file_as && (!character || *character != tolower(*file_as)) ) {
- if (ctxt->style->sections_start_new_page && ! first_contact) {
- e_contact_start_new_page(ctxt);
- }
- else if ((!first_contact) && (ctxt->y - e_contact_get_letter_heading_height(ctxt) - e_contact_get_phone_list_size(card, ctxt, shown_fields) < ctxt->style->bottom_margin * 72))
- e_contact_start_new_column(ctxt);
- if (!character)
- character = g_strdup(" ");
- *character = tolower(*file_as);
- if ( ctxt->style->letter_headings )
- e_contact_print_letter_heading(ctxt, character);
- ctxt->first_section = FALSE;
- }
- else if ( (!first_contact) && (ctxt->y - e_contact_get_card_size(card, ctxt, shown_fields) < ctxt->style->bottom_margin * 72)) {
- e_contact_start_new_column(ctxt);
- if ( ctxt->style->letter_headings )
- e_contact_print_letter_heading(ctxt, character);
- }
- ctxt->last_char_on_page = toupper(*file_as);
- if ( ctxt->last_char_on_page < ctxt->first_char_on_page )
- ctxt->first_char_on_page = ctxt->last_char_on_page;
- e_contact_print_phone_list(card, ctxt, shown_fields);
- first_contact = FALSE;
- g_free (file_as);
- }
- ctxt->last_char_on_page = 'Z';
- if ( ctxt->style->letter_tabs )
- e_contact_print_letter_tab(ctxt);
- gnome_print_showpage(ctxt->pc);
- gnome_print_context_close(ctxt->pc);
- g_free(character);
-}
-#endif
-
-static void
-e_contact_do_print (EBook *book, char *query, EContactPrintContext *ctxt)
-{
- switch ( ctxt->style->type ) {
- case E_CONTACT_PRINT_TYPE_CARDS:
- e_contact_do_print_cards( book, query, ctxt);
- break;
-#if 0
- case E_CONTACT_PRINT_TYPE_PHONE_LIST:
- e_contact_do_print_phone_list( book, query, ctxt );
- break;
-#endif
- default:
- break;
- }
-}
-
-static void lowify( char *data )
-{
- for ( ; *data; data++ )
- *data = tolower((unsigned char) *data);
-}
-
-static gboolean get_bool( char *data )
-{
- if ( data ) {
- lowify ( data );
- return ! strcmp(data, "true");
- } else
- return FALSE;
-}
-
-static void get_string( char *data, char **variable )
-{
- g_free ( *variable );
- if ( data )
- *variable = g_strdup( data );
- else
- *variable = g_strdup( "" );
-}
-
-static int get_integer( char *data )
-{
- if ( data )
- return atoi(data);
- else
- return 0;
-}
-
-static double get_float( char *data )
-{
- if ( data )
- return atof(data);
- else
- return 0;
-}
-
-static void get_font( char *data, GnomeFont **variable )
-{
- if ( data ) {
- GnomeFont *font = gnome_font_find_from_full_name( data );
- if ( font ) {
- g_object_unref(*variable);
- *variable = font;
- }
- }
-}
-
-
-static void
-e_contact_build_style(EContactPrintStyle *style)
-{
- xmlDocPtr styledoc;
- gchar *filename;
-
- style->title = g_strdup("");
- style->type = E_CONTACT_PRINT_TYPE_CARDS;
- style->sections_start_new_page = TRUE;
- style->num_columns = 2;
- style->blank_forms = 2;
- style->letter_tabs = TRUE;
- style->letter_headings = FALSE;
-
- style->headings_font = gnome_font_find_closest_from_weight_slant ("Helvetica", GNOME_FONT_BOLD, FALSE, 8);
- style->body_font = gnome_font_find_closest_from_weight_slant ("Helvetica", GNOME_FONT_BOOK, FALSE, 6);
-
- style->print_using_grey = TRUE;
- style->paper_type = 0;
- style->paper_width = 8.5;
- style->paper_height = 11;
- style->paper_source = 0;
- style->top_margin = .5;
- style->left_margin = .5;
- style->bottom_margin = .5;
- style->right_margin = .5;
- style->page_size = 0;
- style->page_width = 2.75;
- style->page_height = 4.25;
-#if 0
- style->page_width = 4.25;
- style->page_height = 5.5;
-#endif
-#if 0
- style->page_width = 5.5;
- style->page_height = 8.5;
-#endif
- style->orientation_portrait = FALSE;
-
- style->header_font = gnome_font_find_closest_from_weight_slant ("Helvetica", GNOME_FONT_BOOK, FALSE, 6);
-
- style->left_header = g_strdup("");
- style->center_header = g_strdup("");
- style->right_header = g_strdup("");
-
- style->footer_font = gnome_font_find_closest_from_weight_slant ("Helvetica", GNOME_FONT_BOOK, FALSE, 6);
-
- style->left_footer = g_strdup("");
- style->center_footer = g_strdup("");
- style->right_footer = g_strdup("");
- style->reverse_on_even_pages = FALSE;
- filename = g_concat_dir_and_file(EVOLUTION_ECPSDIR, "medbook.ecps");
- styledoc = xmlParseFile(filename);
- g_free(filename);
- if (styledoc) {
- xmlNodePtr stylenode = xmlDocGetRootElement(styledoc);
- xmlNodePtr node;
- for (node = stylenode->children; node; node = node->next) {
- char *data = xmlNodeGetContent ( node );
- if ( !strcmp( node->name, "title" ) ) {
- get_string(data, &(style->title));
- } else if ( !strcmp( node->name, "type" ) ) {
- lowify( data );
- if ( !strcmp( data, "cards" ) )
- style->type = E_CONTACT_PRINT_TYPE_CARDS;
- else if ( !strcmp( data, "memo_style" ) )
- style->type = E_CONTACT_PRINT_TYPE_MEMO_STYLE;
- else if ( !strcmp( data, "phone_list" ) )
- style->type = E_CONTACT_PRINT_TYPE_PHONE_LIST;
- } else if ( !strcmp( node->name, "sections_start_new_page" ) ) {
- style->sections_start_new_page = get_bool(data);
- } else if ( !strcmp( node->name, "num_columns" ) ) {
- style->num_columns = get_integer(data);
- } else if ( !strcmp( node->name, "blank_forms" ) ) {
- style->blank_forms = get_integer(data);
- } else if ( !strcmp( node->name, "letter_tabs" ) ) {
- style->letter_tabs = get_bool(data);
- } else if ( !strcmp( node->name, "letter_headings" ) ) {
- style->letter_headings = get_bool(data);
- } else if ( !strcmp( node->name, "headings_font" ) ) {
- get_font( data, &(style->headings_font) );
- } else if ( !strcmp( node->name, "body_font" ) ) {
- get_font( data, &(style->body_font) );
- } else if ( !strcmp( node->name, "print_using_grey" ) ) {
- style->print_using_grey = get_bool(data);
- } else if ( !strcmp( node->name, "paper_width" ) ) {
- style->paper_width = get_float(data);
- } else if ( !strcmp( node->name, "paper_height" ) ) {
- style->paper_height = get_float(data);
- } else if ( !strcmp( node->name, "top_margin" ) ) {
- style->top_margin = get_float(data);
- } else if ( !strcmp( node->name, "left_margin" ) ) {
- style->left_margin = get_float(data);
- } else if ( !strcmp( node->name, "bottom_margin" ) ) {
- style->bottom_margin = get_float(data);
- } else if ( !strcmp( node->name, "right_margin" ) ) {
- style->right_margin = get_float(data);
- } else if ( !strcmp( node->name, "page_width" ) ) {
- style->page_width = get_float(data);
- } else if ( !strcmp( node->name, "page_height" ) ) {
- style->page_height = get_float(data);
- } else if ( !strcmp( node->name, "orientation" ) ) {
- if ( data ) {
- lowify(data);
- style->orientation_portrait = strcmp(data, "landscape");
- } else {
- style->orientation_portrait = TRUE;
- }
- } else if ( !strcmp( node->name, "header_font" ) ) {
- get_font( data, &(style->header_font) );
- } else if ( !strcmp( node->name, "left_header" ) ) {
- get_string(data, &(style->left_header));
- } else if ( !strcmp( node->name, "center_header" ) ) {
- get_string(data, &(style->center_header));
- } else if ( !strcmp( node->name, "right_header" ) ) {
- get_string(data, &(style->right_header));
- } else if ( !strcmp( node->name, "footer_font" ) ) {
- get_font( data, &(style->footer_font) );
- } else if ( !strcmp( node->name, "left_footer" ) ) {
- get_string(data, &(style->left_footer));
- } else if ( !strcmp( node->name, "center_footer" ) ) {
- get_string(data, &(style->center_footer));
- } else if ( !strcmp( node->name, "right_footer" ) ) {
- get_string(data, &(style->right_footer));
- } else if ( !strcmp( node->name, "reverse_on_even_pages" ) ) {
- style->reverse_on_even_pages = get_bool(data);
- }
- if ( data )
- xmlFree (data);
- }
- xmlFreeDoc(styledoc);
- }
-}
-
-static gint
-e_contact_print_close(GnomeDialog *dialog, gpointer data)
-{
- return FALSE;
-}
-
-static void
-e_contact_print_response(GtkWidget *dialog, gint response_id, gpointer data)
-{
- EContactPrintContext *ctxt = g_new(EContactPrintContext, 1);
- EContactPrintStyle *style = g_new(EContactPrintStyle, 1);
- GnomePrintJob *master;
- GnomePrintConfig *config;
- GnomePrintContext *pc;
- gboolean uses_book = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(dialog), "uses_book"));
- EBook *book = NULL;
- char *query = NULL;
- ECard *card = NULL;
- gdouble font_size;
-
-
- if (uses_book) {
- book = g_object_get_data(G_OBJECT(dialog), "book");
- query = g_object_get_data(G_OBJECT(dialog), "query");
- } else {
- card = g_object_get_data(G_OBJECT(dialog), "card");
- }
- switch( response_id ) {
- case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG(dialog));
- master = gnome_print_job_new( config );
- pc = gnome_print_job_get_context( master );
- e_contact_build_style(style);
-
- ctxt->x = 0;
- ctxt->y = 0;
- ctxt->column = 0;
- ctxt->style = style;
- ctxt->master = master;
- ctxt->first_section = TRUE;
- ctxt->first_char_on_page = 'A' - 1;
- ctxt->type = GNOME_PRINT_DIALOG_RESPONSE_PRINT;
-
- font_size = 72 * ctxt->style->page_height / 27.0 / 2.0;
- ctxt->letter_heading_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5);
- ctxt->letter_tab_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), font_size);
-
- ctxt->pc = pc;
-#warning FIXME gnome_print_multipage_new_from_sizes
-#if 0
- ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc,
- 72 * style->paper_width,
- 72 * style->paper_height,
- 72 * style->page_width,
- 72 * style->page_height));
-#endif
-
- ctxt->book = book;
- ctxt->query = query;
- if (uses_book) {
- ctxt->cards = NULL;
- e_contact_do_print(book, ctxt->query, ctxt);
- } else {
- ctxt->cards = g_list_append(NULL, card);
- complete_sequence(NULL, E_BOOK_VIEW_STATUS_SUCCESS, ctxt);
- }
- gtk_widget_destroy (dialog);
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
- config = gnome_print_dialog_get_config (GNOME_PRINT_DIALOG(dialog));
- master = gnome_print_job_new( config );
- pc = gnome_print_job_get_context( master );
- e_contact_build_style(style);
-
- ctxt->x = 0;
- ctxt->y = 0;
- ctxt->column = 0;
- ctxt->style = style;
- ctxt->master = master;
- ctxt->first_section = TRUE;
- ctxt->first_char_on_page = 'A' - 1;
- ctxt->type = GNOME_PRINT_DIALOG_RESPONSE_PREVIEW;
-
- font_size = 72 * ctxt->style->page_height / 27.0 / 2.0;
- ctxt->letter_heading_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5);
- ctxt->letter_tab_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), font_size);
-
- ctxt->pc = pc;
-#warning FIXME gnome_print_multipage_new_from_sizes
-#if 0
- ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc,
- 72 * style->paper_width,
- 72 * style->paper_height,
- 72 * style->page_width,
- 72 * style->page_height));
-#endif
- ctxt->book = book;
- ctxt->query = g_strdup(query);
- if (uses_book) {
- ctxt->cards = NULL;
- g_object_ref(book);
- e_contact_do_print(book, ctxt->query, ctxt);
- } else {
- ctxt->cards = g_list_append(NULL, card);
- g_object_ref(card);
- complete_sequence(NULL, E_BOOK_VIEW_STATUS_SUCCESS, ctxt);
- }
- break;
- case GNOME_PRINT_DIALOG_RESPONSE_CANCEL:
- if (uses_book)
- g_object_unref(book);
- else
- g_object_unref(card);
- g_free(query);
- gtk_widget_destroy (dialog);
- g_free(style);
- g_free(ctxt);
- break;
- }
-}
-
-GtkWidget *
-e_contact_print_dialog_new(EBook *book, char *query)
-{
- GtkWidget *dialog;
-
-
- dialog = gnome_print_dialog_new(NULL, _("Print cards"), GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES);
- gnome_print_dialog_construct_range_any(GNOME_PRINT_DIALOG(dialog), GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_SELECTION,
- NULL, NULL, NULL);
-
- g_object_ref(book);
- g_object_set_data(G_OBJECT(dialog), "uses_book", (void *) 1);
- g_object_set_data(G_OBJECT(dialog), "book", book);
- g_object_set_data(G_OBJECT(dialog), "query", g_strdup(query));
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_response), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_close), NULL);
- return dialog;
-}
-
-void
-e_contact_print_preview(EBook *book, char *query)
-{
- EContactPrintContext *ctxt = g_new(EContactPrintContext, 1);
- EContactPrintStyle *style = g_new(EContactPrintStyle, 1);
- GnomePrintJob *master;
- GnomePrintContext *pc;
- GnomePrintConfig *config;
- gdouble font_size;
-
- master = gnome_print_job_new(NULL);
- config = gnome_print_job_get_config (master);
- gnome_print_config_set_int (config, GNOME_PRINT_KEY_NUM_COPIES, 1);
- pc = gnome_print_job_get_context (master);
- e_contact_build_style (style);
-
- ctxt->x = 0;
- ctxt->y = 0;
- ctxt->column = 0;
- ctxt->style = style;
- ctxt->master = master;
- ctxt->first_section = TRUE;
- ctxt->first_char_on_page = 'A' - 1;
- ctxt->type = GNOME_PRINT_DIALOG_RESPONSE_PREVIEW;
-
- font_size = 72 * ctxt->style->page_height / 27.0 / 2.0;
- ctxt->letter_heading_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5);
- ctxt->letter_tab_font = gnome_font_find (gnome_font_get_name(ctxt->style->headings_font), font_size);
-
- ctxt->pc = pc;
-#warning FIXME gnome_print_multipage_new_from_sizes
-#if 0
- ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc,
- 72 * style->paper_width,
- 72 * style->paper_height,
- 72 * style->page_width,
- 72 * style->page_height));
-#endif
- ctxt->book = book;
- ctxt->query = g_strdup(query);
- ctxt->cards = NULL;
- g_object_ref(book);
- e_contact_do_print(book, ctxt->query, ctxt);
-}
-
-GtkWidget *
-e_contact_print_card_dialog_new(ECard *card)
-{
- GtkWidget *dialog;
-
- dialog = gnome_print_dialog_new(NULL, _("Print card"), GNOME_PRINT_DIALOG_COPIES);
-
- card = e_card_duplicate(card);
- g_object_set_data(G_OBJECT(dialog), "card", card);
- g_object_set_data(G_OBJECT(dialog), "uses_book", (void *) 0);
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_response), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_close), NULL);
- return dialog;
-}
-
-/* FIXME: Print all the contacts selected. */
-GtkWidget *
-e_contact_print_card_list_dialog_new(GList *list)
-{
- GtkWidget *dialog;
- ECard *card;
-
- if (list == NULL)
- return NULL;
-
- dialog = gnome_print_dialog_new(NULL, _("Print card"), GNOME_PRINT_DIALOG_COPIES);
-
- card = e_card_duplicate(list->data);
- g_object_set_data(G_OBJECT(dialog), "card", card);
- g_object_set_data(G_OBJECT(dialog), "uses_book", (void *) 0);
- g_signal_connect(dialog,
- "response", G_CALLBACK(e_contact_print_response), NULL);
- g_signal_connect(dialog,
- "close", G_CALLBACK(e_contact_print_close), NULL);
- return dialog;
-}
diff --git a/addressbook/printing/e-contact-print.glade b/addressbook/printing/e-contact-print.glade
deleted file mode 100644
index d1721e3509..0000000000
--- a/addressbook/printing/e-contact-print.glade
+++ /dev/null
@@ -1,2018 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
-
-<glade-interface>
- <widget class="GtkDialog" id="print-edit-style">
- <property name="visible">no</property>
- <property name="title" translatable="yes">Page Setup:</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="modal">no</property>
- <property name="allow_shrink">no</property>
- <property name="allow_grow">no</property>
- <property name="window-position">GTK_WIN_POS_NONE</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button1">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button2">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-apply</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="button3">
- <property name="can_default">yes</property>
- <property name="can_focus">yes</property>
- <property name="visible">yes</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox-contact-print-style-editor">
- <property name="homogeneous">no</property>
- <property name="spacing">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="border_width">5</property>
- <property name="homogeneous">no</property>
- <property name="spacing">16</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label8">
- <property name="label" translatable="yes">Style name:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="label-style-name">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkNotebook" id="notebook1">
- <property name="can_focus">yes</property>
- <property name="show_tabs">yes</property>
- <property name="show_border">yes</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">no</property>
- <property name="tab_hborder">2</property>
- <property name="tab_vborder">2</property>
- <property name="enable-popup">no</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox2">
- <property name="border_width">5</property>
- <property name="homogeneous">no</property>
- <property name="spacing">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame5">
- <property name="label" translatable="yes">Preview:</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <placeholder />
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="homogeneous">yes</property>
- <property name="spacing">7</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame6">
- <property name="label" translatable="yes">Options</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">8</property>
- <property name="homogeneous">no</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">0</property>
- <property name="n-rows">6</property>
- <property name="n-columns">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="label" translatable="yes">Include:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="label" translatable="yes">Sections:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton1">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Immediately follow each other</property>
- <property name="active">yes</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton1">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Letter tabs on side</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton2">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Headings for each letter</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton2">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Start on a new page</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">5</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label6">
- <property name="label" translatable="yes">Number of columns:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="label" translatable="yes">Blank forms at end:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkSpinButton" id="spinbutton2">
- <property name="can_focus">yes</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">no</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="wrap">no</property>
- <property name="snap_to_ticks">no</property>
- <property name="visible">yes</property>
- <property name="adjustment">2 0 100 1 10 10</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment5">
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkSpinButton" id="spinbutton1">
- <property name="can_focus">yes</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">no</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="wrap">no</property>
- <property name="width-request">45</property>
- <property name="snap_to_ticks">no</property>
- <property name="visible">yes</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="homogeneous">no</property>
- <property name="spacing">8</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame7">
- <property name="label" translatable="yes">Fonts</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table2">
- <property name="border_width">8</property>
- <property name="homogeneous">no</property>
- <property name="row_spacing">13</property>
- <property name="column_spacing">8</property>
- <property name="n-rows">2</property>
- <property name="n-columns">2</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment7">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button6">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">F_ont...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment8">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button5">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_Font...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="width-request">90</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox4">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label10">
- <property name="label" translatable="yes">Headings</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry3">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes">10 pt. Tahoma</property>
- <property name="width-request">100</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox5">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label9">
- <property name="label" translatable="yes">Body</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry2">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes">8 pt. Tahoma</property>
- <property name="width-request">100</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame8">
- <property name="label" translatable="yes">Shading</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton3">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Print using gray shading</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="label" translatable="yes">Format</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox3">
- <property name="homogeneous">yes</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame9">
- <property name="label" translatable="yes">Paper</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox16">
- <property name="border_width">10</property>
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox17">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label21">
- <property name="label" translatable="yes">Type:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTreeView" id="clist1">
- <property name="can_focus">yes</property>
- <property name="headers-visible">no</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label26">
- <property name="child_name">CList:title</property>
- <property name="label" translatable="yes">label26</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget1">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget2">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox18">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="label" translatable="yes">Dimensions:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox5">
- <property name="homogeneous">yes</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label27">
- <property name="label" translatable="yes">Width:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry9">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label28">
- <property name="label" translatable="yes">Height:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry10">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox19">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="label" translatable="yes">Paper source:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCombo" id="combo1">
- <property name="value_in_list">no</property>
- <property name="case_sensitive">no</property>
- <property name="enable_arrow_keys">yes</property>
- <property name="enable_arrows_always">no</property>
- <property name="allow_empty">yes</property>
- <property name="visible">yes</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="combo-entry1">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="list">
- <widget class="GtkList" id="convertwidget3">
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkListItem" id="convertwidget4">
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="convertwidget5">
- <property name="label" translatable="yes"></property>
- <property name="xalign">0.0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame10">
- <property name="label" translatable="yes">Margins</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table4">
- <property name="border_width">15</property>
- <property name="homogeneous">yes</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">9</property>
- <property name="n-rows">2</property>
- <property name="n-columns">4</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label29">
- <property name="label" translatable="yes">Top:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label30">
- <property name="label" translatable="yes">Bottom:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="label" translatable="yes">Left:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry11">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry12">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry13">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry14">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="label" translatable="yes">Right:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox7">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkFrame" id="frame11">
- <property name="label" translatable="yes">Page</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox8">
- <property name="border_width">10</property>
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox20">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label33">
- <property name="label" translatable="yes">Size:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTreeView" id="clist2">
- <property name="can_focus">yes</property>
- <property name="headers-visible">no</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label35">
- <property name="child_name">CList:title</property>
- <property name="label" translatable="yes">label26</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child internal-child="hscrollbar">
- <widget class="GtkHScrollbar" id="convertwidget6">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
-
- <child internal-child="vscrollbar">
- <widget class="GtkVScrollbar" id="convertwidget7">
- <property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox21">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label34">
- <property name="label" translatable="yes">Dimensions:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox6">
- <property name="homogeneous">yes</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label36">
- <property name="label" translatable="yes">Width:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry15">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label37">
- <property name="label" translatable="yes">Height:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry16">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="width-request">1</property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame12">
- <property name="label" translatable="yes">Orientation</property>
- <property name="label_xalign">0</property>
- <property name="shadow">GTK_SHADOW_ETCHED_IN</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkHBox" id="hbox4">
- <property name="homogeneous">no</property>
- <property name="spacing">10</property>
- <property name="visible">yes</property>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox9">
- <property name="homogeneous">no</property>
- <property name="spacing">5</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment9">
- <property name="xalign">0</property>
- <property name="yalign">1</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton3">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Portrait</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment10">
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkRadioButton" id="radiobutton4">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Landscape</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label2">
- <property name="label" translatable="yes">Paper</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox10">
- <property name="border_width">8</property>
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkTable" id="table5">
- <property name="homogeneous">yes</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
- <property name="n-rows">4</property>
- <property name="n-columns">3</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkAlignment" id="alignment15">
- <property name="xalign">0</property>
- <property name="yalign">1</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button11">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">F_ont...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text10">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text11">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text12">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text13">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand|fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text14">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">5</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTextView" id="text15">
- <property name="can_focus">yes</property>
- <property name="editable">no</property>
- <property name="text" translatable="yes"></property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="height-request">50</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment16">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox14">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="label" translatable="yes">Header</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry7">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment17">
- <property name="xalign">0.5</property>
- <property name="yalign">1</property>
- <property name="xscale">1</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkVBox" id="vbox15">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkLabel" id="label15">
- <property name="label" translatable="yes">Footer:</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="entry8">
- <property name="can_focus">yes</property>
- <property name="editable">yes</property>
- <property name="text" translatable="yes"></property>
- <property name="max-length">0</property>
- <property name="visibility">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">expand|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment14">
- <property name="xalign">0</property>
- <property name="yalign">1</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkButton" id="button10">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">_Font...</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="visible">yes</property>
- <property name="use_underline">yes</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_padding">0</property>
- <property name="y_padding">0</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox7">
- <property name="homogeneous">no</property>
- <property name="spacing">0</property>
- <property name="visible">yes</property>
-
- <child>
- <widget class="GtkToolbar" id="toolbar1">
- <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
- <property name="toolbar-style">GTK_TOOLBAR_ICONS</property>
- <property name="visible">yes</property>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
-
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">yes</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="checkbutton4">
- <property name="can_focus">yes</property>
- <property name="label" translatable="yes">Reverse on even pages</property>
- <property name="active">no</property>
- <property name="draw_indicator">yes</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">no</property>
- <property name="fill">no</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="label" translatable="yes">Header/Footer</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">no</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="visible">yes</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">yes</property>
- <property name="fill">yes</property>
- </packing>
- </child>
- </widget>
-</glade-interface>
diff --git a/addressbook/printing/e-contact-print.h b/addressbook/printing/e-contact-print.h
deleted file mode 100644
index 12f13f4573..0000000000
--- a/addressbook/printing/e-contact-print.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * e-contact-print.h
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef E_CONTACT_PRINT_H
-#define E_CONTACT_PRINT_H
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-#include <addressbook/backend/ebook/e-book.h>
-#include <addressbook/backend/ebook/e-card.h>
-#include "e-contact-print-types.h"
-
-GtkWidget *e_contact_print_dialog_new(EBook *book, char *query);
-void e_contact_print_preview(EBook *book, char *query);
-GtkWidget *e_contact_print_card_dialog_new(ECard *card);
-GtkWidget *e_contact_print_card_list_dialog_new(GList *list);
-
-#endif /* E_CONTACT_PRINT_H */
diff --git a/addressbook/printing/medbook.ecps b/addressbook/printing/medbook.ecps
deleted file mode 100644
index ef76c0b46e..0000000000
--- a/addressbook/printing/medbook.ecps
+++ /dev/null
@@ -1,30 +0,0 @@
-<style>
-<title/>
-<type>cards</type>
-<sections_start_new_page>FALSE</sections_start_new_page>
-<num_columns>2</num_columns>
-<blank_forms>2</blank_forms>
-<letter_tabs>TRUE</letter_tabs>
-<letter_headings>TRUE</letter_headings>
-<headings_font>Helvetica Bold 12</headings_font>
-<body_font>Helvetica 8</body_font>
-<print_using_grey>TRUE</print_using_grey>
-<paper_width>8.5</paper_width>
-<paper_height>11</paper_height>
-<top_margin>0.5</top_margin>
-<left_margin>0.5</left_margin>
-<bottom_margin>0.5</bottom_margin>
-<right_margin>0.5</right_margin>
-<page_width>8.5</page_width>
-<page_height>11</page_height>
-<orientation>portrait</orientation>
-<header_font>Helvetica 8</header_font>
-<left_header/>
-<center_header/>
-<right_header/>
-<footer_font>Helvetica 8</footer_font>
-<left_footer/>
-<center_footer>[Page #]</center_footer>
-<right_footer/>
-<reverse_on_even_pages>FALSE</reverse_on_even_pages>
-</style>
diff --git a/addressbook/printing/phonelist.ecps b/addressbook/printing/phonelist.ecps
deleted file mode 100644
index 980750a6b2..0000000000
--- a/addressbook/printing/phonelist.ecps
+++ /dev/null
@@ -1,29 +0,0 @@
-<style>
-<title/>
-<type>phone_list</type>
-<sections_start_new_page>FALSE</sections_start_new_page>
-<num_columns>2</num_columns>
-<letter_tabs>FALSE</letter_tabs>
-<letter_headings>TRUE</letter_headings>
-<headings_font>Helvetica Bold 10</headings_font>
-<body_font>Helvetica 8</body_font>
-<print_using_grey>TRUE</print_using_grey>
-<paper_width>8.5</paper_width>
-<paper_height>11</paper_height>
-<top_margin>0.5</top_margin>
-<left_margin>0.5</left_margin>
-<bottom_margin>0.5</bottom_margin>
-<right_margin>0.5</right_margin>
-<page_width>8.5</page_width>
-<page_height>11</page_height>
-<orientation>portrait</orientation>
-<header_font>Helvetica 8</header_font>
-<left_header/>
-<center_header/>
-<right_header/>
-<footer_font>Helvetica 8</footer_font>
-<left_footer>[User Name]</left_footer>
-<center_footer>[Page #]</center_footer>
-<right_footer>[Date Printed]</right_footer>
-<reverse_on_even_pages>FALSE</reverse_on_even_pages>
-</style>
diff --git a/addressbook/printing/smallbook.ecps b/addressbook/printing/smallbook.ecps
deleted file mode 100644
index 0bb19aa92e..0000000000
--- a/addressbook/printing/smallbook.ecps
+++ /dev/null
@@ -1,30 +0,0 @@
-<style>
-<title/>
-<type>cards</type>
-<sections_start_new_page>FALSE</sections_start_new_page>
-<num_columns>1</num_columns>
-<blank_forms>2</blank_forms>
-<letter_tabs>TRUE</letter_tabs>
-<letter_headings>TRUE</letter_headings>
-<headings_font>Helvetica Bold 8</headings_font>
-<body_font>Helvetica 6</body_font>
-<print_using_grey>TRUE</print_using_grey>
-<paper_width>8.5</paper_width>
-<paper_height>11</paper_height>
-<top_margin>0.5</top_margin>
-<left_margin>0.5</left_margin>
-<bottom_margin>0.5</bottom_margin>
-<right_margin>0.5</right_margin>
-<page_width>2.75</page_width>
-<page_height>4.25</page_height>
-<orientation>portrait</orientation>
-<header_font>Helvetica 6</header_font>
-<left_header/>
-<center_header/>
-<right_header/>
-<footer_font>Helvetica 6</footer_font>
-<left_footer/>
-<center_footer>[Page #]</center_footer>
-<right_footer/>
-<reverse_on_even_pages>FALSE</reverse_on_even_pages>
-</style>
diff --git a/addressbook/printing/test-contact-print-style-editor.c b/addressbook/printing/test-contact-print-style-editor.c
deleted file mode 100644
index f49625434e..0000000000
--- a/addressbook/printing/test-contact-print-style-editor.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-contact-print-style-editor.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-app.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <bonobo/bonobo-main.h>
-#include "e-contact-print-style-editor.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GtkWidget *editor;
-
-static void destroy_callback(GtkWidget *app, gpointer data)
-{
- static int count = 2;
- count --;
- if ( count <= 0 )
- exit(0);
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Contact Print Style Editor Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the contact print style editor widget" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GtkWidget *app;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_program_init ("Contact Print Style Editor Test", VERSION,
- LIBGNOMEUI_MODULE,
- argc, argv,
- NULL);
-
- glade_init ();
-
- app = gnome_app_new("Contact Print Style Editor Test", NULL);
-
- editor = e_contact_print_style_editor_new("");
-
- gnome_app_set_contents( GNOME_APP( app ), editor );
-
- /* Connect the signals */
- g_signal_connect( app, "destroy",
- G_CALLBACK ( destroy_callback ),
- ( gpointer ) app );
-
- gtk_widget_show_all( app );
-
- bonobo_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c
deleted file mode 100644
index a1dede7bde..0000000000
--- a/addressbook/printing/test-print.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * test-print.c
- * Copyright (C) 2000 Ximian, Inc.
- * Author: Chris Lahey <clahey@ximian.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <gtk/gtkmain.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <glade/glade.h>
-#include <bonobo/bonobo-main.h>
-#include "e-contact-print.h"
-
-/* This is a horrible thing to do, but it is just a test. */
-GtkWidget *print;
-
-static gint test_close(GnomeDialog *dialog, gpointer data)
-{
- exit(0);
- return 1;
-}
-
-#if 0
-static void about_callback( GtkWidget *widget, gpointer data )
-{
-
- const gchar *authors[] =
- {
- "Christopher James Lahey <clahey@umich.edu>",
- NULL
- };
-
- GtkWidget *about =
- gnome_about_new ( _( "Contact Print Test" ), VERSION,
- _( "Copyright (C) 2000, Ximian, Inc." ),
- authors,
- _( "This should test the contact print code" ),
- NULL);
- gtk_widget_show (about);
-}
-#endif
-
-int main( int argc, char *argv[] )
-{
- GList *shown_fields = NULL;
-
- /* bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);*/
-
- gnome_program_init ("Contact Print Test", VERSION,
- LIBGNOMEUI_MODULE,
- argc, argv,
- NULL);
-
- glade_init ();
-
- shown_fields = g_list_append(shown_fields, "First field");
- shown_fields = g_list_append(shown_fields, "Second field");
- shown_fields = g_list_append(shown_fields, "Third field");
- shown_fields = g_list_append(shown_fields, "Fourth field");
-
- print = e_contact_print_dialog_new(NULL, NULL);
- gtk_widget_show_all(print);
- g_signal_connect(print, "close", G_CALLBACK(test_close), NULL);
-
- bonobo_main();
-
- /* Not reached. */
- return 0;
-}
diff --git a/addressbook/tools/.cvsignore b/addressbook/tools/.cvsignore
deleted file mode 100644
index 8e22df3d63..0000000000
--- a/addressbook/tools/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-evolution-addressbook-export
diff --git a/addressbook/tools/Makefile.am b/addressbook/tools/Makefile.am
deleted file mode 100644
index 79a1c746ad..0000000000
--- a/addressbook/tools/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-bin_PROGRAMS = \
- evolution-addressbook-export
-
-INCLUDES = \
- -DG_LOG_DOMAIN=\"evolution-addressbook-tools\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DSYSCONFDIR=\""$(sysconfdir)"\" \
- -DDATADIR=\""$(datadir)"\" \
- -DLIBDIR=\""$(libdir)"\" \
- -I$(top_srcdir)/addressbook \
- -I$(top_srcdir)/addressbook/backend \
- -I$(top_builddir)/addressbook/backend \
- -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED \
- $(GNOME_FULL_CFLAGS)
-
-evolution_addressbook_export_SOURCES = \
- evolution-addressbook-export.c \
- evolution-addressbook-export-list-cards.c \
- evolution-addressbook-export-list-folders.c \
- evolution-addressbook-export.h
-
-evolution_addressbook_export_LDADD = \
- $(GNOME_FULL_LIBS) \
- $(top_builddir)/addressbook/backend/ebook/libebook.la \
- $(top_builddir)/widgets/menus/libmenus.la \
- $(top_builddir)/camel/libcamel.la \
- $(top_builddir)/libversit/libversit.la \
- $(top_builddir)/e-util/ename/libename.la \
- $(top_builddir)/e-util/libeutil.la
-
diff --git a/addressbook/tools/evolution-addressbook-export-list-cards.c b/addressbook/tools/evolution-addressbook-export-list-cards.c
deleted file mode 100644
index c51393d047..0000000000
--- a/addressbook/tools/evolution-addressbook-export-list-cards.c
+++ /dev/null
@@ -1,780 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export-list-cards.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <libbonobo.h>
-#include <libgnome/libgnome.h>
-
-#include <ebook/e-book.h>
-#include <ebook/e-card-simple.h>
-#include <ebook/e-book-util.h>
-
-#include "evolution-addressbook-export.h"
-
-#define COMMA_SEPARATOR ","
-
-typedef enum _CARD_FORMAT CARD_FORMAT;
-typedef enum _DeliveryAddressField DeliveryAddressField;
-typedef enum _ECardSimpleFieldCSV ECardSimpleFieldCSV;
-typedef struct _ECardCSVFieldData ECardCSVFieldData;
-
-enum _CARD_FORMAT
-{
- CARD_FORMAT_CSV,
- CARD_FORMAT_VCARD
-};
-
-enum _DeliveryAddressField
-{
- DELIVERY_ADDRESS_STREET,
- DELIVERY_ADDRESS_EXT,
- DELIVERY_ADDRESS_CITY,
- DELIVERY_ADDRESS_REGION,
- DELIVERY_ADDRESS_CODE,
- DELIVERY_ADDRESS_COUNTRY
-};
-
-enum _ECardSimpleFieldCSV
-{
- E_CARD_SIMPLE_FIELD_CSV_FILE_AS,
- E_CARD_SIMPLE_FIELD_CSV_FULL_NAME,
- E_CARD_SIMPLE_FIELD_CSV_EMAIL,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_PRIMARY,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_ASSISTANT,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_CALLBACK,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_COMPANY,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME,
- E_CARD_SIMPLE_FIELD_CSV_ORG,
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS, */
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY,
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME, */
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_MOBILE,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_CAR,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_FAX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_FAX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_2,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_2,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_ISDN,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER_FAX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_PAGER,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_RADIO,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_TELEX,
- E_CARD_SIMPLE_FIELD_CSV_PHONE_TTYTDD,
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER, */
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_STREET,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_EXT,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_CITY,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_REGION,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_POSTCODE,
- E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_COUNTRY,
- E_CARD_SIMPLE_FIELD_CSV_EMAIL_2,
- E_CARD_SIMPLE_FIELD_CSV_EMAIL_3,
- E_CARD_SIMPLE_FIELD_CSV_URL,
- E_CARD_SIMPLE_FIELD_CSV_ORG_UNIT,
- E_CARD_SIMPLE_FIELD_CSV_OFFICE,
- E_CARD_SIMPLE_FIELD_CSV_TITLE,
- E_CARD_SIMPLE_FIELD_CSV_ROLE,
- E_CARD_SIMPLE_FIELD_CSV_MANAGER,
- E_CARD_SIMPLE_FIELD_CSV_ASSISTANT,
- E_CARD_SIMPLE_FIELD_CSV_NICKNAME,
- E_CARD_SIMPLE_FIELD_CSV_SPOUSE,
- E_CARD_SIMPLE_FIELD_CSV_NOTE,
- E_CARD_SIMPLE_FIELD_CSV_CALURI,
- E_CARD_SIMPLE_FIELD_CSV_FBURL,
- /*E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY, */
- E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_YEAR,
- E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_MONTH,
- E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_DAY,
- /*E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE, */
- E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR,
- E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH,
- E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY,
- E_CARD_SIMPLE_FIELD_CSV_MAILER,
- E_CARD_SIMPLE_FIELD_CSV_NAME_OR_ORG,
- E_CARD_SIMPLE_FIELD_CSV_CATEGORIES,
- E_CARD_SIMPLE_FIELD_CSV_FAMILY_NAME,
- E_CARD_SIMPLE_FIELD_CSV_GIVEN_NAME,
- E_CARD_SIMPLE_FIELD_CSV_ADDITIONAL_NAME,
- E_CARD_SIMPLE_FIELD_CSV_NAME_SUFFIX,
- E_CARD_SIMPLE_FIELD_CSV_WANTS_HTML,
- E_CARD_SIMPLE_FIELD_CSV_IS_LIST,
- E_CARD_SIMPLE_FIELD_CSV_LAST
-};
-
-struct _ECardCSVFieldData
-{
- gint csv_field;
- gint simple_field;
- gchar *csv_name;
-};
-
-#define NOMAP -1
-static ECardCSVFieldData csv_field_data[] = {
- {E_CARD_SIMPLE_FIELD_CSV_FILE_AS, E_CARD_SIMPLE_FIELD_FILE_AS, ""},
- {E_CARD_SIMPLE_FIELD_CSV_FULL_NAME, E_CARD_SIMPLE_FIELD_CSV_FULL_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_EMAIL, E_CARD_SIMPLE_FIELD_EMAIL, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_PRIMARY, E_CARD_SIMPLE_FIELD_PHONE_PRIMARY,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_ASSISTANT,
- E_CARD_SIMPLE_FIELD_PHONE_ASSISTANT, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_CALLBACK,
- E_CARD_SIMPLE_FIELD_PHONE_CALLBACK, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_COMPANY, E_CARD_SIMPLE_FIELD_PHONE_COMPANY,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME, E_CARD_SIMPLE_FIELD_PHONE_HOME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ORG, E_CARD_SIMPLE_FIELD_ORG, ""},
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS, */
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET, NOMAP,
- "Business Address"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT, NOMAP,
- "Business Address2"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY, NOMAP,
- "Business Address City"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION, NOMAP,
- "Business Address State"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE, NOMAP,
- "Business Address PostCode"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY, NOMAP,
- "Business Address Country"},
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME, */
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET, NOMAP, "Home Address"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT, NOMAP, "Home Address2"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY, NOMAP, "Home Address City"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION, NOMAP,
- "Home Address State"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE, NOMAP,
- "Home Address PostCode"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY, NOMAP,
- "Home Address Country"},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_MOBILE, E_CARD_SIMPLE_FIELD_PHONE_MOBILE,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_CAR, E_CARD_SIMPLE_FIELD_PHONE_CAR, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_FAX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_HOME_FAX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_2,
- E_CARD_SIMPLE_FIELD_PHONE_BUSINESS_2, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME_2, E_CARD_SIMPLE_FIELD_PHONE_HOME_2,
- ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_ISDN, E_CARD_SIMPLE_FIELD_PHONE_ISDN, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER, E_CARD_SIMPLE_FIELD_PHONE_OTHER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_OTHER_FAX,
- E_CARD_SIMPLE_FIELD_PHONE_OTHER_FAX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_PAGER, E_CARD_SIMPLE_FIELD_PHONE_PAGER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_RADIO, E_CARD_SIMPLE_FIELD_PHONE_RADIO, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_TELEX, E_CARD_SIMPLE_FIELD_PHONE_TELEX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_PHONE_TTYTDD, E_CARD_SIMPLE_FIELD_PHONE_TTYTDD,
- ""},
- /*E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER, */
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_STREET, NOMAP, "Other Address"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_EXT, NOMAP, "Other Address2"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_CITY, NOMAP,
- "Other Address City"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_REGION, NOMAP,
- "Other Address State"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_POSTCODE, NOMAP,
- "Other Address PostCode"},
- {E_CARD_SIMPLE_FIELD_CSV_ADDRESS_OTHER_COUNTRY, NOMAP,
- "Other Address Country"},
- {E_CARD_SIMPLE_FIELD_CSV_EMAIL_2, E_CARD_SIMPLE_FIELD_EMAIL_2, ""},
- {E_CARD_SIMPLE_FIELD_CSV_EMAIL_3, E_CARD_SIMPLE_FIELD_EMAIL_3, ""},
- {E_CARD_SIMPLE_FIELD_CSV_URL, E_CARD_SIMPLE_FIELD_URL, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ORG_UNIT, E_CARD_SIMPLE_FIELD_ORG_UNIT, ""},
- {E_CARD_SIMPLE_FIELD_CSV_OFFICE, E_CARD_SIMPLE_FIELD_OFFICE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_TITLE, E_CARD_SIMPLE_FIELD_TITLE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ROLE, E_CARD_SIMPLE_FIELD_ROLE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_MANAGER, E_CARD_SIMPLE_FIELD_MANAGER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ASSISTANT, E_CARD_SIMPLE_FIELD_ASSISTANT, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NICKNAME, E_CARD_SIMPLE_FIELD_NICKNAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_SPOUSE, E_CARD_SIMPLE_FIELD_SPOUSE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NOTE, E_CARD_SIMPLE_FIELD_NOTE, ""},
- {E_CARD_SIMPLE_FIELD_CSV_CALURI, E_CARD_SIMPLE_FIELD_CALURI, ""},
- {E_CARD_SIMPLE_FIELD_CSV_FBURL, E_CARD_SIMPLE_FIELD_FBURL, ""},
- /*E_CARD_SIMPLE_FIELD_ANNIVERSARY, */
- {E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_YEAR, NOMAP, "Anniversary Year"},
- {E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_MONTH, NOMAP, "Anniversary Month"},
- {E_CARD_SIMPLE_FIELD_CSV_ANNIVERSARY_DAY, NOMAP, "Anniversary Day"},
- /*E_CARD_SIMPLE_FIELD_BIRTH_DATE, */
- {E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR, NOMAP, "Birth Year"},
- {E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH, NOMAP, "Birth Month"},
- {E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY, NOMAP, "Birth Day"},
- {E_CARD_SIMPLE_FIELD_CSV_MAILER, E_CARD_SIMPLE_FIELD_MAILER, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NAME_OR_ORG, E_CARD_SIMPLE_FIELD_NAME_OR_ORG, ""},
- {E_CARD_SIMPLE_FIELD_CSV_CATEGORIES, E_CARD_SIMPLE_FIELD_CATEGORIES, ""},
- {E_CARD_SIMPLE_FIELD_CSV_FAMILY_NAME, E_CARD_SIMPLE_FIELD_FAMILY_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_GIVEN_NAME, E_CARD_SIMPLE_FIELD_GIVEN_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_ADDITIONAL_NAME,
- E_CARD_SIMPLE_FIELD_ADDITIONAL_NAME, ""},
- {E_CARD_SIMPLE_FIELD_CSV_NAME_SUFFIX, E_CARD_SIMPLE_FIELD_NAME_SUFFIX, ""},
- {E_CARD_SIMPLE_FIELD_CSV_WANTS_HTML, E_CARD_SIMPLE_FIELD_WANTS_HTML, ""},
- {E_CARD_SIMPLE_FIELD_CSV_IS_LIST, E_CARD_SIMPLE_FIELD_IS_LIST, ""},
- {E_CARD_SIMPLE_FIELD_CSV_LAST, NOMAP, ""}
-
-};
-
-static GSList *pre_defined_fields;
-
-/*function prototypes*/
-gint e_card_simple_csv_get_simple_field (ECardSimpleFieldCSV csv_field);
-gchar *e_card_simple_csv_get_name (ECardSimpleFieldCSV csv_field);
-gchar *e_card_simple_csv_get (ECardSimple * simple, ECardSimpleFieldCSV csv_field);
-gchar *e_card_simple_csv_get_header_line (GSList * csv_all_fields);
-gchar *e_card_simple_to_csv (ECardSimple * simple, GSList * csv_all_fields);
-gchar *e_card_get_csv (ECard * card, GSList * csv_all_fields);
-gchar *delivery_address_get_sub_field (const ECardDeliveryAddress * delivery_address, DeliveryAddressField sub_field);
-gchar *check_null_pointer (gchar * orig);
-gchar *quote_string (gchar * orig);
-int output_n_cards_file (FILE * outputfile, ECardCursor * cursor, int size, int begin_no, CARD_FORMAT format);
-static void fork_to_background (void);
-static void action_list_cards_get_cursor_cb (EBook * book, EBookStatus status, ECardCursor * cursor, ActionContext * p_actctx);
-static void action_list_cards_open_cb (EBook * book, EBookStatus status, ActionContext * p_actctx);
-static guint action_list_cards_run (ActionContext * p_actctx);
-void set_pre_defined_field (GSList ** pre_defined_fields);
-guint action_list_cards_init (ActionContext * p_actctx);
-
-
-/* function declarations*/
-gint
-e_card_simple_csv_get_simple_field (ECardSimpleFieldCSV csv_field)
-{
- return csv_field_data[csv_field].simple_field;
-}
-
-gchar *
-e_card_simple_csv_get_name (ECardSimpleFieldCSV csv_field)
-{
- gint simple_field;
- gchar *name;
- gchar *esc_name;
- gchar *quoted_name;
-
- ECardSimple *a_simple_card;
-
- simple_field = e_card_simple_csv_get_simple_field (csv_field);
-
- if (simple_field != NOMAP) {
- a_simple_card = E_CARD_SIMPLE (g_object_new (E_TYPE_CARD_SIMPLE, NULL));
- name = g_strdup (e_card_simple_get_ecard_field (a_simple_card, simple_field));
- g_object_unref (G_OBJECT (a_simple_card));
- } else {
- name = g_strdup (csv_field_data[csv_field].csv_name);
- }
- esc_name = g_strescape (name, NULL);
- g_free (name);
- quoted_name = quote_string (esc_name);
- g_free (esc_name);
- return quoted_name;
-}
-
-
-gchar *
-e_card_simple_csv_get (ECardSimple * simple, ECardSimpleFieldCSV csv_field)
-{
- gint simple_field;
- gchar *field_value;
- gchar *esc_field_value;
- gchar *quoted_field_value;
-
- const ECardDeliveryAddress *delivery_address = NULL;
-
- simple_field = e_card_simple_csv_get_simple_field (csv_field);
-
- if (simple_field != NOMAP) {
- field_value = e_card_simple_get (simple, simple_field);
- } else {
-
- switch (csv_field) {
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_STREET);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_EXT);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CITY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_REGION);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CODE);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_COUNTRY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_STREET);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_EXT);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CITY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_REGION);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_CODE);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY:
- delivery_address = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
- field_value = delivery_address_get_sub_field (delivery_address, DELIVERY_ADDRESS_COUNTRY);
- break;
- case E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR:
- if (simple->card->bday != NULL) {
- field_value = g_strdup_printf ("%04d", simple->card->bday->year);
- } else {
- field_value = g_strdup ("");
- }
- break;
-
- case E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH:
- if (simple->card->bday != NULL) {
- field_value = g_strdup_printf ("%02d", simple->card->bday->month);
- } else {
- field_value = g_strdup ("");
- }
- break;
-
- case E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY:
- if (simple->card->bday != NULL) {
- field_value = g_strdup_printf ("%02d", simple->card->bday->day);
- } else {
- field_value = g_strdup ("");
- }
- break;
-
- default:
- field_value = g_strdup ("");
- }
- }
-
- /*checking to avoid the NULL pointer */
- if (field_value == NULL)
- field_value = g_strdup ("");
-
- esc_field_value = g_strescape (field_value, NULL);
- g_free (field_value);
-
- quoted_field_value = quote_string (esc_field_value);
- g_free (esc_field_value);
-
- return quoted_field_value;
-}
-
-
-gchar *
-e_card_simple_csv_get_header_line (GSList * csv_all_fields)
-{
-
- guint field_number;
- gint csv_field;
- gchar **field_name_array;
- gchar *header_line;
-
- gint loop_counter;
-
- field_number = g_slist_length (csv_all_fields);
- field_name_array = g_new0 (gchar *, field_number + 1);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- csv_field = GPOINTER_TO_INT (g_slist_nth_data (csv_all_fields, loop_counter));
- *(field_name_array + loop_counter) = e_card_simple_csv_get_name (csv_field);
- }
-
- header_line = g_strjoinv (COMMA_SEPARATOR, field_name_array);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- g_free (*(field_name_array + loop_counter));
- }
- g_free (field_name_array);
-
- return header_line;
-
-}
-
-
-gchar *
-e_card_simple_to_csv (ECardSimple * simple, GSList * csv_all_fields)
-{
- guint field_number;
- gint csv_field;
- gchar **field_value_array;
- gchar *aline;
-
- gint loop_counter;
-
- field_number = g_slist_length (csv_all_fields);
- field_value_array = g_new0 (gchar *, field_number + 1);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- csv_field = GPOINTER_TO_INT (g_slist_nth_data (csv_all_fields, loop_counter));
- *(field_value_array + loop_counter) = e_card_simple_csv_get (simple, csv_field);
- }
-
- aline = g_strjoinv (COMMA_SEPARATOR, field_value_array);
-
- for (loop_counter = 0; loop_counter < field_number; loop_counter++) {
- g_free (*(field_value_array + loop_counter));
- }
- g_free (field_value_array);
-
- return aline;
-
-}
-
-
-gchar *
-e_card_get_csv (ECard * card, GSList * csv_all_fields)
-{
- ECardSimple *simple_card;
- gchar *aline;
-
- simple_card = e_card_simple_new (card);
- aline = e_card_simple_to_csv (simple_card, csv_all_fields);
- g_object_unref (G_OBJECT (simple_card));
- return aline;
-}
-
-
-gchar *
-check_null_pointer (gchar * orig)
-{
- gchar *result;
- if (orig == NULL)
- result = g_strdup ("");
- else
- result = g_strdup (orig);
- return result;
-}
-
-gchar *delivery_address_get_sub_field (const ECardDeliveryAddress * address, DeliveryAddressField sub_field)
-{
- gchar *sub_field_value;
- gchar *str_temp, *str_temp_a;
- if (address != NULL) {
- switch (sub_field) {
- case DELIVERY_ADDRESS_STREET:
- str_temp_a = check_null_pointer (address->po);
- str_temp = check_null_pointer (address->street);
- sub_field_value = g_strdup_printf ("%s %s", str_temp_a, str_temp);
- g_free (str_temp);
- g_free (str_temp_a);
- break;
- case DELIVERY_ADDRESS_EXT:
- sub_field_value = check_null_pointer (address->ext);
- break;
- case DELIVERY_ADDRESS_CITY:
- sub_field_value = check_null_pointer (address->city);
- break;
- case DELIVERY_ADDRESS_REGION:
- sub_field_value = check_null_pointer (address->region);
- break;
- case DELIVERY_ADDRESS_CODE:
- sub_field_value = check_null_pointer (address->code);
- break;
- case DELIVERY_ADDRESS_COUNTRY:
- sub_field_value = check_null_pointer (address->country);
- break;
- default:
- sub_field_value = g_strdup ("");
- }
- } else {
- sub_field_value = g_strdup ("");
- }
- return sub_field_value;
-}
-
-gchar *
-quote_string (gchar *orig)
-{
- if (orig == NULL)
- return g_strdup ("\"\"");
- return g_strdup_printf("\"%s\"", orig);
-}
-
-int
-output_n_cards_file (FILE * outputfile, ECardCursor * cursor, int size, int begin_no, CARD_FORMAT format)
-{
- int i;
- if (format == CARD_FORMAT_VCARD) {
- for (i = begin_no; i < size + begin_no; i++) {
- ECard *card = e_card_cursor_get_nth (cursor, i);
- gchar *vcard = e_card_get_vcard_assume_utf8 (card);
- fprintf (outputfile, "%s\n", vcard);
- g_free (vcard);
- g_object_unref (G_OBJECT (card));
- }
- } else if (format == CARD_FORMAT_CSV) {
- gchar *csv_fields_name = e_card_simple_csv_get_header_line (pre_defined_fields);
- fprintf (outputfile, "%s\n", csv_fields_name);
- g_free (csv_fields_name);
-
- for (i = begin_no; i < size + begin_no; i++) {
- ECard *card = e_card_cursor_get_nth (cursor, i);
- gchar *csv = e_card_get_csv (card, pre_defined_fields);
- fprintf (outputfile, "%s\n", csv);
- g_free (csv);
- g_object_unref (G_OBJECT (card));
-
- }
- }
-
- return SUCCESS;
-
-}
-
-static void
-fork_to_background (void)
-{
- pid_t pid;
- pid = fork ();
- if (pid == -1) {
- /* ouch, fork() failed */
- perror ("fork");
- exit (-1);
- } else if (pid == 0) {
- /* child */
- /*contunue */
-
- } else {
- /* parent exit, note the use of _exit() instead of exit() */
- _exit (-1);
- }
-}
-
-
-
-
-static void
-action_list_cards_get_cursor_cb (EBook * book, EBookStatus status, ECardCursor * cursor, ActionContext * p_actctx)
-{
- FILE *outputfile;
- long length;
- int IsFirstOne;
- int series_no;
- gchar *file_series_name;
- CARD_FORMAT format;
- int size;
-
- length = e_card_cursor_get_length (cursor);
-
- if (length <= 0) {
- g_warning ("Couldn't load addressbook correctly!!!! %s####", p_actctx->action_list_cards.addressbook_folder_uri);
- exit (-1);
- }
-
-
- if (p_actctx->action_list_cards.async_mode == FALSE) { /* normal mode */
-
- if (p_actctx->action_list_cards.output_file == NULL) {
- outputfile = stdout;
- } else {
- /* fopen output file */
- if (!(outputfile = fopen (p_actctx->action_list_cards.output_file, "w"))) {
- g_warning (_("Can not open file"));
- exit (-1);
- }
- }
-
- if (p_actctx->action_list_cards.IsVCard == TRUE)
- format = CARD_FORMAT_VCARD;
- else
- format = CARD_FORMAT_CSV;
-
- output_n_cards_file (outputfile, cursor, length, 0, format);
-
-
-
- if (p_actctx->action_list_cards.output_file != NULL) {
- fclose (outputfile);
- }
- }
-
-
- /*async mode */
- else {
-
- size = p_actctx->action_list_cards.file_size;
- IsFirstOne = TRUE;
- series_no = 0;
-
- do {
- /* whether it is the last file */
- if ((series_no + 1) * size >= length) { /*last one */
- file_series_name = g_strdup_printf ("%s.end", p_actctx->action_list_cards.output_file);
-
- } else { /*next one */
- file_series_name =
- g_strdup_printf ("%s.%04d", p_actctx->action_list_cards.output_file, series_no);
- }
-
- if (!(outputfile = fopen (file_series_name, "w"))) {
- g_warning (_("Can not open file"));
- exit (-1);
- }
-
-
- if (p_actctx->action_list_cards.IsVCard == TRUE)
- format = CARD_FORMAT_VCARD;
- else
- format = CARD_FORMAT_CSV;
- output_n_cards_file (outputfile, cursor, size, series_no * size, format);
-
- fclose (outputfile);
-
- series_no++;
-
- if (IsFirstOne == TRUE) {
- fork_to_background ();
- IsFirstOne = FALSE;
- }
-
-
- }
- while (series_no * size < length);
- g_free (file_series_name);
- }
-
- bonobo_main_quit ();
-}
-
-
-
-
-static void
-action_list_cards_open_cb (EBook * book, EBookStatus status, ActionContext * p_actctx)
-{
- if (status != E_BOOK_STATUS_SUCCESS) {
- g_warning ("Couldn't load addressbook %s", p_actctx->action_list_cards.addressbook_folder_uri);
- exit (-1);
- }
- e_book_get_cursor (book, "(contains \"full_name\" \"\")", (EBookCursorCallback)action_list_cards_get_cursor_cb, p_actctx);
-}
-
-
-static guint
-action_list_cards_run (ActionContext * p_actctx)
-{
- EBook *book;
- book = e_book_new ();
-
- if (p_actctx->action_list_cards.addressbook_folder_uri != NULL) {
- e_book_load_uri (book, p_actctx->action_list_cards.addressbook_folder_uri,
- (EBookCallback)action_list_cards_open_cb, p_actctx);
- } else {
- e_book_load_default_book (book, (EBookCallback)action_list_cards_open_cb, p_actctx);
- }
- return SUCCESS;
-}
-
-
-void
-set_pre_defined_field (GSList ** pre_defined_fields)
-{
- *pre_defined_fields = NULL;
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_GIVEN_NAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_FAMILY_NAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_FULL_NAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_NICKNAME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_EMAIL));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_EMAIL_2));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_WANTS_HTML));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_HOME));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_BUSINESS_FAX));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_PAGER));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_PHONE_MOBILE));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_STREET));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_EXT));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_CITY));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_REGION));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_POSTCODE));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_HOME_COUNTRY));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_STREET));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_EXT));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_CITY));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_REGION));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_POSTCODE));
- *pre_defined_fields =
- g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ADDRESS_BUSINESS_COUNTRY));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_TITLE));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_OFFICE));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_ORG));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_URL));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_CALURI));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_YEAR));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_MONTH));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_BIRTH_DATE_DAY));
- *pre_defined_fields = g_slist_append (*pre_defined_fields, GINT_TO_POINTER (E_CARD_SIMPLE_FIELD_CSV_NOTE));
-}
-
-guint
-action_list_cards_init (ActionContext * p_actctx)
-{
- g_idle_add ((GSourceFunc) action_list_cards_run, p_actctx);
- set_pre_defined_field (&pre_defined_fields);
-
- return SUCCESS;
-}
diff --git a/addressbook/tools/evolution-addressbook-export-list-folders.c b/addressbook/tools/evolution-addressbook-export-list-folders.c
deleted file mode 100644
index 8922422a8f..0000000000
--- a/addressbook/tools/evolution-addressbook-export-list-folders.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export-list-folders.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <libbonobo.h>
-#include <libgnome/libgnome.h>
-
-#include <ebook/e-book.h>
-#include <ebook/e-book-util.h>
-
-#include "evolution-addressbook-export.h"
-
-static void
-action_list_folders_get_cursor_cb (EBook * book, EBookStatus status, ECardCursor * cursor, ActionContext * p_actctx)
-{
- FILE *outputfile;
- long length;
- const char *uri;
- char *name;
-
- uri = e_book_get_default_book_uri ();
- length = e_card_cursor_get_length (cursor);
-
- /*Fix me *
- can not get name, should be a bug of e-book.Anyway, should set a default name.
- */
- /*name = e_book_get_name (book); */
- name = g_strdup (_("Contacts"));
-
- if (p_actctx->action_list_folders.output_file == NULL) {
- printf ("\"%s\",\"%s\",%d\n", uri, name, (int) length);
- } else {
- /*output to a file */
- if (!(outputfile = fopen (p_actctx->action_list_folders.output_file, "w"))) {
- g_warning (_("Can not open file"));
- exit (-1);
- }
- fprintf (outputfile, "\"%s\",\"%s\",%d\n", uri, name, (int) length);
- fclose (outputfile);
- }
-
- g_free (name);
- g_object_unref (G_OBJECT (book));
- bonobo_main_quit ();
-}
-
-static void
-action_list_folders_open_cb (EBook * book, EBookStatus status, ActionContext * p_actctx)
-{
- if (E_BOOK_STATUS_SUCCESS == status) {
- e_book_get_cursor (book, "(contains \"full_name\" \"\")",
- (EBookCursorCallback)action_list_folders_get_cursor_cb, p_actctx);
- } else {
- g_object_unref (G_OBJECT (book));
- g_warning (_("Can not load URI"));
- exit (-1);
- }
-}
-
-static guint
-action_list_folders_run (ActionContext * p_actctx)
-{
- EBook *book;
- book = e_book_new ();
-
- e_book_load_default_book (book, (EBookCallback)action_list_folders_open_cb, p_actctx);
- return SUCCESS;
-}
-
-guint
-action_list_folders_init (ActionContext * p_actctx)
-{
- g_idle_add ((GSourceFunc) action_list_folders_run, p_actctx);
-
- return SUCCESS;
-}
diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c
deleted file mode 100644
index a61880ed14..0000000000
--- a/addressbook/tools/evolution-addressbook-export.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export.c
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#include <config.h>
-
-#include <glib.h>
-#include <bonobo-activation/bonobo-activation.h>
-#include <bonobo/bonobo-main.h>
-#include <gnome.h>
-
-#include <ebook/e-book.h>
-
-#include "evolution-addressbook-export.h"
-
-int
-main (int argc, char **argv)
-{
- ActionContext actctx;
- GnomeProgram *program;
- poptContext context;
- const gchar **argvn;
-
- int current_action = ACTION_NOTHING;
- int IsCSV = FALSE;
- int IsVCard = FALSE;
-
- /*** popttable */
- char *output_file = NULL;
- int list_folders_mode = FALSE;
- char *output_format = NULL;
- char *addressbook_folder_uri = NULL;
- int async_mode = FALSE;
- int file_size = 0;
-
- struct poptOption options[] = {
- {"output", '\0', POPT_ARG_STRING, &output_file, 0, N_("Specify the output file instead of standard output"),
- N_("OUTPUTFILE")},
- {"list-addressbook-folders", 'l', POPT_ARG_NONE, &list_folders_mode, 0, N_("List local addressbook folders"),
- NULL},
- {"format", '\0', POPT_ARG_STRING, &output_format, 0, N_("Show cards as vcard or csv file"), N_("[vcard|csv]")},
- {"async", 'a', POPT_ARG_NONE, &async_mode, 0, N_("Export in asynchronous mode "), NULL},
- {"size", '\0', POPT_ARG_INT, &file_size, 0,
- N_("The number of cards in one output file in asychronous mode,default size 100."), N_("NUMBER")},
- {NULL, '\0', 0, NULL, 0, NULL, NULL}
- };
- /* popttable end ** */
-
- /*i18n-lize */
- bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- program =
- gnome_program_init (PACKAGE, VERSION, GNOME_BONOBO_MODULE, argc, argv, GNOME_PARAM_POPT_TABLE, options,
- GNOME_PARAM_NONE);
-
- /* Parsing Parameter */
- g_object_get (program, "popt-context", &context, NULL);
- argvn = poptGetArgs (context);
- if (!argvn) {
- addressbook_folder_uri = NULL;
- } else { /* there at lease is a one argument, and that should be addressbook folder uri */
- addressbook_folder_uri = g_strdup (*argvn);
- }
- poptFreeContext (context);
-
- if (list_folders_mode != FALSE) {
- current_action = ACTION_LIST_FOLDERS;
- /* check there should not be addressbook-folder-uri , and async and size , output_format */
- if (addressbook_folder_uri != NULL || async_mode != FALSE || output_format != NULL || file_size != 0) {
- g_warning (_("Command line arguments error, please use --help option to see the usage."));
- exit (-1);
- }
- } else {
-
- current_action = ACTION_LIST_CARDS;
-
- /* check the output format */
- if (output_format == NULL) {
- IsVCard = TRUE;
- } else {
- IsCSV = !strcmp (output_format, "csv");
- IsVCard = !strcmp (output_format, "vcard");
- if (IsCSV == FALSE && IsVCard == FALSE) {
- g_warning (_("Only support csv or vcard format."));
- exit (-1);
- }
- }
-
- /*check async and output file */
- if (async_mode == TRUE) {
- /* check have to output file , set default file_size */
- if (output_file == NULL) {
- g_warning (_("In async mode, output must be file."));
- exit (-1);
- }
- if (file_size == 0)
- file_size = DEFAULT_SIZE_NUMBER;
- } else {
- /*check no file_size */
- if (file_size != 0) {
- g_warning (_("In normal mode, there should not need size option."));
- exit (-1);
- }
- }
- }
-
- /* do actions */
- if (current_action == ACTION_LIST_FOLDERS) {
- actctx.action_type = current_action;
- if (output_file == NULL) {
- actctx.action_list_folders.output_file = NULL;
- } else {
- actctx.action_list_folders.output_file = g_strdup (output_file);
- }
- action_list_folders_init (&actctx);
- } else if (current_action == ACTION_LIST_CARDS) {
- actctx.action_type = current_action;
- if (output_file == NULL) {
- actctx.action_list_cards.output_file = NULL;
- } else {
- actctx.action_list_cards.output_file = g_strdup (output_file);
- }
- actctx.action_list_cards.IsCSV = IsCSV;
- actctx.action_list_cards.IsVCard = IsVCard;
- actctx.action_list_cards.addressbook_folder_uri = g_strdup (addressbook_folder_uri);
- actctx.action_list_cards.async_mode = async_mode;
- actctx.action_list_cards.file_size = file_size;
-
- action_list_cards_init (&actctx);
-
- } else {
- g_warning (_("Impossible internal error."));
- exit (-1);
- }
-
- bonobo_main ();
-
- /*FIXME:should free actctx's some char* field, such as output_file! but since the program will end, so that will not cause mem leak. */
-
- return 0;
-}
diff --git a/addressbook/tools/evolution-addressbook-export.h b/addressbook/tools/evolution-addressbook-export.h
deleted file mode 100644
index 13749aed61..0000000000
--- a/addressbook/tools/evolution-addressbook-export.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* evolution-addressbook-export.h
- *
- * Copyright (C) 2003 Ximian, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Gilbert Fang <gilbert.fang@sun.com>
- *
- */
-
-#ifndef _EVOLUTION_ADDRESSBOOK_EXPORT_H_
-#define _EVOLUTION_ADDRESSBOOK_EXPORT_H__
-
-#include <glib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#pragma }
-#endif /* __cplusplus */
-
-#define SUCCESS 0
-#define FAILED -1
-
-#define ACTION_NOTHING 0
-#define ACTION_LIST_FOLDERS 1
-#define ACTION_LIST_CARDS 2
-
-#define DEFAULT_SIZE_NUMBER 100
-
-union _ActionContext
-{
-
- guint action_type;
-
- struct
- {
- gint action_type;
- gchar *output_file;
- }
- action_list_folders;
-
- struct
- {
- gint action_type;
- gchar *output_file;
- gint IsCSV;
- gint IsVCard;
- gchar *addressbook_folder_uri;
- gint async_mode;
- gint file_size;
- }
- action_list_cards;
-};
-
-typedef union _ActionContext ActionContext;
-
-
-/* action_list_folders */
-guint action_list_folders_init (ActionContext * p_actctx);
-
-/*action list cards*/
-guint action_list_cards_init (ActionContext * p_actctx);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _EVOLUTION_ADDRESSBOOK_EXPORT_H_ */