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



Jan Schampera a écrit :
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*);

This is backend.

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*);

This is frontend.

- a contact is identified by its uid AND its name field

Hmmmm... it should only be the uid. You could want to rename a contact! This is backend.

- the widget holds a private copy of each contact

This is frontend.

- the widget self-organizes which groups to show/not show by
  scanning the proper the GMContact member

This is frontend.

- the GMContact "state" member is used to determinate offline, online
  and away status

Ok. Does SIP/SIMPLE allow to attach a string to the status ? (Like "I'm gone for dinner -- be back near 20".) This is backend.

- gmroster_modify_entry() only scans the "state" member of the
  contact (to update the presence)

What if I want to rename sip:500 ekiga net from the "500" I set at first to the saner "Miroir de test" ? This is backend.

- 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?)

I'm not sure I understand this one ; but it seems frontend.

- 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

In my little pet project, I have a group named "Unsorted" exactly for that. This is frontend.

I really want a strict backend-frontend separation.

Snark



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