nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / PageBreakWin.hxx
blob982c81e157a4a8f12be17be955406b8506d7c8e8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
9 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_PAGEBREAKWIN_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_PAGEBREAKWIN_HXX
12 #include "edtwin.hxx"
13 #include "FrameControl.hxx"
14 #include <vcl/builder.hxx>
15 #include <vcl/timer.hxx>
16 #include <optional>
18 class Menu;
19 class SwPageFrame;
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;
31 bool m_bIsAppearing;
32 int m_nFadeRate;
33 int m_nDelayAppearing; ///< Before we show the control, let it transparent for a few timer ticks to avoid appearing with every mouse over.
34 Timer m_aFadeTimer;
35 bool m_bDestroyed;
37 std::optional<Point> m_xMousePt;
39 public:
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 );
58 private:
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 );
64 #endif
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */