LibreOffice Module sw (master) 1
Public Types | Public Member Functions | Private Attributes | List of all members
ww8::Frame Class Reference

Make exporting a Writer Frame easy. More...

#include <writerhelper.hxx>

Collaboration diagram for ww8::Frame:
[legend]

Public Types

enum  WriterSource {
  eTextBox ,
  eGraphic ,
  eOle ,
  eDrawing ,
  eFormControl ,
  eBulletGrf
}
 

Public Member Functions

 Frame (const SwFrameFormat &rFlyFrame, SwPosition aPos)
 
 Frame (const Graphic &, SwPosition)
 
const SwFrameFormatGetFrameFormat () const
 Get the writer SwFrameFormat that this object describes. More...
 
const SwPositionGetPosition () const
 Get the position this frame is anchored at. More...
 
void SetPosition (SwPosition const &rPos)
 
const SwContentNodeGetContentNode () const
 Get the node this frame is anchored into. More...
 
WriterSource GetWriterType () const
 Get the type of frame that this wraps. More...
 
bool IsInline () const
 Is this frame inline (as character) More...
 
void ForceTreatAsInline ()
 Even if the frame isn't an inline frame, force it to behave as one. More...
 
const SwNodeGetContent () const
 Get the first node of content in the frame. More...
 
const GraphicGetGraphic () const
 
bool HasGraphic () const
 
bool RefersToSameFrameAs (const Frame &rOther) const
 Does this ww8::Frame refer to the same writer content as another. More...
 
const SizeGetSize () const
 The Size of the contained element. More...
 
const SizeGetLayoutSize () const
 The layout size of the contained element. More...
 

Private Attributes

const SwFrameFormatmpFlyFrame
 
SwPosition maPos
 
Size maSize
 
Size maLayoutSize
 
WriterSource meWriterType
 
const SwNodempStartFrameContent
 
bool mbIsInline
 
bool mbForBullet:1
 
Graphic maGrf
 

Detailed Description

Make exporting a Writer Frame easy.

In word all frames are effectively anchored to character or as character. This is nice and simple, writer is massively complex in this area, so this ww8::Frame simplifies matters by providing a single unified view of the multitude of elements in writer and their differing quirks.

A ww8::Frame wraps a writer frame and is guaranteed to have a suitable anchor position available from it. It hides much of the needless complexity of the multitude of floating/inline elements in writer, it...

Guarantees an anchor position for a frame. Provides a readable way to see if we are anchored inline. (as character) Provides a simple way to flag what type of entity this frame describes. Provides the size of the element as drawn by writer.

Definition at line 84 of file writerhelper.hxx.

Member Enumeration Documentation

◆ WriterSource

Enumerator
eTextBox 
eGraphic 
eOle 
eDrawing 
eFormControl 
eBulletGrf 

Definition at line 87 of file writerhelper.hxx.

Constructor & Destructor Documentation

◆ Frame() [1/2]

ww8::Frame::Frame ( const SwFrameFormat rFlyFrame,
SwPosition  aPos 
)

◆ Frame() [2/2]

ww8::Frame::Frame ( const Graphic rGrf,
SwPosition  aPos 
)

Member Function Documentation

◆ ForceTreatAsInline()

void ww8::Frame::ForceTreatAsInline ( )

Even if the frame isn't an inline frame, force it to behave as one.

There are a variety of circumstances where word cannot have anything except inline elements, e.g. inside frames. So its easier to force this ww8::Frame into behaving as one, instead of special casing export code all over the place.

Definition at line 246 of file writerhelper.cxx.

References mbIsInline.

◆ GetContent()

const SwNode * ww8::Frame::GetContent ( ) const
inline

Get the first node of content in the frame.

Returns
the first node of content in the frame, might not be any at all.

Definition at line 158 of file writerhelper.hxx.

References mpStartFrameContent.

Referenced by WW8Export::OutGrf(), RtfAttributeOutput::OutputFlyFrame_Impl(), DocxAttributeOutput::WriteFlyFrame(), and SwWW8WrGrf::WriteGraphicNode().

◆ GetContentNode()

const SwContentNode * ww8::Frame::GetContentNode ( ) const
inline

Get the node this frame is anchored into.

Returns
The SwTextNode this frame is anchored inside

Definition at line 126 of file writerhelper.hxx.

References SwNode::GetContentNode(), SwPosition::GetNode(), and maPos.

Referenced by AttributeOutputBase::OutputFlyFrame(), and DocxAttributeOutput::OutputFlyFrame_Impl().

◆ GetFrameFormat()

const SwFrameFormat & ww8::Frame::GetFrameFormat ( ) const
inline

◆ GetGraphic()

const Graphic & ww8::Frame::GetGraphic ( ) const
inline

Definition at line 159 of file writerhelper.hxx.

References maGrf.

Referenced by SwWW8WrGrf::WriteGraphicNode().

◆ GetLayoutSize()

const Size & ww8::Frame::GetLayoutSize ( ) const
inline

The layout size of the contained element.

#i43447# - Needed for graphics, which are scaled into its environment

Returns
layout size

Definition at line 190 of file writerhelper.hxx.

References maLayoutSize.

Referenced by SwWW8WrGrf::Insert(), RtfAttributeOutput::OutputFlyFrame_Impl(), and DocxAttributeOutput::WriteFlyFrame().

◆ GetPosition()

const SwPosition & ww8::Frame::GetPosition ( ) const
inline

Get the position this frame is anchored at.

Returns
The anchor position of this frame

Definition at line 118 of file writerhelper.hxx.

References maPos.

Referenced by WW8Export::MiserableRTLFrameFormatHack().

◆ GetSize()

const Size & ww8::Frame::GetSize ( ) const
inline

The Size of the contained element.

Returns
the best size to use to export to word

Definition at line 182 of file writerhelper.hxx.

References maSize.

Referenced by DocxAttributeOutput::EndParagraphProperties(), RtfAttributeOutput::OutputFlyFrame_Impl(), DocxSdrExport::writeDMLTextFrame(), SwWW8WrGrf::WritePICFHeader(), and DocxSdrExport::writeVMLTextFrame().

◆ GetWriterType()

WriterSource ww8::Frame::GetWriterType ( ) const
inline

Get the type of frame that this wraps.

Returns
a WriterSource which describes the source type of this wrapper

Definition at line 134 of file writerhelper.hxx.

References meWriterType.

Referenced by WW8Export::MiserableRTLFrameFormatHack(), WW8Export::OutGrf(), WW8AttributeOutput::OutputFlyFrame_Impl(), RtfAttributeOutput::OutputFlyFrame_Impl(), SwEscherEx::SwEscherEx(), DocxAttributeOutput::WriteFlyFrame(), and SwWW8WrGrf::WriteGraphicNode().

◆ HasGraphic()

bool ww8::Frame::HasGraphic ( ) const
inline

Definition at line 160 of file writerhelper.hxx.

References mbForBullet.

Referenced by SwWW8WrGrf::WriteGraphicNode().

◆ IsInline()

bool ww8::Frame::IsInline ( ) const
inline

◆ RefersToSameFrameAs()

bool ww8::Frame::RefersToSameFrameAs ( const Frame rOther) const
inline

Does this ww8::Frame refer to the same writer content as another.

Returns
if the two ww8::Frames are handling the same writer frame

Definition at line 167 of file writerhelper.hxx.

References maGrf, mbForBullet, and mpFlyFrame.

Referenced by GraphicDetails::operator==().

◆ SetPosition()

void ww8::Frame::SetPosition ( SwPosition const &  rPos)
inline

Definition at line 119 of file writerhelper.hxx.

References maPos.

Member Data Documentation

◆ maGrf

Graphic ww8::Frame::maGrf
private

Definition at line 101 of file writerhelper.hxx.

Referenced by GetGraphic(), and RefersToSameFrameAs().

◆ maLayoutSize

Size ww8::Frame::maLayoutSize
private

Definition at line 95 of file writerhelper.hxx.

Referenced by Frame(), and GetLayoutSize().

◆ maPos

SwPosition ww8::Frame::maPos
private

Definition at line 90 of file writerhelper.hxx.

Referenced by GetContentNode(), GetPosition(), and SetPosition().

◆ maSize

Size ww8::Frame::maSize
private

Definition at line 91 of file writerhelper.hxx.

Referenced by Frame(), and GetSize().

◆ mbForBullet

bool ww8::Frame::mbForBullet
private

Definition at line 100 of file writerhelper.hxx.

Referenced by HasGraphic(), and RefersToSameFrameAs().

◆ mbIsInline

bool ww8::Frame::mbIsInline
private

Definition at line 99 of file writerhelper.hxx.

Referenced by ForceTreatAsInline(), and IsInline().

◆ meWriterType

WriterSource ww8::Frame::meWriterType
private

Definition at line 97 of file writerhelper.hxx.

Referenced by Frame(), and GetWriterType().

◆ mpFlyFrame

const SwFrameFormat* ww8::Frame::mpFlyFrame
private

Definition at line 89 of file writerhelper.hxx.

Referenced by GetFrameFormat(), and RefersToSameFrameAs().

◆ mpStartFrameContent

const SwNode* ww8::Frame::mpStartFrameContent
private

Definition at line 98 of file writerhelper.hxx.

Referenced by Frame(), and GetContent().


The documentation for this class was generated from the following files: