class documentation

class SourceViewObjectType(InsertedObjectTypeExtension): (source)

View In Hierarchy

Undocumented

Method __init__ Constructor @param plugin: the plugin object to which this extension belongs @param obj: the object being extended
Method create_widget Return a Gtk widget for the given model @param model: an object created with model_from_data() @returns: a Gtk widget object derived from InsertedObjectWidget
Method data_from_model No summary
Method format_html Undocumented
Method model_from_data Returns a model for the object
Method new_model_interactive Create a new object model interactively Interactive means that we can use e.g. a dialog to prompt for input. The default behavior is to use new_object().
Method on_preferences_changed Undocumented
Class Variable label Undocumented
Class Variable name Undocumented
Class Variable object_attr Undocumented
Instance Variable preferences Undocumented
Instance Variable _widgets Undocumented

Inherited from InsertedObjectTypeExtension:

Method teardown No summary
Instance Variable _objmap Undocumented

Inherited from InsertedObjectType (via InsertedObjectTypeExtension):

Method format Format the object using a specific output format Intended to improve rendering of the object on exporting.
Method new_object Create a new empty object @returns: a 2-tuple (attrib, data)
Method parse_attrib Convenience method to enforce the supported attributes and their types. @returns: a ConfigDict using the object_attr dict as definition
Class Variable is_inline Undocumented
Class Variable verb_icon Undocumented
Method _data_from_model_wrapper Undocumented
Method _format_wrapper Undocumented
Method _model_from_data_wrapper Undocumented

Inherited from ExtensionBase (via InsertedObjectTypeExtension):

Method destroy Called when the plugin is being destroyed Calls teardown() followed by the teardown() methods of parent base classes.
Class Variable __signals__ Undocumented
Instance Variable obj the extendable object
Instance Variable plugin the plugin object to which this extension belongs

Inherited from SignalEmitter (via InsertedObjectTypeExtension, ExtensionBase):

Method __new__ Undocumented
Method block_signals Returns a context manager for blocking one or more signals
Method connect Register a handler for a specific object.
Method connect_after Like connect() but handler will be called after default handler
Method disconnect Undocumented
Method emit Undocumented
Method emit_return_first Emits a signal and stops emission on the first handler that returns a not-None value.
Method emit_return_iter Returns an generator that calls one handler on each iteration and yields the return values. This allows aggregating return values.
Method _connect Undocumented
Method _setup_signal Undocumented
Method _teardown_signal Undocumented

Inherited from ConnectorMixin (via InsertedObjectTypeExtension, ExtensionBase):

Method connectto Connect to signals of another object E.g.:
Method connectto_all Convenience method to combine multiple calls to connectto().
Method disconnect_all Disconnect all signals that have been connected with connectto and friends. Typically called when you want to destroy this object.
Method disconnect_from Disc all signals that have been connected with connectto and friends to a specific object.
Method _disconnect_from Undocumented
Instance Variable _connected_signals Undocumented
def __init__(self, plugin, objmap): (source)
Constructor
Parameters
pluginthe plugin object to which this extension belongs
objmapUndocumented
objthe object being extended
def create_widget(self, buffer): (source)
Return a Gtk widget for the given model
Parameters
bufferUndocumented
modelan object created with model_from_data()
Returns
a Gtk widget object derived from InsertedObjectWidget
def data_from_model(self, buffer): (source)
Returns the object data for a model object This method is used to serialize the model object back into a form that can be handled when parsing wiki content.
Parameters
bufferUndocumented
modelan object created with model_from_data()
Returns
a 2-tuple (attrib, data)
def format_html(self, dumper, attrib, data): (source)

Undocumented

def model_from_data(self, notebook, page, attrib, text): (source)

Returns a model for the object

The main purpose for the model is that it is shared between widgets that show the same object. See e.g. Gtk.TextBuffer or Gtk.TreeModel for examples.

No API is expected of the model object other than that it can be used as argument for create_widget() and data_from_model() and a "changed" signal that should be emitted when the content has changed, so the pageview knows that the page has changed and should be saved before closing.

Since the model is specific for the page where the object occurs, any user of the object type should serialize back to data before e.g. copying the object to a different page.

This method should always be robust for missing attributes and body contents. The attrib will automatically be checked by parse_attrib before being given to this method.

Parameters
notebooka Notebook object
pagea Page object for the page where this object occurs
attribdict with object attributes
textUndocumented
datastring with object content
Returns
a model object
def new_model_interactive(self, parent, notebook, page): (source)
Create a new object model interactively Interactive means that we can use e.g. a dialog to prompt for input. The default behavior is to use new_object().
Parameters
parentGtk widget to use as parent widget for dialogs
notebooka Notebook object
pagea Page object for the page where this object occurs
Returns
a model object (see model_from_data())
Raises
Unknown exceptionValueError: if user cancelled the action
def on_preferences_changed(self, preferences): (source)

Undocumented

preferences = (source)

Undocumented

_widgets = (source)

Undocumented