diff options
-rw-r--r-- | doc/reference/evolution-util/evolution-util-sections.txt | 1 | ||||
-rw-r--r-- | e-util/e-table-specification.c | 28 | ||||
-rw-r--r-- | e-util/e-table-specification.h | 3 |
3 files changed, 31 insertions, 1 deletions
diff --git a/doc/reference/evolution-util/evolution-util-sections.txt b/doc/reference/evolution-util/evolution-util-sections.txt index d5193113b4..989ea338c0 100644 --- a/doc/reference/evolution-util/evolution-util-sections.txt +++ b/doc/reference/evolution-util/evolution-util-sections.txt @@ -3913,6 +3913,7 @@ e_table_sorting_utils_lookup_cmp_cache <TITLE>ETableSpecification</TITLE> ETableSpecification e_table_specification_new +e_table_specification_ref_columns e_table_specification_load_from_file e_table_specification_load_from_string e_table_specification_load_from_node diff --git a/e-util/e-table-specification.c b/e-util/e-table-specification.c index 03c160ba74..b14bbde9df 100644 --- a/e-util/e-table-specification.c +++ b/e-util/e-table-specification.c @@ -112,6 +112,34 @@ e_table_specification_new (void) } /** + * e_table_specification_ref_columns: + * @specification: an #ETableSpecification + * + * Returns a #GPtrArray containing #ETableColumnSpecification instances for + * all columns defined by @specification. The array contents are owned by + * the @specification and should not be modified. Unreference the array + * with g_ptr_array_unref() when finished with it. + * + * Returns: a #GPtrArray of #ETableColumnSpecification instances + **/ +GPtrArray * +e_table_specification_ref_columns (ETableSpecification *specification) +{ + GPtrArray *array; + guint ii; + + g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), NULL); + g_return_val_if_fail (specification->columns != NULL, NULL); + + array = g_ptr_array_new (); + + for (ii = 0; specification->columns[ii] != NULL; ii++) + g_ptr_array_add (array, specification->columns[ii]); + + return array; +} + +/** * e_table_specification_load_from_file: * @specification: an #ETableSpecification * @filename: the name of a file containing an #ETable specification diff --git a/e-util/e-table-specification.h b/e-util/e-table-specification.h index 11986bb991..feada9e82c 100644 --- a/e-util/e-table-specification.h +++ b/e-util/e-table-specification.h @@ -84,7 +84,8 @@ struct _ETableSpecificationClass { GType e_table_specification_get_type (void) G_GNUC_CONST; ETableSpecification * e_table_specification_new (void); - +GPtrArray * e_table_specification_ref_columns + (ETableSpecification *specification); gboolean e_table_specification_load_from_file (ETableSpecification *specification, const gchar *filename); |