10 #include <strings.hrc>
13 #include <drawdoc.hxx>
53 #define TEXT_PADDING 5
54 #define BOX_DISTANCE 10
55 #define BUTTON_WIDTH 18
66 double nLuminance = aHslLine.getZ() * 2.5;
67 if ( nLuminance == 0 )
69 else if ( nLuminance >= 1.0 )
70 nLuminance = aHslLine.getZ() * 0.4;
71 aHslLine.setZ( nLuminance );
78 double nLuminance = aHslDark.getZ() * 255 + 20;
79 aHslDark.setZ( nLuminance / 255.0 );
83 B2DPolygon lcl_GetPolygon( const ::tools::Rectangle& rRect,
bool bOnTop )
85 const double nRadius = 3;
86 const double nKappa((M_SQRT2 - 1.0) * 4.0 / 3.0);
92 B2DPoint aCorner( rRect.Left(), rRect.Bottom() );
93 B2DPoint aStart( rRect.Left(), rRect.Bottom() - nRadius );
94 B2DPoint aEnd( rRect.Left() + nRadius, rRect.Bottom() );
103 B2DPoint aCorner( rRect.Right(), rRect.Bottom() );
104 B2DPoint aStart( rRect.Right() - nRadius, rRect.Bottom() );
105 B2DPoint aEnd( rRect.Right(), rRect.Bottom() - nRadius );
106 aPolygon.
append( aStart );
131 B2DPolygon aPolygon = lcl_GetPolygon(rRect, bOnTop);
136 basegfx::BColor aLighterColor = lcl_GetLighterGradientColor(aFillColor);
150 double nAngle = M_PI;
165 m_xMenuButton(m_xBuilder->weld_menu_button(
"menubutton")),
166 m_xPushButton(m_xBuilder->weld_button(
"button")),
167 m_bIsHeader( bHeader ),
169 m_bIsAppearing( false ),
223 : bIsLeft ?
SwResId(STR_LEFT_FOOTER_TITLE)
224 : bIsRight ?
SwResId(STR_RIGHT_FOOTER_TITLE)
228 : bIsLeft ?
SwResId(STR_LEFT_HEADER_TITLE)
229 : bIsRight ?
SwResId(STR_RIGHT_HEADER_TITLE)
246 nYFooterOff = aBoxSize.
Height();
249 aOffset.Y() - nYFooterOff);
262 double nYLinePos = aBoxPos.Y();
264 nYLinePos += aBoxSize.Height();
265 Point aLinePos(nXLineStart, nYLinePos);
266 Size aLineSize(nXLineEnd - nXLineStart, 1);
316 double(aTextPos.X()),
double(aTextPos.Y())));
321 std::vector<double>(), aFontAttr, css::lang::Locale(), aLineColor)));
325 B2DSize(aRect.Right(), aRect.getHeight()));
329 if (bIsEmptyHeaderFooter)
334 double nHalfW = ( nRight - nLeft ) / 2.0;
336 double nTop = aSignArea.
getCenterY() - nHalfW;
337 double nBottom = aSignArea.
getCenterY() + nHalfW;
358 B2DPoint aBottom((aLeft.getX() + aRight.getX()) / 2.0, aLeft.getY() + 4.0);
375 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
383 std::make_shared<basegfx::BColorModifier_interpolate>(
COL_WHITE.getBColor(),
389 pProcessor->process(aGhostedSeq);
391 if (bIsEmptyHeaderFooter)
426 if (rIdent ==
"edit")
428 OString sPageId =
m_bIsHeader ? OString(
"header") : OString(
"footer");
431 else if (rIdent ==
"borderback")
442 aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
447 aSet.MergeRange(SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER);
449 std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
452 aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->
Clone()));
454 aBoxInfo->SetTable(
false);
455 aBoxInfo->SetDist(
true);
456 aBoxInfo->SetMinDist(
false);
458 aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE);
467 else if (rIdent ==
"delete")
473 else if (rIdent ==
"insert_pagenumber")
478 else if (rIdent ==
"insert_pagecount")
492 SwView& rView = GetEditWin()->GetView();
498 m_xPushButton->hide();
499 m_xMenuButton->show();
505 ExecuteCommand(rIdent);
510 if (m_bIsAppearing && m_nFadeRate > 0)
512 else if (!m_bIsAppearing && m_nFadeRate < 100)
515 if (m_nFadeRate != 100 && !IsVisible())
520 else if (m_nFadeRate == 100 && IsVisible())
523 m_pLine->Show(
false);
528 if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
529 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
constexpr tools::Long Height() const
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)
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