1 /* Copyright (c) 2009, Igalia
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.
30 #include <glib/gi18n.h>
31 #ifdef MODEST_TOOLKIT_HILDON2
32 #include <hildon/hildon.h>
33 #include <hildon/hildon-file-chooser-dialog.h>
34 #include <modest-number-editor.h>
35 #include <modest-ui-constants.h>
37 #include "modest-toolkit-factory.h"
39 #ifndef MODEST_TOOLKIT_HILDON2
40 #define USE_SCROLLED_WINDOW
41 #define USE_GTK_FIND_TOOLBAR
42 #define USE_GTK_CHECK_BUTTON
43 #define USE_GTK_CHECK_MENU
45 #define USE_GTK_FILE_CHOOSER
46 #define USE_COUNTRY_COMBOBOX
47 #define USE_SERVERSECURITY_COMBOBOX
48 #define USE_SECUREAUTH_COMBOBOX
49 #define USE_GTK_SECURITY_OPTIONS_VIEW
52 #ifdef USE_SCROLLED_WINDOW
53 #include <modest-scrolled-window-scrollable.h>
55 #include <modest-hildon-pannable-area-scrollable.h>
58 #ifdef USE_GTK_TOOLBAR
59 #include <modest-find-toolbar.h>
61 #include <modest-hildon-find-toolbar.h>
64 #ifdef USE_COUNTRY_COMBOBOX
65 #include <modest-country-combo-box.h>
67 #include <modest-country-picker.h>
70 #ifdef USE_PROVIDER_COMBOBOX
71 #include <modest-provider-combo-box.h>
73 #include <modest-provider-picker.h>
76 #ifdef USE_SERVERTYPE_COMBOBOX
77 #include <modest-servertype-combo-box.h>
79 #include <modest-servertype-picker.h>
82 #ifdef USE_SERVERSECURITY_COMBOBOX
83 #include <modest-serversecurity-combo-box.h>
85 #include <modest-serversecurity-picker.h>
88 #ifdef USE_SECUREAUTH_COMBOBOX
89 #include <modest-secureauth-combo-box.h>
91 #include <modest-secureauth-picker.h>
94 #ifdef USE_GTK_SECURITY_OPTIONS_VIEW
95 #include <modest-gtk-security-options-view.h>
97 #include <modest-maemo-security-options-view.h>
100 static void modest_toolkit_factory_class_init (ModestToolkitFactoryClass *klass);
101 static void modest_toolkit_factory_init (ModestToolkitFactory *self);
103 /* GObject interface */
104 static GtkWidget * modest_toolkit_factory_create_scrollable_default (ModestToolkitFactory *self);
105 static GtkWidget * modest_toolkit_factory_create_check_button_default (ModestToolkitFactory *self,
107 static GtkWidget * modest_toolkit_factory_create_check_menu_default (ModestToolkitFactory *self,
109 static GtkWidget * modest_toolkit_factory_create_isearch_toolbar_default (ModestToolkitFactory *self,
111 static GtkWidget * modest_toolkit_factory_create_entry_default (ModestToolkitFactory *self);
112 static GtkWidget * modest_toolkit_factory_create_number_entry_default (ModestToolkitFactory *self,
115 static GtkWidget * modest_toolkit_factory_create_file_chooser_dialog_default (ModestToolkitFactory *self,
118 GtkFileChooserAction action);
119 static GtkWidget * modest_toolkit_factory_create_country_selector_default (ModestToolkitFactory *self);
120 static GtkWidget * modest_toolkit_factory_create_provider_selector_default (ModestToolkitFactory *self);
121 static GtkWidget * modest_toolkit_factory_create_servertype_selector_default (ModestToolkitFactory *self,
122 gboolean filter_providers);
123 static GtkWidget * modest_toolkit_factory_create_serversecurity_selector_default (ModestToolkitFactory *self);
124 static GtkWidget * modest_toolkit_factory_create_secureauth_selector_default (ModestToolkitFactory *self);
125 static GtkWidget * modest_toolkit_factory_create_security_options_view_default (ModestToolkitFactory *self,
126 ModestSecurityOptionsType type,
128 GtkSizeGroup *title_size_group,
129 GtkSizeGroup *value_size_group);
131 static GObjectClass *parent_class = NULL;
133 G_DEFINE_TYPE (ModestToolkitFactory,
134 modest_toolkit_factory,
137 ModestToolkitFactory *
138 modest_toolkit_factory_get_instance (void)
140 GObject* self = g_object_new (MODEST_TYPE_TOOLKIT_FACTORY, NULL);
142 return (ModestToolkitFactory *) self;
146 modest_toolkit_factory_class_init (ModestToolkitFactoryClass *klass)
148 parent_class = g_type_class_peek_parent (klass);
150 klass->create_scrollable = modest_toolkit_factory_create_scrollable_default;
151 klass->create_check_button = modest_toolkit_factory_create_check_button_default;
152 klass->create_check_menu = modest_toolkit_factory_create_check_menu_default;
153 klass->create_isearch_toolbar = modest_toolkit_factory_create_isearch_toolbar_default;
154 klass->create_entry = modest_toolkit_factory_create_entry_default;
155 klass->create_number_entry = modest_toolkit_factory_create_number_entry_default;
156 klass->create_file_chooser_dialog = modest_toolkit_factory_create_file_chooser_dialog_default;
157 klass->create_country_selector = modest_toolkit_factory_create_country_selector_default;
158 klass->create_provider_selector = modest_toolkit_factory_create_provider_selector_default;
159 klass->create_servertype_selector = modest_toolkit_factory_create_servertype_selector_default;
160 klass->create_serversecurity_selector = modest_toolkit_factory_create_serversecurity_selector_default;
161 klass->create_secureauth_selector = modest_toolkit_factory_create_secureauth_selector_default;
162 klass->create_security_options_view = modest_toolkit_factory_create_security_options_view_default;
166 modest_toolkit_factory_init (ModestToolkitFactory *self)
171 modest_toolkit_factory_create_scrollable (ModestToolkitFactory *self)
173 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_scrollable (self);
177 modest_toolkit_factory_create_scrollable_default (ModestToolkitFactory *self)
179 #ifdef USE_SCROLLED_WINDOW
180 return modest_scrolled_window_scrollable_new ();
182 return modest_hildon_pannable_area_scrollable_new ();
187 modest_toolkit_factory_create_check_button (ModestToolkitFactory *self, const gchar *label)
189 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_check_button (self, label);
193 modest_toolkit_factory_create_check_button_default (ModestToolkitFactory *self, const gchar *label)
196 #ifdef USE_GTK_CHECK_BUTTON
197 result = gtk_check_button_new_with_label (label);
199 result = hildon_check_button_new (HILDON_SIZE_FINGER_HEIGHT);
200 gtk_button_set_label (GTK_BUTTON (result), label);
201 gtk_button_set_alignment (GTK_BUTTON (result), 0.0, 0.5);
207 modest_toolkit_factory_create_check_menu (ModestToolkitFactory *self, const gchar *label)
209 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_check_menu (self, label);
213 modest_toolkit_factory_create_check_menu_default (ModestToolkitFactory *self, const gchar *label)
216 #ifdef USE_GTK_CHECK_MENU
217 result = gtk_check_menu_item_new_with_label (label);
219 result = hildon_check_button_new (0);
220 gtk_button_set_label (GTK_BUTTON (result), label);
221 gtk_button_set_alignment (GTK_BUTTON (result), 0.5, 0.5);
227 modest_togglable_get_active (GtkWidget *widget)
229 if (GTK_IS_CHECK_MENU_ITEM (widget)) {
230 return gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
231 } else if (GTK_IS_TOGGLE_BUTTON (widget)) {
232 return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
233 #ifdef MODEST_TOOLKIT_HILDON2
234 } else if (HILDON_IS_CHECK_BUTTON (widget)) {
235 return hildon_check_button_get_active (HILDON_CHECK_BUTTON (widget));
238 g_return_val_if_reached (FALSE);
243 modest_togglable_set_active (GtkWidget *widget, gboolean active)
245 if (GTK_IS_CHECK_MENU_ITEM (widget)) {
246 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), active);
247 } else if (GTK_IS_TOGGLE_BUTTON (widget)) {
248 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), active);
249 #ifdef MODEST_TOOLKIT_HILDON2
250 } else if (HILDON_IS_CHECK_BUTTON (widget)) {
251 hildon_check_button_set_active (HILDON_CHECK_BUTTON (widget), active);
257 modest_is_togglable (GtkWidget *widget)
259 return GTK_IS_CHECK_MENU_ITEM (widget)
260 || GTK_IS_TOGGLE_BUTTON (widget)
261 #ifdef MODEST_TOOLKIT_HILDON2
262 || HILDON_IS_CHECK_BUTTON (widget)
268 modest_toolkit_factory_create_isearch_toolbar (ModestToolkitFactory *self, const gchar *label)
270 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_isearch_toolbar (self, label);
274 modest_toolkit_factory_create_isearch_toolbar_default (ModestToolkitFactory *self, const gchar *label)
277 #ifdef USE_GTK_FIND_TOOLBAR
278 result = modest_find_toolbar_new (label);
280 result = modest_hildon_find_toolbar_new (label);
286 modest_toolkit_factory_create_entry (ModestToolkitFactory *self)
288 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_entry (self);
292 modest_toolkit_factory_create_entry_default (ModestToolkitFactory *self)
295 return gtk_entry_new ();
297 return hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
302 modest_entry_set_text (GtkWidget *widget, const gchar *text)
304 #ifdef MODEST_TOOLKIT_HILDON2
305 hildon_entry_set_text (HILDON_ENTRY (widget), text);
307 gtk_entry_set_text (GTK_ENTRY (widget), text);
312 modest_entry_get_text (GtkWidget *widget)
314 #ifdef MODEST_TOOLKIT_HILDON2
315 return hildon_entry_get_text (HILDON_ENTRY (widget));
317 return gtk_entry_set_text (GTK_ENTRY (widget));
322 modest_entry_set_hint (GtkWidget *widget, const gchar *hint)
324 #ifdef MODEST_TOOLKIT_HILDON2
325 hildon_entry_set_placeholder (HILDON_ENTRY (widget), hint);
327 gtk_widget_set_tooltip_text (widget, hint);
332 modest_is_entry (GtkWidget *widget)
334 #ifdef MODEST_TOOLKIT_HILDON2
335 return HILDON_IS_ENTRY (widget);
337 return GTK_IS_ENTRY (widget);
342 modest_toolkit_factory_create_number_entry (ModestToolkitFactory *self, gint min, gint max)
344 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_number_entry (self, min, max);
348 modest_toolkit_factory_create_number_entry_default (ModestToolkitFactory *self, gint min, gint max)
351 #ifdef USE_GTK_SPIN_BUTTON
352 result = gtk_spin_button_new_with_range (min, max, 1.0);
353 gtk_spin_button_set_digits (GTK_SPIN_BUTTON (result), 0);
355 result = modest_number_editor_new (min, max);
361 modest_number_entry_set_value (GtkWidget *widget, gint value)
363 #ifdef USE_GTK_SPIN_BUTTON
364 gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), value);
366 modest_number_editor_set_value (MODEST_NUMBER_EDITOR (widget), value);
371 modest_number_entry_get_value (GtkWidget *widget)
373 #ifdef USE_GTK_SPIN_BUTTON
374 return gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (widget));
376 return modest_number_editor_get_value (MODEST_NUMBER_EDITOR (widget));
381 modest_number_entry_is_valid (GtkWidget *widget)
383 #ifdef USE_GTK_SPIN_BUTTON
386 return modest_number_editor_is_valid (MODEST_NUMBER_EDITOR (widget));
391 modest_is_number_entry (GtkWidget *widget)
393 #ifdef USE_GTK_SPIN_BUTTON
394 return GTK_IS_SPIN_BUTTON (widget);
396 return MODEST_IS_NUMBER_EDITOR (widget);
401 modest_toolkit_factory_create_file_chooser_dialog (ModestToolkitFactory *self,
404 GtkFileChooserAction action)
406 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_file_chooser_dialog (self, title, parent, action);
410 modest_toolkit_factory_create_file_chooser_dialog_default (ModestToolkitFactory *self,
413 GtkFileChooserAction action)
416 #ifdef USE_GTK_FILE_CHOOSER
417 result = gtk_file_chooser_dialog_new (title, parent, action,
418 (action == GTK_FILE_CHOOSER_ACTION_OPEN) ? GTK_STOCK_OPEN : GTK_STOCK_SAVE,
420 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
423 result = hildon_file_chooser_dialog_new (parent, action);
424 gtk_window_set_title ((GtkWindow *) result, title);
430 modest_toolkit_factory_create_country_selector (ModestToolkitFactory *self)
432 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_country_selector (self);
436 modest_toolkit_factory_create_country_selector_default (ModestToolkitFactory *self)
439 #ifdef USE_COUNTRY_COMBOBOX
440 result = modest_country_combo_box_new ();
442 result = GTK_WIDGET (modest_country_picker_new (MODEST_EDITABLE_SIZE,
443 HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
449 modest_country_selector_get_active_country_mcc (GtkWidget *widget)
451 #ifdef USE_COUNTRY_COMBOBOX
452 return modest_country_combo_box_get_active_country_mcc (MODEST_COUNTRY_COMBO_BOX (widget));
454 return modest_country_picker_get_active_country_mcc (MODEST_COUNTRY_PICKER (widget));
459 modest_country_selector_load_data (GtkWidget *widget)
461 #ifdef USE_COUNTRY_COMBOBOX
462 modest_country_combo_box_load_data (MODEST_COUNTRY_COMBO_BOX (widget));
464 modest_country_picker_load_data (MODEST_COUNTRY_PICKER (widget));
469 modest_country_selector_set_active_country_locale (GtkWidget *widget)
471 #ifdef USE_COUNTRY_COMBOBOX
472 return modest_country_combo_box_set_active_country_locale (MODEST_COUNTRY_COMBO_BOX (widget));
474 return modest_country_picker_set_active_country_locale (MODEST_COUNTRY_PICKER (widget));
479 modest_toolkit_factory_create_provider_selector (ModestToolkitFactory *self)
481 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_provider_selector (self);
485 modest_toolkit_factory_create_provider_selector_default (ModestToolkitFactory *self)
488 #ifdef USE_PROVIDER_COMBOBOX
489 result = GTK_WIDGET (modest_provider_combo_box_new ());
491 result = GTK_WIDGET (modest_provider_picker_new (MODEST_EDITABLE_SIZE,
492 HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
498 modest_provider_selector_fill (GtkWidget *widget,
499 ModestPresets *presets,
502 #ifdef USE_PROVIDER_COMBOBOX
503 modest_provider_combo_box_fill (MODEST_PROVIDER_COMBO_BOX (widget),
507 modest_provider_picker_fill (MODEST_PROVIDER_PICKER (widget),
514 modest_provider_selector_get_active_provider_id (GtkWidget *widget)
516 #ifdef USE_PROVIDER_COMBOBOX
517 return modest_provider_combo_box_get_active_provider_id (MODEST_PROVIDER_COMBO_BOX (widget));
519 return modest_provider_picker_get_active_provider_id (MODEST_PROVIDER_PICKER (widget));
524 modest_provider_selector_get_active_provider_label (GtkWidget *widget)
526 #ifdef USE_PROVIDER_COMBOBOX
528 return modest_provider_combo_box_get_active_provider_label (MODEST_PROVIDER_COMBO_BOX (widget));
532 selector = GTK_WIDGET (hildon_picker_button_get_selector (HILDON_PICKER_BUTTON (widget)));
533 return g_strdup (hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector)));
537 ModestProviderSelectorIdType
538 modest_provider_selector_get_active_id_type (GtkWidget *widget)
540 ModestProviderSelectorIdType result;
541 #ifdef USE_PROVIDER_COMBOBOX
542 ModestProviderComboBoxIdType id_type;
544 id_type = modest_provider_combo_box_get_active_id_type (MODEST_PROVIDER_COMBO_BOX (widget));
546 case MODEST_PROVIDER_COMBO_BOX_ID_PROVIDER:
547 result = MODEST_PROVIDER_SELECTOR_ID_PROVIDER;
549 case MODEST_PROVIDER_COMBO_BOX_ID_OTHER:
550 result = MODEST_PROVIDER_SELECTOR_ID_OTHER;
552 case MODEST_PROVIDER_COMBO_BOX_ID_PLUGIN_PROTOCOL:
553 result = MODEST_PROVIDER_SELECTOR_ID_PLUGIN_PROTOCOL;
556 result = MODEST_PROVIDER_SELECTOR_ID_OTHER;
560 ModestProviderPickerIdType id_type;
562 id_type = modest_provider_picker_get_active_id_type (MODEST_PROVIDER_PICKER (widget));
564 case MODEST_PROVIDER_PICKER_ID_PROVIDER:
565 result = MODEST_PROVIDER_SELECTOR_ID_PROVIDER;
567 case MODEST_PROVIDER_PICKER_ID_OTHER:
568 result = MODEST_PROVIDER_SELECTOR_ID_OTHER;
570 case MODEST_PROVIDER_PICKER_ID_PLUGIN_PROTOCOL:
571 result = MODEST_PROVIDER_SELECTOR_ID_PLUGIN_PROTOCOL;
574 result = MODEST_PROVIDER_SELECTOR_ID_OTHER;
581 modest_provider_selector_set_others_provider (GtkWidget *self)
583 #ifdef USE_PROVIDER_COMBOBOX
584 modest_provider_combo_box_set_others_provider (MODEST_PROVIDER_COMBO_BOX (self));
586 modest_provider_picker_set_others_provider (MODEST_PROVIDER_PICKER (self));
591 modest_toolkit_factory_create_servertype_selector (ModestToolkitFactory *self, gboolean filter_providers)
593 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_servertype_selector (self, filter_providers);
597 modest_toolkit_factory_create_servertype_selector_default (ModestToolkitFactory *self, gboolean filter_providers)
600 #ifdef USE_PROVIDER_COMBOBOX
601 result = GTK_WIDGET (modest_servertype_combo_box_new (filter_providers));
603 result = GTK_WIDGET (modest_servertype_picker_new (MODEST_EDITABLE_SIZE,
604 HILDON_BUTTON_ARRANGEMENT_HORIZONTAL,
611 modest_servertype_selector_get_active_servertype (GtkWidget *self)
613 #ifdef USE_SERVERTYPE_COMBOBOX
614 return modest_servertype_combo_box_get_active_servertype (MODEST_SERVERTYPE_COMBO_BOX (self));
616 return modest_servertype_picker_get_active_servertype (MODEST_SERVERTYPE_PICKER (self));
621 modest_servertype_selector_set_active_servertype (GtkWidget *self,
622 ModestProtocolType protocol_type_id)
624 #ifdef USE_SERVERTYPE_COMBOBOX
625 modest_servertype_combo_box_set_active_servertype (MODEST_SERVERTYPE_COMBO_BOX (self), protocol_type_id);
627 modest_servertype_picker_set_active_servertype (MODEST_SERVERTYPE_PICKER (self), protocol_type_id);
632 modest_toolkit_factory_create_serversecurity_selector (ModestToolkitFactory *self)
634 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_serversecurity_selector (self);
638 modest_toolkit_factory_create_serversecurity_selector_default (ModestToolkitFactory *self)
641 #ifdef USE_SERVERSECURITY_COMBOBOX
642 result = GTK_WIDGET (modest_serversecurity_combo_box_new ());
644 result = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
645 HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
651 modest_serversecurity_selector_fill (GtkWidget *combobox,
652 ModestProtocolType protocol)
654 #ifdef USE_SERVERSECURITY_COMBOBOX
655 modest_serversecurity_combo_box_fill (MODEST_SERVERSECURITY_COMBO_BOX (combobox),
658 modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (combobox),
664 modest_serversecurity_selector_get_active_serversecurity (GtkWidget *combobox)
666 #ifdef USE_SERVERSECURITY_COMBOBOX
667 return modest_serversecurity_combo_box_get_active_serversecurity (MODEST_SERVERSECURITY_COMBO_BOX (combobox));
669 return modest_serversecurity_picker_get_active_serversecurity (MODEST_SERVERSECURITY_PICKER (combobox));
674 modest_serversecurity_selector_set_active_serversecurity (GtkWidget *combobox,
675 ModestProtocolType serversecurity)
677 #ifdef USE_SERVERSECURITY_COMBOBOX
678 return modest_serversecurity_combo_box_set_active_serversecurity (MODEST_SERVERSECURITY_COMBO_BOX (combobox),
681 return modest_serversecurity_picker_set_active_serversecurity (MODEST_SERVERSECURITY_PICKER (combobox),
687 modest_serversecurity_selector_get_active_serversecurity_port (GtkWidget *combobox)
689 #ifdef USE_SERVERSECURITY_COMBOBOX
690 return modest_serversecurity_combo_box_get_active_serversecurity_port (MODEST_SERVERSECURITY_COMBO_BOX (combobox));
692 return modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (combobox));
697 modest_toolkit_factory_create_secureauth_selector (ModestToolkitFactory *self)
699 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_secureauth_selector (self);
703 modest_toolkit_factory_create_secureauth_selector_default (ModestToolkitFactory *self)
706 #ifdef USE_SECUREAUTH_COMBOBOX
707 result = GTK_WIDGET (modest_secureauth_combo_box_new ());
709 result = GTK_WIDGET (modest_secureauth_picker_new (MODEST_EDITABLE_SIZE,
710 HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
716 modest_secureauth_selector_get_active_secureauth (GtkWidget *widget)
718 #ifdef USE_SECUREAUTH_COMBOBOX
719 return modest_secureauth_combo_box_get_active_secureauth (MODEST_SECUREAUTH_COMBO_BOX (widget));
721 return modest_secureauth_picker_get_active_secureauth (MODEST_SECUREAUTH_PICKER (widget));
726 modest_secureauth_selector_set_active_secureauth (GtkWidget *widget,
727 ModestProtocolType secureauth)
729 #ifdef USE_SECUREAUTH_COMBOBOX
730 return modest_secureauth_combo_box_set_active_secureauth (MODEST_SECUREAUTH_COMBO_BOX (widget),
733 return modest_secureauth_picker_set_active_secureauth (MODEST_SECUREAUTH_PICKER (widget),
739 modest_is_secureauth_selector (GtkWidget *widget)
741 #ifdef USE_SECUREAUTH_COMBOBOX
742 return MODEST_IS_SECUREAUTH_COMBO_BOX (widget);
744 return MODEST_IS_SECUREAUTH_PICKER (widget);
749 modest_toolkit_factory_create_security_options_view (ModestToolkitFactory *self,
750 ModestSecurityOptionsType type,
752 GtkSizeGroup *title_size_group,
753 GtkSizeGroup *value_size_group)
755 return MODEST_TOOLKIT_FACTORY_GET_CLASS (self)->create_security_options_view (self, type, full,
756 title_size_group, value_size_group);
760 modest_toolkit_factory_create_security_options_view_default (ModestToolkitFactory *self,
761 ModestSecurityOptionsType type,
763 GtkSizeGroup *title_size_group,
764 GtkSizeGroup *value_size_group)
767 #ifdef USE_GTK_SECURITY_OPTIONS_VIEW
768 result = GTK_WIDGET (modest_gtk_security_options_view_new (type, full, title_size_group, value_size_group));
770 result = GTK_WIDGET (modest_maemo_security_options_view_new (type, full, title_size_group, value_size_group));