From 3ade071f273aaa973e44bf95d6b1d4913a18f03b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:39:48 +0200 Subject: Adding upstream version 43.2. Signed-off-by: Daniel Baumann --- .../nautilus-properties-model-provider.h | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 libnautilus-extension/nautilus-properties-model-provider.h (limited to 'libnautilus-extension/nautilus-properties-model-provider.h') diff --git a/libnautilus-extension/nautilus-properties-model-provider.h b/libnautilus-extension/nautilus-properties-model-provider.h new file mode 100644 index 0000000..b4ecda5 --- /dev/null +++ b/libnautilus-extension/nautilus-properties-model-provider.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2022 The GNOME project contributors + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#pragma once + +#if !defined (NAUTILUS_EXTENSION_H) && !defined (NAUTILUS_COMPILATION) +#warning "Only should be included directly." +#endif + +#include + +G_BEGIN_DECLS + +#define NAUTILUS_TYPE_PROPERTIES_MODEL_PROVIDER (nautilus_properties_model_provider_get_type ()) + +G_DECLARE_INTERFACE (NautilusPropertiesModelProvider, + nautilus_properties_model_provider, + NAUTILUS, PROPERTIES_MODEL_PROVIDER, + GObject) + +/** + * SECTION:nautilus-properties-model-provider + * @title: NautilusPropertiesModelProvider + * @short_description: Interface to provide additional properties + * + * #NautilusPropertiesModelProvider allows extension to provide additional + * information for the file properties. + */ + +/** + * NautilusPropertiesModelProviderInterface: + * @g_iface: The parent interface. + * @get_models: Returns a #GList of #NautilusPropertiesModel. + * See nautilus_properties_model_provider_get_models() for details. + * + * Interface for extensions to provide additional properties. + */ +struct _NautilusPropertiesModelProviderInterface +{ + GTypeInterface g_iface; + + GList *(*get_models) (NautilusPropertiesModelProvider *provider, + GList *files); +}; + +/** + * nautilus_properties_model_provider_get_models: + * @provider: a #NautilusPropertiesModelProvider + * @files: (element-type NautilusFileInfo): a #GList of #NautilusFileInfo + * + * This function is called by the application when it wants properties models + * from the extension. + * + * This function is called in the main thread before the Properties are shown, + * so it should return quickly. The models can be populated and updated + * asynchronously. + * + * Returns: (nullable) (element-type NautilusPropertiesModel) (transfer full): A #GList of allocated #NautilusPropertiesModel models. + */ +GList *nautilus_properties_model_provider_get_models (NautilusPropertiesModelProvider *provider, + GList *files); + +G_END_DECLS -- cgit v1.2.3