1 /* Copyright (c) 2007, Nokia Corporation
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Nokia Corporation nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include <modest-mime-part-view.h>
33 #include <modest-marshal.h>
42 static guint mime_part_view_signals[LAST_SIGNAL] = { 0 };
45 * modest_mime_part_view_is_empty:
46 * @self: a #ModestMimePartView
48 * checks if the mail shown can be considered as empty or not.
50 * Returns: %TRUE if mail shown is empty, %FALSE otherwise.
53 modest_mime_part_view_is_empty (ModestMimePartView *self)
55 return MODEST_MIME_PART_VIEW_GET_IFACE (self)->is_empty_func (self);
59 modest_mime_part_view_base_init (gpointer g_class)
61 static gboolean initialized = FALSE;
66 * ModestMimePartView::activate-link:
67 * @self: a #ModestMimePartView instance the signal is emitted
68 * @string: a string containing the URI
70 * This signal is emitted when a URI is activated
74 mime_part_view_signals[ACTIVATE_LINK] =
75 g_signal_new ("activate_link",
76 MODEST_TYPE_MIME_PART_VIEW,
78 G_STRUCT_OFFSET (ModestMimePartViewIface, activate_link),
80 modest_marshal_BOOLEAN__STRING,
84 * ModestMimePartView::link-hover:
85 * @self: a #ModestMimePartView instance the signal is emitted
86 * @string: a string containing the URI
88 * This signal is emitted when user passes the mouse over a link
92 mime_part_view_signals[LINK_HOVER] =
93 g_signal_new ("link_hover",
94 MODEST_TYPE_MIME_PART_VIEW,
96 G_STRUCT_OFFSET (ModestMimePartViewIface, link_hover),
98 modest_marshal_BOOLEAN__STRING,
103 * ModestMimePartView::fetch-url:
104 * @self: a #ModestMimePartView instance the signal is emitted
105 * @string: a string containing the URI
106 * @stream: a #TnyStream
108 * This signal is emitted when the page is rendered, and some
109 * url has to be resolved externally. You have to put the
110 * required information in the stream (images, etc).
114 mime_part_view_signals[FETCH_URL] =
115 g_signal_new ("fetch_url",
116 MODEST_TYPE_MIME_PART_VIEW,
118 G_STRUCT_OFFSET (ModestMimePartViewIface, fetch_url),
120 modest_marshal_BOOLEAN__STRING_OBJECT,
129 modest_mime_part_view_get_type (void)
131 static GType type = 0;
133 if (G_UNLIKELY(type == 0))
135 static const GTypeInfo info =
137 sizeof (ModestMimePartViewIface),
138 modest_mime_part_view_base_init, /* base_init */
139 NULL, /* base_finalize */
140 NULL, /* class_init */
141 NULL, /* class_finalize */
142 NULL, /* class_data */
145 NULL, /* instance_init */
149 type = g_type_register_static (G_TYPE_INTERFACE,
150 "ModestMimePartView", &info, 0);