LibreOffice Module sw (master) 1
PageBreakWin.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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
11
12#include "edtwin.hxx"
13#include "DashedLine.hxx"
14#include "FrameControl.hxx"
15#include <vcl/timer.hxx>
16#include <optional>
17
18class Menu;
19class SwPageFrame;
20
21class SwPageBreakWin;
22
28class SwBreakDashedLine final : public SwDashedLine, public ISwFrameControl
29{
30private:
33 std::optional<Point> m_xMousePt;
36
38
39public:
40 SwBreakDashedLine(SwEditWin* pEditWin, const SwFrame *pFrame);
41
42 virtual ~SwBreakDashedLine() override { disposeOnce(); }
44
45 virtual void MouseMove(const MouseEvent& rMEvt) override;
46
47 virtual const SwFrame* GetFrame() override { return m_pFrame; }
48 virtual SwEditWin* GetEditWin() override { return m_pEditWin; }
49 virtual void ShowAll(bool bShow) override;
50 virtual bool Contains(const Point &rDocPt) const override;
51 virtual void SetReadonly(bool bReadonly) override;
52
53 void execute(std::u16string_view rIdent);
54
55 virtual FactoryFunction GetUITestFactory() const override;
56
57 void UpdatePosition(const std::optional<Point>& xEvtPt = std::optional<Point>());
58 void DestroyWin();
59};
60
62{
63 std::unique_ptr<weld::MenuButton> m_xMenuButton;
73
74public:
75 SwPageBreakWin(SwBreakDashedLine* pLine, SwEditWin* pEditWin, const SwFrame *pFrame);
76 virtual ~SwPageBreakWin() override;
77 virtual void dispose() override;
78
79 void Fade( bool bFadeIn );
80
81 void SetRectanglePixel(const ::tools::Rectangle& rRect);
82
83private:
84 DECL_LINK( FadeHandler, Timer *, void );
86 DECL_LINK(ToggleHdl, weld::Toggleable&, void);
87 DECL_LINK(SelectHdl, const OUString&, void);
88 void PaintButton();
89};
90
91#endif
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void dispose() override
Class for the page break control window.
virtual void SetReadonly(bool bReadonly) override
virtual const SwFrame * GetFrame() override
virtual void dispose() 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 ~SwBreakDashedLine() override
virtual FactoryFunction GetUITestFactory() const override
virtual SwEditWin * GetEditWin() override
std::optional< Point > m_xMousePt
virtual void ShowAll(bool bShow) override
const SwFrame * m_pFrame
virtual bool Contains(const Point &rDocPt) const override
void execute(std::u16string_view rIdent)
::tools::Rectangle m_aBtnRect
SwPageBreakWin & GetOrCreateWin()
VclPtr< SwPageBreakWin > m_pWin
Class for displaying a dashed line in the Writer GUI.
Definition: DashedLine.hxx:18
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
Base class of the Writer layout elements.
Definition: frame.hxx:315
virtual ~SwPageBreakWin() override
DECL_LINK(SelectHdl, const OUString &, void)
DECL_LINK(ToggleHdl, weld::Toggleable &, void)
Hide the button when the menu is toggled closed, e.g by clicking outside.
int m_nDelayAppearing
Before we show the control, let it transparent for a few timer ticks to avoid appearing with every mo...
DECL_LINK(FadeHandler, Timer *, void)
void Fade(bool bFadeIn)
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
const SwFrame * m_pFrame
virtual void dispose() override
A page of the document layout.
Definition: pagefrm.hxx:60
void disposeAndClear()
void clear()
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction