Introspection: add basic io
[gnumeric.git] / README-introspection
blobc3633091e0b756145d62da65d280f3b336422bd7
1 Today is 20180412.  If that seems a long time ago, this document might
2 be outdated.
4 test/t3001-introspection-simple.py shows a sample of using introspection
5 to work with a spreadsheet.  Note: you must either "make install" first
6 or else run it the corresponding *.pl file.
8 The following is a list of types and the API that is expected to both
9 be useful in this setting and actually work.
11 This is incomplete.  In particular, I'll have to look at
12 * Expressions other than via text
13 * File i/o
14 * Installing a gi override module for more pythony structure handling
16 -----------------------------------------------------------------------------
17 Note: the Python version of type names excludes the Gnm prefix.
19 Workbook: [GObject, derived from GODoc]
20   new_with_sheets(count)
21   sheet_by_index(no)
22   sheet_by_name(string)
23   recalc()
24   recalc_all()
25   cells(qcomments,visibility)
26   props.recalc_mode
29 GODoc: [GObject]
30   props.uri
31   props.dirty
32   props.pristine
35 Sheet: [GObject]
36   get_size()
37   cell_set_value(col,row,value)      [1]
38   cell_set_text(col,row,string)      [1]
39   cell_get_value(col,row)
40   cell_get(col,row)
41   cell_fetch(col,row)
42   cells(range)
43   cells_count()
44   is_cell_empty(col,row)
45   apply_style(range,style)           [1]
46   style_get(col,row)
47   props.name
48   props.workbook
49   props.rtl
50   props.visibility
51   props.display_formulas
52   props.display_zeros
53   props.display_grid
54   props.display_column_header
55   props.display_row_header
56   props.display_outlines
57   props.display_outlines_below
58   props.display_outlines_right
59   props.protected
60   props.protected_allow_edit_objects
61   props.protected_allow_edit_scenarios
62   props.protected_allow_cell_formatting
63   props.protected_allow_column_formatting
64   props.protected_allow_row_formatting
65   props.protected_allow_insert_columns
66   props.protected_allow_insert_rows
67   props.protected_allow_insert_hyperlinks
68   props.protected_allow_delete_columns
69   props.protected_allow_delete_rows
70   props.protected_allow_select_locked_cells
71   props.protected_allow_sort_ranges
72   props.protected_allow_edit_auto_filters
73   props.protected_allow_edit_pivottable
74   props.protected_allow_select_unlocked_cells
75   props.use_r1c1
76   props.tab_foreground
77   props.tab_background
78   props.zoom_factor
79   props.columns
80   props.rows
83 GnmCell: [Boxed structure] [2]
84   name()
85   get_value()
86   get_entered_text()
87   get_format()
88   pos
91 GnmSheetSize: [Simple structure]
92   max_cols
93   max_rows
96 GnmValue: [Boxed union]
97   new_int(int)
98   new_bool(bool)
99   new_float(double)
100   new_string(string)
101   new_empty()
102   get_as_string()
103   get_as_int()
104   get_as_float()
105   type_of()
106   hash()
109 GnmValueType: [Enum]
110   EMPTY
111   BOOLEAN
112   FLOAT
113   ERROR
114   STRING
115   CELLRANGE
116   ARRAY
119 GnmRange: [Simple structure]
120   init(col,row,col,row)
121   init_full_sheet(sheet)
122   init_cols(sheet,start,end)
123   init_rows(sheet,start,end)
124   init_cellpos(sheet,cellpos)
125   as_string()
126   start
127   end
130 GnmCellPos: [Simple structure]
131   col
132   row
135 GnmSheetVisibility: [Enum]
136   VISIBLE
137   HIDDEN
138   VERY_HIDDEN
141 PasteFlags: [Enum]
142   CONTENTS
143   AS_VALUES
144   FORMATS
145   COMMENTS
146   OBJECTS
147   OPER_ADD
148   OPER_SUB
149   OPER_MULT
150   OPER_DIV
151   TRANSPOSE
152   LINK
153   SKIP_BLANKS
154   DONT_MERGE
155   IGNORE_COMMENTS_AT_ORIGIN
156   UPDATE_ROW_HEIGHT
157   EXPR_LOCAL_RELOCATE
158   NO_RECALC
159   FLIP_H
160   FLIP_V
161   ALL_TYPES
162   DEFAULT
165 GnmStyle: [Boxed structure]
166   new()
167   new_default()
168   is_complete()
169   is_element_set()
170   unset_element()
171   set_pattern(int)
172   get_pattern()
173   set_font_name(string)
174   get_font_name()
175   set_font_bold(bool)
176   get_font_bold()
177   set_font_italic(bool)
178   get_font_italic()
179   set_font_uline(uline)
180   get_font_uline()
181   set_font_strike(bool)
182   get_font_strike()
183   set_font_script(script)
184   get_font_script()
185   set_font_size(pts)
186   get_font_size()
187   set_format(fmt)
188   set_format_text(fmtstring)
189   get_format()
190   set_align_h(halign)
191   get_align_h()
192   set_align_v(valign)
193   get_align_v()
194   set_indent(int)
195   get_indent()
196   set_rotation(degs)
197   get_rotation()
198   set_text_dir(dir)
199   get_text_dir()
200   set_text_wrap(bool)
201   get_text_wrap()
202   set_shrink_to_fit(bool)
203   get_shrink_to_fit()
204   set_contents_locked(bool)
205   get_contents_locked()
206   set_contents_hidden(bool)
207   get_contents_hidden()
208   get_effective_text_wrap()
209   visible_in_blank()
212 GOFormat: [Boxed structure]
213   new_from_XL(string)
214   as_XL()
215   general
216   empty
217   default_date
218   default_time
219   default_date_time
220   default_percentage
221   default_money
222   default_accounting
223   is_invalid
224   is_general
225   is_markup
226   is_text
227   is_var_width
228   is_date
229   is_time
230   month_before_day
231   has_hour
232   has_minute
233   inc_precision
234   dec_precision
235   toggle_1000sep
239 Gnm (i.e., not in a class):
240   clipboard_copy_range(sheet,range)
245 Footnotes:
246 [1] This function is not calling the obvious C function, but uses
247     introspection's rename-to feature to present a better API.
248 [2] Cells are owned by the sheet.  GnmCell's boxed type uses no-op
249     copying and freeing.