def get_item_list(self, content=None): """Return all the list items that match the criteria. Arguments: style -- unicode content -- unicode regex Return: list of odf_paragraph """ return _get_element_list(self, 'text:list-item', content=content)
def get_note_list(self, note_class=None, regex=None): """Return the list of all note element, optionally the ones of the given class or that match the given regex. Arguments: note_class -- 'footnote' or 'endnote' regex -- unicode Return: list of odf_element """ return _get_element_list(self, 'descendant::text:note', note_class=note_class, regex=regex)
def get_annotation_list(self, creator=None, start_date=None, end_date=None, regex=None): """XXX end date is not included (as expected in Python). """ annotations = [] for annotation in _get_element_list(self, 'descendant::office:annotation', regex=regex): if (creator is not None and creator != annotation.get_dc_creator()): continue date = annotation.get_dc_date() if start_date is not None and date < start_date: continue if end_date is not None and date >= end_date: continue annotations.append(annotation) return annotations
def get_image_list(self, style=None, href=None, regex=None): """Get all image elements matching the criteria. Style is the style name. Set link to False to get only internal images, and True to get only external images (not in the container). Href is a regex to find all images with their path matching. Arguments: style -- str link -- bool href -- unicode regex Return: list of odf_element """ return _get_element_list(self, 'descendant::draw:image', text_style=style, href=href, regex=regex)
def get_styled_elements(self, name=True): """Brute-force to find paragraphs, tables, etc. using the given style name (or all by default). Arguments: name -- unicode Return: list """ # FIXME incomplete (and possibly inaccurate) return (_get_element_list(self, 'descendant::*', text_style=name) + _get_element_list(self, 'descendant::*', draw_style=name) + _get_element_list(self, 'descendant::*', style_name=name) + _get_element_list(self, 'descendant::*', draw_text_style=name) + _get_element_list(self, 'descendant::*', table_style=name) + _get_element_list(self, 'descendant::*', page_layout=name) )
def get_draw_rectangle_list(self, draw_style=None, draw_text_style=None, regex=None): return _get_element_list(self, 'descendant::draw:rect', draw_style=draw_style, draw_text_style=draw_text_style, regex=regex)
def get_frame_list(self, style=None, title=None, description=None, regex=None): return _get_element_list(self, 'descendant::draw:frame', draw_style=style, svg_title=title, svg_desc=description, regex=regex)
def get_heading_list(self, style=None, level=None, regex=None): return _get_element_list(self, 'descendant::text:h', text_style=style, outline_level=level, regex=regex)
def get_toc_list(self): return _get_element_list(self, 'text:table-of-content')
def get_variable_sets(self, name): return _get_element_list(self, 'descendant::text:variable-set', text_name=name)
def get_variable_list(self): return _get_element_list(self, 'descendant::text:variable-decl')
def get_note_by_class(self, note_class): return _get_element_list(self, 'descendant::text:note', note_class=note_class)
def get_table_list(self, style=None, regex=None): return _get_element_list(self, 'descendant::table:table', table_style=style, regex=regex)
def get_draw_ellipse_list(self, draw_style=None, draw_text_style=None, regex=None): return _get_element_list(self, 'descendant::draw:ellipse', draw_style=draw_style, draw_text_style=draw_text_style, regex=regex)
def get_draw_connector_list(self, draw_style=None, draw_text_style=None, regex=None): return _get_element_list(self, 'descendant::draw:connector', draw_style=draw_style, draw_text_style=draw_text_style, regex=regex)
def get_user_field_list(self): return _get_element_list(self, 'descendant::text:user-field-decl')
def get_style_list(self, family=None): # Both common and default styles tagname, famattr = self._get_style_tagname(family) return _get_element_list(self, tagname, family=famattr)
def get_draw_page_list(self, style=None, regex=None): return _get_element_list(self, 'descendant::draw:page', draw_style=style, regex=regex)
def get_section_list(self, style=None, regex=None): return _get_element_list(self, 'text:section', text_style=style, regex=regex)
def get_link_list(self, name=None, title=None, href=None, regex=None): return _get_element_list(self, 'descendant::text:a', office_name=name, office_title=title, href=href, regex=regex)
def get_list_list(self, style=None, regex=None): return _get_element_list(self, 'descendant::text:list', text_style=style, regex=regex)
def get_bookmark_start_list(self): return _get_element_list(self, 'descendant::text:bookmark-start')
def get_bookmark_end_list(self): return _get_element_list(self, 'descendant::text:bookmark-end')
def get_reference_mark_end_list(self): return _get_element_list(self, 'descendant::text:reference-mark-end')
def get_changed_region_list(self, creator=None, date=None, content=None): return _get_element_list(self, 'text:changed-region', dc_creator=creator, dc_date=date, content=content)
def get_item_list(self, regex=None): return _get_element_list(self, 'text:list-item', regex=regex)