RE: Mime part viewers, support for PGP, ICS files and others
- From: Philip Van Hoof <spam pvanhoof be>
- To: Dirk-Jan Binnema nokia com
- Cc: tinymail-devel-list gnome org
- Subject: RE: Mime part viewers, support for PGP, ICS files and others
- Date: Thu, 12 Oct 2006 17:07:54 +0200
On Thu, 2006-10-12 at 12:06 +0300, Dirk-Jan Binnema nokia com wrote:
Hey Dirk,
I'll comment on your remarks now ;)
> I like the idea - it just seems the right thing to do. There are
> some "real world imperfections" that should be addressed in the
> design though:
>
> - there won't be a nice 1:1 correspondence between MIME-type and
> viewer in all cases.
> 1) user preference (view pics inline or as attachment)
This could be a preference of the specific mime-part view implementation
for viewing images. And could probably be integrated in a property
window or something like that.
I would quote design unquote this as two types. And let the preference
be the classification: which type to instantiate when a mime-part of
that type is to be shown. So basically, the "if-then-else" that reads
the preference would fit in the factory that creates my TnyMimePartView
instances.
> 2) wrong MIME-type (ie. application/octet-stream for just
> about any file-type when some versions of Outlook
> send it.
A default TnyMimePartView implementation that can only perform the save
operation (which will use the TnySaveStrategy, because it's a strategy
pattern being used here)?
The problem will be a detector in the TnyMimePartView implementations
that can figure out whether or not it can show the mime-part.
My current idea is to in stead of having properties like "mime_type" and
"fileext", have a method: bool i_can_handle_this_mime_part (part) in the
TnyMimePartView interface.
And letting the TnyMsgView, who loops over all mime-part-view instances
that are registered with it, invoke that method for each mime-part that
it must show. And if the return is true, it will stop looping and use
that mime-part-view instance.
> 3) (less important) many MIME-types can be represented
> as a other types just for viewing; ie. many file types can
> be represented as images (inkscape, thumbnails of jpg,
> pdf, video etc.)
The TnyMimePartView implementation is free to implement both a preview
and a real-view. It's responsible for all of the viewing-of the
mime-part. The TnyMsgView merely puts the widget being implemented by
them gtk- TnyMimePartView (it doesn't have to be a gtk widget, for
example when doing web development it might be a HTML page) in a
Gtk[H/V]Box.
> So I guess it would be good to have a way for the model to provide
> the MIME-type, which is a function of the explicit MIME-type of
> the MIME-part, user preference, and some 'special code' to make
> intelligent decisions. Also, in the view there should be a way
> to apply user preferences.
Let me know if I need to clarify things a little bit more ;)
--
Philip Van Hoof, software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
blog: http://pvanhoof.be/blog
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]