aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-component-registry.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-07-20 21:37:56 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-07-20 21:37:56 +0800
commitb40242c395b0eec33a622ddfe90634fd6d63e4c6 (patch)
treeaecb84b01ffb6c3536c5db0c26165df4f51d860a /shell/e-component-registry.c
parent8aec5bf2be2fbfdfb4cecd6c48a77d197db41d39 (diff)
downloadgsoc2013-evolution-b40242c395b0eec33a622ddfe90634fd6d63e4c6.tar
gsoc2013-evolution-b40242c395b0eec33a622ddfe90634fd6d63e4c6.tar.gz
gsoc2013-evolution-b40242c395b0eec33a622ddfe90634fd6d63e4c6.tar.bz2
gsoc2013-evolution-b40242c395b0eec33a622ddfe90634fd6d63e4c6.tar.lz
gsoc2013-evolution-b40242c395b0eec33a622ddfe90634fd6d63e4c6.tar.xz
gsoc2013-evolution-b40242c395b0eec33a622ddfe90634fd6d63e4c6.tar.zst
gsoc2013-evolution-b40242c395b0eec33a622ddfe90634fd6d63e4c6.zip
Add support for saving the current configuration of all the
components. svn path=/trunk/; revision=4237
Diffstat (limited to 'shell/e-component-registry.c')
-rw-r--r--shell/e-component-registry.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c
index 944b5c150b..a331a1a551 100644
--- a/shell/e-component-registry.c
+++ b/shell/e-component-registry.c
@@ -297,5 +297,76 @@ e_component_registry_register_component (EComponentRegistry *component_registry,
}
+static void
+compose_id_list_foreach (void *key,
+ void *value,
+ void *data)
+{
+ GList **listp;
+ const char *id;
+
+ listp = (GList **) data;
+ id = (const char *) key;
+
+ *listp = g_list_prepend (*listp, g_strdup (id));
+}
+
+/**
+ * e_component_registry_get_id_list:
+ * @component_registry:
+ *
+ * Get the list of components registered.
+ *
+ * Return value: A GList of strings containining the IDs for all the registered
+ * components. The list must be freed by the caller when not used anymore.
+ **/
+GList *
+e_component_registry_get_id_list (EComponentRegistry *component_registry)
+{
+ EComponentRegistryPrivate *priv;
+ GList *list;
+
+ g_return_val_if_fail (component_registry != NULL, NULL);
+ g_return_val_if_fail (E_IS_COMPONENT_REGISTRY (component_registry), NULL);
+
+ priv = component_registry->priv;
+ list = NULL;
+
+ g_hash_table_foreach (priv->component_id_to_component, compose_id_list_foreach, &list);
+
+ return list;
+}
+
+/**
+ * e_component_registry_get_component_by_id:
+ * @component_registry:
+ * @id: The component's OAF ID
+ *
+ * Get the registered component client for the specified ID. If that component
+ * is not registered, return NULL.
+ *
+ * Return value: A pointer to the ShellComponentClient for that component.
+ **/
+EvolutionShellComponentClient *
+e_component_registry_get_component_by_id (EComponentRegistry *component_registry,
+ const char *id)
+{
+ EComponentRegistryPrivate *priv;
+ const Component *component;
+
+ g_return_val_if_fail (component_registry != NULL, NULL);
+ g_return_val_if_fail (E_IS_COMPONENT_REGISTRY (component_registry), NULL);
+ g_return_val_if_fail (id != NULL, NULL);
+
+ priv = component_registry->priv;
+
+ component = g_hash_table_lookup (priv->component_id_to_component, id);
+ if (component == NULL)
+ return NULL;
+
+ return component->client;
+}
+
+
E_MAKE_TYPE (e_component_registry, "EComponentRegistry", EComponentRegistry,
class_init, init, PARENT_TYPE)