"Fossies" - the Fresh Open Source Software Archive 
Member "evolution-mapi-3.46.1/src/configuration/e-book-config-mapigal.c" (2 Dec 2022, 3132 Bytes) of package /linux/misc/evolution-mapi-3.46.1.tar.xz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "e-book-config-mapigal.c" see the
Fossies "Dox" file reference documentation.
1 /*
2 * e-book-config-mapigal.c
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
16 *
17 */
18
19 #include "evolution-mapi-config.h"
20
21 #include <glib/gi18n-lib.h>
22
23 #include "e-source-mapi-folder.h"
24 #include "e-book-config-mapigal.h"
25
26 G_DEFINE_DYNAMIC_TYPE (
27 EBookConfigMapigal,
28 e_book_config_mapigal,
29 E_TYPE_SOURCE_CONFIG_BACKEND)
30
31 static gboolean
32 book_config_mapigal_allow_creation (ESourceConfigBackend *backend)
33 {
34 return FALSE;
35 }
36
37 static void
38 book_config_mapigal_insert_widgets (ESourceConfigBackend *backend,
39 ESource *scratch_source)
40 {
41 ESourceBackend *backend_ext;
42 ESourceMapiFolder *folder_ext;
43 ESourceConfig *config;
44 GtkWidget *widget;
45
46 if (!e_source_has_extension (scratch_source, E_SOURCE_EXTENSION_ADDRESS_BOOK))
47 return;
48
49 backend_ext = e_source_get_extension (scratch_source, E_SOURCE_EXTENSION_ADDRESS_BOOK);
50 if (!backend_ext || g_strcmp0 (e_source_backend_get_backend_name (backend_ext), "mapigal") != 0)
51 return;
52
53 folder_ext = e_source_get_extension (scratch_source, E_SOURCE_EXTENSION_MAPI_FOLDER);
54 g_return_if_fail (folder_ext != NULL);
55
56 config = e_source_config_backend_get_config (backend);
57 e_book_source_config_add_offline_toggle (E_BOOK_SOURCE_CONFIG (config), scratch_source);
58
59 widget = gtk_check_button_new_with_mnemonic (_("Allow _partial search results"));
60 e_source_config_insert_widget (config, scratch_source, NULL, widget);
61 gtk_widget_show (widget);
62
63 e_binding_bind_property (
64 folder_ext, "allow-partial",
65 widget, "active",
66 G_BINDING_BIDIRECTIONAL |
67 G_BINDING_SYNC_CREATE);
68 }
69
70 static void
71 e_book_config_mapigal_class_init (EBookConfigMapigalClass *class)
72 {
73 EExtensionClass *extension_class;
74 ESourceConfigBackendClass *backend_class;
75
76 extension_class = E_EXTENSION_CLASS (class);
77 extension_class->extensible_type = E_TYPE_BOOK_SOURCE_CONFIG;
78
79 backend_class = E_SOURCE_CONFIG_BACKEND_CLASS (class);
80 backend_class->backend_name = "mapigal";
81 backend_class->allow_creation = book_config_mapigal_allow_creation;
82 backend_class->insert_widgets = book_config_mapigal_insert_widgets;
83 }
84
85 static void
86 e_book_config_mapigal_class_finalize (EBookConfigMapigalClass *class)
87 {
88 }
89
90 static void
91 e_book_config_mapigal_init (EBookConfigMapigal *backend)
92 {
93 }
94
95 void
96 e_book_config_mapigal_type_register (GTypeModule *type_module)
97 {
98 /* XXX G_DEFINE_DYNAMIC_TYPE declares a static type registration
99 * function, so we have to wrap it with a public function in
100 * order to register types from a separate compilation unit. */
101 e_book_config_mapigal_register_type (type_module);
102 }