1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Authors: Jeffrey Stedfast <fejj@ximian.com>
5 * Copyright 2002 Ximian, Inc. (www.ximian.com)
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
28 #include <gtk/gtkstock.h>
30 #include "message-tag-editor.h"
32 static void message_tag_editor_class_init (MessageTagEditorClass
*class);
33 static void message_tag_editor_init (MessageTagEditor
*editor
);
34 static void message_tag_editor_finalise (GObject
*obj
);
36 static CamelTag
*get_tag_list (MessageTagEditor
*editor
);
37 static void set_tag_list (MessageTagEditor
*editor
, CamelTag
*value
);
39 static GtkDialogClass
*parent_class
= NULL
;
42 message_tag_editor_get_type (void)
44 static GType type
= 0;
47 static const GTypeInfo info
= {
48 sizeof (MessageTagEditorClass
),
49 NULL
, /* base_class_init */
50 NULL
, /* base_class_finalize */
51 (GClassInitFunc
) message_tag_editor_class_init
,
52 NULL
, /* class_finalize */
53 NULL
, /* class_data */
54 sizeof (MessageTagEditor
),
56 (GInstanceInitFunc
) message_tag_editor_init
,
59 type
= g_type_register_static (gtk_dialog_get_type (), "MessageTagEditor", &info
, 0);
66 message_tag_editor_class_init (MessageTagEditorClass
*klass
)
68 GObjectClass
*object_class
= G_OBJECT_CLASS (klass
);
70 parent_class
= g_type_class_ref (gtk_dialog_get_type ());
72 object_class
->finalize
= message_tag_editor_finalise
;
74 klass
->get_tag_list
= get_tag_list
;
75 klass
->set_tag_list
= set_tag_list
;
79 message_tag_editor_init (MessageTagEditor
*editor
)
81 gtk_window_set_default_size((GtkWindow
*)editor
, 400, 500);
82 gtk_dialog_add_buttons (GTK_DIALOG (editor
),
83 GTK_STOCK_CANCEL
, GTK_RESPONSE_CANCEL
,
84 GTK_STOCK_OK
, GTK_RESPONSE_OK
,
87 gtk_dialog_set_default_response (GTK_DIALOG (editor
), GTK_RESPONSE_OK
);
92 message_tag_editor_finalise (GObject
*obj
)
94 /*MessageTagEditor *editor = (MessageTagEditor *) obj;*/
96 G_OBJECT_CLASS (parent_class
)->finalize (obj
);
100 get_tag_list (MessageTagEditor
*editor
)
106 message_tag_editor_get_tag_list (MessageTagEditor
*editor
)
108 g_return_val_if_fail (IS_MESSAGE_TAG_EDITOR (editor
), NULL
);
110 return MESSAGE_TAG_EDITOR_GET_CLASS (editor
)->get_tag_list (editor
);
115 set_tag_list (MessageTagEditor
*editor
, CamelTag
*tags
)
122 message_tag_editor_set_tag_list (MessageTagEditor
*editor
, CamelTag
*tags
)
124 g_return_if_fail (IS_MESSAGE_TAG_EDITOR (editor
));
125 g_return_if_fail (tags
!= NULL
);
127 MESSAGE_TAG_EDITOR_GET_CLASS (editor
)->set_tag_list (editor
, tags
);