GOffice.Component¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new_by_mime_type(mime_type) | 
| class | new_from_uri(uri) | 
| class | sax_push_parser(xin, attrs, handler, *user_data) | 
| class | set_default_command_context(cc) | 
| build_snapshot() | |
| duplicate() | |
| edit() | |
| emit_changed() | |
| export_image(format, output, x_dpi, y_dpi) | |
| get_command_context() | |
| get_data(data, length, clearfunc, user_data) | |
| get_inline() | |
| get_mime_type() | |
| get_size(width, height) | |
| get_snapshot(type, length) | |
| get_use_font_from_app() | |
| is_editable() | |
| is_resizable() | |
| render(cr, width, height) | |
| set_command_context(cc) | |
| set_data(data, length) | |
| set_default_size(width, ascent, descent) | |
| set_font(desc) | |
| set_inline(is_inline) | |
| set_size(width, height) | |
| set_use_font_from_app(use_font_from_app) | |
| stop_editing() | |
| write_xml_sax(output) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_changed() | |
| do_edit() | |
| do_get_data(data, length, clearfunc, *user_data) | |
| do_mime_type_set() | |
| do_render(cr, width, height) | |
| do_set_data() | |
| do_set_default_size() | |
| do_set_font(desc) | |
| do_set_size() | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| ascent | float | r/w | Component ascent | 
| descent | float | r/w | Component descent | 
| height | float | r | Component height | 
| inline | bool | r/w | Whether the component should be displayed in-line | 
| mime-type | str | r/w/co | mime type of the content of the component | 
| width | float | r/w | Component width | 
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| ascent | float | r | |
| cc | GOffice.CmdContext | r | |
| data | str | r | |
| default_ascent | float | r | |
| default_descent | float | r | |
| default_width | float | r | |
| descent | float | r | |
| destroy_data | object | r | |
| destroy_notify | GLib.DestroyNotify | r | |
| editable | bool | r | |
| editor | Gtk.Window | r | |
| height | float | r | |
| length | int | r | |
| mime_type | str | r | |
| parent | GObject.Object | r | |
| resizable | bool | r | |
| snapshot_data | object | r | |
| snapshot_length | int | r | |
| snapshot_type | GOffice.SnapshotType | r | |
| width | float | r | 
Class Details¶
- 
class GOffice.Component(**kwargs)¶
- Bases: - GObject.Object- Abstract: - Yes - Structure: - GOffice.ComponentClass- 
classmethod new_by_mime_type(mime_type)¶
- Parameters: - mime_type ( - str) –- Return type: - GOffice.Component
 - 
classmethod new_from_uri(uri)¶
- Parameters: - uri ( - str) –- Return type: - GOffice.Component
 - 
classmethod sax_push_parser(xin, attrs, handler, *user_data)¶
- Parameters: - xin (Gsf.XMLIn) –Gsf.Input
- attrs (libxml2.Char) – the current node attributes.
- handler (GOffice.ComponentSaxHandler) –GOffice.ComponentSaxHandler
- user_data (objectorNone) – data to pass to handler
 - Loads the component from the xml stream. handler will be called when done. 
- xin (
 - 
classmethod set_default_command_context(cc)¶
- Parameters: - cc ( - GOffice.CmdContext) –
 - 
build_snapshot()¶
- Return type: - GOffice.SnapshotType
 - 
duplicate()¶
- Returns: - the duplicated component. - Return type: - GOffice.Component- Duplicates the component. 
 - 
edit()¶
- Returns: - the editor window or - None- Return type: - Gtk.Window- Opens a top level window editor for the component if it can be edited. 
 - 
emit_changed()¶
 - 
export_image(format, output, x_dpi, y_dpi)¶
- Parameters: - format (GOffice.ImageFormat) – image format for export
- output (Gsf.Output) – aGsf.Outputstream
- x_dpi (float) – x resolution of exported graph
- y_dpi (float) – y resolution of exported graph
 - Returns: - Trueif export succeed.- Return type: - Exports an image of graph in given format, writing results in a - Gsf.Outputstream. If export format type is a bitmap one, it computes image size with x_dpi, y_dpi and graph size (see gog_graph_get_size()).
- format (
 - 
get_command_context()¶
- Returns: - the command context used by the component or the default command context if the argument is - None.- Return type: - GOffice.CmdContext
 - 
get_data(data, length, clearfunc, user_data)¶
- Parameters: - Return type: 
 - 
get_inline()¶
- Returns: - whether the component is displayed in-line - Return type: - bool- Returns the in-line or not nature of the component. 
 - 
get_snapshot(type, length)¶
- Parameters: - type (GOffice.SnapshotType) –GOffice.SnapshotType
- length (int) – where to store the data length
 - Returns: - the snapshot as an arry of bytes. - Return type: - Returns a snapshot is either svg or png format for the component. 
- type (
 - 
get_use_font_from_app()¶
- Returns: - whether the component should use the - GOffice.fontfrom the calling application- Return type: - bool- Returns whether the component should use the - GOffice.fontfrom the calling application or use its own- GOffice.font.
 - 
render(cr, width, height)¶
- Parameters: - cr (cairo.Context) –
- width (float) –
- height (float) –
 
- cr (
 - 
set_command_context(cc)¶
- Parameters: - cc ( - GOffice.CmdContext) –
 - 
set_default_size(width, ascent, descent)¶
- Parameters: 
 - 
set_font(desc)¶
- Parameters: - desc ( - Pango.FontDescription) –- Pango.FontDescription- Returns: - Trueif size changed.- Return type: - bool- Sets the - GOffice.fontthe component should use. Not all components will actually changed the- GOffice.fontthey use.
 - 
set_inline(is_inline)¶
- Parameters: - is_inline ( - bool) – whether the component should be displayed in-line- Sets the in-line or not nature of the component. Default is - False.
 - 
set_use_font_from_app(use_font_from_app)¶
- Parameters: - use_font_from_app ( - bool) – whether the component should use the- GOffice.fontfrom the calling application or use its own- GOffice.font.- Sets the source of the - GOffice.fontthat the component should use. Default is- False.
 - 
stop_editing()¶
 - 
write_xml_sax(output)¶
- Parameters: - output ( - Gsf.XMLOut) –
 - 
do_changed() virtual¶
 - 
do_edit() virtual¶
- Returns: - the editor window or - None- Return type: - Gtk.Window- Opens a top level window editor for the component if it can be edited. 
 - 
do_get_data(data, length, clearfunc, *user_data) virtual¶
- Parameters: - Return type: 
 - 
do_mime_type_set() virtual¶
 - 
do_render(cr, width, height) virtual¶
- Parameters: - cr (cairo.Context) –
- width (float) –
- height (float) –
 
- cr (
 - 
do_set_data() virtual¶
 - 
do_set_default_size() virtual¶
 - 
do_set_font(desc) virtual¶
- Parameters: - desc ( - Pango.FontDescription) –- Pango.FontDescription- Returns: - Trueif size changed.- Return type: - bool- Sets the - GOffice.fontthe component should use. Not all components will actually changed the- GOffice.fontthey use.
 - 
do_set_size() virtual¶
 
- 
classmethod 
Signal Details¶
- 
GOffice.Component.signals.changed(component)¶
- Signal Name: - changed- Flags: - RUN_LAST- Parameters: - component ( - GOffice.Component) – The object which received the signal
Property Details¶
- 
GOffice.Component.props.ascent¶
- Name: - ascent- Type: - float- Default Value: - 0.0- Flags: - READABLE,- WRITABLE- Component ascent 
- 
GOffice.Component.props.descent¶
- Name: - descent- Type: - float- Default Value: - 0.0- Flags: - READABLE,- WRITABLE- Component descent 
- 
GOffice.Component.props.height¶
- Name: - height- Type: - float- Default Value: - 0.0- Flags: - READABLE- Component height 
- 
GOffice.Component.props.inline¶
- Name: - inline- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE- Whether the component should be displayed in-line