Class odf.OdfCanvas
Defined in: OdfCanvas.js.
Constructor Attributes | Constructor Name and Description |
---|---|
odf.OdfCanvas(element, viewport)
This class manages a loaded ODF document that is shown in an element.
|
Method Attributes | Method Name and Description |
---|---|
addAnnotation(annotation)
Adds an annotation for the annotaiton manager to track
and wraps and highlights it
|
|
addCssForFrameWithImage(frame)
Add additional css rules for newly inserted draw:frame and draw:image.
|
|
<inner> |
addEventListener(eventType, eventHandler)
Register an event handler
|
addListener(eventName, handler)
|
|
destroy(callback,)
|
|
enableAnnotations(allow, showRemoveButton)
Allows / disallows annotations
|
|
<inner> |
fireEvent(eventType, args)
Fire an event
|
fitSmart(width, height)
|
|
fitToContainingElement(width, height)
|
|
fitToHeight(height)
|
|
fitToWidth(width)
|
|
<inner> | |
forgetAnnotation(annotation)
Stops an annotation and unwraps it
|
|
getSizer()
This returns the element inside the canvas which can be zoomed with
CSS and which contains the ODF document and the annotation sidebar.
|
|
<inner> |
handleAnnotations(odfnode)
This should create an annotations pane if non existent, and then populate it with annotations
If annotations are disallowed, it should remove the pane and all annotations
|
<inner> |
handleContent(container, odfnode)
A new content.xml has been loaded.
|
<inner> |
load(url)
|
<inner> |
loadImages(container, odffragment, stylesheet)
Load all the images that are inside an odf element.
|
<inner> |
loadVideos(container, odffragment)
Load all the video that are inside an odf element.
|
<inner> | |
Unstyles and untracks all annotations present in the document,
and then tracks them again with fresh rendering
|
|
Updates the CSS rules to match the ODF document styles and also
updates the size of the canvas to match the new layout.
|
|
<inner> |
refreshOdf(suppressEvent)
|
Updates the size of the canvas to the size of the content.
|
|
Re-renders all annotations if enabled
|
|
save(callback)
|
|
setOdfContainer(container, suppressEvent)
Set a odfcontainer manually.
|
|
setZoomLevel(zoom)
|
|
showPage(n)
|
|
Class Detail
odf.OdfCanvas(element, viewport)
This class manages a loaded ODF document that is shown in an element.
It takes care of giving visual feedback on loading, ensures that the
stylesheets are loaded.
- Parameters:
- {!HTMLElement} element
- Put and ODF Canvas inside this element.
- {!gui.Viewport=} viewport
- Viewport used for scrolling elements and ranges into view
Method Detail
{undefined}
addAnnotation(annotation)
Adds an annotation for the annotaiton manager to track
and wraps and highlights it
- Parameters:
- {!odf.AnnotationElement} annotation
- Returns:
- {undefined}
addCssForFrameWithImage(frame)
Add additional css rules for newly inserted draw:frame and draw:image. eg. position, dimensions and background image
- Parameters:
- {!Element} frame
<inner>
{undefined}
addEventListener(eventType, eventHandler)
Register an event handler
- Parameters:
- {!string} eventType
- {!Function} eventHandler
- Returns:
- {undefined}
{undefined}
addListener(eventName, handler)
- Parameters:
- {!string} eventName
- {!function(*)} handler
- Returns:
- {undefined}
{undefined}
destroy(callback,)
- Parameters:
- {!function(!Error=)} callback,
- passing an error object in case of error
- Returns:
- {undefined}
{undefined}
enableAnnotations(allow, showRemoveButton)
Allows / disallows annotations
- Parameters:
- {!boolean} allow
- {!boolean} showRemoveButton
- Returns:
- {undefined}
<inner>
{undefined}
fireEvent(eventType, args)
Fire an event
- Parameters:
- {!string} eventType
- {Array.