Contact Views provide an easy way for a UI to create a view containing sorted contact data. A Contact View is a sorted collection of Contact Items that is continually updated on receipt of observer events from the Contacts Model. Most Contacts Model clients require views in which the contacts are either sorted by type (contacts with email addresses, for example) or by their position between two characters.
There are two main types of view: For Local views
(CContactLocalView
) the data is allocated to the client’s
memory. For Remote views (CContactRemoteView
) data is
allocated within the memory of the contact's server and can be shared by
multiple clients.
Within the server the local view object is associated with each client side remote view object. This configuration allows multiple clients to share the same server side view objects, thereby reducing the overhead associated with initial sorting of the view data, and keeping it in sync with the underlying data. Remote views should therefore be used when the same view is likely to be needed by more than one client.
The Contact Views library contains more specialised views and allows
clients to specify views by field, methods and sort order. The
CContactViewBase
class includes:
Group view (CContactGroupView
) - provides a view
where all the contacts belonging to the group will be displayed.
CContactGroupView::TGroupType
defines whether the view
displays either all contacts belonging to the group or all contacts not part of
this group.
Find view (CContactFindView
) - contains Contact
Items from the underlying view that match the search criteria
Filtered view (CContactFilteredView
) - provides
a view containing only contacts with a specified field
Sub view (CContactSubView
) – presents a 'window'
of data over a (potentially) larger data set. As the underlying data in
CContactViewBase
is modified, objects of this class will
keep themselves up to date.
Concatenated view (CContactConcatenatedView
) –
joins multiple contact views from CContactViewBase
into a
single contiguous view.