Re: [GnomeMeeting-devel-list] Refactoring the addressbook code



On Sun, 26 Mar 2006 21:47:10 +0200
Jan Schampera <jan schampera web de> wrote:

> It was a basic test for me, if I am able at all to do this.

In case anybody is interested, I tried to code a composite widget.
It's relatively easy. Okay, now we should talk about the API, what we
can use from the struct GMContact as information and how to process
everything.

I thought about the following API (not implemented, draft!, partly
pseudocode, symbolnames should explain themselves):


GMRoster* gmroster_new (void);

void gmroster_add_entry (GMRoster*, GMContact*);
void gmroster_del_entry (GMRoster*, GMContact*);
void gmroster_modify_entry (GMRoster*, GMContact*);

void gmroster_set_icon (GMRoster*, enum state_type, GdkPixbuf*);

void gmroster_set_show_offlines (GMRoster*, gboolean);
gboolean gmroster_get_show_offlines (GMRoster*);

void gmroster_set_show_in_multiple_groups (GMRoster*, gboolean);
gboolean gmroster_get_show_in_multiple_groups (GMRoster*);

void gmroster_set_unknown_group_name (GMRoster*, gchar*);
void gmroster_set_show_groupless_contacts (GMRoster*, gboolean);
gboolean gmroster_get_show_groupless_contacts (GMRoster*);

Remarks/Discussion:
- a contact is identified by its uid AND its name field
- the widget holds a private copy of each contact
- the widget self-organizes which groups to show/not show by
  scanning the proper the GMContact member
- the GMContact "state" member is used to determinate offline, online
  and away status
- gmroster_modify_entry() only scans the "state" member of the
  contact (to update the presence)
- the *_show_in_multiple_groups() will control, if a contact that
  belongs to more then one group is shown in its first group found or
  in all groups found (discussion?)
- the *_show_groupless_contacts() control weather a contact without a
  group entry is shown in a group named by
  gmroster_set_unknown_group_name(), or not shown at all

Questions so far:
- what makes sense to hold a private copy of?

RFC

Jan

-- 
dreaming in digital
living in realtime
thinking in binary
talking in IP

WELCOME TO OUR WORLD




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]