Difference between revisions of "Writer/Core And Layout"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
Line 92: Line 92:
 
       |aText : string
 
       |aText : string
 
       |}  
 
       |}  
 +
 +
== Relationship between nodes and frames
  
 
== Some UML Diagrams ==
 
== Some UML Diagrams ==

Revision as of 12:33, 27 June 2007

Caution

This page is still under construction hence the content is still very tentative.

About Frames

The layout is the visual representation of a Writer document. Basically a frame is a rectangular area which is linked with other frames:

Writer layout.png

The base class of the frame hierachy is SwFrm, which is derived from SwClient for inheriting the ability of being notified by changes.

SwFrm : SwClient
pRegisteredIn : SwModify*
pUpper : SwFrm*
pNext : SwFrm*
pPrev : SwFrm*
aFrm : SwRect
aPrt : SwRect
bValidPos : bool
bValidSize : bool
bValidPrtArea : bool

A layout frame has an additional member pLower, i.e., a layout frame is a frame that contains other frames. Incarnations of a layout frame are pages, tables, ...

SwLayoutFrm : SwFrm
pLower : SwFrm*

Some frames are not only derived from SwFrm, but also from SwFlowFrm. These are the frames that are allowed at page breaks and shall continue on the next page, e.g., paragraphs, tables, ...

SwFlowFrm
rThis : SwFrm&
pFollow : SwFlowFrm*

The most important frame is the SwTxtFrm, which is the layout counterpart a SwTxtNode object. The nOfst member referes to the aText string member of the associated SwTxtNode object. A SwTxtFrm object is registered in a SwTxtNode object in order to be notified in case the SwTxtNode object is changed.

SwTxtFrm : SwFrm
nOfst : xub_StrLen

A page frame additionally has a couple of boolean members to indicate if any of the page contents is invalid. These flags are used during formatting of the document.

SwPageFrm
bInvalidLayout : bool
bInvalidContent : bool
bInvalidFly : bool

Some Notes about Nodes

A SwDoc object, which denotes the model of a Writer document, has as member of Type SwNodes, which stores the document content. The SwNodes object of an empty Writer document looks like this:

SwStartNode	(special start-end-section, not used)
SwEndNode
SwStartNode	(special start-end-section used for footnotes)
SwEndNode
SwStartNode	(special start-end-section used for frames, headers, footers)
SwEndNode
SwStartNode	(special start-end-section used for 'delete' redlines if they are not shown)
SwEndNode
SwStartNode (special start-end-section for 'regular' document content)
	SwTxtNode	(there always at least one empty paragraph in the document)
SwEndNode
SwTxtNode : SwCntntNode
aText : string

== Relationship between nodes and frames

Some UML Diagrams

Nodes

Writer nodes.png

Attributes

Writer attributes.png

Cursors

Writer cursors.png

Formats / Styles

Writer formats.png

Personal tools