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, const SwPosition &rPos)
 
 Frame (const Graphic &, const 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 86 of file writerhelper.hxx.

Member Enumeration Documentation

Enumerator
eTextBox 
eGraphic 
eOle 
eDrawing 
eFormControl 
eBulletGrf 

Definition at line 89 of file writerhelper.hxx.

Constructor & Destructor Documentation

ww8::Frame::Frame ( const SwFrameFormat rFlyFrame,
const SwPosition rPos 
)
ww8::Frame::Frame ( const Graphic rGrf,
const SwPosition rPos 
)

Member Function Documentation

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 258 of file writerhelper.cxx.

References mbIsInline.

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 160 of file writerhelper.hxx.

References mpStartFrameContent.

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

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 128 of file writerhelper.hxx.

References SwNode::GetContentNode(), SwNodeIndex::GetNode(), and SwPosition::nNode.

Referenced by AttributeOutputBase::OutputFlyFrame().

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

Definition at line 161 of file writerhelper.hxx.

References maGrf.

Referenced by SwWW8WrGrf::WriteGraphicNode().

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 192 of file writerhelper.hxx.

References maLayoutSize.

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

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 120 of file writerhelper.hxx.

References maPos.

Referenced by WW8Export::MiserableRTLFrameFormatHack(), and sortswflys::operator()().

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 184 of file writerhelper.hxx.

References maSize.

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

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 136 of file writerhelper.hxx.

References meWriterType.

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

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

Definition at line 162 of file writerhelper.hxx.

References mbForBullet.

Referenced by SwWW8WrGrf::WriteGraphicNode().

bool ww8::Frame::IsInline ( ) const
inline
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 169 of file writerhelper.hxx.

References maGrf, mbForBullet, and mpFlyFrame.

Referenced by GraphicDetails::operator==().

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

Definition at line 121 of file writerhelper.hxx.

Referenced by sw::util::UpdateFramePositions().

Member Data Documentation

Graphic ww8::Frame::maGrf
private

Definition at line 103 of file writerhelper.hxx.

Referenced by GetGraphic(), and RefersToSameFrameAs().

Size ww8::Frame::maLayoutSize
private

Definition at line 97 of file writerhelper.hxx.

Referenced by Frame(), and GetLayoutSize().

SwPosition ww8::Frame::maPos
private

Definition at line 92 of file writerhelper.hxx.

Referenced by GetPosition().

Size ww8::Frame::maSize
private

Definition at line 93 of file writerhelper.hxx.

Referenced by Frame(), and GetSize().

bool ww8::Frame::mbForBullet
private

Definition at line 102 of file writerhelper.hxx.

Referenced by HasGraphic(), and RefersToSameFrameAs().

bool ww8::Frame::mbIsInline
private

Definition at line 101 of file writerhelper.hxx.

Referenced by ForceTreatAsInline(), and IsInline().

WriterSource ww8::Frame::meWriterType
private

Definition at line 99 of file writerhelper.hxx.

Referenced by Frame(), and GetWriterType().

const SwFrameFormat* ww8::Frame::mpFlyFrame
private

Definition at line 91 of file writerhelper.hxx.

Referenced by GetFrameFormat(), and RefersToSameFrameAs().

const SwNode* ww8::Frame::mpStartFrameContent
private

Definition at line 100 of file writerhelper.hxx.

Referenced by Frame(), and GetContent().


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