1 Today is 20180412. If that seems a long time ago, this document might
4 Note: For tests you must either "make install" first or else run the
5 python script via the corresponding *.pl file.
7 test/t3001-introspection-simple.py shows a sample of using introspection
8 to work with a spreadsheet.
10 test/t3002-introspection-io.py shows a sample of using introspection
11 to load and save files.
14 The following is a list of types and the API that is expected to both
15 be useful in this setting and actually work.
17 This is incomplete. In particular, I'll have to look at
18 * Expressions other than via text
19 * Installing a gi override module for more pythony structure handling
21 -----------------------------------------------------------------------------
22 Note: the Python version of type names excludes the Gnm prefix.
24 Workbook: [GObject, derived from GODoc]
25 new_with_sheets(count)
30 cells(qcomments,visibility)
40 WorkbookView: [GObject]
41 new_from_uri(uri,opener,iocontext,encoding)
43 save_as(uri,saver,cmdctx)
46 props.preferred_height
51 cell_set_value(col,row,value) [1]
52 cell_set_text(col,row,string) [1]
53 cell_get_value(col,row)
58 is_cell_empty(col,row)
59 apply_style(range,style) [1]
65 col_set_size_pts(col,pts)
66 row_set_size_pts(row,pts)
67 col_set_size_pixels(col,pix)
68 row_set_size_pixels(row,pix)
69 col_size_fit_pixels(col,startrow,endrow,ignorestrings)
70 row_size_fit_pixels(row,startcol,endcol,ignorestrings)
75 props.display_formulas
78 props.display_column_header
79 props.display_row_header
80 props.display_outlines
81 props.display_outlines_below
82 props.display_outlines_right
84 props.protected_allow_edit_objects
85 props.protected_allow_edit_scenarios
86 props.protected_allow_cell_formatting
87 props.protected_allow_column_formatting
88 props.protected_allow_row_formatting
89 props.protected_allow_insert_columns
90 props.protected_allow_insert_rows
91 props.protected_allow_insert_hyperlinks
92 props.protected_allow_delete_columns
93 props.protected_allow_delete_rows
94 props.protected_allow_select_locked_cells
95 props.protected_allow_sort_ranges
96 props.protected_allow_edit_auto_filters
97 props.protected_allow_edit_pivottable
98 props.protected_allow_select_unlocked_cells
107 GnmCell: [Boxed structure] [2]
115 ColRowInfo: [Boxed structure]
119 GnmSheetSize: [Simple structure]
124 GnmValue: [Boxed union]
147 GnmRange: [Simple structure]
148 init(col,row,col,row)
149 init_full_sheet(sheet)
150 init_cols(sheet,start,end)
151 init_rows(sheet,start,end)
152 init_cellpos(sheet,cellpos)
158 GnmCellPos: [Simple structure]
163 GnmSheetVisibility: [Enum]
183 IGNORE_COMMENTS_AT_ORIGIN
193 GnmStyle: [Boxed structure]
201 set_font_name(string)
205 set_font_italic(bool)
207 set_font_uline(uline)
209 set_font_strike(bool)
211 set_font_script(script)
216 set_format_text(fmtstring)
230 set_shrink_to_fit(bool)
232 set_contents_locked(bool)
233 get_contents_locked()
234 set_contents_hidden(bool)
235 get_contents_hidden()
236 get_effective_text_wrap()
240 GOFormat: [Boxed structure]
266 GOIOContext: [GObject]
270 GnmCmdContextStderr: [GObject]
274 GOFileSaver: [GObject]
276 for_file_name(filename_or_uri)
277 for_mime_type(mimetype)
284 props.interactive_only
289 GOFileOpener: [GObject]
294 props.interactive_only
297 GOFileFormatLevel: [Enum]
307 Gnm (i.e., not in a class):
308 clipboard_copy_range(sheet,range)
312 GOffice (i.e., not in a class):
313 filename_to_uri(filename)
320 [1] This function is not calling the obvious C function, but uses
321 introspection's rename-to feature to present a better API.
322 [2] Cells are owned by the sheet. GnmCell's boxed type uses no-op