2007-01-26 [wwp] 2.7.2cvs2
[claws.git] / src / quote_fmt.c
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #  include "config.h"
22 #endif
23
24 #include <glib.h>
25 #include <glib/gi18n.h>
26 #include <gtk/gtk.h>
27 #include <gdk/gdkkeysyms.h>
28
29 #include "manage_window.h"
30 #include "description_window.h"
31 #include "gtkutils.h"
32
33
34 /*
35  * Strings describing quote format strings
36  * 
37  * When adding new lines, remember to put 2 strings for each line
38  */
39 static gchar *quote_desc_strings[] = {
40         "%D{fmt}",      N_("customized date format (see 'man strftime')"), /* date expression */
41         "%d",           N_("Date"), /* date */
42         "%f",           N_("From"), /* from */
43         "%N",           N_("full name of sender"), /* full name */
44         "%F",           N_("first name of sender"), /* first name */
45         "%L",           N_("last name of sender"), /* last name */
46         "%I",           N_("initials of sender"), /* initial of sender */
47         "%s",           N_("Subject"), /* subject */ 
48         "%t",           N_("To"), /* to */ 
49         "%c",           N_("Cc"), /* cc */ 
50         "%n",           N_("Newsgroups"), /* newsgroups */ 
51         "%r",           N_("References"), /* references */ 
52         "%i",           N_("Message-ID"), /* message-id */ 
53         "%M",           N_("message body"), /* message */
54         "%Q",           N_("quoted message body"), /* quoted message */
55         "%m",           N_("message body without signature"), /* message with no signature */
56         "%q",           N_("quoted message body without signature"), /* quoted message with no signature */
57         "%X",           N_("cursor position"), /* X marks the cursor spot */
58         "%af",          N_("Account property: your name"), /* full name in compose account */
59         "%am",          N_("Account property: your email address"), /* mail address in compose account */
60         "%an",          N_("Account property: account name"), /* compose account name itself */
61         "%ao",          N_("Account property: organization"), /* organization in compose account */
62         "\\%",          N_("literal %"),
63         "\\\\",         N_("literal backslash"),
64         "\\?",          N_("literal question mark"),
65         "\\!",          N_("literal exclamation mark"),
66         "\\|",          N_("literal pipe"),
67         "\\{",          N_("literal opening curly brace"),
68         "\\}",          N_("literal closing curly brace"),
69         "\\t",          N_("tab"),
70         "\\n",          N_("linefeed"),
71         "",             NULL,
72         "?x{expr}\n",   N_("insert expr if x is set\n(where x is one of the dfNFLIstcnri characters or af, ao)"),
73         "!x{expr}\n",   N_("insert expr if x is not set\n(where x is one of the dfNFLIstcnri characters or af, ao)"),
74         "|f{sub_expr}\n",       N_("insert file:\nsub_expr is evaluated as a filename to insert"), /* insert file */
75         "|p{sub_expr}\n\n",     N_("insert program output:\nsub_expr is evaluated as a command-line to get\nthe output from"), /* insert program output */
76         "|i{sub_expr}\n\n",     N_("insert user input:\nsub_expr is a variable to be replaced by\nuser-entered text"), /* insert user input */
77         "",             NULL,
78         N_("terms definition:"),        NULL,
79         "expr",                 N_("text that can contain any of the symbols above"),
80         "sub_expr\n",   N_("text that can contain any of the symbols above\nbut ?x{}, !x{}, |f{}, |p{} and |i{}"),
81         NULL,NULL
82 };
83
84 static DescriptionWindow quote_desc_win = { 
85         NULL,
86         NULL,
87         2,
88         N_("Description of symbols"),
89         N_("The following symbols can be used:"),
90         quote_desc_strings
91 };
92
93
94 void quote_fmt_quote_description(GtkWidget *widget, GtkWidget *pref_window)
95 {
96         quote_desc_win.parent = pref_window;
97         description_window_create(&quote_desc_win);
98 }
99