Styles module - SPStylesInterface
Module used to manipulate style collections.
Constants
Styles number
To specify which styles collection shall be manipulated, use these
constants:
STYLES_MAIN = 0
Style manipulation methods
These functions of SPSubInterface enable to call corresponding
methods of TStyleCol in SP. Common parameter is styles_no
with the same meaning as in Style module.
get_count(styles_no)
- Get number of styles in the collection
- nil will be returned in case of invalid
styles_no value.
add(styles_no)
- Add a new empty style, return it's index
delete(styles_no, style_id_to_delete)
- Delete specified style by index or name
get_unique_name(styles_no, base_name)
- Append a number (in current SP's implementation) to base_name to ensure that the name is unique in the
entire styles collection
find_compatible_style(styles_no,
styles_to_find, style_to_find)
- Find a style in compatible with the second style
- styles_no: collection where the style
will be searched
- styles_to_find, style_to_find:
specification of the known style used as a search template
- Return:
- index of found style
- nil if not found
purge_non_local(styles_no)
- Delete all styles where the local
property is false
find_by_font_props(styles_no, f_name, f_b,
f_i, f_u, f_s, f_charset)
- Find style by font properties
- f_name: Font name
- f_b, f_i, f_u, f_s: Font style (Bold,
Italic, Underline, Strikeout) - boolean
- f_charset: integer specifying Windows
font charset
- Return:
- index of found style
- nil if not found
find_by_font_name(styles_no, f_name)
- Find style by font name
- f_name: Font name
- Return:
- index of found style
- nil if not found