10#include <bitmaps.hlst>
30#include <uiobject.hxx>
55#define BUTTON_WIDTH 30
56#define BUTTON_HEIGHT 19
64 , m_pEditWin(pEditWin)
76 m_pWin->SetZOrder(
this, ZOrderFlags::Before);
126 InterimItemWindow(pEditWin,
"modules/swriter/ui/pbmenubutton.ui",
"PBMenuButton"),
127 m_xMenuButton(m_xBuilder->weld_menu_button(
"menubutton")),
129 m_pEditWin(pEditWin),
131 m_bIsAppearing( false ),
133 m_nDelayAppearing( 0 ),
134 m_aFadeTimer(
"SwPageBreakWin m_aFadeTimer"),
135 m_bDestroyed( false )
180 double nLuminance = aHslLine.
getZ();
181 nLuminance += (1.0 - nLuminance) * 0.75;
182 if ( aHslLine.
getZ() > 0.7 )
183 nLuminance = aHslLine.
getZ() * 0.7;
184 aHslLine.
setZ(nLuminance);
204 std::move(aPolygon), aColor));
207 BitmapEx aBmpEx(RID_BMP_PAGE_BREAK);
208 double nImgOfstX = 3.0;
214 double nTop = double(aRect.getOpenHeight()) / 2.0;
215 double nBottom = nTop + 4.0;
216 double nLeft = aRect.getOpenWidth() -
ARROW_WIDTH - 6.0;
219 double nRight = nLeft + 8.0;
241 std::move(
aSeq), aBColorModifier));
245 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
248 pProcessor->process(aGhostedSeq);
270 m_pLine->execute(rIdent);
274 if (pFrameControl.use_count() > 1)
287 SvxBreak ePrevBreak = SvxBreak::NONE;
295 if (pCnt && rIdent ==
u"edit")
302 if ( ePrevBreak == SvxBreak::PageAfter )
306 ? *
static_cast<SwTextFrame*
>(pCnt)->GetTextNodeFirst()
317 m_pEditWin->GetView().GetViewFrame().GetDispatcher()->ExecuteList(
319 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
329 m_pEditWin->GetView().GetViewFrame().GetDispatcher()->ExecuteList(
331 SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
332 { &aItem, &aPaMItem });
337 else if (pCnt && rIdent ==
u"delete")
340 ? *
static_cast<SwTextFrame*
>(pCnt)->GetTextNodeFirst()
346 m_pEditWin->GetView().GetWrtShell().GetAttrPool());
350 if ( eBreak == SvxBreak::PageBefore )
357 if ( ePrevBreak == SvxBreak::PageAfter )
360 ? *
static_cast<SwTextFrame*
>(pPrevCnt)->GetTextNodeFirst()
382 const SwFrame* pPrevPage = pPageFrame;
385 pPrevPage = pPrevPage->
GetPrev();
397 nYLineOffset = ( aPrevFrameRect.
Bottom() + aFrameRect.
Top() ) / 2;
410 nPgLeft -= nSidebarWidth;
412 nPgRight += nSidebarWidth;
427 if ( nBtnLeft < nLineLeft )
428 nBtnLeft = nLineLeft;
429 else if ( ( nBtnLeft + aBtnSize.
getWidth() ) > nLineRight )
430 nBtnLeft = nLineRight - aBtnSize.
getWidth();
439 Point aLinePos( nLineLeft, nYLineOffset - 5 );
440 Size aLineSize( nLineRight - nLineLeft, 10 );
447 m_xVirDev->SetOutputSizePixel(rRect.GetSize());
465 Fade(rMenuButton.get_active());
470 const int TICKS_BEFORE_WE_APPEAR = 10;
471 if ( m_bIsAppearing && m_nDelayAppearing < TICKS_BEFORE_WE_APPEAR )
474 m_aFadeTimer.Start();
478 if ( m_bIsAppearing && m_nFadeRate > 0 )
480 else if ( !m_bIsAppearing && m_nFadeRate < 100 )
483 if ( m_nFadeRate != 100 && !IsVisible() )
485 else if ( m_nFadeRate == 100 && IsVisible( ) )
488 m_pLine->DestroyWin();
493 m_pLine->UpdatePosition();
497 if (IsVisible( ) && m_nFadeRate > 0 && m_nFadeRate < 100)
498 m_aFadeTimer.Start();
std::shared_ptr< SwFrameControl > SwFrameControlPtr
static SvxBreak lcl_GetBreakItem(const SwContentFrame *pCnt)
IMPL_LINK(SwPageBreakWin, SelectHdl, const OUString &, rIdent, void)
IMPL_LINK_NOARG(SwPageBreakWin, FadeHandler, Timer *, void)
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static const AllSettings & GetSettings()
const Size & GetSizePixel() const
basegfx::BColor getBColor() const
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual void dispose() override
bool IsLeaveWindow() const
const Point & GetPosPixel() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
constexpr tools::Long getWidth() const
constexpr tools::Long Width() const
const Color & GetDialogTextColor() const
bool GetHighContrastMode() const
const Color & GetDialogColor() const
Class for the page break control window.
virtual void SetReadonly(bool bReadonly) override
SwBreakDashedLine(SwEditWin *pEditWin, const SwFrame *pFrame)
void UpdatePosition(const std::optional< Point > &xEvtPt=std::optional< Point >())
VclPtr< SwEditWin > m_pEditWin
virtual void MouseMove(const MouseEvent &rMEvt) override
virtual FactoryFunction GetUITestFactory() const override
virtual SwEditWin * GetEditWin() override
std::optional< Point > m_xMousePt
virtual void ShowAll(bool bShow) override
virtual bool Contains(const Point &rDocPt) const override
void execute(std::u16string_view rIdent)
::tools::Rectangle m_aBtnRect
SwPageBreakWin & GetOrCreateWin()
VclPtr< SwPageBreakWin > m_pWin
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
void Push()
store a copy of the current cursor on the cursor stack
void SetSelection(const SwPaM &rCursor)
Class for displaying a dashed line in the Writer GUI.
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
const SwView & GetView() const
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
const SwRect & getFrameArea() const
Base class of the Writer layout elements.
SwTabFrame * FindTabFrame()
SwRootFrame * getRootFrame()
virtual const SvxFormatBreakItem & GetBreakItem() const
PaM is Point and Mark: a selection of the document model.
virtual ~SwPageBreakWin() override
int m_nDelayAppearing
Before we show the control, let it transparent for a few timer ticks to avoid appearing with every mo...
VclPtr< SwEditWin > m_pEditWin
std::unique_ptr< weld::MenuButton > m_xMenuButton
SwPageBreakWin(SwBreakDashedLine *pLine, SwEditWin *pEditWin, const SwFrame *pFrame)
void SetRectanglePixel(const ::tools::Rectangle &rRect)
VclPtr< VirtualDevice > m_xVirDev
VclPtr< SwBreakDashedLine > m_pLine
virtual void dispose() override
A page of the document layout.
SwContentFrame * FindLastBodyContent()
Searches the last ContentFrame in BodyText below the page.
SwContentFrame * FindFirstBodyContent()
sw::sidebarwindows::SidebarPosition SidebarPosition() const
asks the page on which side a margin should be shown, e.g for notes returns true for left side,...
SwRect GetBoundRect(OutputDevice const *pOutputDevice) const
tools::ULong GetSidebarWidth(bool bPx=false) const
tools::ULong GetSidebarBorderWidth(bool bPx=false) const
void Top(const tools::Long nTop)
tools::Rectangle SVRect() const
Represents the visualization of a paragraph.
static const SwViewOption & GetCurrentViewOptions()
const Color & GetPageBreakColor() const
bool IsViewLocked() const
const SwPostItMgr * GetPostItMgr() const
SwWrtShell & GetWrtShell() const
Used by the UI to modify the document model.
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
Point LogicToPixel(const Point &rLogicPt) const
void set_id(const OUString &rID)
virtual Point GetPosPixel() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
::OutputDevice const * GetOutDev() const
virtual Size GetSizePixel() const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
#define FN_FORMAT_TABLE_DLG
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
#define LINK(Instance, Class, Member)
Sequence< sal_Int8 > aSeq
B2DPolygon createPolygonFromRect(const B2DRectangle &rRect, double fRadiusX, double fRadiusY)
BColor rgb2hsl(const BColor &rRGBColor)
BColor hsl2rgb(const BColor &rHSLColor)
std::shared_ptr< BColorModifier > BColorModifierSharedPtr
std::unique_ptr< BaseProcessor2D > createProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
OUString SwResId(TranslateId aId)