summaryrefslogtreecommitdiffstats
path: root/libnautilus-extension/nautilus-properties-model-provider.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:39:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:39:48 +0000
commit3ade071f273aaa973e44bf95d6b1d4913a18f03b (patch)
treee2f99d267ae18427645404f215b984afbe73098d /libnautilus-extension/nautilus-properties-model-provider.h
parentInitial commit. (diff)
downloadnautilus-3ade071f273aaa973e44bf95d6b1d4913a18f03b.tar.xz
nautilus-3ade071f273aaa973e44bf95d6b1d4913a18f03b.zip
Adding upstream version 43.2.upstream/43.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--libnautilus-extension/nautilus-properties-model-provider.h66
1 files changed, 66 insertions, 0 deletions
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 <nautilus-extension.h> should be included directly."
+#endif
+
+#include <glib-object.h>
+
+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