11 #include <strings.hrc>
12 #include <globals.hrc>
15 #include <drawdoc.hxx>
46 #include <svx/svxids.hrc>
60 #define TEXT_PADDING 5
61 #define BOX_DISTANCE 10
62 #define BUTTON_WIDTH 18
73 double nLuminance = aHslLine.
getZ() * 2.5;
74 if ( nLuminance == 0 )
76 else if ( nLuminance >= 1.0 )
77 nLuminance = aHslLine.
getZ() * 0.4;
78 aHslLine.
setZ( nLuminance );
85 double nLuminance = aHslDark.
getZ() * 255 + 20;
86 aHslDark.
setZ( nLuminance / 255.0 );
90 B2DPolygon lcl_GetPolygon( const ::tools::Rectangle& rRect,
bool bOnTop )
92 const double nRadius = 3;
93 const double nKappa((M_SQRT2 - 1.0) * 4.0 / 3.0);
99 B2DPoint aCorner( rRect.Left(), rRect.Bottom() );
100 B2DPoint aStart( rRect.Left(), rRect.Bottom() - nRadius );
101 B2DPoint aEnd( rRect.Left() + nRadius, rRect.Bottom() );
102 aPolygon.
append( aStart );
110 B2DPoint aCorner( rRect.Right(), rRect.Bottom() );
111 B2DPoint aStart( rRect.Right() - nRadius, rRect.Bottom() );
112 B2DPoint aEnd( rRect.Right(), rRect.Bottom() - nRadius );
113 aPolygon.
append( aStart );
138 B2DPolygon aPolygon = lcl_GetPolygon(rRect, bOnTop);
143 basegfx::BColor aLighterColor = lcl_GetLighterGradientColor(aFillColor);
157 double nAngle = M_PI;
172 m_aBuilder(nullptr,
VclBuilderContainer::getUIRootDir(),
"modules/swriter/ui/headerfootermenu.ui",
""),
173 m_bIsHeader( bHeader ),
174 m_pPopupMenu(m_aBuilder.get_menu(
"menu")),
176 m_bIsAppearing( false ),
232 : bIsLeft ?
SwResId(STR_LEFT_FOOTER_TITLE)
233 : bIsRight ?
SwResId(STR_RIGHT_FOOTER_TITLE)
237 : bIsLeft ?
SwResId(STR_LEFT_HEADER_TITLE)
238 : bIsRight ?
SwResId(STR_RIGHT_HEADER_TITLE)
252 long nYFooterOff = 0;
254 nYFooterOff = aBoxSize.
Height();
257 aOffset.
Y() - nYFooterOff);
267 double nYLinePos = aBoxPos.Y();
269 nYLinePos += aBoxSize.Height();
270 Point aLinePos(nXLineStart, nYLinePos);
271 Size aLineSize(nXLineEnd - nXLineStart, 1);
317 double(aTextPos.
X()),
double(aTextPos.
Y())));
322 std::vector<double>(), aFontAttr, css::lang::Locale(), aLineColor)));
326 B2DSize(aRect.Right(), aRect.getHeight()));
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(
389 pProcessor->process(aGhostedSeq);
421 if (rIdent ==
"edit")
423 OString sPageId =
m_bIsHeader ? OString(
"header") : OString(
"footer");
426 else if (rIdent ==
"borderback")
437 aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
442 aSet.MergeRange(SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER);
444 std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
447 aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->
Clone()));
449 aBoxInfo->SetTable(
false);
450 aBoxInfo->SetDist(
true);
451 aBoxInfo->SetMinDist(
false);
453 aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE);
462 else if (rIdent ==
"delete")
468 else if (rIdent ==
"insert_pagenumber")
473 else if (rIdent ==
"insert_pagecount")
506 if (m_bIsAppearing && m_nFadeRate > 0)
508 else if (!m_bIsAppearing && m_nFadeRate < 100)
511 if (m_nFadeRate != 100 && !IsVisible())
516 else if (m_nFadeRate == 100 && IsVisible())
519 m_pLine->Show(
false);
524 if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
525 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
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
static Color & GetHeaderFooterMarkColor()
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
void ChangeHeaderOrFooter(const OUString &rStyleName, bool bHeader, bool bOn, bool bShowWarning)
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
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 long *pDXArray=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) 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
std::shared_ptr< BColorModifier > BColorModifierSharedPtr
const vcl::Font & GetFont() const
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
const vcl::Font & GetToolFont() 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)
SfxBindings & GetBindings()
SwPageDesc * GetPageDesc()
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)
SwFrameFormat & GetMaster()
void setClosed(bool bNew)
vcl::Window * GetWin() const
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)
Sequence< sal_Int8 > aSeq
void SetInvokeHandler(const Link< Timer *, void > &rLink)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
void SetZOrder(vcl::Window *pRefWindow, ZOrderFlags nFlags)
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
basegfx::BColor getBColor() const
bool IsFirstShared() const
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
void SetZoomedPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
const Color & GetDialogTextColor() const
long GetLineHeight() const