124 if (!aFrameName.isEmpty())
189 throw std::runtime_error(
"missing Parent Layout");
190 if (xParent->IsPage() && xParent->GetParentLayout().is()
191 && xParent->GetParentLayout()->IsPage())
194 xParent = xParent->GetParentLayout();
218 sal_uInt16
first =
static_cast<sal_uInt16
>(nFirst);
322 pFrameStyle->
SetMargins(fLeft, fRight, fTop, fBottom);
335 pFrameStyle->
SetPadding(fLeft, fRight, fTop, fBottom);
435 if (xContainer.is() && (xContainer->IsHeader() || xContainer->IsFooter()))
466 if (xContainer.is() && xContainer->IsPage())
473 else if (xContainer.is() && xContainer->IsFrame())
612 if (xContainer.is() && (xContainer->IsHeader() || xContainer->IsFooter()))
615 fYOffset -= xContainer->GetMarginsValue(
MARGIN_TOP);
641 if (xContainer.is() && xContainer->IsPage())
646 else if (xContainer.is() && xContainer->IsFrame())
650 else if (xContainer.is() && xContainer->IsCell())
654 fYOffset -= xContainer->GetMarginsValue(
MARGIN_TOP);
656 else if (xContainer.is()
657 && (xContainer->IsHeader() || xContainer->IsFooter()))
660 fYOffset -= xContainer->GetMarginsValue(
MARGIN_TOP);
668 if (nOffset > 0 && pLayoutGeo)
695 fYOffset = offset - fYOffset;
702 pXFFrame->
SetX(fXOffset);
703 pXFFrame->
SetY(fYOffset);
726 double fParentWidth = pParent->
GetWidth();
730 fParentWidth =
static_cast<LwpCellLayout*
>(pParent)->GetActualWidth();
735 double fLeft = fXOffset - fWrapLeft - fParentMarginLeft;
736 double fRight = fParentWidth - fParentMarginRight - (fXOffset + fWidth + fWrapRight);
757 , m_bGettingMaxWidth(false)
822 m_pFrame->Parse(xXFFrame.get(), nStart);
829 content->DoXFConvert(xXFFrame.get());
834 pCont->
Add(xXFFrame.get());
850 std::unique_ptr<XFFrameStyle> xFrameStyle(
new XFFrameStyle);
852 m_pFrame->RegisterStyle(xFrameStyle);
859 content->DoRegisterStyle();
895 return !rObjectID.
IsNull();
938 throw std::runtime_error(
"recursive GetMaxWidth");
941 double fActualWidth = 0;
951 double fParentWidth = pParent->
GetWidth();
955 fParentWidth =
static_cast<LwpCellLayout*
>(pParent)->GetActualWidth();
958 double fParentMarginRight = 0;
966 fActualWidth = fParentWidth - fXOffset - fParentMarginRight - fWrapRight;
1038 std::unique_ptr<XFFrameStyle> xFrameStyle(
new XFFrameStyle);
1040 m_pFrame->RegisterStyle(xFrameStyle);
1087 m_pFrame->Parse(xXFFrame.get(), nStart);
1092 while (pLayout && pLayout !=
this)
1098 pCont->
Add(xXFFrame.get());
1142 pPara->DoParse(pOutputStream);
1215 if (pStory && pMarker)
1223 throw std::runtime_error(
"missing Ruby Marker");
1225 std::unique_ptr<XFRubyStyle> xRubyStyle(
new XFRubyStyle);
1240 xRubyStyle->SetAlignment(
eType);
1251 xRubyStyle->SetPosition(
eType);
Stream wrapper for sax writer.
virtual OUString GetStyleName()=0
@descr: return the style name.
AtomHolder class of Word Pro to hold a string.
const OUString & str() const
bool IsTransparent() const
lwpcolor class (red, green, blue, extra)
sal_uInt32 To24Color()
@descr return the BGR format
Base class of all Lwp content objects.
void Read() override
@descr default read function
LwpObjectID & GetChildHead()
LwpAtomHolder & GetName()
void RegisterStyle() override
@descr do nothing
LwpDropcapLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual void Parse(IXFStream *pOutputStream) override
@descr default parse function
void Read() override
@descr read frame layout object
virtual void XFConvert(XFContentContainer *pCont) override
@descr create a xfframe and add into content container
virtual void XFConvert(XFContentContainer *pCont) override
@descr create a xfframe and add into content container
LwpFrameLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void Read() override
@descr read frame layout object
bool IsForWaterMark() override
@descr whether current frame is for water mark.
double GetWidth() override
@descr Get frame width
double GetMaxWidth()
@descr Get frame width when the text field chooses maximize field length
void XFConvertFrame(XFContentContainer *pCont, sal_Int32 nStart=0, sal_Int32 nEnd=0, bool bAll=false) override
@descr create a xfframe and add into content container, called by XFConvert
virtual ~LwpFrameLayout() override
OUString GetNextLinkName()
@descr get the name of the frame that current frame links
void ApplyGraphicSize(XFFrame *pXFFrame)
@descr Set frame size according to graphic size
bool HasPreviousLinkLayout()
@descr whether current frame is linked by other frame
std::unique_ptr< LwpFrame > m_pFrame
virtual void RegisterStyle() override
@descr register frame style
LwpObjectID & GetNextLayout()
LwpObjectID m_PreviousLayout
LwpObjectID & GetPreviousLayout()
void Read(LwpObjectStream *pStrm)
@descr frame link information
For register frame style and parse frame.
LwpPlacableLayout * m_pLayout
void ParseAnchorType(XFFrame *pXFFrame)
@descr: set frame size, anchor type, anchored page number
void ApplyWrapType(XFFrameStyle *pFrameStyle)
@descr: set frame wrap type style
void ApplyProtect(XFFrameStyle *pFrameStyle)
@descr: set frame protect style
void XFConvert(XFContentContainer *pCont)
@descr: parse frame relative to page, frame or cell
void Parse(XFFrame *pXFFrame, sal_Int32 nPageNo)
@descr: parse frame and set frame properties
void ApplyBackGround(XFFrameStyle *pFrameStyle)
Apply background to frame style.
void ApplyBackColor(XFFrameStyle *pFrameStyle)
@descr: set frame back color style
void RegisterStyle(std::unique_ptr< XFFrameStyle > &rFrameStyle)
@descr: parse frame
void ApplyPosType(XFFrameStyle *pFrameStyle)
@descr: set frame position type style
void ApplyPadding(XFFrameStyle *pFrameStyle)
@descr: set padding border style
void ApplyShadow(XFFrameStyle *pFrameStyle)
@descr: set frame shadow style
bool IsLeftWider()
@descr Calculate the distance between the frame object and the page margins.
void ApplyWatermark(XFFrameStyle *pFrameStyle)
@descr: set frame watermark style
LwpFrame(LwpPlacableLayout *pLayout)
void ApplyMargins(XFFrameStyle *pFrameStyle)
@descr: set frame margins style
void ApplyBorders(XFFrameStyle *pFrameStyle)
@descr: set frame border style
void ApplyPatternFill(XFFrameStyle *pFrameStyle)
Apply pattern fill to frame style.
void ApplyColumns(XFFrameStyle *pFrameStyle)
@descr: set frame columns style
void ApplyTextDir(XFFrameStyle *pFrameStyle)
@descr: set frame text direction style
XFStyleManager * GetXFStyleManager()
static LwpGlobalMgr * GetInstance(LwpSvStream *pSvStream=nullptr)
@descr super class of LwpOleObject and LwpGraphicObject
void GetGrafScaledSize(double &fWidth, double &fHeight)
LwpGroupFrame(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
virtual ~LwpGroupFrame() override
virtual void XFConvert(XFContentContainer *pCont) override
@descr default XFConvert function pCont is the XFContentContainer for the object conversion
void Read() override
@descr default read function
virtual void RegisterStyle() override
@descr default register style function
void XFConvertFrame(XFContentContainer *pCont, sal_Int32 nStart=0, sal_Int32 nEnd=0, bool bAll=false) override
@descr create a xfframe and add into content container, called by XFConvert
virtual ~LwpGroupLayout() override
virtual void XFConvert(XFContentContainer *pCont) override
@descr create a xfframe and add into content container
void Read() override
@descr read group layout object
virtual void RegisterStyle() override
@descr register group frame style
LwpGroupLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
std::unique_ptr< LwpFrame > m_pFrame
const LwpPoint & GetOrigin() const
virtual bool IsUseOnPage() override
@descr: Whether it is use on current page
virtual bool IsUseOnAllOddPages() override
@descr: Whether it is use on all odd pages
virtual bool IsUseOnAllEvenPages() override
@descr: Whether it is use on all even pages
XFShadow * GetXFShadow()
@descr: create xfshadow
virtual rtl::Reference< LwpVirtualLayout > GetContainerLayout() override
@descr get the layout that containers the current frame layout
virtual bool IsUseOnAllPages() override
@descr: Whether it is use on all pages
XFColumns * GetXFColumns()
@descr: Create and return XFColumns object
sal_uInt16 GetUsePage()
@descr: Get use page
LwpObjectID & GetContent()
virtual bool IsAutoGrow() override
@descr: Whether the height and width of layout is auto grow
rtl::Reference< LwpVirtualLayout > GetWaterMarkLayout()
@descr: Get watermark layout
std::unique_ptr< XFBorders > GetXFBorders()
@descr: create xfborder.
std::unique_ptr< XFBGImage > GetXFBGImage()
@descr: Create and return xfbgimage object for watermark
virtual bool IsAutoGrowUp() override
@descr: Whether the height of layout is auto grow up
enumXFTextDir GetTextDirection()
@descr: Get text direction settings.
virtual bool IsAutoGrowLeft() override
@descr: Whether the height of layout is auto grow down
virtual double GetWidth() override
@descr: Get layout height
virtual bool IsAutoGrowDown() override
@descr: Whether the height of layout is auto grow down
std::unique_ptr< XFBGImage > GetFillPattern()
@descr: Get the fill pattern style.
LwpPoint GetOrigin()
@descr: Get layout origin point
virtual bool IsAutoGrowRight() override
@descr: Whether the height of layout is auto grow down
bool IsPatternFill()
@descr: Whether the fill is pattern fill or not
LwpBackgroundStuff * GetBackgroundStuff()
@descr: Get LwpBackgroundStuff object according to m_LayBackgroundStuff id;
LwpColor * GetBackColor()
@descr: Get background color.
LwpLayoutGeometry * GetGeometry()
@descr: Get the geometry of current layout
double GetGeometryHeight()
@descr: Get layout height, measured by "cm"
virtual double GetHeight()
@descr: Get layout height
void ReadIndexed(LwpSvStream *pStrm)
@descr Read object id with indexed format from stream if index>0, lowid is get from time table per th...
rtl::Reference< LwpObject > obj(VO_TYPE tag=VO_INVALID) const
@descr get object from object factory per the object id
stream class for LwpObject body data provide stream like interface to read object data
void SkipExtra()
@descr skip extra bytes
void SetFoundry(LwpFoundry *pFoundry)
std::unique_ptr< LwpObjectStream > m_pObjStrm
void DoXFConvert(XFContentContainer *pCont)
void RegisterStyle() override
register paragraph style
virtual sal_uInt8 GetRelativeType() override
@descr: Get relative type
virtual bool IsAnchorFrame() override
@descr: whether the parent layout is frame layout
virtual bool IsAnchorPage() override
@descr: whether the parent layout is page layout
sal_Int32 GetBaseLineOffset()
@descr: Get offset from the baseline
virtual bool IsAnchorCell() override
@descr: whether the parent layout is cell layout
virtual void XFConvertFrame(XFContentContainer *, sal_Int32=0, sal_Int32=0, bool=false)
void Read() override
@descr Read name of LwpDLNFVList from object stream
sal_uInt8 GetWrapType()
@descr: get wrap type
const rtl::Reference< XFFont > & GetFont() const
@descr: Get font style for setting position of frame
LwpStory * GetContentStory()
void Read() override
@descr read frame layout object
LwpRubyMarker * GetMarker()
void RegisterStyle() override
@descr register frame style
void ConvertContentText()
LwpObjectID m_objRubyMarker
LwpRubyLayout(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
void SetRubyStyleName(const OUString &sName)
void SetRubyText(const OUString &sText)
void SetTextStyleName(const OUString &sName)
virtual void XFConvert(XFContentContainer *pCont) override
@descr default XFConvert function pCont is the XFContentContainer for the object conversion
void SetDropcapFlag(bool bFlag)
OUString RegisterFirstFribStyle()
LwpObjectID & GetFirstPara()
OUString GetContentText(bool bAllText=false)
encapsulate XInputStream to provide SvStream like interfaces
bool IsFrame()
@descr: Whether this layout is frame layout or not
bool IsInlineToMargin() const
@descr: Determine whether the layout width is to margin
bool IsRelativeAnchored()
@descr: whether it is relative anchored layout
rtl::Reference< LwpVirtualLayout > GetParentLayout()
@descr: Get parent layout
void SetStyleName(const OUString &str)
virtual double GetWidth()
const OUString & GetStyleName() const
bool IsMinimumHeight() const
@descr: whether it is MinimumHeight layout
bool IsFitGraphic()
@descr: Whether the size of layout is fit the graphic
double GetExtMarginsValue(sal_uInt8 nWhichSide)
bool IsGroupHead()
@descr: Whether this layout is group layout or not
bool IsAutoGrowWidth()
@descr: Whether the width of layout is auto grow
void RegisterChildStyle()
@descr: Register child layout style
double GetMarginsValue(sal_uInt8 nWhichSide)
bool IsCell()
@descr: Whether this layout is cell layout or not
virtual void Add(XFContent *pContent)
@descr Add content.
virtual void SetStyleName(const OUString &style)
: All content except XFTextContent can have a style.
Floating frame on any page.
Style for all frame objects.
void SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel)
@descr Set vertical position type.
void SetTransparency(sal_Int16 nTransparency)
void SetTextDir(enumXFTextDir dir)
@descr Set text dir.
void SetMargins(double left, double right, double top, double bottom)
@descr: space between frame and paragraph text.
void SetColumns(XFColumns *pColumns)
@descr: set the column property of the frame.
void SetWrapType(enumXFWrap wrap)
void SetProtect(bool content, bool size, bool pos)
@descr Set whether frame is protected.
void SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel)
@descr Set horizontal position type.
void SetBackColor(XFColor const &color)
@descr: set the background color of the frame.
void SetShadow(XFShadow *pShadow)
@descr: set the shadow object the frame.
void SetBorders(std::unique_ptr< XFBorders > pBorders)
@descr: set the border property of the frame.
void SetBackImage(std::unique_ptr< XFBGImage > &rImage)
@descr: set the background image of the frame.
void SetPadding(double left, double right, double top, double bottom)
@descr: space between frame and text inside frame.
Base class for all frame object,include drawing,image,text-box.
void SetWidth(double width)
@descr Set frame width.
void SetHeight(double height)
@descr Set frame height.
void SetName(const OUString &name)
@descr Set frame name.
void SetY(double y)
@descr Set frame position Y.
void SetAnchorPage(sal_Int32 page)
@descr: if it's page anchor,set the page number.
void SetAnchorType(enumXFAnchor type)
@descr: Set the anchor type for the frame object.
void SetMinHeight(double minHeight)
@descr Set frame min-height.
void SetX(double x)
@descr Set frame position X.
void SetNextLink(const OUString &next)
@descr: Link the text content of the two frame.
Style manager for the filter.
IXFStyleRet AddStyle(std::unique_ptr< IXFStyle > pStyle)
For LWP filter architecture prototype - cell layouts.
#define LAST_LAYOUTPAGENO
#define FIRST_LAYOUTPAGENO
const sal_uInt8 MARGIN_BOTTOM
const sal_uInt8 MARGIN_RIGHT
const sal_uInt8 MARGIN_TOP
const sal_uInt8 MARGIN_LEFT
For LWP filter architecture prototype - OLE object.
constexpr OUStringLiteral first
@ enumXFFrameYRelParaContent
@ enumXFFrameYRelBaseLine
@ enumXFFrameXPosFromLeft
@ enumXFFrameXRelParaContent