1
<refentry id="eds-cursor-example" revision="30 Nov 2013">
3
<refentrytitle>Contacts Browser Example</refentrytitle>
4
<refmiscinfo>Contacts Browser Example</refmiscinfo>
7
<refname>Contacts Browser Example</refname>
9
Explanation of how to create a scrolling window listing contacts in
15
<title>Introduction</title>
17
This is a fully functional reference application for implementing scrolling contact
18
browsers using the #EBookClientCursor. With the cursor, the following features are
24
<para>Display contacts in a configurable sort order</para>
26
Sort by any #EContactField which conforms to #G_TYPE_STRING, this can be checked
27
with e_contact_field_type()
31
<para>Minimal memory constraints</para>
33
Only load into memory the contacts which are currently visible in the list
37
<para>Filter search results on the fly</para>
39
Set new search expressions generated with #EBookQuery on the fly. Refresh
40
the contact list at the current position without losing the current cursor
45
<para>Display the the user's alphabet</para>
47
Using interesting features from ICU libraries allow us to display
48
the user's alphabet, and implement features such as jumping to
49
a given letter in the user's alphabet.
55
The actual example code is built into the 'example' subdirectory of the Evolution Data Server
56
sources. In order to run the example, just launch the program and give it a path to a directory
57
full of vcards, bearing the .vcf filename extention.
63
<title>Contact Browser</title>
65
Below is an example of the contact browser code itself, the example program is
66
broken down into a couple of object classes which are also listed below.
71
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
73
href="@SRCDIR@/examples/cursor/cursor-example.c"/>
79
<title>The alphabetic navigator</title>
81
This is a simple class which implements a vertical scroller and displays
82
various letters according to the currently active alphabet. The actual
83
interaction with #EBookClientCursor is done in the main contact browser
84
and this class is simply configured with the active alphabet.
89
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
91
href="@SRCDIR@/examples/cursor/cursor-navigator.c"/>
97
<title>The search entry</title>
99
The search entry is placed at the top of the contacts browser,
100
this class simply implements a drop down box choosing the appropriate
101
search expression which should be used to filter the contacts
102
in the browser display window.
107
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
109
href="@SRCDIR@/examples/cursor/cursor-search.c"/>
115
<title>The contact slot</title>
117
This is a very simple class who's only purpose is to display
118
contact related data, each entry in the list is a 'slot'
123
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
125
href="@SRCDIR@/examples/cursor/cursor-slot.c"/>
131
<title>Creating addressbooks and loading vcards</title>
133
This is the messy part of the example, here we take care
134
of creating a custom addressbook and populating it with
135
the contacts found in the directory given to the example.
140
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
142
href="@SRCDIR@/examples/cursor/cursor-data.c"/>