GOffice.Component¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Component ascent |
||
r/w |
Component descent |
||
r |
Component height |
||
r/w |
Whether the component should be displayed in-line |
||
r/w/co |
mime type of the content of the component |
||
r/w |
Component width |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
ascent |
r |
||
cc |
r |
||
data |
r |
||
default_ascent |
r |
||
default_descent |
r |
||
default_width |
r |
||
descent |
r |
||
destroy_data |
r |
||
destroy_notify |
r |
||
editable |
r |
||
editor |
r |
||
height |
r |
||
length |
r |
||
mime_type |
r |
||
parent |
r |
||
resizable |
r |
||
snapshot_data |
r |
||
snapshot_length |
r |
||
snapshot_type |
r |
||
width |
r |
Class Details¶
- class GOffice.Component(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- classmethod sax_push_parser(xin, attrs, handler, *user_data)¶
- Parameters:
attrs (
libxml2.Char
) – the current node attributes.handler (
GOffice.ComponentSaxHandler
) –GOffice.ComponentSaxHandler
Loads the component from the xml stream. handler will be called when done.
- classmethod set_default_command_context(cc)¶
- Parameters:
cc (
GOffice.CmdContext
) –
- build_snapshot()¶
- Return type:
- duplicate()¶
- Returns:
the duplicated component.
- Return type:
Duplicates the component.
- edit()¶
- Returns:
the editor window or
None
- Return type:
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 exportoutput (
Gsf.Output
) – aGsf.Output
streamx_dpi (
float
) – x resolution of exported graphy_dpi (
float
) – y resolution of exported graph
- Returns:
True
if export succeed.- Return type:
Exports an image of graph in given format, writing results in a
Gsf.Output
stream. 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()).
- get_command_context()¶
- Returns:
the command context used by the component or the default command context if the argument is
None
.- Return type:
- get_data(data, length, clearfunc, user_data)¶
- get_inline()¶
- Returns:
whether the component is displayed in-line
- Return type:
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.
- get_use_font_from_app()¶
- Returns:
whether the component should use the
GOffice.font
from the calling application- Return type:
Returns whether the component should use the
GOffice.font
from the calling application or use its ownGOffice.font
.
- render(cr, width, height)¶
- Parameters:
cr (
cairo.Context
) –width (
float
) –height (
float
) –
- set_command_context(cc)¶
- Parameters:
cc (
GOffice.CmdContext
) –
- set_default_size(width, ascent, descent)¶
- set_font(desc)¶
- Parameters:
- Returns:
True
if size changed.- Return type:
Sets the
GOffice.font
the component should use. Not all components will actually changed theGOffice.font
they 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 theGOffice.font
from the calling application or use its ownGOffice.font
.
Sets the source of the
GOffice.font
that the component should use. Default isFalse
.
- stop_editing()¶
- write_xml_sax(output)¶
- Parameters:
output (
Gsf.XMLOut
) –
- do_changed() virtual¶
- do_edit() virtual¶
- Returns:
the editor window or
None
- Return type:
Opens a top level window editor for the component if it can be edited.
- do_get_data(data, length, clearfunc, *user_data) virtual¶
- do_mime_type_set() virtual¶
- do_render(cr, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –width (
float
) –height (
float
) –
- do_set_data() virtual¶
- do_set_default_size() virtual¶
- do_set_font(desc) virtual¶
- Parameters:
- Returns:
True
if size changed.- Return type:
Sets the
GOffice.font
the component should use. Not all components will actually changed theGOffice.font
they use.
- do_set_size() virtual¶
Signal Details¶
- GOffice.Component.signals.changed(component)¶
- Signal Name:
changed
- Flags:
- Parameters:
component (
GOffice.Component
) – The object which received the signal
Property Details¶
- GOffice.Component.props.ascent¶
-
Component ascent
- GOffice.Component.props.descent¶
-
Component descent
- GOffice.Component.props.height¶
-
Component height
- GOffice.Component.props.inline¶
-
Whether the component should be displayed in-line
- GOffice.Component.props.mime_type¶
- Name:
mime-type
- Type:
- Default Value:
- Flags:
mime type of the content of the component