10 #include <strings.hrc>
13 #include <drawdoc.hxx>
54 #define TEXT_PADDING 5
55 #define BOX_DISTANCE 10
56 #define BUTTON_WIDTH 18
67 double nLuminance = aHslLine.getZ() * 2.5;
68 if ( nLuminance == 0 )
70 else if ( nLuminance >= 1.0 )
71 nLuminance = aHslLine.getZ() * 0.4;
72 aHslLine.setZ( nLuminance );
79 double nLuminance = aHslDark.getZ() * 255 + 20;
80 aHslDark.setZ( nLuminance / 255.0 );
84 B2DPolygon lcl_GetPolygon( const ::tools::Rectangle& rRect,
bool bOnTop )
86 const double nRadius = 3;
87 const double nKappa((M_SQRT2 - 1.0) * 4.0 / 3.0);
93 B2DPoint aCorner( rRect.Left(), rRect.Bottom() );
94 B2DPoint aStart( rRect.Left(), rRect.Bottom() - nRadius );
95 B2DPoint aEnd( rRect.Left() + nRadius, rRect.Bottom() );
104 B2DPoint aCorner( rRect.Right(), rRect.Bottom() );
105 B2DPoint aStart( rRect.Right() - nRadius, rRect.Bottom() );
106 B2DPoint aEnd( rRect.Right(), rRect.Bottom() - nRadius );
107 aPolygon.
append( aStart );
132 B2DPolygon aPolygon = lcl_GetPolygon(rRect, bOnTop);
137 basegfx::BColor aLighterColor = lcl_GetLighterGradientColor(aFillColor);
151 double nAngle = M_PI;
166 m_xMenuButton(m_xBuilder->weld_menu_button(
"menubutton")),
167 m_xPushButton(m_xBuilder->weld_button(
"button")),
168 m_bIsHeader( bHeader ),
170 m_bIsAppearing( false ),
224 : bIsLeft ?
SwResId(STR_LEFT_FOOTER_TITLE)
225 : bIsRight ?
SwResId(STR_RIGHT_FOOTER_TITLE)
229 : bIsLeft ?
SwResId(STR_LEFT_HEADER_TITLE)
230 : bIsRight ?
SwResId(STR_RIGHT_HEADER_TITLE)
247 nYFooterOff = aBoxSize.
Height();
250 aOffset.Y() - nYFooterOff);
263 double nYLinePos = aBoxPos.Y();
265 nYLinePos += aBoxSize.Height();
266 Point aLinePos(nXLineStart, nYLinePos);
267 Size aLineSize(nXLineEnd - nXLineStart, 1);
320 double(aTextPos.X()),
double(aTextPos.Y())));
325 std::vector<double>(), aFontAttr, css::lang::Locale(), aLineColor)));
329 B2DSize(aRect.Right(), aRect.getHeight()));
333 if (bIsEmptyHeaderFooter)
338 double nHalfW = ( nRight - nLeft ) / 2.0;
340 double nTop = aSignArea.
getCenterY() - nHalfW;
341 double nBottom = aSignArea.
getCenterY() + nHalfW;
362 B2DPoint aBottom((aLeft.getX() + aRight.getX()) / 2.0, aLeft.getY() + 4.0);
379 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
387 std::make_shared<basegfx::BColorModifier_interpolate>(
COL_WHITE.getBColor(),
393 pProcessor->process(aGhostedSeq);
395 if (bIsEmptyHeaderFooter)
430 if (rIdent ==
"edit")
432 OString sPageId =
m_bIsHeader ? OString(
"header") : OString(
"footer");
435 else if (rIdent ==
"borderback")
446 aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
451 aSet.MergeRange(SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER);
453 std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
456 aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->
Clone()));
458 aBoxInfo->SetTable(
false);
459 aBoxInfo->SetDist(
true);
460 aBoxInfo->SetMinDist(
false);
462 aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE);
471 else if (rIdent ==
"delete")
477 else if (rIdent ==
"insert_pagenumber")
482 else if (rIdent ==
"insert_pagecount")
496 SwView& rView = GetEditWin()->GetView();
502 m_xPushButton->hide();
503 m_xMenuButton->show();
509 ExecuteCommand(rIdent);
514 if (m_bIsAppearing && m_nFadeRate > 0)
516 else if (!m_bIsAppearing && m_nFadeRate < 100)
519 if (m_nFadeRate != 100 && !IsVisible())
524 else if (m_nFadeRate == 100 && IsVisible())
527 m_pLine->Show(
false);
532 if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
533 m_aFadeTimer.Start();
virtual Point GetPosPixel() const
SfxViewFrame * GetViewFrame() const
#define LINK(Instance, Class, Member)
double getCenterY() const
#define FN_INSERT_FLD_PGCOUNT
Base class of the Writer layout elements.
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
virtual void SetModified(bool=true) override
BColor rgb2hsl(const BColor &rRGBColor)
const Color & GetDialogColor() const
static Color & GetHeaderFooterMarkColor()
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
const SwView & GetView() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
#define FN_INSERT_FLD_PGNUMBER
virtual Size GetSizePixel() const
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
attribute::FontAttribute getFontAttributeFromVclFont(basegfx::B2DVector &o_rSize, const vcl::Font &rFont, bool bRTL, bool bBiDiStrong)
const OUString & GetName() const
SwWrtShell & GetWrtShell() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Used by the UI to modify the document model.
bool ShowBorderBackgroundDlg(weld::Window *pParent, SfxItemSet *pBBSet)
weld::Window * GetFrameWeld() const
const SwView & GetView() const
tools::Long GetAscent() const
const vcl::Font & GetFont() const
class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_black_and_white final class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_gamma final class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_RGBLuminanceContrast final typedef std::shared_ptr< BColorModifier > BColorModifierSharedPtr
bool GetHighContrastMode() const
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
FontMetric GetFontMetric() const
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
BColor hsl2rgb(const BColor &rHSLColor)
bool IsHeaderShared() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
SfxBindings & GetBindings()
SwPageDesc * GetPageDesc()
const SwPageDesc & GetPageDesc(size_t i) const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
static bool GetLayoutRTL()
virtual void Start() override
void GrabFocusToDocument()
B2DPolygon interpolate(const B2DPolygon &rOld1, const B2DPolygon &rOld2, double t)
OUString SwResId(const char *pId)
void SetTimeout(sal_uInt64 nTimeoutMs)
void PutAreaListItems(SfxItemSet &rSet) const
Put needed items for XPropertyList entries from the DrawModel.
SwDocShell * GetDocShell()
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
void transform(const basegfx::B2DHomMatrix &rMatrix)
double getCenterX() const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
std::unique_ptr< drawinglayer::processor2d::BaseProcessor2D > createBaseProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
SwFrameFormat & GetMaster()
void setClosed(bool bNew)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
vcl::Window * GetWin() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
SwFrameFormat * GetRightFormat(bool const bFirst=false)
Layout uses the following methods to obtain a format in order to be able to create a page...
static VclPtr< reference_type > Create(Arg &&...arg)
tools::Long Height() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
Sequence< sal_Int8 > aSeq
void SetInvokeHandler(const Link< Timer *, void > &rLink)
void SetZOrder(vcl::Window *pRefWindow, ZOrderFlags nFlags)
basegfx::BColor getBColor() const
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, const tools::Long *pDXArray=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
VirtualDevice * get() const
bool IsFirstShared() const
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
const Color & GetDialogTextColor() const
tools::Long GetLineHeight() const