Added a view for tnymsgheaderiface

Hi there,

I just added a view for the tnymsgheaderiface type. Both the tnymsgview
and the tnymozembedmsgview tnymsgviewiface implementations use it.

I've added a tnymsgheaderviewiface and a gtk+ implementation called

The gtk+ view inherits the GtkTable. When inheriting the default
implementation in libtinymailui-gtk, you can use the gtk_table_resize
method on 'self' if you'd like to add additional headers to the view.

I'm open to suggestions (like dynamically adding headers in stead of how
it's done at this moment). Note, however, that a view is NOT a data
store for headers. A view is a view for a model. That model is, in this
case, an implementation of tnymsgheaderiface.

It's okay to make the view flexible by allowing settings like "show the
following headers: a, b and c". It would be a Model View Controller
design mistake if you'd make a method like: add_header_line ("label",

So if people want this, I would like to see an API like:

tny_msg_header_view_iface_set_visible (self, const gchar *header_type);
tny_msg_header_view_iface_set_header (self, TnyMsgHeaderIface *header);

Like this:

tny_msg_header_view_iface_set_visible (self, "From");
tny_msg_header_view_iface_set_visible (self, "To");
tny_msg_header_view_iface_set_visible (self, "Subject");
tny_msg_header_view_iface_set_visible (self, "Date");
tny_msg_header_view_iface_set_header (self, header);

Or something like this (display all headers):

GList *headers = tny_msg_header_get_all_types (header);
while (headers) {
  gchar *type = headers->data;
  tny_msg_header_view_iface_set_visible (self, type);
  headers = g_list_next (headers);
tny_msg_header_view_iface_set_header (self, header);

Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be -

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