2 * Copyright (C) 2015 Red Hat, Inc. (www.redhat.com)
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by
6 * the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "evolution-config.h"
21 #include <glib/gi18n-lib.h>
23 #include <libedataserver/libedataserver.h>
24 #include <e-util/e-util.h>
26 #include "calendar-config.h"
27 #include "e-timezone-entry.h"
29 #include "e-comp-editor-property-part.h"
30 #include "e-comp-editor-property-parts.h"
32 /* ************************************************************************* */
34 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_SUMMARY \
35 (e_comp_editor_property_part_summary_get_type ())
36 #define E_COMP_EDITOR_PROPERTY_PART_SUMMARY(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST \
38 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_SUMMARY, ECompEditorPropertyPartSummary))
39 #define E_IS_COMP_EDITOR_PROPERTY_PART_SUMMARY(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE \
41 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_SUMMARY))
43 typedef struct _ECompEditorPropertyPartSummary ECompEditorPropertyPartSummary
;
44 typedef struct _ECompEditorPropertyPartSummaryClass ECompEditorPropertyPartSummaryClass
;
46 struct _ECompEditorPropertyPartSummary
{
47 ECompEditorPropertyPartString parent
;
50 struct _ECompEditorPropertyPartSummaryClass
{
51 ECompEditorPropertyPartStringClass parent_class
;
54 GType
e_comp_editor_property_part_summary_get_type (void) G_GNUC_CONST
;
56 G_DEFINE_TYPE (ECompEditorPropertyPartSummary
, e_comp_editor_property_part_summary
, E_TYPE_COMP_EDITOR_PROPERTY_PART_STRING
)
59 ecepp_summary_create_widgets (ECompEditorPropertyPart
*property_part
,
60 GtkWidget
**out_label_widget
,
61 GtkWidget
**out_edit_widget
)
63 ECompEditorPropertyPartClass
*part_class
;
65 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_SUMMARY (property_part
));
66 g_return_if_fail (out_label_widget
!= NULL
);
67 g_return_if_fail (out_edit_widget
!= NULL
);
69 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_summary_parent_class
);
70 g_return_if_fail (part_class
!= NULL
);
71 g_return_if_fail (part_class
->create_widgets
!= NULL
);
73 *out_label_widget
= NULL
;
75 part_class
->create_widgets (property_part
, out_label_widget
, out_edit_widget
);
76 g_return_if_fail (*out_label_widget
== NULL
);
77 g_return_if_fail (*out_edit_widget
!= NULL
);
79 *out_label_widget
= gtk_label_new_with_mnemonic (C_("ECompEditor", "_Summary:"));
80 gtk_label_set_mnemonic_widget (GTK_LABEL (*out_label_widget
), *out_edit_widget
);
82 g_object_set (G_OBJECT (*out_label_widget
),
84 "halign", GTK_ALIGN_END
,
86 "valign", GTK_ALIGN_CENTER
,
89 gtk_widget_show (*out_label_widget
);
93 e_comp_editor_property_part_summary_init (ECompEditorPropertyPartSummary
*part_summary
)
98 e_comp_editor_property_part_summary_class_init (ECompEditorPropertyPartSummaryClass
*klass
)
100 ECompEditorPropertyPartStringClass
*part_string_class
;
101 ECompEditorPropertyPartClass
*part_class
;
103 part_string_class
= E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass
);
104 part_string_class
->entry_type
= E_TYPE_SPELL_ENTRY
;
105 part_string_class
->ical_prop_kind
= ICAL_SUMMARY_PROPERTY
;
106 part_string_class
->ical_new_func
= icalproperty_new_summary
;
107 part_string_class
->ical_set_func
= icalproperty_set_summary
;
108 part_string_class
->ical_get_func
= icalproperty_get_summary
;
110 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
111 part_class
->create_widgets
= ecepp_summary_create_widgets
;
114 ECompEditorPropertyPart
*
115 e_comp_editor_property_part_summary_new (EFocusTracker
*focus_tracker
)
117 ECompEditorPropertyPart
*property_part
;
119 property_part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_SUMMARY
, NULL
);
121 e_comp_editor_property_part_string_attach_focus_tracker (
122 E_COMP_EDITOR_PROPERTY_PART_STRING (property_part
), focus_tracker
);
124 return property_part
;
127 /* ************************************************************************* */
129 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_LOCATION \
130 (e_comp_editor_property_part_location_get_type ())
131 #define E_COMP_EDITOR_PROPERTY_PART_LOCATION(obj) \
132 (G_TYPE_CHECK_INSTANCE_CAST \
133 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_LOCATION, ECompEditorPropertyPartLocation))
134 #define E_IS_COMP_EDITOR_PROPERTY_PART_LOCATION(obj) \
135 (G_TYPE_CHECK_INSTANCE_TYPE \
136 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_LOCATION))
138 typedef struct _ECompEditorPropertyPartLocation ECompEditorPropertyPartLocation
;
139 typedef struct _ECompEditorPropertyPartLocationClass ECompEditorPropertyPartLocationClass
;
141 struct _ECompEditorPropertyPartLocation
{
142 ECompEditorPropertyPartString parent
;
145 struct _ECompEditorPropertyPartLocationClass
{
146 ECompEditorPropertyPartStringClass parent_class
;
149 GType
e_comp_editor_property_part_location_get_type (void) G_GNUC_CONST
;
151 G_DEFINE_TYPE (ECompEditorPropertyPartLocation
, e_comp_editor_property_part_location
, E_TYPE_COMP_EDITOR_PROPERTY_PART_STRING
)
154 ecepp_location_get_locations_filename (gboolean config_dir_only
)
156 return g_build_filename (e_get_user_config_dir (), "calendar", config_dir_only
? NULL
: "locations", NULL
);
160 ecepp_location_load_list (GtkEntry
*entry
)
162 GtkEntryCompletion
*completion
;
164 gchar
*filename
, *contents
= NULL
;
167 GError
*error
= NULL
;
169 g_return_if_fail (GTK_IS_ENTRY (entry
));
171 completion
= gtk_entry_get_completion (entry
);
172 g_return_if_fail (completion
!= NULL
);
174 filename
= ecepp_location_get_locations_filename (FALSE
);
176 if (!g_file_test (filename
, G_FILE_TEST_EXISTS
)) {
181 if (!g_file_get_contents (filename
, &contents
, NULL
, &error
)) {
184 "%s: Failed to load locations list '%s': %s",
185 G_STRFUNC
, filename
, error
->message
);
186 g_error_free (error
);
193 locations
= g_strsplit (contents
, "\n", 0);
201 store
= GTK_LIST_STORE (gtk_entry_completion_get_model (completion
));
202 while (locations
[row
] && *locations
[row
]) {
204 gtk_list_store_append (store
, &iter
);
205 gtk_list_store_set (store
, &iter
, 0, locations
[row
], -1);
209 g_strfreev (locations
);
215 ecepp_location_save_list (GtkEntry
*entry
)
217 GtkEntryCompletion
*completion
;
220 const gchar
*current_location
;
221 gchar
*filename
, *stored_content
= NULL
;
222 gboolean needs_save
= TRUE
;
224 GError
*error
= NULL
;
226 g_return_if_fail (GTK_IS_ENTRY (entry
));
228 completion
= gtk_entry_get_completion (entry
);
229 g_return_if_fail (completion
!= NULL
);
231 filename
= ecepp_location_get_locations_filename (TRUE
);
233 if (!g_file_test (filename
, G_FILE_TEST_EXISTS
| G_FILE_TEST_IS_DIR
)) {
234 gint r
= g_mkdir_with_parents (filename
, 0700);
236 g_warning ("%s: Failed to create %s: %s", G_STRFUNC
, filename
, g_strerror (errno
));
244 filename
= ecepp_location_get_locations_filename (FALSE
);
245 current_location
= gtk_entry_get_text (entry
);
247 /* Put current locatin on the very top of the list */
248 contents
= g_string_new (current_location
);
249 if (contents
->len
> 0)
250 g_string_append_c (contents
, '\n');
252 model
= gtk_entry_completion_get_model (completion
);
253 if (gtk_tree_model_get_iter_first (model
, &iter
)) {
258 gtk_tree_model_get (model
, &iter
, 0, &str
, -1);
260 /* Skip the current location */
261 if (str
&& *str
&& g_ascii_strcasecmp (str
, current_location
) != 0)
262 g_string_append_printf (contents
, "%s\n", str
);
268 } while (gtk_tree_model_iter_next (model
, &iter
) && (i
< 20));
271 if (g_file_get_contents (filename
, &stored_content
, NULL
, NULL
)) {
272 needs_save
= g_strcmp0 (stored_content
, contents
->str
) != 0;
273 g_free (stored_content
);
277 g_file_set_contents (filename
, contents
->str
, -1, &error
);
280 "%s: Failed to save locations '%s': %s",
281 G_STRFUNC
, filename
, error
->message
);
282 g_error_free (error
);
286 g_string_free (contents
, TRUE
);
291 ecepp_location_create_widgets (ECompEditorPropertyPart
*property_part
,
292 GtkWidget
**out_label_widget
,
293 GtkWidget
**out_edit_widget
)
295 ECompEditorPropertyPartClass
*part_class
;
296 GtkEntryCompletion
*completion
;
297 GtkListStore
*list_store
;
299 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_LOCATION (property_part
));
300 g_return_if_fail (out_label_widget
!= NULL
);
301 g_return_if_fail (out_edit_widget
!= NULL
);
303 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_location_parent_class
);
304 g_return_if_fail (part_class
!= NULL
);
305 g_return_if_fail (part_class
->create_widgets
!= NULL
);
307 *out_label_widget
= NULL
;
309 part_class
->create_widgets (property_part
, out_label_widget
, out_edit_widget
);
311 g_return_if_fail (*out_label_widget
== NULL
);
312 g_return_if_fail (*out_edit_widget
!= NULL
);
314 completion
= gtk_entry_completion_new ();
316 list_store
= gtk_list_store_new (1, G_TYPE_STRING
);
317 gtk_entry_completion_set_model (completion
, GTK_TREE_MODEL (list_store
));
318 gtk_entry_completion_set_text_column (completion
, 0);
320 gtk_entry_set_completion (GTK_ENTRY (*out_edit_widget
), completion
);
321 g_object_unref (completion
);
323 *out_label_widget
= gtk_label_new_with_mnemonic (C_("ECompEditor", "_Location:"));
324 gtk_label_set_mnemonic_widget (GTK_LABEL (*out_label_widget
), *out_edit_widget
);
326 g_object_set (G_OBJECT (*out_label_widget
),
328 "halign", GTK_ALIGN_END
,
330 "valign", GTK_ALIGN_CENTER
,
333 gtk_widget_show (*out_label_widget
);
335 ecepp_location_load_list (GTK_ENTRY (*out_edit_widget
));
339 ecepp_location_fill_component (ECompEditorPropertyPart
*property_part
,
340 icalcomponent
*component
)
342 ECompEditorPropertyPartClass
*part_class
;
343 GtkWidget
*edit_widget
;
345 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_LOCATION (property_part
));
347 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_location_parent_class
);
348 g_return_if_fail (part_class
!= NULL
);
349 g_return_if_fail (part_class
->fill_component
!= NULL
);
351 part_class
->fill_component (property_part
, component
);
353 edit_widget
= e_comp_editor_property_part_get_edit_widget (property_part
);
354 g_return_if_fail (GTK_IS_ENTRY (edit_widget
));
356 ecepp_location_save_list (GTK_ENTRY (edit_widget
));
360 e_comp_editor_property_part_location_init (ECompEditorPropertyPartLocation
*part_location
)
365 e_comp_editor_property_part_location_class_init (ECompEditorPropertyPartLocationClass
*klass
)
367 ECompEditorPropertyPartStringClass
*part_string_class
;
368 ECompEditorPropertyPartClass
*part_class
;
370 part_string_class
= E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass
);
371 part_string_class
->ical_prop_kind
= ICAL_LOCATION_PROPERTY
;
372 part_string_class
->ical_new_func
= icalproperty_new_location
;
373 part_string_class
->ical_set_func
= icalproperty_set_location
;
374 part_string_class
->ical_get_func
= icalproperty_get_location
;
376 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
377 part_class
->create_widgets
= ecepp_location_create_widgets
;
378 part_class
->fill_component
= ecepp_location_fill_component
;
381 ECompEditorPropertyPart
*
382 e_comp_editor_property_part_location_new (EFocusTracker
*focus_tracker
)
384 ECompEditorPropertyPart
*property_part
;
386 property_part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_LOCATION
, NULL
);
388 e_comp_editor_property_part_string_attach_focus_tracker (
389 E_COMP_EDITOR_PROPERTY_PART_STRING (property_part
), focus_tracker
);
391 return property_part
;
394 /* ************************************************************************* */
396 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_CATEGORIES \
397 (e_comp_editor_property_part_categories_get_type ())
398 #define E_COMP_EDITOR_PROPERTY_PART_CATEGORIES(obj) \
399 (G_TYPE_CHECK_INSTANCE_CAST \
400 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_CATEGORIES, ECompEditorPropertyPartCategories))
401 #define E_IS_COMP_EDITOR_PROPERTY_PART_CATEGORIES(obj) \
402 (G_TYPE_CHECK_INSTANCE_TYPE \
403 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_CATEGORIES))
405 typedef struct _ECompEditorPropertyPartCategories ECompEditorPropertyPartCategories
;
406 typedef struct _ECompEditorPropertyPartCategoriesClass ECompEditorPropertyPartCategoriesClass
;
408 struct _ECompEditorPropertyPartCategories
{
409 ECompEditorPropertyPartString parent
;
412 struct _ECompEditorPropertyPartCategoriesClass
{
413 ECompEditorPropertyPartStringClass parent_class
;
416 GType
e_comp_editor_property_part_categories_get_type (void) G_GNUC_CONST
;
418 G_DEFINE_TYPE (ECompEditorPropertyPartCategories
, e_comp_editor_property_part_categories
, E_TYPE_COMP_EDITOR_PROPERTY_PART_STRING
)
421 ecepp_categories_button_clicked_cb (GtkButton
*button
,
424 g_return_if_fail (GTK_IS_ENTRY (entry
));
426 e_categories_config_open_dialog_for_entry (entry
);
430 ecepp_categories_create_widgets (ECompEditorPropertyPart
*property_part
,
431 GtkWidget
**out_label_widget
,
432 GtkWidget
**out_edit_widget
)
434 ECompEditorPropertyPartClass
*part_class
;
435 GtkEntryCompletion
*completion
;
438 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_CATEGORIES (property_part
));
439 g_return_if_fail (out_label_widget
!= NULL
);
440 g_return_if_fail (out_edit_widget
!= NULL
);
442 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_categories_parent_class
);
443 g_return_if_fail (part_class
!= NULL
);
444 g_return_if_fail (part_class
->create_widgets
!= NULL
);
446 *out_label_widget
= NULL
;
448 part_class
->create_widgets (property_part
, out_label_widget
, out_edit_widget
);
449 g_return_if_fail (*out_label_widget
== NULL
);
450 g_return_if_fail (*out_edit_widget
!= NULL
);
452 completion
= e_category_completion_new ();
453 gtk_entry_set_completion (GTK_ENTRY (*out_edit_widget
), completion
);
454 g_object_unref (completion
);
456 button
= gtk_button_new_with_mnemonic (C_("ECompEditor", "_Categories..."));
457 g_signal_connect (button
, "clicked", G_CALLBACK (ecepp_categories_button_clicked_cb
), *out_edit_widget
);
459 *out_label_widget
= button
;
461 g_object_set (G_OBJECT (*out_label_widget
),
463 "halign", GTK_ALIGN_END
,
465 "valign", GTK_ALIGN_CENTER
,
468 gtk_widget_show (*out_label_widget
);
472 e_comp_editor_property_part_categories_init (ECompEditorPropertyPartCategories
*part_categories
)
474 e_comp_editor_property_part_string_set_is_multivalue (
475 E_COMP_EDITOR_PROPERTY_PART_STRING (part_categories
), TRUE
);
479 e_comp_editor_property_part_categories_class_init (ECompEditorPropertyPartCategoriesClass
*klass
)
481 ECompEditorPropertyPartStringClass
*part_string_class
;
482 ECompEditorPropertyPartClass
*part_class
;
484 part_string_class
= E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass
);
485 part_string_class
->ical_prop_kind
= ICAL_CATEGORIES_PROPERTY
;
486 part_string_class
->ical_new_func
= icalproperty_new_categories
;
487 part_string_class
->ical_set_func
= icalproperty_set_categories
;
488 part_string_class
->ical_get_func
= icalproperty_get_categories
;
490 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
491 part_class
->create_widgets
= ecepp_categories_create_widgets
;
494 ECompEditorPropertyPart
*
495 e_comp_editor_property_part_categories_new (EFocusTracker
*focus_tracker
)
497 ECompEditorPropertyPart
*property_part
;
499 property_part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_CATEGORIES
, NULL
);
501 e_comp_editor_property_part_string_attach_focus_tracker (
502 E_COMP_EDITOR_PROPERTY_PART_STRING (property_part
), focus_tracker
);
504 return property_part
;
507 /* ************************************************************************* */
509 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_DESCRIPTION \
510 (e_comp_editor_property_part_description_get_type ())
511 #define E_COMP_EDITOR_PROPERTY_PART_DESCRIPTION(obj) \
512 (G_TYPE_CHECK_INSTANCE_CAST \
513 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DESCRIPTION, ECompEditorPropertyPartDescription))
514 #define E_IS_COMP_EDITOR_PROPERTY_PART_DESCRIPTION(obj) \
515 (G_TYPE_CHECK_INSTANCE_TYPE \
516 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DESCRIPTION))
518 typedef struct _ECompEditorPropertyPartDescription ECompEditorPropertyPartDescription
;
519 typedef struct _ECompEditorPropertyPartDescriptionClass ECompEditorPropertyPartDescriptionClass
;
521 struct _ECompEditorPropertyPartDescription
{
522 ECompEditorPropertyPartString parent
;
525 struct _ECompEditorPropertyPartDescriptionClass
{
526 ECompEditorPropertyPartStringClass parent_class
;
529 GType
e_comp_editor_property_part_description_get_type (void) G_GNUC_CONST
;
531 G_DEFINE_TYPE (ECompEditorPropertyPartDescription
, e_comp_editor_property_part_description
, E_TYPE_COMP_EDITOR_PROPERTY_PART_STRING
)
534 ecepp_description_create_widgets (ECompEditorPropertyPart
*property_part
,
535 GtkWidget
**out_label_widget
,
536 GtkWidget
**out_edit_widget
)
538 ECompEditorPropertyPartClass
*part_class
;
539 GtkTextView
*text_view
;
541 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DESCRIPTION (property_part
));
542 g_return_if_fail (out_label_widget
!= NULL
);
543 g_return_if_fail (out_edit_widget
!= NULL
);
545 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_description_parent_class
);
546 g_return_if_fail (part_class
!= NULL
);
547 g_return_if_fail (part_class
->create_widgets
!= NULL
);
549 *out_label_widget
= NULL
;
551 part_class
->create_widgets (property_part
, out_label_widget
, out_edit_widget
);
552 g_return_if_fail (*out_label_widget
== NULL
);
553 g_return_if_fail (*out_edit_widget
!= NULL
);
555 *out_label_widget
= gtk_label_new_with_mnemonic (C_("ECompEditor", "_Description:"));
556 gtk_label_set_mnemonic_widget (GTK_LABEL (*out_label_widget
), *out_edit_widget
);
558 text_view
= GTK_TEXT_VIEW (gtk_bin_get_child (GTK_BIN (*out_edit_widget
)));
559 gtk_text_view_set_wrap_mode (text_view
, GTK_WRAP_WORD
);
560 gtk_text_view_set_monospace (text_view
, TRUE
);
561 e_buffer_tagger_connect (text_view
);
562 e_spell_text_view_attach (text_view
);
564 g_object_set (G_OBJECT (*out_label_widget
),
566 "halign", GTK_ALIGN_END
,
568 "valign", GTK_ALIGN_START
,
571 g_object_set (G_OBJECT (*out_edit_widget
),
573 "halign", GTK_ALIGN_FILL
,
575 "valign", GTK_ALIGN_FILL
,
576 "height-request", 100,
579 gtk_widget_show (*out_label_widget
);
583 ecepp_description_fill_widget (ECompEditorPropertyPart
*property_part
,
584 icalcomponent
*component
)
586 ECompEditorPropertyPartClass
*part_class
;
587 GtkWidget
*edit_widget
;
589 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DESCRIPTION (property_part
));
590 g_return_if_fail (component
!= NULL
);
592 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_description_parent_class
);
593 g_return_if_fail (part_class
!= NULL
);
594 g_return_if_fail (part_class
->fill_widget
!= NULL
);
596 part_class
->fill_widget (property_part
, component
);
598 edit_widget
= e_comp_editor_property_part_get_edit_widget (property_part
);
599 g_return_if_fail (GTK_IS_SCROLLED_WINDOW (edit_widget
));
601 e_buffer_tagger_update_tags (GTK_TEXT_VIEW (gtk_bin_get_child (GTK_BIN (edit_widget
))));
605 e_comp_editor_property_part_description_init (ECompEditorPropertyPartDescription
*part_description
)
610 e_comp_editor_property_part_description_class_init (ECompEditorPropertyPartDescriptionClass
*klass
)
612 ECompEditorPropertyPartStringClass
*part_string_class
;
613 ECompEditorPropertyPartClass
*part_class
;
615 part_string_class
= E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass
);
616 part_string_class
->entry_type
= GTK_TYPE_TEXT_VIEW
;
617 part_string_class
->ical_prop_kind
= ICAL_DESCRIPTION_PROPERTY
;
618 part_string_class
->ical_new_func
= icalproperty_new_description
;
619 part_string_class
->ical_set_func
= icalproperty_set_description
;
620 part_string_class
->ical_get_func
= icalproperty_get_description
;
622 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
623 part_class
->create_widgets
= ecepp_description_create_widgets
;
624 part_class
->fill_widget
= ecepp_description_fill_widget
;
627 ECompEditorPropertyPart
*
628 e_comp_editor_property_part_description_new (EFocusTracker
*focus_tracker
)
630 ECompEditorPropertyPart
*property_part
;
632 property_part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_DESCRIPTION
, NULL
);
634 e_comp_editor_property_part_string_attach_focus_tracker (
635 E_COMP_EDITOR_PROPERTY_PART_STRING (property_part
), focus_tracker
);
637 return property_part
;
640 /* ************************************************************************* */
642 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_URL \
643 (e_comp_editor_property_part_url_get_type ())
644 #define E_COMP_EDITOR_PROPERTY_PART_URL(obj) \
645 (G_TYPE_CHECK_INSTANCE_CAST \
646 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_URL, ECompEditorPropertyPartUrl))
647 #define E_IS_COMP_EDITOR_PROPERTY_PART_URL(obj) \
648 (G_TYPE_CHECK_INSTANCE_TYPE \
649 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_URL))
651 typedef struct _ECompEditorPropertyPartUrl ECompEditorPropertyPartUrl
;
652 typedef struct _ECompEditorPropertyPartUrlClass ECompEditorPropertyPartUrlClass
;
654 struct _ECompEditorPropertyPartUrl
{
655 ECompEditorPropertyPartString parent
;
658 struct _ECompEditorPropertyPartUrlClass
{
659 ECompEditorPropertyPartStringClass parent_class
;
662 GType
e_comp_editor_property_part_url_get_type (void) G_GNUC_CONST
;
664 G_DEFINE_TYPE (ECompEditorPropertyPartUrl
, e_comp_editor_property_part_url
, E_TYPE_COMP_EDITOR_PROPERTY_PART_STRING
)
667 ecepp_url_create_widgets (ECompEditorPropertyPart
*property_part
,
668 GtkWidget
**out_label_widget
,
669 GtkWidget
**out_edit_widget
)
671 ECompEditorPropertyPartClass
*part_class
;
673 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_URL (property_part
));
674 g_return_if_fail (out_label_widget
!= NULL
);
675 g_return_if_fail (out_edit_widget
!= NULL
);
677 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_url_parent_class
);
678 g_return_if_fail (part_class
!= NULL
);
679 g_return_if_fail (part_class
->create_widgets
!= NULL
);
681 *out_label_widget
= NULL
;
683 part_class
->create_widgets (property_part
, out_label_widget
, out_edit_widget
);
684 g_return_if_fail (*out_label_widget
== NULL
);
685 g_return_if_fail (*out_edit_widget
!= NULL
);
687 *out_label_widget
= gtk_label_new_with_mnemonic (C_("ECompEditor", "_Web page:"));
688 gtk_label_set_mnemonic_widget (GTK_LABEL (*out_label_widget
), *out_edit_widget
);
690 g_object_set (G_OBJECT (*out_label_widget
),
692 "halign", GTK_ALIGN_END
,
694 "valign", GTK_ALIGN_CENTER
,
697 gtk_widget_show (*out_label_widget
);
701 e_comp_editor_property_part_url_init (ECompEditorPropertyPartUrl
*part_url
)
706 e_comp_editor_property_part_url_class_init (ECompEditorPropertyPartUrlClass
*klass
)
708 ECompEditorPropertyPartStringClass
*part_string_class
;
709 ECompEditorPropertyPartClass
*part_class
;
711 part_string_class
= E_COMP_EDITOR_PROPERTY_PART_STRING_CLASS (klass
);
712 part_string_class
->entry_type
= E_TYPE_URL_ENTRY
;
713 part_string_class
->ical_prop_kind
= ICAL_URL_PROPERTY
;
714 part_string_class
->ical_new_func
= icalproperty_new_url
;
715 part_string_class
->ical_set_func
= icalproperty_set_url
;
716 part_string_class
->ical_get_func
= icalproperty_get_url
;
718 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
719 part_class
->create_widgets
= ecepp_url_create_widgets
;
722 ECompEditorPropertyPart
*
723 e_comp_editor_property_part_url_new (EFocusTracker
*focus_tracker
)
725 ECompEditorPropertyPart
*property_part
;
727 property_part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_URL
, NULL
);
729 e_comp_editor_property_part_string_attach_focus_tracker (
730 E_COMP_EDITOR_PROPERTY_PART_STRING (property_part
), focus_tracker
);
732 return property_part
;
735 /* ************************************************************************* */
737 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED \
738 (e_comp_editor_property_part_datetime_labeled_get_type ())
739 #define E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED(obj) \
740 (G_TYPE_CHECK_INSTANCE_CAST \
741 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED, ECompEditorPropertyPartDatetimeLabeled))
742 #define E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED(obj) \
743 (G_TYPE_CHECK_INSTANCE_TYPE \
744 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED))
746 typedef struct _ECompEditorPropertyPartDatetimeLabeled ECompEditorPropertyPartDatetimeLabeled
;
747 typedef struct _ECompEditorPropertyPartDatetimeLabeledClass ECompEditorPropertyPartDatetimeLabeledClass
;
749 struct _ECompEditorPropertyPartDatetimeLabeled
{
750 ECompEditorPropertyPartDatetime parent
;
755 struct _ECompEditorPropertyPartDatetimeLabeledClass
{
756 ECompEditorPropertyPartDatetimeClass parent_class
;
759 GType
e_comp_editor_property_part_datetime_labeled_get_type (void) G_GNUC_CONST
;
762 DATETIME_LABELED_PROP_0
,
763 DATETIME_LABELED_PROP_LABEL
766 G_DEFINE_ABSTRACT_TYPE (ECompEditorPropertyPartDatetimeLabeled
, e_comp_editor_property_part_datetime_labeled
, E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME
)
769 ecepp_datetime_labeled_create_widgets (ECompEditorPropertyPart
*property_part
,
770 GtkWidget
**out_label_widget
,
771 GtkWidget
**out_edit_widget
)
773 ECompEditorPropertyPartDatetimeLabeled
*part_datetime_labeled
;
774 ECompEditorPropertyPartClass
*part_class
;
776 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (property_part
));
777 g_return_if_fail (out_label_widget
!= NULL
);
778 g_return_if_fail (out_edit_widget
!= NULL
);
780 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_datetime_labeled_parent_class
);
781 g_return_if_fail (part_class
!= NULL
);
782 g_return_if_fail (part_class
->create_widgets
!= NULL
);
784 part_datetime_labeled
= E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (property_part
);
786 *out_label_widget
= NULL
;
788 part_class
->create_widgets (property_part
, out_label_widget
, out_edit_widget
);
789 g_return_if_fail (*out_label_widget
== NULL
);
790 g_return_if_fail (*out_edit_widget
!= NULL
);
792 *out_label_widget
= gtk_label_new_with_mnemonic (part_datetime_labeled
->label
);
793 gtk_label_set_mnemonic_widget (GTK_LABEL (*out_label_widget
), *out_edit_widget
);
795 g_object_set (G_OBJECT (*out_label_widget
),
797 "halign", GTK_ALIGN_END
,
799 "valign", GTK_ALIGN_CENTER
,
802 gtk_widget_show (*out_label_widget
);
806 ecepp_datetime_labeled_set_property (GObject
*object
,
811 ECompEditorPropertyPartDatetimeLabeled
*part_datetime_labeled
;
813 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (object
));
815 part_datetime_labeled
= E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (object
);
817 switch (property_id
) {
818 case DATETIME_LABELED_PROP_LABEL
:
819 g_free (part_datetime_labeled
->label
);
820 part_datetime_labeled
->label
= g_value_dup_string (value
);
824 G_OBJECT_WARN_INVALID_PROPERTY_ID (object
, property_id
, pspec
);
828 ecepp_datetime_labeled_finalize (GObject
*object
)
830 ECompEditorPropertyPartDatetimeLabeled
*part_datetime_labeled
;
832 part_datetime_labeled
= E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (object
);
834 g_free (part_datetime_labeled
->label
);
835 part_datetime_labeled
->label
= NULL
;
837 G_OBJECT_CLASS (e_comp_editor_property_part_datetime_labeled_parent_class
)->finalize (object
);
841 e_comp_editor_property_part_datetime_labeled_init (ECompEditorPropertyPartDatetimeLabeled
*part_datetime_labeled
)
846 e_comp_editor_property_part_datetime_labeled_class_init (ECompEditorPropertyPartDatetimeLabeledClass
*klass
)
848 ECompEditorPropertyPartClass
*part_class
;
849 GObjectClass
*object_class
;
851 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
852 part_class
->create_widgets
= ecepp_datetime_labeled_create_widgets
;
854 object_class
= G_OBJECT_CLASS (klass
);
855 object_class
->set_property
= ecepp_datetime_labeled_set_property
;
856 object_class
->finalize
= ecepp_datetime_labeled_finalize
;
858 g_object_class_install_property (
860 DATETIME_LABELED_PROP_LABEL
,
861 g_param_spec_string (
864 "Label of the datetime",
867 G_PARAM_CONSTRUCT_ONLY
|
868 G_PARAM_STATIC_STRINGS
));
872 e_comp_editor_property_part_datetime_labeled_setup (ECompEditorPropertyPartDatetimeLabeled
*part_datetime_labeled
,
874 gboolean allow_no_date_set
)
876 ECompEditorPropertyPartDatetime
*part_datetime
;
878 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (part_datetime_labeled
));
880 part_datetime
= E_COMP_EDITOR_PROPERTY_PART_DATETIME (part_datetime_labeled
);
882 e_comp_editor_property_part_datetime_set_date_only (part_datetime
, date_only
);
883 e_comp_editor_property_part_datetime_set_allow_no_date_set (part_datetime
, allow_no_date_set
);
886 /* ************************************************************************* */
888 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_DTSTART \
889 (e_comp_editor_property_part_dtstart_get_type ())
890 #define E_COMP_EDITOR_PROPERTY_PART_DTSTART(obj) \
891 (G_TYPE_CHECK_INSTANCE_CAST \
892 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DTSTART, ECompEditorPropertyPartDtstart))
893 #define E_IS_COMP_EDITOR_PROPERTY_PART_DTSTART(obj) \
894 (G_TYPE_CHECK_INSTANCE_TYPE \
895 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DTSTART))
897 typedef struct _ECompEditorPropertyPartDtstart ECompEditorPropertyPartDtstart
;
898 typedef struct _ECompEditorPropertyPartDtstartClass ECompEditorPropertyPartDtstartClass
;
900 struct _ECompEditorPropertyPartDtstart
{
901 ECompEditorPropertyPartDatetimeLabeled parent
;
904 struct _ECompEditorPropertyPartDtstartClass
{
905 ECompEditorPropertyPartDatetimeLabeledClass parent_class
;
908 GType
e_comp_editor_property_part_dtstart_get_type (void) G_GNUC_CONST
;
910 G_DEFINE_TYPE (ECompEditorPropertyPartDtstart
, e_comp_editor_property_part_dtstart
, E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED
)
913 e_comp_editor_property_part_dtstart_init (ECompEditorPropertyPartDtstart
*part_dtstart
)
918 e_comp_editor_property_part_dtstart_class_init (ECompEditorPropertyPartDtstartClass
*klass
)
920 ECompEditorPropertyPartDatetimeClass
*part_datetime_class
;
922 part_datetime_class
= E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass
);
923 part_datetime_class
->ical_prop_kind
= ICAL_DTSTART_PROPERTY
;
924 part_datetime_class
->ical_new_func
= icalproperty_new_dtstart
;
925 part_datetime_class
->ical_set_func
= icalproperty_set_dtstart
;
926 part_datetime_class
->ical_get_func
= icalproperty_get_dtstart
;
929 ECompEditorPropertyPart
*
930 e_comp_editor_property_part_dtstart_new (const gchar
*label
,
932 gboolean allow_no_date_set
)
934 ECompEditorPropertyPart
*part
;
936 part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_DTSTART
,
940 e_comp_editor_property_part_datetime_labeled_setup (
941 E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (part
),
942 date_only
, allow_no_date_set
);
947 /* ************************************************************************* */
949 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_DTEND \
950 (e_comp_editor_property_part_dtend_get_type ())
951 #define E_COMP_EDITOR_PROPERTY_PART_DTEND(obj) \
952 (G_TYPE_CHECK_INSTANCE_CAST \
953 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DTEND, ECompEditorPropertyPartDtend))
954 #define E_IS_COMP_EDITOR_PROPERTY_PART_DTEND(obj) \
955 (G_TYPE_CHECK_INSTANCE_TYPE \
956 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DTEND))
958 typedef struct _ECompEditorPropertyPartDtend ECompEditorPropertyPartDtend
;
959 typedef struct _ECompEditorPropertyPartDtendClass ECompEditorPropertyPartDtendClass
;
961 struct _ECompEditorPropertyPartDtend
{
962 ECompEditorPropertyPartDatetimeLabeled parent
;
965 struct _ECompEditorPropertyPartDtendClass
{
966 ECompEditorPropertyPartDatetimeLabeledClass parent_class
;
969 GType
e_comp_editor_property_part_dtend_get_type (void) G_GNUC_CONST
;
971 G_DEFINE_TYPE (ECompEditorPropertyPartDtend
, e_comp_editor_property_part_dtend
, E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED
)
974 e_comp_editor_property_part_dtend_init (ECompEditorPropertyPartDtend
*part_dtend
)
979 e_comp_editor_property_part_dtend_class_init (ECompEditorPropertyPartDtendClass
*klass
)
981 ECompEditorPropertyPartDatetimeClass
*part_datetime_class
;
983 part_datetime_class
= E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass
);
984 part_datetime_class
->ical_prop_kind
= ICAL_DTEND_PROPERTY
;
985 part_datetime_class
->ical_new_func
= icalproperty_new_dtend
;
986 part_datetime_class
->ical_set_func
= icalproperty_set_dtend
;
987 part_datetime_class
->ical_get_func
= icalproperty_get_dtend
;
990 ECompEditorPropertyPart
*
991 e_comp_editor_property_part_dtend_new (const gchar
*label
,
993 gboolean allow_no_date_set
)
995 ECompEditorPropertyPart
*part
;
997 part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_DTEND
,
1001 e_comp_editor_property_part_datetime_labeled_setup (
1002 E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (part
),
1003 date_only
, allow_no_date_set
);
1008 /* ************************************************************************* */
1010 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_DUE \
1011 (e_comp_editor_property_part_due_get_type ())
1012 #define E_COMP_EDITOR_PROPERTY_PART_DUE(obj) \
1013 (G_TYPE_CHECK_INSTANCE_CAST \
1014 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DUE, ECompEditorPropertyPartDue))
1015 #define E_IS_COMP_EDITOR_PROPERTY_PART_DUE(obj) \
1016 (G_TYPE_CHECK_INSTANCE_TYPE \
1017 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_DUE))
1019 typedef struct _ECompEditorPropertyPartDue ECompEditorPropertyPartDue
;
1020 typedef struct _ECompEditorPropertyPartDueClass ECompEditorPropertyPartDueClass
;
1022 struct _ECompEditorPropertyPartDue
{
1023 ECompEditorPropertyPartDatetimeLabeled parent
;
1026 struct _ECompEditorPropertyPartDueClass
{
1027 ECompEditorPropertyPartDatetimeLabeledClass parent_class
;
1030 GType
e_comp_editor_property_part_due_get_type (void) G_GNUC_CONST
;
1032 G_DEFINE_TYPE (ECompEditorPropertyPartDue
, e_comp_editor_property_part_due
, E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED
)
1035 e_comp_editor_property_part_due_init (ECompEditorPropertyPartDue
*part_due
)
1040 e_comp_editor_property_part_due_class_init (ECompEditorPropertyPartDueClass
*klass
)
1042 ECompEditorPropertyPartDatetimeClass
*part_datetime_class
;
1044 part_datetime_class
= E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass
);
1045 part_datetime_class
->ical_prop_kind
= ICAL_DUE_PROPERTY
;
1046 part_datetime_class
->ical_new_func
= icalproperty_new_due
;
1047 part_datetime_class
->ical_set_func
= icalproperty_set_due
;
1048 part_datetime_class
->ical_get_func
= icalproperty_get_due
;
1051 ECompEditorPropertyPart
*
1052 e_comp_editor_property_part_due_new (gboolean date_only
,
1053 gboolean allow_no_date_set
)
1055 ECompEditorPropertyPart
*part
;
1057 part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_DUE
,
1058 "label", C_("ECompEditor", "D_ue date:"),
1061 e_comp_editor_property_part_datetime_labeled_setup (
1062 E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (part
),
1063 date_only
, allow_no_date_set
);
1068 /* ************************************************************************* */
1070 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_COMPLETED \
1071 (e_comp_editor_property_part_completed_get_type ())
1072 #define E_COMP_EDITOR_PROPERTY_PART_COMPLETED(obj) \
1073 (G_TYPE_CHECK_INSTANCE_CAST \
1074 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_COMPLETED, ECompEditorPropertyPartCompleted))
1075 #define E_IS_COMP_EDITOR_PROPERTY_PART_COMPLETED(obj) \
1076 (G_TYPE_CHECK_INSTANCE_TYPE \
1077 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_COMPLETED))
1079 typedef struct _ECompEditorPropertyPartCompleted ECompEditorPropertyPartCompleted
;
1080 typedef struct _ECompEditorPropertyPartCompletedClass ECompEditorPropertyPartCompletedClass
;
1082 struct _ECompEditorPropertyPartCompleted
{
1083 ECompEditorPropertyPartDatetimeLabeled parent
;
1086 struct _ECompEditorPropertyPartCompletedClass
{
1087 ECompEditorPropertyPartDatetimeLabeledClass parent_class
;
1090 GType
e_comp_editor_property_part_completed_get_type (void) G_GNUC_CONST
;
1092 G_DEFINE_TYPE (ECompEditorPropertyPartCompleted
, e_comp_editor_property_part_completed
, E_TYPE_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED
)
1095 e_comp_editor_property_part_completed_ensure_date_time (struct icaltimetype
*pvalue
)
1097 if (!pvalue
|| !pvalue
->is_date
)
1100 pvalue
->is_date
= 0;
1104 pvalue
->zone
= icaltimezone_get_utc_timezone ();
1107 static icalproperty
*
1108 e_comp_editor_property_part_completed_new_func_wrapper (struct icaltimetype value
)
1110 e_comp_editor_property_part_completed_ensure_date_time (&value
);
1112 return icalproperty_new_completed (value
);
1116 e_comp_editor_property_part_completed_set_func_wrapper (icalproperty
*prop
,
1117 struct icaltimetype value
)
1119 e_comp_editor_property_part_completed_ensure_date_time (&value
);
1121 return icalproperty_set_completed (prop
, value
);
1125 e_comp_editor_property_part_completed_init (ECompEditorPropertyPartCompleted
*part_completed
)
1130 e_comp_editor_property_part_completed_class_init (ECompEditorPropertyPartCompletedClass
*klass
)
1132 ECompEditorPropertyPartDatetimeClass
*part_datetime_class
;
1134 part_datetime_class
= E_COMP_EDITOR_PROPERTY_PART_DATETIME_CLASS (klass
);
1135 part_datetime_class
->ical_prop_kind
= ICAL_COMPLETED_PROPERTY
;
1136 part_datetime_class
->ical_new_func
= e_comp_editor_property_part_completed_new_func_wrapper
;
1137 part_datetime_class
->ical_set_func
= e_comp_editor_property_part_completed_set_func_wrapper
;
1138 part_datetime_class
->ical_get_func
= icalproperty_get_completed
;
1141 ECompEditorPropertyPart
*
1142 e_comp_editor_property_part_completed_new (gboolean date_only
,
1143 gboolean allow_no_date_set
)
1145 ECompEditorPropertyPart
*part
;
1147 part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_COMPLETED
,
1148 "label", C_("ECompEditor", "Date _completed:"),
1151 e_comp_editor_property_part_datetime_labeled_setup (
1152 E_COMP_EDITOR_PROPERTY_PART_DATETIME_LABELED (part
),
1153 date_only
, allow_no_date_set
);
1158 /* ************************************************************************* */
1160 ECompEditorPropertyPart
*
1161 e_comp_editor_property_part_classification_new (void)
1163 ECompEditorPropertyPartPickerMap map
[] = {
1164 { ICAL_CLASS_PUBLIC
, NC_("ECompEditor", "Public"), FALSE
, NULL
},
1165 { ICAL_CLASS_PRIVATE
, NC_("ECompEditor", "Private"), FALSE
, NULL
},
1166 { ICAL_CLASS_CONFIDENTIAL
, NC_("ECompEditor", "Confidential"), FALSE
, NULL
}
1168 GSettings
*settings
;
1169 ECompEditorPropertyPart
*part
;
1170 gboolean classify_private
;
1171 gint ii
, n_elems
= G_N_ELEMENTS (map
);
1173 for (ii
= 0; ii
< n_elems
; ii
++) {
1174 map
[ii
].description
= g_dpgettext2 (GETTEXT_PACKAGE
, "ECompEditor", map
[ii
].description
);
1177 settings
= e_util_ref_settings ("org.gnome.evolution.calendar");
1178 classify_private
= g_settings_get_boolean (settings
, "classify-private");
1179 g_object_unref (settings
);
1181 part
= e_comp_editor_property_part_picker_with_map_new (map
, n_elems
,
1182 C_("ECompEditor", "C_lassification:"),
1183 ICAL_CLASS_PROPERTY
,
1184 (ECompEditorPropertyPartPickerMapICalNewFunc
) icalproperty_new_class
,
1185 (ECompEditorPropertyPartPickerMapICalSetFunc
) icalproperty_set_class
,
1186 (ECompEditorPropertyPartPickerMapICalGetFunc
) icalproperty_get_class
);
1188 e_comp_editor_property_part_picker_with_map_set_selected (
1189 E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (part
),
1190 classify_private
? ICAL_CLASS_PRIVATE
: ICAL_CLASS_PUBLIC
);
1195 /* ************************************************************************* */
1197 ECompEditorPropertyPart
*
1198 e_comp_editor_property_part_status_new (void)
1200 ECompEditorPropertyPartPickerMap map
[] = {
1201 { ICAL_STATUS_NONE
, NC_("ECompEditor", "Not Started"), TRUE
, NULL
},
1202 { ICAL_STATUS_INPROCESS
, NC_("ECompEditor", "In Progress"), FALSE
, NULL
},
1203 { ICAL_STATUS_COMPLETED
, NC_("ECompEditor", "Completed"), FALSE
, NULL
},
1204 { ICAL_STATUS_CANCELLED
, NC_("ECompEditor", "Cancelled"), FALSE
, NULL
}
1206 gint ii
, n_elems
= G_N_ELEMENTS (map
);
1208 for (ii
= 0; ii
< n_elems
; ii
++) {
1209 map
[ii
].description
= g_dpgettext2 (GETTEXT_PACKAGE
, "ECompEditor", map
[ii
].description
);
1212 return e_comp_editor_property_part_picker_with_map_new (map
, n_elems
,
1213 C_("ECompEditor", "_Status:"),
1214 ICAL_STATUS_PROPERTY
,
1215 (ECompEditorPropertyPartPickerMapICalNewFunc
) icalproperty_new_status
,
1216 (ECompEditorPropertyPartPickerMapICalSetFunc
) icalproperty_set_status
,
1217 (ECompEditorPropertyPartPickerMapICalGetFunc
) icalproperty_get_status
);
1220 /* ************************************************************************* */
1223 ecepp_priority_matches (gint map_value
,
1224 gint component_value
)
1226 if (map_value
== component_value
)
1229 if (component_value
== 0)
1230 return map_value
== 0;
1231 else if (component_value
<= 4)
1232 return map_value
== 3;
1233 else if (component_value
== 5)
1234 return map_value
== 5;
1236 return map_value
== 7;
1239 ECompEditorPropertyPart
*
1240 e_comp_editor_property_part_priority_new (void)
1242 ECompEditorPropertyPartPickerMap map
[] = {
1243 { 0, NC_("ECompEditor", "Undefined"), TRUE
, ecepp_priority_matches
},
1244 { 3, NC_("ECompEditor", "High"), FALSE
, ecepp_priority_matches
},
1245 { 5, NC_("ECompEditor", "Normal"), FALSE
, ecepp_priority_matches
},
1246 { 7, NC_("ECompEditor", "Low"), FALSE
, ecepp_priority_matches
}
1248 gint ii
, n_elems
= G_N_ELEMENTS (map
);
1250 for (ii
= 0; ii
< n_elems
; ii
++) {
1251 map
[ii
].description
= g_dpgettext2 (GETTEXT_PACKAGE
, "ECompEditor", map
[ii
].description
);
1254 return e_comp_editor_property_part_picker_with_map_new (map
, n_elems
,
1255 C_("ECompEditor", "Priorit_y:"),
1256 ICAL_PRIORITY_PROPERTY
,
1257 icalproperty_new_priority
,
1258 icalproperty_set_priority
,
1259 icalproperty_get_priority
);
1262 /* ************************************************************************* */
1264 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_PERCENTCOMPLETE \
1265 (e_comp_editor_property_part_percentcomplete_get_type ())
1266 #define E_COMP_EDITOR_PROPERTY_PART_PERCENTCOMPLETE(obj) \
1267 (G_TYPE_CHECK_INSTANCE_CAST \
1268 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_PERCENTCOMPLETE, ECompEditorPropertyPartPercentcomplete))
1269 #define E_IS_COMP_EDITOR_PROPERTY_PART_PERCENTCOMPLETE(obj) \
1270 (G_TYPE_CHECK_INSTANCE_TYPE \
1271 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_PERCENTCOMPLETE))
1273 typedef struct _ECompEditorPropertyPartPercentcomplete ECompEditorPropertyPartPercentcomplete
;
1274 typedef struct _ECompEditorPropertyPartPercentcompleteClass ECompEditorPropertyPartPercentcompleteClass
;
1276 struct _ECompEditorPropertyPartPercentcomplete
{
1277 ECompEditorPropertyPartSpin parent
;
1280 struct _ECompEditorPropertyPartPercentcompleteClass
{
1281 ECompEditorPropertyPartSpinClass parent_class
;
1284 GType
e_comp_editor_property_part_percentcomplete_get_type (void) G_GNUC_CONST
;
1286 G_DEFINE_TYPE (ECompEditorPropertyPartPercentcomplete
, e_comp_editor_property_part_percentcomplete
, E_TYPE_COMP_EDITOR_PROPERTY_PART_SPIN
)
1289 ecepp_percentcomplete_create_widgets (ECompEditorPropertyPart
*property_part
,
1290 GtkWidget
**out_label_widget
,
1291 GtkWidget
**out_edit_widget
)
1293 ECompEditorPropertyPartClass
*part_class
;
1295 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_PERCENTCOMPLETE (property_part
));
1296 g_return_if_fail (out_label_widget
!= NULL
);
1297 g_return_if_fail (out_edit_widget
!= NULL
);
1299 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (e_comp_editor_property_part_percentcomplete_parent_class
);
1300 g_return_if_fail (part_class
!= NULL
);
1301 g_return_if_fail (part_class
->create_widgets
!= NULL
);
1303 *out_label_widget
= NULL
;
1305 part_class
->create_widgets (property_part
, out_label_widget
, out_edit_widget
);
1306 g_return_if_fail (*out_label_widget
== NULL
);
1307 g_return_if_fail (*out_edit_widget
!= NULL
);
1309 *out_label_widget
= gtk_label_new_with_mnemonic (C_("ECompEditor", "Percent complete:"));
1310 gtk_label_set_mnemonic_widget (GTK_LABEL (*out_label_widget
), *out_edit_widget
);
1312 g_object_set (G_OBJECT (*out_label_widget
),
1314 "halign", GTK_ALIGN_END
,
1316 "valign", GTK_ALIGN_CENTER
,
1319 gtk_widget_show (*out_label_widget
);
1323 e_comp_editor_property_part_percentcomplete_init (ECompEditorPropertyPartPercentcomplete
*part_percentcomplete
)
1328 e_comp_editor_property_part_percentcomplete_class_init (ECompEditorPropertyPartPercentcompleteClass
*klass
)
1330 ECompEditorPropertyPartSpinClass
*part_spin_class
;
1331 ECompEditorPropertyPartClass
*part_class
;
1333 part_spin_class
= E_COMP_EDITOR_PROPERTY_PART_SPIN_CLASS (klass
);
1334 part_spin_class
->ical_prop_kind
= ICAL_PERCENTCOMPLETE_PROPERTY
;
1335 part_spin_class
->ical_new_func
= icalproperty_new_percentcomplete
;
1336 part_spin_class
->ical_set_func
= icalproperty_set_percentcomplete
;
1337 part_spin_class
->ical_get_func
= icalproperty_get_percentcomplete
;
1339 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
1340 part_class
->create_widgets
= ecepp_percentcomplete_create_widgets
;
1343 ECompEditorPropertyPart
*
1344 e_comp_editor_property_part_percentcomplete_new (void)
1346 ECompEditorPropertyPart
*part
;
1348 part
= g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_PERCENTCOMPLETE
, NULL
);
1350 e_comp_editor_property_part_spin_set_range (E_COMP_EDITOR_PROPERTY_PART_SPIN (part
), 0, 100);
1355 /* ************************************************************************* */
1357 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_TIMEZONE \
1358 (e_comp_editor_property_part_timezone_get_type ())
1359 #define E_COMP_EDITOR_PROPERTY_PART_TIMEZONE(obj) \
1360 (G_TYPE_CHECK_INSTANCE_CAST \
1361 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_TIMEZONE, ECompEditorPropertyPartTimezone))
1362 #define E_IS_COMP_EDITOR_PROPERTY_PART_TIMEZONE(obj) \
1363 (G_TYPE_CHECK_INSTANCE_TYPE \
1364 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_TIMEZONE))
1366 typedef struct _ECompEditorPropertyPartTimezone ECompEditorPropertyPartTimezone
;
1367 typedef struct _ECompEditorPropertyPartTimezoneClass ECompEditorPropertyPartTimezoneClass
;
1369 struct _ECompEditorPropertyPartTimezone
{
1370 ECompEditorPropertyPart parent
;
1373 struct _ECompEditorPropertyPartTimezoneClass
{
1374 ECompEditorPropertyPartClass parent_class
;
1377 GType
e_comp_editor_property_part_timezone_get_type (void) G_GNUC_CONST
;
1379 G_DEFINE_TYPE (ECompEditorPropertyPartTimezone
, e_comp_editor_property_part_timezone
, E_TYPE_COMP_EDITOR_PROPERTY_PART
)
1382 ecepp_timezone_create_widgets (ECompEditorPropertyPart
*property_part
,
1383 GtkWidget
**out_label_widget
,
1384 GtkWidget
**out_edit_widget
)
1386 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TIMEZONE (property_part
));
1387 g_return_if_fail (out_label_widget
!= NULL
);
1388 g_return_if_fail (out_edit_widget
!= NULL
);
1390 *out_label_widget
= gtk_label_new_with_mnemonic (C_("ECompEditor", "Time _zone:"));
1392 g_object_set (G_OBJECT (*out_label_widget
),
1394 "halign", GTK_ALIGN_END
,
1396 "valign", GTK_ALIGN_CENTER
,
1399 gtk_widget_show (*out_label_widget
);
1401 *out_edit_widget
= e_timezone_entry_new ();
1402 e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (*out_edit_widget
), calendar_config_get_icaltimezone ());
1404 gtk_widget_show (*out_edit_widget
);
1406 gtk_label_set_mnemonic_widget (GTK_LABEL (*out_label_widget
), *out_edit_widget
);
1408 g_signal_connect_swapped (*out_edit_widget
, "changed",
1409 G_CALLBACK (e_comp_editor_property_part_emit_changed
), property_part
);
1413 ecepp_timezone_fill_widget (ECompEditorPropertyPart
*property_part
,
1414 icalcomponent
*component
)
1416 struct icaltimetype (* get_func
) (const icalproperty
*prop
);
1419 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TIMEZONE (property_part
));
1421 get_func
= icalproperty_get_dtstart
;
1422 prop
= icalcomponent_get_first_property (component
, ICAL_DTSTART_PROPERTY
);
1425 get_func
= icalproperty_get_dtend
;
1426 prop
= icalcomponent_get_first_property (component
, ICAL_DTEND_PROPERTY
);
1430 get_func
= icalproperty_get_due
;
1431 prop
= icalcomponent_get_first_property (component
, ICAL_DUE_PROPERTY
);
1435 struct icaltimetype itt
;
1437 itt
= get_func (prop
);
1439 GtkWidget
*edit_widget
;
1441 edit_widget
= e_comp_editor_property_part_get_edit_widget (property_part
);
1442 g_return_if_fail (E_IS_TIMEZONE_ENTRY (edit_widget
));
1444 e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (edit_widget
), (icaltimezone
*) itt
.zone
);
1450 ecepp_timezone_fill_component (ECompEditorPropertyPart
*property_part
,
1451 icalcomponent
*component
)
1453 /* Nothing to do here, this is sort-of virtual property part */
1457 e_comp_editor_property_part_timezone_init (ECompEditorPropertyPartTimezone
*part_timezone
)
1462 e_comp_editor_property_part_timezone_class_init (ECompEditorPropertyPartTimezoneClass
*klass
)
1464 ECompEditorPropertyPartClass
*part_class
;
1466 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
1467 part_class
->create_widgets
= ecepp_timezone_create_widgets
;
1468 part_class
->fill_widget
= ecepp_timezone_fill_widget
;
1469 part_class
->fill_component
= ecepp_timezone_fill_component
;
1472 ECompEditorPropertyPart
*
1473 e_comp_editor_property_part_timezone_new (void)
1475 return g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_TIMEZONE
, NULL
);
1478 /* ************************************************************************* */
1480 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY \
1481 (e_comp_editor_property_part_transparency_get_type ())
1482 #define E_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY(obj) \
1483 (G_TYPE_CHECK_INSTANCE_CAST \
1484 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY, ECompEditorPropertyPartTransparency))
1485 #define E_IS_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY(obj) \
1486 (G_TYPE_CHECK_INSTANCE_TYPE \
1487 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY))
1489 typedef struct _ECompEditorPropertyPartTransparency ECompEditorPropertyPartTransparency
;
1490 typedef struct _ECompEditorPropertyPartTransparencyClass ECompEditorPropertyPartTransparencyClass
;
1492 struct _ECompEditorPropertyPartTransparency
{
1493 ECompEditorPropertyPart parent
;
1496 struct _ECompEditorPropertyPartTransparencyClass
{
1497 ECompEditorPropertyPartClass parent_class
;
1500 GType
e_comp_editor_property_part_transparency_get_type (void) G_GNUC_CONST
;
1502 G_DEFINE_TYPE (ECompEditorPropertyPartTransparency
, e_comp_editor_property_part_transparency
, E_TYPE_COMP_EDITOR_PROPERTY_PART
)
1505 ecepp_transparency_create_widgets (ECompEditorPropertyPart
*property_part
,
1506 GtkWidget
**out_label_widget
,
1507 GtkWidget
**out_edit_widget
)
1509 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY (property_part
));
1510 g_return_if_fail (out_label_widget
!= NULL
);
1511 g_return_if_fail (out_edit_widget
!= NULL
);
1513 *out_label_widget
= NULL
;
1515 *out_edit_widget
= gtk_check_button_new_with_mnemonic (C_("ECompEditor", "Show time as _busy"));
1517 g_object_set (G_OBJECT (*out_edit_widget
),
1519 "halign", GTK_ALIGN_FILL
,
1521 "valign", GTK_ALIGN_CENTER
,
1524 gtk_widget_show (*out_edit_widget
);
1526 g_signal_connect_swapped (*out_edit_widget
, "toggled",
1527 G_CALLBACK (e_comp_editor_property_part_emit_changed
), property_part
);
1531 ecepp_transparency_fill_widget (ECompEditorPropertyPart
*property_part
,
1532 icalcomponent
*component
)
1534 GtkWidget
*edit_widget
;
1537 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY (property_part
));
1539 edit_widget
= e_comp_editor_property_part_get_edit_widget (property_part
);
1540 g_return_if_fail (GTK_IS_CHECK_BUTTON (edit_widget
));
1542 prop
= icalcomponent_get_first_property (component
, ICAL_TRANSP_PROPERTY
);
1544 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edit_widget
),
1545 icalproperty_get_transp (prop
) == ICAL_TRANSP_OPAQUE
);
1547 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edit_widget
), TRUE
);
1552 ecepp_transparency_fill_component (ECompEditorPropertyPart
*property_part
,
1553 icalcomponent
*component
)
1555 GtkWidget
*edit_widget
;
1557 icalproperty_transp value
;
1559 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY (property_part
));
1561 edit_widget
= e_comp_editor_property_part_get_edit_widget (property_part
);
1562 g_return_if_fail (GTK_IS_CHECK_BUTTON (edit_widget
));
1564 value
= gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (edit_widget
)) ? ICAL_TRANSP_OPAQUE
: ICAL_TRANSP_TRANSPARENT
;
1566 prop
= icalcomponent_get_first_property (component
, ICAL_TRANSP_PROPERTY
);
1568 icalproperty_set_transp (prop
, value
);
1570 prop
= icalproperty_new_transp (value
);
1571 icalcomponent_add_property (component
, prop
);
1576 e_comp_editor_property_part_transparency_init (ECompEditorPropertyPartTransparency
*part_transparency
)
1581 e_comp_editor_property_part_transparency_class_init (ECompEditorPropertyPartTransparencyClass
*klass
)
1583 ECompEditorPropertyPartClass
*part_class
;
1585 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
1586 part_class
->create_widgets
= ecepp_transparency_create_widgets
;
1587 part_class
->fill_widget
= ecepp_transparency_fill_widget
;
1588 part_class
->fill_component
= ecepp_transparency_fill_component
;
1591 ECompEditorPropertyPart
*
1592 e_comp_editor_property_part_transparency_new (void)
1594 return g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_TRANSPARENCY
, NULL
);
1597 /* ************************************************************************* */
1599 #define E_TYPE_COMP_EDITOR_PROPERTY_PART_COLOR \
1600 (e_comp_editor_property_part_color_get_type ())
1601 #define E_COMP_EDITOR_PROPERTY_PART_COLOR(obj) \
1602 (G_TYPE_CHECK_INSTANCE_CAST \
1603 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_COLOR, ECompEditorPropertyPartColor))
1604 #define E_IS_COMP_EDITOR_PROPERTY_PART_COLOR(obj) \
1605 (G_TYPE_CHECK_INSTANCE_TYPE \
1606 ((obj), E_TYPE_COMP_EDITOR_PROPERTY_PART_COLOR))
1608 typedef struct _ECompEditorPropertyPartColor ECompEditorPropertyPartColor
;
1609 typedef struct _ECompEditorPropertyPartColorClass ECompEditorPropertyPartColorClass
;
1611 struct _ECompEditorPropertyPartColor
{
1612 ECompEditorPropertyPart parent
;
1615 struct _ECompEditorPropertyPartColorClass
{
1616 ECompEditorPropertyPartClass parent_class
;
1619 GType
e_comp_editor_property_part_color_get_type (void) G_GNUC_CONST
;
1621 G_DEFINE_TYPE (ECompEditorPropertyPartColor
, e_comp_editor_property_part_color
, E_TYPE_COMP_EDITOR_PROPERTY_PART
)
1624 ecepp_color_create_widgets (ECompEditorPropertyPart
*property_part
,
1625 GtkWidget
**out_label_widget
,
1626 GtkWidget
**out_edit_widget
)
1630 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_COLOR (property_part
));
1631 g_return_if_fail (out_label_widget
!= NULL
);
1632 g_return_if_fail (out_edit_widget
!= NULL
);
1639 *out_label_widget
= NULL
;
1641 /* Translators: This 'None' is meant for 'Color' in calendar component editor, like 'None color' */
1642 *out_edit_widget
= e_color_combo_new_defaults (&rgba
, C_("ECompEditor", "None"));
1644 g_object_set (G_OBJECT (*out_edit_widget
),
1646 "halign", GTK_ALIGN_START
,
1648 "valign", GTK_ALIGN_CENTER
,
1651 gtk_widget_show (*out_edit_widget
);
1653 g_signal_connect_swapped (*out_edit_widget
, "activated",
1654 G_CALLBACK (e_comp_editor_property_part_emit_changed
), property_part
);
1658 ecepp_color_fill_widget (ECompEditorPropertyPart
*property_part
,
1659 icalcomponent
*component
)
1661 #ifdef HAVE_ICAL_COLOR_PROPERTY
1662 GtkWidget
*edit_widget
;
1664 gboolean color_set
= FALSE
;
1666 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_COLOR (property_part
));
1668 edit_widget
= e_comp_editor_property_part_get_edit_widget (property_part
);
1669 g_return_if_fail (E_IS_COLOR_COMBO (edit_widget
));
1671 prop
= icalcomponent_get_first_property (component
, ICAL_COLOR_PROPERTY
);
1673 const gchar
*color
= icalproperty_get_color (prop
);
1676 if (color
&& gdk_rgba_parse (&rgba
, color
)) {
1677 e_color_combo_set_current_color (E_COLOR_COMBO (edit_widget
), &rgba
);
1690 e_color_combo_set_current_color (E_COLOR_COMBO (edit_widget
), &rgba
);
1696 ecepp_color_fill_component (ECompEditorPropertyPart
*property_part
,
1697 icalcomponent
*component
)
1699 #ifdef HAVE_ICAL_COLOR_PROPERTY
1700 GtkWidget
*edit_widget
;
1704 g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART_COLOR (property_part
));
1706 edit_widget
= e_comp_editor_property_part_get_edit_widget (property_part
);
1707 g_return_if_fail (E_IS_COLOR_COMBO (edit_widget
));
1714 e_color_combo_get_current_color (E_COLOR_COMBO (edit_widget
), &rgba
);
1716 prop
= icalcomponent_get_first_property (component
, ICAL_COLOR_PROPERTY
);
1718 if (rgba
.alpha
<= 1.0 - 1e-9) {
1720 icalcomponent_remove_property (component
, prop
);
1721 icalproperty_free (prop
);
1726 str
= gdk_rgba_to_string (&rgba
);
1729 icalproperty_set_color (prop
, str
);
1731 prop
= icalproperty_new_color (str
);
1732 icalcomponent_add_property (component
, prop
);
1737 g_warning ("%s: Failed to convert RGBA (%f,%f,%f,%f) to string", G_STRFUNC
, rgba
.red
, rgba
.green
, rgba
.blue
, rgba
.alpha
);
1744 e_comp_editor_property_part_color_init (ECompEditorPropertyPartColor
*part_color
)
1749 e_comp_editor_property_part_color_class_init (ECompEditorPropertyPartColorClass
*klass
)
1751 ECompEditorPropertyPartClass
*part_class
;
1753 part_class
= E_COMP_EDITOR_PROPERTY_PART_CLASS (klass
);
1754 part_class
->create_widgets
= ecepp_color_create_widgets
;
1755 part_class
->fill_widget
= ecepp_color_fill_widget
;
1756 part_class
->fill_component
= ecepp_color_fill_component
;
1759 ECompEditorPropertyPart
*
1760 e_comp_editor_property_part_color_new (void)
1762 #ifdef HAVE_ICAL_COLOR_PROPERTY
1763 return g_object_new (E_TYPE_COMP_EDITOR_PROPERTY_PART_COLOR
, NULL
);