version and bug fix info update for this testing image
[modest] / src / widgets / modest-msg-edit-window-ui.h
1 /* Copyright (c) 2006, Nokia Corporation
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
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.
16  *
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.
28  */
29
30 #ifndef __MODEST_MSG_EDIT_WINDOW_UI_H__
31 #define __MODEST_MSG_EDIT_WINDOW_UI_H__
32
33 #include <glib/gi18n.h>
34 #include <gtk/gtk.h>
35 #include "modest-icon-names.h"
36 #include "modest-ui-actions.h"
37 #include "modest-defs.h"
38
39 G_BEGIN_DECLS
40
41 static const GtkActionEntry modest_msg_edit_action_entries [] = {
42         /* Toplevel menus */
43         { "Email", NULL, N_("mcen_me_inbox_email") , NULL, NULL, G_CALLBACK (modest_ui_actions_on_email_menu_activated) },
44         { "View", NULL, N_("mcen_me_inbox_view") , NULL, NULL, G_CALLBACK (modest_ui_actions_on_view_menu_activated)},
45         { "Edit", NULL, N_("mcen_me_inbox_edit") , NULL, NULL, G_CALLBACK (modest_ui_actions_on_edit_menu_activated)},
46         { "Format", NULL, N_("mcen_me_editor_format") , NULL, NULL, G_CALLBACK (modest_ui_actions_on_format_menu_activated)},
47         { "Alignment", NULL, N_("mcen_me_editor_align") },
48         { "Attachments", NULL, N_("mcen_me_viewer_attachments"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_attachment_menu_activated) },
49         { "MessagePriority", NULL, N_("mcen_me_editor_message_priority") },
50         { "FileFormat", NULL, N_("mcen_me_editor_file_format") },
51         { "Tools", NULL, N_("mcen_me_inbox_tools") },
52         { "ShowToolbar", NULL, N_("mcen_me_inbox_toolbar") },
53         { "Close", NULL, N_("mcen_me_inbox_close") },
54
55         /* ACTIONS */
56         /* The logical id is different */
57 #ifdef MODEST_TOOLKIT_HILDON2
58         { "ActionsNewMessage", NULL, N_("mcen_me_new_message"), "<CTRL>N", NULL, G_CALLBACK (modest_ui_actions_on_new_msg) },
59 #else
60         { "ActionsNewMessage", NULL, N_("mcen_me_viewer_newemail"), "<CTRL>N", NULL, G_CALLBACK (modest_ui_actions_on_new_msg) },
61         { "ActionsSaveToDrafts", NULL, N_("mcen_me_editor_save_as_draft"), "<CTRL>S", NULL, G_CALLBACK (modest_ui_actions_on_save_to_drafts) },
62 #endif
63 #ifdef MODEST_TOOLKIT_HILDON2
64         { "ActionsDelete", NULL, N_("mcen_me_delete_messages"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete_message) },
65 #else
66         { "ActionsDelete", NULL, N_("mcen_me_inbox_delete"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_delete_message) },
67 #endif
68         { "ActionsSend", NULL, N_("mcen_me_editor_send"), NULL, NULL,  G_CALLBACK (modest_ui_actions_on_send) },
69 #ifndef MODEST_TOOLKIT_HILDON2
70         { "ActionsFontColor", GTK_STOCK_SELECT_COLOR, N_("Color"), NULL, N_("Change text color"), G_CALLBACK (modest_ui_actions_on_select_editor_color)},
71         { "BackgroundColor", GTK_STOCK_SELECT_COLOR, N_("Background color"), NULL, N_("Change background color"), G_CALLBACK (modest_ui_actions_on_select_editor_background_color)},
72 #endif
73         { "InsertImage", NULL, N_("mcen_me_editor_attach_inlineimage"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_insert_image)},
74 #ifndef MODEST_TOOLKIT_HILDON2
75         { "AttachFile", NULL, N_("mcen_me_editor_attachfile"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_attach_file)},
76 #endif
77         { "RemoveAttachments", NULL, N_("mcen_me_inbox_remove_attachments"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_remove_attachments) },
78         { "Undo", NULL, N_("mcen_me_inbox_undo"), "<CTRL>Z", NULL, G_CALLBACK (modest_ui_actions_on_undo)},
79 #ifndef MODEST_TOOLKIT_HILDON2
80         { "Redo", NULL, N_("mcen_me_inbox_redo"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_redo)},
81         { "Cut", NULL, N_("mcen_me_inbox_cut"),  "<CTRL>X", NULL, G_CALLBACK (modest_ui_actions_on_cut)},
82         { "Copy", NULL, N_("mcen_me_inbox_copy"),  "<CTRL>C", NULL, G_CALLBACK (modest_ui_actions_on_copy)},
83         { "Paste", NULL, N_("mcen_me_inbox_paste"),  "<CTRL>V", NULL, G_CALLBACK (modest_ui_actions_on_paste)},
84         { "SelectAll", NULL, N_("mcen_me_viewer_selectall"),  "<CTRL>A", NULL, G_CALLBACK (modest_ui_actions_on_select_all)},
85 #endif
86         { "SelectFont", NULL, N_("mcen_me_editor_font"), NULL, NULL, G_CALLBACK (modest_ui_actions_msg_edit_on_select_font)},
87 #ifndef MODEST_TOOLKIT_HILDON2
88         { "SelectContacts", NULL, N_("mcen_me_editor_selectrecipients"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_select_contacts)},
89 #endif
90         { "CheckNames", NULL, N_("mcen_me_editor_checknames"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_check_names)},
91         { "CloseWindow", NULL, N_("mcen_me_inbox_close_window"), "<CTRL>W", NULL, G_CALLBACK (modest_ui_actions_on_close_window)},
92         { "CloseAllWindows", NULL, N_("mcen_me_inbox_close_windows"), "<CTRL>Q", NULL, G_CALLBACK (modest_ui_actions_on_quit) },
93         { "Help", NULL, N_("mcen_me_inbox_help"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_help) },
94 #ifndef MODEST_TOOLKIT_HILDON2
95         { "SearchMessages", NULL, N_("mcen_me_inbox_search"), "<CTRL>E", NULL,  G_CALLBACK (modest_ui_actions_on_search_messages) },
96 #endif
97         /* KEY ACCELERATOR ACTIONS */
98         { "ZoomPlus", NULL, N_("Zoom +"), "F7", NULL, G_CALLBACK (modest_ui_actions_on_zoom_plus) },
99         { "ZoomMinus", NULL, N_("Zoom -"), "F8", NULL, G_CALLBACK (modest_ui_actions_on_zoom_minus) },
100         { "SendShortcut", NULL, N_("Send email"), "<CTRL>KP_Enter", NULL, G_CALLBACK (modest_ui_actions_on_send) },
101 #ifdef MODEST_TOOLKIT_HILDON2
102         { "SendShortcut2", NULL, N_("Send email"), "<CTRL>Return", NULL, G_CALLBACK (modest_ui_actions_on_send) },
103 #endif
104         { "ToggleFullscreen", NULL, N_("Toggle fullscreen"), "F6", NULL, G_CALLBACK (modest_ui_actions_on_change_fullscreen) },
105         { "CloseWindowShortcut", NULL, NULL, "Escape", NULL, NULL },
106
107         /* TOOLBAR ACTIONS */
108 #ifndef MODEST_TOOLKIT_HILDON2
109         /* Find in page. This is a normal menu option in Hildon2, and a checkbox in the others */
110         { "FindInMessage", NULL, N_("mcen_me_viewer_find"), "<CTRL>F", NULL, G_CALLBACK (modest_ui_actions_on_toggle_find_in_page)},
111         { "ToolbarSend", MODEST_TOOLBAR_ICON_MAIL_SEND, N_("mcen_me_editor_send"),  "<Control>Return", NULL,  G_CALLBACK (modest_ui_actions_on_send) },
112 #endif
113 #ifdef MODEST_TOOLKIT_GTK
114         { "ToolbarAttach", "stock_attach", N_("mcen_me_editor_attachfile"),  NULL, NULL,  G_CALLBACK (modest_ui_actions_on_attach_file) },
115 #endif
116 };
117
118 static const GtkToggleActionEntry modest_msg_edit_toggle_action_entries [] = {
119
120         /* VIEW */
121 #ifdef MODEST_TOOLKIT_HILDON2
122         { "ViewCcField",   NULL,    N_("mcen_me_editor_showcc"),  NULL, NULL,  G_CALLBACK (modest_ui_actions_on_toggle_show_cc), FALSE },
123         { "ViewBccField",  NULL,    N_("mcen_me_editor_showbcc"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_show_bcc), FALSE },
124 #else
125         { "ViewCcField",   NULL,    N_("mcen_me_editor_showcc"),  NULL, NULL,  G_CALLBACK (modest_ui_actions_on_toggle_show_cc), TRUE },
126         { "ViewBccField",  NULL,    N_("mcen_me_editor_showbcc"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_show_bcc), TRUE },
127 #endif
128
129         /* Fullscreen toggle */
130         { "ViewToggleFullscreen", NULL, N_("mcen_me_inbox_fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_fullscreen), FALSE},
131         /* Toolbar visibility */
132         { "ViewShowToolbarNormalScreen", NULL, N_("mcen_me_inbox_normalview"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_toolbar), TRUE },
133         { "ViewShowToolbarFullScreen", NULL, N_("mcen_me_inbox_fullscreen"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_toolbar), TRUE },
134
135         /* Rich text editor functions */
136         { "ActionsBulletedList", NULL, N_("mcen_me_editor_bullets"), NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_bullets), FALSE },
137
138         /* Toolbar buttons */
139         { "ActionsBold", MODEST_TOOLBAR_ICON_BOLD, MODEST_TOOLBAR_ICON_BOLD, NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_bold), FALSE },
140         { "ActionsItalics", MODEST_TOOLBAR_ICON_ITALIC, MODEST_TOOLBAR_ICON_ITALIC, NULL, NULL, G_CALLBACK (modest_ui_actions_on_toggle_italics), FALSE },
141
142 #ifndef MODEST_TOOLKIT_HILDON2
143         /* Find in page */
144         { "FindInMessage", NULL, N_("mcen_me_viewer_find"), "<CTRL>F", NULL, G_CALLBACK (modest_ui_actions_on_toggle_find_in_page), FALSE },
145 #endif
146 };
147
148 static const GtkRadioActionEntry modest_msg_edit_alignment_radio_action_entries [] = {
149         { "AlignmentLeft", NULL, N_("mcen_me_editor_align_left"), NULL, NULL, GTK_JUSTIFY_LEFT },
150         { "AlignmentCenter", NULL, N_("mcen_me_editor_align_centred"), NULL, NULL, GTK_JUSTIFY_CENTER },
151         { "AlignmentRight", NULL, N_("mcen_me_editor_align_right"), NULL, NULL, GTK_JUSTIFY_RIGHT },
152 };
153
154 static const GtkRadioActionEntry modest_msg_edit_priority_action_entries [] = {
155         { "MessagePriorityHigh", NULL, N_("mcen_me_editor_priority_high"), NULL, NULL, TNY_HEADER_FLAG_HIGH_PRIORITY },
156         { "MessagePriorityNormal", NULL, N_("mcen_me_editor_priority_normal"), NULL, NULL, TNY_HEADER_FLAG_NORMAL_PRIORITY },
157         { "MessagePriorityLow", NULL, N_("mcen_me_editor_priority_low"), NULL, NULL, TNY_HEADER_FLAG_LOW_PRIORITY },
158 };
159
160 static const GtkRadioActionEntry modest_msg_edit_file_format_action_entries [] = {
161         { "FileFormatPlainText", NULL, N_("mcen_me_editor_plain_text"), NULL, NULL, MODEST_FILE_FORMAT_PLAIN_TEXT },
162         { "FileFormatFormattedText", NULL, N_("mcen_me_editor_formatted_text"), NULL, NULL, MODEST_FILE_FORMAT_FORMATTED_TEXT },
163 };
164
165 G_END_DECLS
166 #endif /* __MODEST_MSG_EDIT_WINDOW_UI_H__ */