Gnm.SheetObject

g GObject.Object GObject.Object Gnm.SheetObject Gnm.SheetObject GObject.Object->Gnm.SheetObject

Subclasses:

Gnm.CellCombo, Gnm.Comment, Gnm.FilterCombo, Gnm.SOFilled, Gnm.SOLine, Gnm.SOPath, Gnm.SOPolygon, Gnm.SheetObjectComponent, Gnm.SheetObjectGraph, Gnm.SheetObjectImage, Gnm.SheetObjectWidget

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

build_menu (view, actions, i)

class

move_do (objects, anchors, objects_created)

class

move_undo (objects, objects_created)

class

pts_to_anchor (anchor, sheet, res_pts)

adjust_stacking (positions)

can_edit ()

can_print ()

can_resize ()

clear_sheet ()

component_get_component ()

component_set_component (component)

default_size ()

direction_set (coords)

draw_cairo (cr, rtl)

draw_cairo_sized (cr, width, height)

dup ()

exportable_get_target_list ()

foreach_dep (func, user)

get_anchor ()

get_editor (sc)

get_print_flag ()

get_range ()

get_sheet ()

get_stacking ()

get_target_list ()

get_view (container)

graph_ensure_size ()

graph_get_gog ()

graph_set_gog (graph)

invalidate_sheet (sheet)

new_view (container)

populate_menu (actions)

position_pts_get ()

rubber_band_directly ()

save_as_image (format, resolution, url)

set_anchor (anchor)

set_anchor_mode (mode)

set_name (name)

set_print_flag (print_)

set_sheet (sheet)

update_bounds (p)

write_image (format, resolution, output)

write_object (format, output, err, convs)

Virtual Methods

Inherited:

GObject.Object (7)

do_assign_to_sheet (sheet)

do_bounds_changed ()

do_copy (src)

do_default_size ()

do_draw_cairo (cr, width, height)

do_foreach_dep (func, user)

do_new_view (container)

do_populate_menu (actions)

do_prep_sax_parser (xin, attrs, convs)

do_remove_from_sheet ()

do_unrealized ()

do_user_config (s_control)

do_write_xml_sax (output, convs)

Properties

Name

Type

Flags

Short Description

name

str

r/w

Signals

Inherited:

GObject.Object (1)

Name

Short Description

bounds-changed

unrealized

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

anchor

Gnm.SheetObjectAnchor

r

flags

Gnm.SheetObjectFlags

r

name

str

r

parent_object

GObject.Object

r

realized_list

[object]

r

sheet

Gnm.Sheet

r

Class Details

class Gnm.SheetObject(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gnm.SheetObjectClass

classmethod build_menu(view, actions, i)
Parameters:
Returns:

the newly constructed Gtk.Menu.

Return type:

Gtk.Widget

Builds the contextual menu for view.

classmethod move_do(objects, anchors, objects_created)
Parameters:
Returns:

the newly allocated GOffice.Undo.

Return type:

GOffice.Undo

classmethod move_undo(objects, objects_created)
Parameters:
Returns:

the newly allocated GOffice.Undo.

Return type:

GOffice.Undo

classmethod pts_to_anchor(anchor, sheet, res_pts)
Parameters:
adjust_stacking(positions)
Parameters:

positions (int) –

Return type:

int

can_edit()
Return type:

bool

can_print()
Return type:

bool

can_resize()
Return type:

bool

clear_sheet()

Removes self from its container, unrealizes all views, disconnects the associated data and unrefs the object

component_get_component()
Returns:

the embedded GOffice.Component or None on error.

Return type:

GOffice.Component

component_set_component(component)
Parameters:

component (GOffice.Component) –

default_size()
Returns:

w:

a ptr into which to store the default_width.

h:

a ptr into which to store the default_height.

Return type:

(w: float, h: float)

Measurements are in pts.

direction_set(coords)
Parameters:

coords ([float]) – array of coordinates in L,T,R,B order

Sets the object direction from the given the new coordinates The original coordinates are assumed to be normalized (so that top is above bottom and right is at the right of left)

draw_cairo(cr, rtl)
Parameters:

Draw a sheet object using cairo.

We are assuming that the cairo context is set up so that the top left of the bounds is (0,0). Note that this is the real top left cell, not necessarily the cell with to which we are anchored.

draw_cairo_sized(cr, width, height)
Parameters:
dup()
Returns:

A copy of self that is not attached to a sheet.

Return type:

Gnm.SheetObject or None

exportable_get_target_list()
Return type:

Gtk.TargetList

foreach_dep(func, user)
Parameters:

Loops over each dependent contained in a sheet object and call the handler.

get_anchor()
Returns:

the Gnm.SheetObjectAnchor for self.

Return type:

Gnm.SheetObjectAnchor

get_editor(sc)
Parameters:

sc (Gnm.SheetControl) –

get_print_flag()
Return type:

bool

get_range()
Returns:

the Gnm.Range used for self.

Return type:

Gnm.Range

get_sheet()
Returns:

the Gnm.Sheet owning the object.

Return type:

Gnm.Sheet

A small utility to help keep the implementation of SheetObjects modular.

get_stacking()
Returns:

self's position in the stack of sheet objects.

Return type:

int

get_target_list()
Return type:

Gtk.TargetList

get_view(container)
Parameters:

container (Gnm.SheetObjectViewContainer) – Gnm.SheetObjectViewContainer

Returns:

the found Gnm.SheetObjectView or None.

Return type:

Gnm.SheetObjectView or None

graph_ensure_size()

Updates the size of the graph item in the canvas for graph sheets objects.

graph_get_gog()
Returns:

the embedded GOffice.GraphGraph or None on error.

Return type:

GOffice.GraphGraph

graph_set_gog(graph)
Parameters:

graph (GOffice.GraphGraph or None) – GOffice.GraphGraph

If graph is non-None add a reference to it, otherwise create a new graph. Assign the graph to its Gnm.SheetObjectGraph wrapper and initialize the handlers, disconnecting any existing connection for the preceding graph.

invalidate_sheet(sheet)
Parameters:

sheet (Gnm.Sheet) –

new_view(container)
Parameters:

container (Gnm.SheetObjectViewContainer) –

Returns:

the new Gnm.SheetObjectView.

Return type:

Gnm.SheetObjectView

Asks self to create a view for container.

populate_menu(actions)
Parameters:

actions ([Gnm.SheetObjectAction]) – GLib.PtrArray

Returns:

GLib.PtrArray

Return type:

actions: [Gnm.SheetObjectAction]

Get a list of the actions that can be performed on self

position_pts_get()
Returns:

coordinates

Return type:

coords: [float]

Calculate the position of the object self in pts from the logical position in the object.

rubber_band_directly()
Returns:

True if we should draw the object as we are laying it out on an sheet. If False we draw a rectangle where the object is going to go

Return type:

bool

save_as_image(format, resolution, url)
Parameters:
  • format (str or None) – image format to use

  • resolution (float) – export resolution

  • url (str) – destination url

Raises:

GLib.Error

Saves a sheet object as an image to url. If an error occurs, err will be set.

set_anchor(anchor)
Parameters:

anchor (Gnm.SheetObjectAnchor) –

set_anchor_mode(mode)
Parameters:

mode (Gnm.SOAnchorMode) –

set_name(name)
Parameters:

name (str) –

set_print_flag(print_)
Parameters:

print (bool) –

set_sheet(sheet)
Parameters:

sheet (Gnm.Sheet) –

Adds a reference to the object.

update_bounds(p)
Parameters:

p (Gnm.CellPos or None) – A position marking the top left of the region needing relocation (default == A1)

update the bounds of an object that intersects the region whose top left is p. This is used when an objects position is anchored to cols/rows and they change position.

write_image(format, resolution, output)
Parameters:
  • format (str or None) – image format to use

  • resolution (float) – export resolution

  • output (Gsf.Output) – destination

Raises:

GLib.Error

Saves a sheet object as an image to output. If an error occurs, err will be set.

write_object(format, output, err, convs)
Parameters:
do_assign_to_sheet(sheet) virtual
Parameters:

sheet (Gnm.Sheet) –

Return type:

bool

do_bounds_changed() virtual
do_copy(src) virtual
Parameters:

src (Gnm.SheetObject) –

do_default_size() virtual
Returns:

w:

a ptr into which to store the default_width.

h:

a ptr into which to store the default_height.

Return type:

(w: float, h: float)

Measurements are in pts.

do_draw_cairo(cr, width, height) virtual
Parameters:
do_foreach_dep(func, user) virtual
Parameters:

Loops over each dependent contained in a sheet object and call the handler.

do_new_view(container) virtual
Parameters:

container (Gnm.SheetObjectViewContainer) –

Returns:

the new Gnm.SheetObjectView.

Return type:

Gnm.SheetObjectView

Asks so to create a view for container.

do_populate_menu(actions) virtual
Parameters:

actions ([Gnm.SheetObjectAction]) – GLib.PtrArray

Returns:

GLib.PtrArray

Return type:

actions: [Gnm.SheetObjectAction]

Get a list of the actions that can be performed on so

do_prep_sax_parser(xin, attrs, convs) virtual
Parameters:
do_remove_from_sheet() virtual
Return type:

bool

do_unrealized() virtual
do_user_config(s_control) virtual
Parameters:

s_control (Gnm.SheetControl) –

do_write_xml_sax(output, convs) virtual
Parameters:

Signal Details

Gnm.SheetObject.signals.bounds_changed(sheet_object)
Signal Name:

bounds-changed

Flags:

RUN_LAST

Parameters:

sheet_object (Gnm.SheetObject) – The object which received the signal

Gnm.SheetObject.signals.unrealized(sheet_object)
Signal Name:

unrealized

Flags:

RUN_LAST

Parameters:

sheet_object (Gnm.SheetObject) – The object which received the signal

Property Details

Gnm.SheetObject.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE