1 #ifndef _GNM_EXPR_NAME_H_
2 # define _GNM_EXPR_NAME_H_
6 #include <goffice/goffice.h>
10 struct _GnmNamedExpr
{
14 GHashTable
*dependents
;
15 GnmExprTop
const *texpr
;
16 gboolean is_placeholder
;
18 gboolean is_permanent
;
20 GnmNamedExprCollection
*scope
;
23 gboolean
expr_name_validate (const char *name
);
25 GType
gnm_named_expr_get_type (void);
26 GnmNamedExpr
*expr_name_new (char const *name
);
27 GnmNamedExpr
*expr_name_lookup (GnmParsePos
const *pos
, char const *name
);
28 GnmNamedExpr
*expr_name_add (GnmParsePos
const *pp
, char const *name
,
29 GnmExprTop
const *texpr
, char **error_msg
,
30 gboolean link_to_container
,
32 void expr_name_perm_add (Sheet
*sheet
,
34 GnmExprTop
const *texpr
,
35 gboolean is_editable
);
36 GnmNamedExpr
*expr_name_ref (GnmNamedExpr
*nexpr
);
37 void expr_name_unref (GnmNamedExpr
*nexpr
);
38 void expr_name_remove (GnmNamedExpr
*nexpr
);
39 GnmValue
*expr_name_eval (GnmNamedExpr
const *nexpr
,
40 GnmEvalPos
const *pos
,
41 GnmExprEvalFlags flags
);
43 const char *expr_name_name (GnmNamedExpr
const *nexpr
);
44 gboolean
expr_name_set_name (GnmNamedExpr
*nexpr
, const char *new_name
);
46 gboolean
expr_name_is_placeholder (GnmNamedExpr
const *ne
);
47 void expr_name_set_is_placeholder (GnmNamedExpr
*nexpr
, gboolean is_placeholder
);
49 char *expr_name_as_string (GnmNamedExpr
const *nexpr
, GnmParsePos
const *pp
,
50 GnmConventions
const *fmt
);
51 char *expr_name_set_pos (GnmNamedExpr
*nexpr
, GnmParsePos
const *pp
);
52 void expr_name_set_expr (GnmNamedExpr
*nexpr
, GnmExprTop
const *texpr
);
53 void expr_name_add_dep (GnmNamedExpr
*nexpr
, GnmDependent
*dep
);
54 void expr_name_remove_dep (GnmNamedExpr
*nexpr
, GnmDependent
*dep
);
55 gboolean
expr_name_is_active (GnmNamedExpr
const *nexpr
);
56 void expr_name_downgrade_to_placeholder (GnmNamedExpr
*nexpr
);
57 gboolean
expr_name_in_use (GnmNamedExpr
*nexpr
);
59 int expr_name_cmp_by_name (GnmNamedExpr
const *a
, GnmNamedExpr
const *b
);
60 gboolean
expr_name_check_for_loop (char const *name
, GnmExprTop
const *texpr
);
62 char const *sheet_names_check (Sheet
const *sheet
, GnmRange
const *r
);
64 GOUndo
*expr_name_set_expr_undo_new (GnmNamedExpr
*nexpr
);
66 /******************************************************************************/
68 GType
gnm_named_expr_collection_get_type (void);
69 GnmNamedExprCollection
*gnm_named_expr_collection_new (void);
70 void gnm_named_expr_collection_free (GnmNamedExprCollection
*names
);
71 void gnm_named_expr_collection_unlink (GnmNamedExprCollection
*names
);
72 void gnm_named_expr_collection_relink (GnmNamedExprCollection
*names
);
73 void gnm_named_expr_collection_foreach (GnmNamedExprCollection
*names
,
76 GSList
*gnm_named_expr_collection_list (GnmNamedExprCollection
const *scope
);
78 GnmNamedExpr
*gnm_named_expr_collection_lookup (GnmNamedExprCollection
const *scope
,
80 void gnm_named_expr_collection_dump (GnmNamedExprCollection
*names
,
82 gboolean
gnm_named_expr_collection_sanity_check (GnmNamedExprCollection
*names
,
87 #endif /* _GNM_EXPR_NAME_H_ */