aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-model.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-04-13 08:40:49 +0800
committerChris Lahey <clahey@src.gnome.org>2001-04-13 08:40:49 +0800
commit0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f (patch)
tree65b0c7756268decded8c5f5341c85aaaf6476d8e /widgets/table/e-tree-model.c
parenta4f57fbbde67f1423a741b898d51773310a8c696 (diff)
downloadgsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.gz
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.bz2
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.lz
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.xz
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.tar.zst
gsoc2013-evolution-0f85f30ab1145a7ed3c6ee7b2e2216874dc2074f.zip
Upped the version number to 0.6.99.0. Upped the so number to 6.
2001-04-12 Christopher James Lahey <clahey@ximian.com> * configure.in: Upped the version number to 0.6.99.0. Upped the so number to 6. * docs/etablexml.txt: Made some updates here. * tests/test-tree-1.c, tests/test-tree-3.c: Added NULL, NULL to the call to e_tree_memory_callbacks_new. From gal/e-table/ChangeLog: 2001-04-12 Christopher James Lahey <clahey@ximian.com> * e-table-item.c (eti_cursor_change): Only move the screen to show the cursor if there are no changes pending. Updated the commented out code for alternating colors a bit. * e-table-model.c, e-table-model.h: Added e_table_model_has_change_pending. * e-tree-memory-callbacks.c, e-tree-memory-callbacks.h: Added has_get_node_by_id and get_node_by_id. * e-tree-model.c, e-tree-model.h: Added e_tree_model_has_get_node_by_id and e_tree_model_get_node_by_id. Added e_tree_model_has_change_pending. * e-tree-selection-model.c: Handle the selection and cursor properly across the tree changing. * e-tree-sorted.c: Implemented has_get_node_by_id and get_node_by_id, and has_changes_pending. * e-tree-table-adapter.c: Implemented has_changes_pending. Fixed an array underflow. svn path=/trunk/; revision=9289
Diffstat (limited to 'widgets/table/e-tree-model.c')
-rw-r--r--widgets/table/e-tree-model.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index 895b3fb3cd..90ed489a74 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -122,6 +122,10 @@ e_tree_model_class_init (GtkObjectClass *klass)
tree_class->has_save_id = NULL;
tree_class->get_save_id = NULL;
+ tree_class->has_get_node_by_id = NULL;
+ tree_class->get_node_by_id = NULL;
+
+ tree_class->has_change_pending = NULL;
tree_class->value_at = NULL;
tree_class->set_value_at = NULL;
@@ -584,6 +588,70 @@ e_tree_model_get_save_id (ETreeModel *etree, ETreePath node)
}
/**
+ * e_tree_model_has_get_node_by_id
+ * @etree: The ETreeModel.
+ *
+ * XXX docs here.
+ *
+ * return values: Whether this tree can quickly get a node from its save id.
+ */
+gboolean
+e_tree_model_has_get_node_by_id (ETreeModel *etree)
+{
+ g_return_val_if_fail (etree != NULL, FALSE);
+ g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
+
+ if (ETM_CLASS(etree)->has_get_node_by_id)
+ return ETM_CLASS(etree)->has_get_node_by_id (etree);
+ else
+ return FALSE;
+}
+
+/**
+ * e_tree_model_get_node_by_id
+ * @etree: The ETreeModel.
+ * @node: The ETreePath.
+ *
+ * get_node_by_id(get_save_id(node)) should be the original node.
+ * Likewise if get_node_by_id is not NULL, then
+ * get_save_id(get_node_by_id(string)) should be a copy of the
+ * original string.
+ *
+ * return values: The path for this save id.
+ */
+ETreePath
+e_tree_model_get_node_by_id (ETreeModel *etree, gchar *save_id)
+{
+ g_return_val_if_fail (etree != NULL, NULL);
+ g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
+
+ if (ETM_CLASS(etree)->get_node_by_id)
+ return ETM_CLASS(etree)->get_node_by_id (etree, save_id);
+ else
+ return NULL;
+}
+
+/**
+ * e_tree_model_has_change_pending
+ * @etree: The ETreeModel.
+ *
+ * XXX docs here.
+ *
+ * return values: Whether this tree has valid save id data.
+ */
+gboolean
+e_tree_model_has_change_pending (ETreeModel *etree)
+{
+ g_return_val_if_fail (etree != NULL, FALSE);
+ g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
+
+ if (ETM_CLASS(etree)->has_change_pending)
+ return ETM_CLASS(etree)->has_change_pending (etree);
+ else
+ return FALSE;
+}
+
+/**
* e_tree_model_icon_of_node
* @etree: The ETreeModel.
* @path: The ETreePath to the node we're getting the icon of.