1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_PAGEBREAKWIN_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_PAGEBREAKWIN_HXX
13 #include "FrameControl.hxx"
14 #include <vcl/builder.hxx>
15 #include <vcl/timer.hxx>
21 /** Class for the page break control window.
23 This control shows a line indicating a manual page break and a
24 button providing a few actions on that page break.
26 class SwPageBreakWin
: public SwFrameMenuButtonBase
28 VclBuilder m_aBuilder
;
29 VclPtr
<PopupMenu
> m_pPopupMenu
;
30 VclPtr
<vcl::Window
> m_pLine
;
33 int m_nDelayAppearing
; ///< Before we show the control, let it transparent for a few timer ticks to avoid appearing with every mouse over.
37 std::optional
<Point
> m_xMousePt
;
40 SwPageBreakWin( SwEditWin
* pEditWin
, const SwFrame
*pFrame
);
41 virtual ~SwPageBreakWin() override
;
42 virtual void dispose() override
;
44 virtual void Paint( vcl::RenderContext
& /*rRenderContext*/, const tools::Rectangle
& rRect
) override
;
45 virtual void Select( ) override
;
46 virtual void MouseMove( const MouseEvent
& rMEvt
) override
;
47 virtual void Activate( ) override
;
49 void UpdatePosition(const std::optional
<Point
>& xEvtPt
= std::optional
<Point
>());
51 virtual void ShowAll( bool bShow
) override
;
52 virtual bool Contains( const Point
&rDocPt
) const override
;
54 void SetReadonly( bool bReadonly
) override
;
56 void Fade( bool bFadeIn
);
59 /// Hide the button (used when the popup menu is closed by clicking outside)
60 DECL_LINK( HideHandler
, Menu
*, bool );
61 DECL_LINK( FadeHandler
, Timer
*, void );
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */