gnumeric-expr-entry.h 3.48 KB
Newer Older
1 2 3
#ifndef GNUMERIC_EXPR_ENTRY_H
#define GNUMERIC_EXPR_ENTRY_H

4
#include "gnumeric-fwd.h"
5
#include "parse-util.h"
Morten Welinder's avatar
Morten Welinder committed
6
#include <gtk/gtk.h>
7

8 9
#define GNM_EXPR_ENTRY_TYPE	(gnm_expr_entry_get_type ())
#define GNM_EXPR_ENTRY(o)	(G_TYPE_CHECK_INSTANCE_CAST ((o), GNM_EXPR_ENTRY_TYPE, GnmExprEntry))
Morten Welinder's avatar
Morten Welinder committed
10
#define GNM_EXPR_ENTRY_IS(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), GNM_EXPR_ENTRY_TYPE))
11

12
typedef struct _GnmExprEntry GnmExprEntry;
13

14
typedef enum {
Jon Kåre Hellan's avatar
Jon Kåre Hellan committed
15
	GNM_EE_SINGLE_RANGE    = 1 << 0,
16 17
	GNM_EE_FORCE_ABS_REF   = 1 << 1, /* takes precedence over FORCE_REL_REF */
	GNM_EE_FORCE_REL_REF   = 1 << 2,
18 19 20 21 22
	GNM_EE_DEFAULT_ABS_REF = 1 << 3, /* lower priority than the _FORCE variants */
	GNM_EE_FULL_COL        = 1 << 4,
	GNM_EE_FULL_ROW        = 1 << 5,
	GNM_EE_SHEET_OPTIONAL  = 1 << 6,
	GNM_EE_FORMULA_ONLY    = 1 << 7,
23 24
	GNM_EE_CONSTANT_ALLOWED= 1 << 8,
	GNM_EE_MASK            = 0x1FF
25
} GnmExprEntryFlags;
26

27
GType gnm_expr_entry_get_type (void);
28
GnmExprEntry *gnm_expr_entry_new       (WBCGtk *wbcg,
29
					gboolean with_icon);
30 31

/* Widget specific methods */
32
void	  gnm_expr_entry_freeze		(GnmExprEntry *gee);
33 34
void	  gnm_expr_entry_thaw		(GnmExprEntry *gee);
void	  gnm_expr_entry_set_flags	(GnmExprEntry *gee,
35 36
					 GnmExprEntryFlags flags,
					 GnmExprEntryFlags mask);
37
void	  gnm_expr_entry_set_scg	(GnmExprEntry *gee,
Jody Goldberg's avatar
Jody Goldberg committed
38
					 SheetControlGUI *scg);
39 40
SheetControlGUI *gnm_expr_entry_get_scg	(GnmExprEntry *gee);

41 42
GtkEntry *gnm_expr_entry_get_entry	(GnmExprEntry *gee);
gboolean  gnm_expr_entry_get_rangesel	(GnmExprEntry const *gee,
Jody Goldberg's avatar
Jody Goldberg committed
43
					 GnmRange *r, Sheet **sheet);
44
gboolean  gnm_expr_entry_find_range	(GnmExprEntry *gee);
45
void	  gnm_expr_entry_rangesel_stop	(GnmExprEntry *gee,
46
					 gboolean clear_string);
Jody Goldberg's avatar
Jody Goldberg committed
47

48 49
gboolean  gnm_expr_entry_can_rangesel	(GnmExprEntry *gee);
gboolean  gnm_expr_entry_is_blank	(GnmExprEntry *gee);
50
gboolean  gnm_expr_entry_is_cell_ref	(GnmExprEntry *gee,
51 52
					 Sheet *sheet,
					 gboolean allow_multiple_cell);
53

54 55 56 57
char const *gnm_expr_entry_get_text	  (GnmExprEntry const *gee);
GnmValue   *gnm_expr_entry_parse_as_value (GnmExprEntry *gee, Sheet *sheet);
GSList	   *gnm_expr_entry_parse_as_list  (GnmExprEntry *gee, Sheet *sheet);
GnmExprTop const *gnm_expr_entry_parse	  (GnmExprEntry *gee,
Morten Welinder's avatar
Morten Welinder committed
58 59
					   GnmParsePos const *pp,
					   GnmParseError *perr, gboolean start_sel,
Jody Goldberg's avatar
Jody Goldberg committed
60
					   GnmExprParseFlags flags);
61
char    *gnm_expr_entry_global_range_name (GnmExprEntry *gee, Sheet *sheet);
62
void	 gnm_expr_entry_load_from_text	  (GnmExprEntry *gee, char const *txt);
63
void	 gnm_expr_entry_load_from_dep	  (GnmExprEntry *gee,
64
					   GnmDependent const *dep);
65
void	 gnm_expr_entry_load_from_expr	  (GnmExprEntry *gee,
66
					   GnmExprTop const *texpr,
Morten Welinder's avatar
Morten Welinder committed
67
					   GnmParsePos const *pp);
68
gboolean gnm_expr_entry_load_from_range   (GnmExprEntry *gee,
69
					   Sheet *sheet, GnmRange const *r);
70 71 72 73 74 75 76 77
typedef enum
{
	GNM_UPDATE_CONTINUOUS,
	GNM_UPDATE_DISCONTINUOUS,
	GNM_UPDATE_DELAYED
} GnmUpdateType;
#define GNM_TYPE_UPDATE_TYPE (gnm_update_type_get_type())
GType gnm_update_type_get_type (void);
78

79
void gnm_expr_entry_set_update_policy (GnmExprEntry *gee,
80
					    GnmUpdateType  policy);
81
void gnm_expr_entry_grab_focus (GnmExprEntry *gee, gboolean select_all);
82

83
void    gnm_expr_entry_close_tips  (GnmExprEntry *gee);
84 85
void    gnm_expr_entry_enable_tips  (GnmExprEntry *gee);
void    gnm_expr_entry_disable_tips  (GnmExprEntry *gee);
86

87 88
/* Cell Renderer Specific Method */

89
gboolean gnm_expr_entry_editing_canceled (GnmExprEntry *gee);
90

91
/* private : for internal use */
Jody Goldberg's avatar
Jody Goldberg committed
92
void gnm_expr_entry_signal_update (GnmExprEntry *gee, gboolean user_requested);
93

94
#endif /* GNUMERIC_EXPR_ENTRY_H */