GOffice.Component

g GObject.Object GObject.Object GOffice.Component GOffice.Component GObject.Object->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

Signals

Inherited:GObject.Object (1)
Name Short Description
changed  

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:

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: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:
Returns:

True if export succeed.

Return type:

bool

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:GOffice.CmdContext
get_data(data, length, clearfunc, user_data)
Parameters:
Return type:

bool

get_inline()
Returns:whether the component is displayed in-line
Return type:bool

Returns the in-line or not nature of the component.

get_mime_type()
Return type:str
get_size(width, height)
Parameters:
get_snapshot(type, length)
Parameters:
Returns:

the snapshot as an arry of bytes.

Return type:

object or None

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:bool

Returns whether the component should use the GOffice.font from the calling application or use its own GOffice.font.

is_editable()
Return type:bool
is_resizable()
Return type:bool
render(cr, width, height)
Parameters:
set_command_context(cc)
Parameters:cc (GOffice.CmdContext) –
set_data(data, length)
Parameters:
  • data (str) –
  • length (int) –
set_default_size(width, ascent, descent)
Parameters:
set_font(desc)
Parameters:desc (Pango.FontDescription) – Pango.FontDescription
Returns:True if size changed.
Return type:bool

Sets the GOffice.font the component should use. Not all components will actually changed the GOffice.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_size(width, height)
Parameters:
set_use_font_from_app(use_font_from_app)
Parameters:use_font_from_app (bool) – whether the component should use the GOffice.font from the calling application or use its own GOffice.font.

Sets the source of the GOffice.font that 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:

bool

do_mime_type_set() virtual
do_render(cr, width, height) virtual
Parameters:
do_set_data() virtual
do_set_default_size() virtual
do_set_font(desc) virtual
Parameters:desc (Pango.FontDescription) – Pango.FontDescription
Returns:True if size changed.
Return type:bool

Sets the GOffice.font the component should use. Not all components will actually changed the GOffice.font they use.

do_set_size() virtual

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

GOffice.Component.props.mime_type
Name:mime-type
Type:str
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

mime type of the content of the component

GOffice.Component.props.width
Name:width
Type:float
Default Value:0.0
Flags:READABLE, WRITABLE

Component width