Changeset 1002
- Timestamp:
- 10/16/06 00:09:02
- Files:
-
- trunk/libtinymailui/tny-account-store-view.c (modified) (1 diff)
- trunk/libtinymailui/tny-header-view.c (modified) (3 diffs)
- trunk/libtinymailui/tny-mime-part-save-strategy.c (modified) (3 diffs)
- trunk/libtinymailui/tny-mime-part-view.c (modified) (1 diff)
- trunk/libtinymailui/tny-msg-view.c (modified) (4 diffs)
- trunk/libtinymailui/tny-platform-factory.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymailui/tny-account-store-view.c
r900 r1002 28 28 * @account_store: A #TnyAccountStore instace 29 29 * 30 * Set the account store of the view 31 * 30 * Set the account store of the view. 31 * 32 * Implementors: This should let the account store view @self display the 33 * account store @account_store. 32 34 **/ 33 35 void trunk/libtinymailui/tny-header-view.c
r908 r1002 22 22 #include <tny-header-view.h> 23 23 24 25 24 /** 26 25 * tny_header_view_clear: … … 29 28 * Clear the view @self (show nothing) 30 29 * 31 * Implementors: this method should clear @self (display nothing, or display 32 * a picture with flowers and nude people if that is how your E-mail client 33 * indicates that there's no header loaded) 30 * Implementors: this method should clear view @self (display nothing and 31 * clearup) 34 32 * 35 33 **/ … … 55 53 * 56 54 * Implementors: this method should cause the view @self to show the header 57 * @header to the user. Often thismeans showing the from, to, subject, date55 * @header to the user. This typically means showing the from, to, subject, date 58 56 * and cc labels. 59 57 * 60 * #TnyHeaderView is often used in a composition with the#TnyMsgView61 * type (the #TnyMsgView implementation contains a #TnyHeaderView).58 * #TnyHeaderView is often used in a composition with a #TnyMsgView 59 * type (the #TnyMsgView implementation contains or aggregates a #TnyHeaderView). 62 60 * 63 61 **/ trunk/libtinymailui/tny-mime-part-save-strategy.c
r998 r1002 29 29 * Performs the saving of a mime part 30 30 * 31 * A save strategy for a mime part is used with a type that implements the 32 * #TnyMimePartSaver interface. Types that do, will often also implement the 33 * #TnyMsgView interface (it's not a requirement). In this case they say that 34 * the view has functionality for saving mime parts. 35 * 36 * You can for example inherit an implementation of a #TnyMsgView, like the 37 * #TnyGtkMsgView one, and let yours also implement #TnyMimePartSaver. The 38 * example shown here is such a situation 39 * 31 40 * Example: 32 41 * <informalexample><programlisting> 33 42 * static void 34 * tny_my_msg_view_ on_mime_part_save_clicked (TnyMsgView *self_i, TnyMimePart *attachment)43 * tny_my_msg_view_perform_save (TnyMimePartView *self_i, TnyMimePart *attachment) 35 44 * { 36 45 * TnyMyMsgView *self = TNY_MY_MSG_VIEW (self_i); … … 39 48 * </programlisting></informalexample> 40 49 * 41 * Implementors: the idea is that devices can have a specific such strategy. 42 * For example a strategy that sends it to another computer or a strategy that 43 * saves it to a flash disk. 50 * Implementors: The idea is that devices can have specific such strategies. 51 * For example a strategy that sends it to another computer and/or a strategy 52 * that saves it to a flash disk. Configurable at runtime by simply switching 53 * the strategy property of a #TnyMimePartSaver. 54 * 55 * The implementation shown in the example implements it using the gtk+ toolkit. 56 * Saving a mime part can also be doing nothing, if your device doesn't support 57 * it. Maybe you will implement it by letting it contact a service and sending 58 * the mime part to it? It's up to you. 44 59 * 45 60 * Example: … … 74 89 * #TnyMsgView implementation. 75 90 * 91 * Note that a mime can mean both the entire message (without its headers) and 92 * one individual mime part in such a message. A #TnyMsg inherits from #TnyMimePart 93 * which means that if you use the message instance with a #TnyMimePartSaveStrategy 94 * instance, that the strategy for saving it will save the entire message. Whereas 95 * when you pass it just one individual mime part instance, the strategy will 96 * save only that part. 76 97 **/ 77 98 void trunk/libtinymailui/tny-mime-part-view.c
r994 r1002 75 75 * @mime_part: A #TnyMimePart instace 76 76 * 77 * Set mime part of the view @self77 * Set mime part which the view @self should display. 78 78 * 79 79 * Implementors: this method should cause the view @self to show the mime part trunk/libtinymailui/tny-msg-view.c
r994 r1002 27 27 * @part: A #TnyMimePart instance 28 28 * 29 * Create a #TnyMimePartView instance for viewing @part 29 * Create a #TnyMimePartView instance for viewing @part. The returned instance 30 * must be unreferenced after use. 31 * 32 * Implementors: This method should create and return a new #TnyMimePartView 33 * that is suitable for displaying the #TnyMimePart @part. 34 * 35 * Example: 36 * <informalexample><programlisting> 37 * static TnyMimePartView* 38 * tny_gtk_msg_view_create_mime_part_view_for (TnyMsgView *self, TnyMimePart *part) 39 * { 40 * TnyGtkMsgViewPriv *priv = TNY_GTK_MSG_VIEW_GET_PRIVATE (self); 41 * TnyMimePartView *retval = NULL; 42 * if (tny_mime_part_content_type_is (part, "text/*")) 43 * { 44 * retval = tny_gtk_text_mime_part_view_new (); 45 * gtk_box_pack_start (GTK_BOX (TNY_GTK_MSG_VIEW (self)->viewers), 46 * GTK_WIDGET (retval), TRUE, TRUE, 0); 47 * gtk_widget_show (GTK_WIDGET (retval)); 48 * } else if (tny_mime_part_get_content_type (part) && 49 * tny_mime_part_is_attachment (part)) 50 * { 51 * static gboolean first = TRUE; 52 * GtkTreeModel *model; 53 * gtk_widget_show (priv->attachview_sw); 54 * if (first) 55 * { 56 * model = tny_gtk_attach_list_model_new (); 57 * gtk_icon_view_set_model (priv->attachview, model); 58 * first = FALSE; 59 * } else 60 * model = gtk_icon_view_get_model (priv->attachview); 61 * retval = tny_gtk_attachment_mime_part_view_new (TNY_GTK_ATTACH_LIST_MODEL (model)); 62 * } 63 * return retval; 64 * } 65 * </programlisting></informalexample> 66 * 67 * This example is the implementation of #TnyGtkMsgView. If you are planning to 68 * use libtinymailui-gtk, which contains this type, it's also possible to inherit 69 * from this type. Take for example another type in libtinymailui-mozembed that 70 * implements one that adds support for a text/html mime part. 71 * 72 * Example: 73 * <informalexample><programlisting> 74 * static TnyMimePartView* 75 * tny_moz_embed_msg_view_create_mime_part_view_for (TnyMsgView *self, TnyMimePart *part) 76 * { 77 * TnyMimePartView *retval = NULL; 78 * if (tny_mime_part_content_type_is (part, "text/html")) 79 * { 80 * retval = tny_moz_embed_html_mime_part_view_new (); 81 * gtk_box_pack_start (GTK_BOX (TNY_GTK_MSG_VIEW (self)->viewers), GTK_WIDGET (retval), TRUE, TRUE, 0); 82 * gtk_widget_show (GTK_WIDGET (retval)); 83 * } 84 * if (!retval) 85 * retval = TNY_MOZ_EMBED_MSG_VIEW_GET_CLASS (self)->create_mime_part_view_for_orig_func (self, part); 86 * return retval; 87 * } 88 * static void 89 * tny_moz_embed_msg_view_class_init (TnyMozEmbedMsgViewClass *class) 90 * { 91 * GObjectClass *object_class; 92 * parent_class = g_type_class_peek_parent (class); 93 * object_class = (GObjectClass*) class; 94 * object_class->finalize = tny_moz_embed_msg_view_finalize; 95 * class->create_mime_part_view_for_orig_func = TNY_GTK_MSG_VIEW_CLASS (class)->create_mime_part_view_for_func; 96 * TNY_GTK_MSG_VIEW_CLASS (class)->create_mime_part_view_for_func = tny_moz_embed_msg_view_create_mime_part_view_for; 97 * } 98 * </programlisting></informalexample> 30 99 * 31 100 * Return value: A #TnyMimePartView instance for viewing @part … … 48 117 * Clear the view @self (show nothing) 49 118 * 50 * Implementors: this method should clear @self (display nothing, or display 51 * a picture with flowers and nude people if that is how your E-mail client 52 * indicates that there's no message loaded) 53 * 119 * Implementors: this method should clear @self (display nothing and clearup) 54 120 **/ 55 121 void … … 94 160 * @self: A #TnyMsgView instance 95 161 * 96 * Get message of the view @self The return value must be unreferenced after97 * u se.162 * Get the current message of the view @self. The returned instance must be 163 * unreferenced after use. 98 164 * 99 165 * Implementors: this method should return the message this view is currently … … 119 185 * @msg: A #TnyMsg instace 120 186 * 121 * Set message of the view @self187 * Set the message which view @self must display. 122 188 * 123 189 * Implementors: this method should cause the view @self to show the message 124 190 * @msg to the user. This includes showing the header (for which you can 125 191 * make a composition with a #TnyHeaderView), the message body and the 126 * attachments. 192 * attachments (for which you typically use the #TnyMimePartView interface and 193 * implementations). 127 194 * 128 195 * You can get a list of mime-parts using the tny_msg_get_parts API of 129 * the #TnyMsg type. If the mime-part has as content type a type that your 130 * viewer supports and recognises as an E-mail body (you can check the content 131 * type if a mime-part using tny_mime_part_content_type_is), the view 132 * should show it. 133 * 134 * It's advised to use the #TnyStream API for streaming the decoded content 135 * of the mime-part to the model of your view that will display the body. 136 * Examples are #TnyMsgView in libtinymailui-gtk and #TnyMozEmbedMsgView in 137 * libtinymailui-mozembed. If you don't decode the content of the mime-part, 138 * for example using tny_mime_part_decode_to_stream, the content might be 139 * encoded in a format suitable for data transfer over for example SMTP. 140 * 196 * the #TnyMsg type. You can use the tny_msg_view_create_mime_part_view_for 197 * API to get an instance of a #TnyMimePartView that can view the mime part. 198 * 199 * Example: 200 * <informalexample><programlisting> 201 * static void 202 * tny_my_msg_view_set_msg (TnyMsgView *self, TnyMsg *msg) 203 * { 204 * TnyIterator *iterator; 205 * TnyList *list = tny_simple_list_new (); 206 * tny_msg_view_clear (self); 207 * header = tny_msg_get_header (msg); 208 * tny_header_view_set_header (priv->headerview, header); 209 * g_object_unref (G_OBJECT (header)); 210 * tny_msg_get_parts (msg, list); 211 * iterator = tny_list_create_iterator (list); 212 * while (!tny_iterator_is_done (iterator)) 213 * { 214 * TnyMimePart *part = tny_iterator_get_current (iterator); 215 * TnyMimePartView *mpview; 216 * mpview = tny_msg_view_create_mime_part_view_for (self, part); 217 * if (mpview) 218 * tny_mime_part_view_set_part (mpview, part); 219 * g_object_unref (G_OBJECT(part)); 220 * tny_iterator_next (iterator); 221 * } 222 * g_object_unref (G_OBJECT (iterator)); 223 * g_object_unref (G_OBJECT (list)); 224 * } 225 * </programlisting></informalexample> 141 226 **/ 142 227 void trunk/libtinymailui/tny-platform-factory.c
r900 r1002 29 29 * @self: a TnyPlatformFactory object 30 30 * 31 * Get a new #TnyAccountStore instance. The returned instance must be 32 * unreferenced after use. 33 * 31 34 * Implementors: when implementing a platform-specific library, return a 32 35 * new #TnyAccountStore instance. 33 36 * 34 37 * Return value: a #TnyAccountStore instance 35 *36 38 **/ 37 39 TnyAccountStore* … … 49 51 * tny_platform_factory_new_device: 50 52 * @self: a TnyPlatformFactory object 53 * 54 * 55 * Get a new #TnyDevice instance. The returned instance must be 56 * unreferenced after use. 51 57 * 52 58 * Implementors: when implementing a platform-specific library, return a … … 71 77 * @self: a TnyPlatformFactory object 72 78 * 79 * Get a new #TnyMsgView instance. The returned instance must be 80 * unreferenced after use. 81 * 73 82 * Implementors: when implementing a platform-specific library, return a 74 83 * new #TnyMsgView instance. 75 84 * 76 85 * Return value: a #TnyMsgView instance 77 *78 86 **/ 79 87 TnyMsgView*
