LibreOffice Module sw (master) 1
|
Make exporting a Writer Frame easy. More...
#include <writerhelper.hxx>
Public Types | |
enum | WriterSource { eTextBox , eGraphic , eOle , eDrawing , eFormControl , eBulletGrf } |
Public Member Functions | |
Frame (const SwFrameFormat &rFlyFrame, SwPosition aPos) | |
Frame (const Graphic &, SwPosition) | |
const SwFrameFormat & | GetFrameFormat () const |
Get the writer SwFrameFormat that this object describes. More... | |
const SwPosition & | GetPosition () const |
Get the position this frame is anchored at. More... | |
void | SetPosition (SwPosition const &rPos) |
const SwContentNode * | GetContentNode () 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 SwNode * | GetContent () const |
Get the first node of content in the frame. More... | |
const Graphic & | GetGraphic () const |
bool | HasGraphic () const |
bool | RefersToSameFrameAs (const Frame &rOther) const |
Does this ww8::Frame refer to the same writer content as another. More... | |
const Size & | GetSize () const |
The Size of the contained element. More... | |
const Size & | GetLayoutSize () const |
The layout size of the contained element. More... | |
Private Attributes | |
const SwFrameFormat * | mpFlyFrame |
SwPosition | maPos |
Size | maSize |
Size | maLayoutSize |
WriterSource | meWriterType |
const SwNode * | mpStartFrameContent |
bool | mbIsInline |
bool | mbForBullet:1 |
Graphic | maGrf |
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.
Enumerator | |
---|---|
eTextBox | |
eGraphic | |
eOle | |
eDrawing | |
eFormControl | |
eBulletGrf |
Definition at line 87 of file writerhelper.hxx.
ww8::Frame::Frame | ( | const SwFrameFormat & | rFlyFrame, |
SwPosition | aPos | ||
) |
Definition at line 173 of file writerhelper.cxx.
References eDrawing, eFormControl, eGraphic, eOle, eTextBox, SwFrameFormat::FindLayoutRect(), SwFrameFormat::FindRealSdrObject(), FLY_AS_CHAR, SwFormat::GetContent(), SwFormatContent::GetContentIdx(), SwFormat::GetFrameSize(), SwNodeIndex::GetNode(), SwNode::GetNodeType(), SwNode::GetNoTextNode(), SvxSizeItem::GetSize(), tools::Rectangle::GetSize(), SwNoTextNode::GetTwipSize(), Grf, SwRect::IsEmpty(), maLayoutSize, maSize, meWriterType, mpStartFrameContent, Ole, RES_FLYFRMFMT(), tools::Rectangle::SetSize(), SwRect::SVRect(), and SwFormat::Which().
ww8::Frame::Frame | ( | const Graphic & | rGrf, |
SwPosition | aPos | ||
) |
Definition at line 150 of file writerhelper.cxx.
References Application::GetDefaultDevice(), MapMode::GetMapUnit(), Graphic::GetPrefMapMode(), Graphic::GetPrefSize(), OutputDevice::LogicToLogic(), maLayoutSize, maSize, and OutputDevice::PixelToLogic().
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.
|
inline |
Get the first node of content in the frame.
Definition at line 158 of file writerhelper.hxx.
References mpStartFrameContent.
Referenced by WW8Export::OutGrf(), RtfAttributeOutput::OutputFlyFrame_Impl(), DocxAttributeOutput::WriteFlyFrame(), and SwWW8WrGrf::WriteGraphicNode().
|
inline |
Get the node this frame is anchored into.
Definition at line 126 of file writerhelper.hxx.
References SwNode::GetContentNode(), SwPosition::GetNode(), and maPos.
Referenced by AttributeOutputBase::OutputFlyFrame(), and DocxAttributeOutput::OutputFlyFrame_Impl().
|
inline |
Get the writer SwFrameFormat that this object describes.
Definition at line 111 of file writerhelper.hxx.
References mpFlyFrame.
Referenced by PlcDrawObj::Append(), DocxAttributeOutput::EndParagraph(), DocxAttributeOutput::EndParagraphProperties(), RtfAttributeOutput::FlyFrameGraphic(), DocxAttributeOutput::FormatBox(), DocxAttributeOutput::FormatFillGradient(), AttributeOutputBase::GetTablePageSize(), WW8Export::MiserableRTLFrameFormatHack(), SwWW8AttrIter::OutFlys(), WW8Export::OutGrf(), AttributeOutputBase::OutputFlyFrame(), DocxAttributeOutput::OutputFlyFrame_Impl(), WW8AttributeOutput::OutputFlyFrame_Impl(), RtfAttributeOutput::OutputFlyFrame_Impl(), MSWordExportBase::OutputFormat(), WW8Export::OutputOLENode(), MSWordExportBase::OutputTextNode(), SwEscherEx::SwEscherEx(), DocxAttributeOutput::TableDefinition(), DocxSdrExport::writeDMLTextFrame(), DocxAttributeOutput::WriteFloatingTable(), SwEscherEx::WriteFlyFrame(), DocxAttributeOutput::WriteFlyFrame(), SwWW8WrGrf::WriteGraphicNode(), SwWW8WrGrf::WriteGrfFromGrfNode(), DocxSdrExport::writeOnlyTextOfFrame(), SwWW8WrGrf::WritePICFHeader(), PlcDrawObj::WritePlc(), SwEscherEx::WriteTextFlyFrame(), RtfAttributeOutput::writeTextFrame(), and DocxSdrExport::writeVMLTextFrame().
|
inline |
Definition at line 159 of file writerhelper.hxx.
References maGrf.
Referenced by SwWW8WrGrf::WriteGraphicNode().
|
inline |
The layout size of the contained element.
#i43447# - Needed for graphics, which are scaled into its environment
Definition at line 190 of file writerhelper.hxx.
References maLayoutSize.
Referenced by SwWW8WrGrf::Insert(), RtfAttributeOutput::OutputFlyFrame_Impl(), and DocxAttributeOutput::WriteFlyFrame().
|
inline |
Get the position this frame is anchored at.
Definition at line 118 of file writerhelper.hxx.
References maPos.
Referenced by WW8Export::MiserableRTLFrameFormatHack().
|
inline |
The Size of the contained element.
Definition at line 182 of file writerhelper.hxx.
References maSize.
Referenced by DocxAttributeOutput::EndParagraphProperties(), RtfAttributeOutput::OutputFlyFrame_Impl(), DocxSdrExport::writeDMLTextFrame(), SwWW8WrGrf::WritePICFHeader(), and DocxSdrExport::writeVMLTextFrame().
|
inline |
Get the type of frame that this wraps.
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().
|
inline |
Definition at line 160 of file writerhelper.hxx.
References mbForBullet.
Referenced by SwWW8WrGrf::WriteGraphicNode().
|
inline |
Is this frame inline (as character)
Definition at line 141 of file writerhelper.hxx.
References mbIsInline.
Referenced by WW8Export::AppendFlyInFlys(), RtfAttributeOutput::FlyFrameGraphic(), WW8Export::OutGrf(), DocxAttributeOutput::OutputFlyFrame_Impl(), WW8AttributeOutput::OutputFlyFrame_Impl(), RtfAttributeOutput::OutputFlyFrame_Impl(), WW8Export::OutputOLENode(), DocxAttributeOutput::WriteFlyFrame(), and PlcDrawObj::WritePlc().
|
inline |
Does this ww8::Frame refer to the same writer content as another.
Definition at line 167 of file writerhelper.hxx.
References maGrf, mbForBullet, and mpFlyFrame.
Referenced by GraphicDetails::operator==().
|
inline |
Definition at line 119 of file writerhelper.hxx.
References maPos.
|
private |
Definition at line 101 of file writerhelper.hxx.
Referenced by GetGraphic(), and RefersToSameFrameAs().
|
private |
Definition at line 95 of file writerhelper.hxx.
Referenced by Frame(), and GetLayoutSize().
|
private |
Definition at line 90 of file writerhelper.hxx.
Referenced by GetContentNode(), GetPosition(), and SetPosition().
|
private |
Definition at line 91 of file writerhelper.hxx.
|
private |
Definition at line 100 of file writerhelper.hxx.
Referenced by HasGraphic(), and RefersToSameFrameAs().
|
private |
Definition at line 99 of file writerhelper.hxx.
Referenced by ForceTreatAsInline(), and IsInline().
|
private |
Definition at line 97 of file writerhelper.hxx.
Referenced by Frame(), and GetWriterType().
|
private |
Definition at line 89 of file writerhelper.hxx.
Referenced by GetFrameFormat(), and RefersToSameFrameAs().
|
private |
Definition at line 98 of file writerhelper.hxx.
Referenced by Frame(), and GetContent().