Class: GOffice::Component

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The component base object class.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ GOffice::Component

Parameters:

  • uri (String)

Class Method Details

.default_command_context=(cc) ⇒ nil

Parameters:

Returns:

  • (nil)

.sax_push_parser(xin, attrs, handler, user_data) ⇒ nil

Loads the component from the xml stream. handler will be called when done.

Parameters:

  • xin (Gsf::XMLIn)

    Gsf::Input

  • attrs (libxml2::Char)

    the current node attributes.

  • handler (GOffice::ComponentSaxHandler)

    GOComponent::SaxHandler

  • user_data (GObject)

    data to pass to handler

Returns:

  • (nil)

Instance Method Details

#ascentFloat

Returns ascent.

Returns:

  • (Float)

    ascent

#ascent=(ascent) ⇒ Float

Parameters:

  • ascent (Float)

Returns:

  • (Float)

    ascent

  • (Float)

    ascent

#build_snapshotGOffice::SnapshotType

#command_contextGOffice::CmdContext

default command context if the argument is NULL.

Returns:

#command_context=(cc) ⇒ nil

Parameters:

Returns:

  • (nil)

#descentFloat

Returns descent.

Returns:

  • (Float)

    descent

#descent=(descent) ⇒ Float

Parameters:

  • descent (Float)

Returns:

  • (Float)

    descent

  • (Float)

    descent

#duplicateGOffice::Component

Duplicates the component.

Returns:

#editGtk::Window

Opens a top level window editor for the component if it can be edited.

Returns:

  • (Gtk::Window)

    the editor window or nil

#emit_changednil

Returns:

  • (nil)

#export_image(format, output, x_dpi, y_dpi) ⇒ Boolean

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()).

Parameters:

  • format (GOffice::ImageFormat)

    image format for export

  • output (Gsf::Output)

    a Gsf::Output stream

  • x_dpi (Float)

    x resolution of exported graph

  • y_dpi (Float)

    y resolution of exported graph

Returns:

  • (Boolean)

    true if export succeed.

#font=(desc) ⇒ Boolean

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

Parameters:

  • desc (Pango::FontDescription)

    Pango::FontDescription

Returns:

  • (Boolean)

    true if size changed.

#get_data(data, length, clearfunc, user_data) ⇒ Boolean

Parameters:

  • data (GObject)
  • length (Integer)
  • clearfunc (GLib::DestroyNotify)
  • user_data (GObject)

Returns:

  • (Boolean)

#get_size(width, height) ⇒ nil

Parameters:

  • width (Float)
  • height (Float)

Returns:

  • (nil)

#get_snapshot(type, length) ⇒ GObject

Returns a snapshot is either svg or png format for the component.

Parameters:

Returns:

  • (GObject)

    the snapshot as an arry of bytes.

#heightFloat

Returns height.

Returns:

  • (Float)

    height

#height=(height) ⇒ Float

Parameters:

  • height (Float)

Returns:

  • (Float)

    height

  • (Float)

    height

#inlineBoolean

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

Returns:

  • (Boolean)

    whether the component is displayed in-line

#inline=(inline) ⇒ Boolean

Parameters:

  • inline (Boolean)

Returns:

  • (Boolean)

    inline

  • (Boolean)

    inline

#inline?Boolean

Returns inline.

Returns:

  • (Boolean)

    inline

#is_editableBoolean

Returns:

  • (Boolean)

#is_resizableBoolean

Returns:

  • (Boolean)

#mime_typeString

Returns mime-type.

Returns:

  • (String)

    mime-type

#mime_type=(mime_type) ⇒ String

Parameters:

  • mime_type (String)

Returns:

  • (String)

    mime-type

  • (String)

    mime-type

#render(cr, width, height) ⇒ nil

Parameters:

  • cr (cairo::Context)
  • width (Float)
  • height (Float)

Returns:

  • (nil)

#set_data(data, length) ⇒ nil

Parameters:

  • data (String)
  • length (Integer)

Returns:

  • (nil)

#set_default_size(width, ascent, descent) ⇒ nil

Parameters:

  • width (Float)
  • ascent (Float)
  • descent (Float)

Returns:

  • (nil)

#set_size(width, height) ⇒ nil

Parameters:

  • width (Float)
  • height (Float)

Returns:

  • (nil)

#stop_editingnil

Returns:

  • (nil)

#use_font_from_appBoolean

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

Returns:

  • (Boolean)

    whether the component should use the font from the calling

#use_font_from_app=(use_font_from_app) ⇒ nil

Sets the source of the font that the component should use. Default is false. calling application or use its own font.

Parameters:

  • use_font_from_app (Boolean)

    whether the component should use the font from the

Returns:

  • (nil)

#widthFloat

Returns width.

Returns:

  • (Float)

    width

#width=(width) ⇒ Float

Parameters:

  • width (Float)

Returns:

  • (Float)

    width

  • (Float)

    width

#write_xml_sax(output) ⇒ nil

Parameters:

  • output (Gsf::XMLOut)

Returns:

  • (nil)