nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / inc / HeaderFooterWin.hxx
blobb874e870e70240668db781852107e79c157a5660
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_HEADERFOOTERWIN_HXX
10 #define INCLUDED_SW_SOURCE_UIBASE_INC_HEADERFOOTERWIN_HXX
12 #include "edtwin.hxx"
13 #include "FrameControl.hxx"
14 #include <vcl/builder.hxx>
15 #include <vcl/timer.hxx>
16 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
18 /**
19 * Button painter helper class used to paint a runtime button positioned to a writer frame.
20 * See header/footer button.
22 class SwFrameButtonPainter
24 public:
26 static void PaintButton(drawinglayer::primitive2d::Primitive2DContainer& rSeq,
27 const tools::Rectangle& rRect, bool bOnTop);
30 /** Class for the header and footer separator control window.
32 This control is showing the header / footer style name and provides
33 a few useful actions to the user.
35 class SwHeaderFooterWin : public SwFrameMenuButtonBase
37 VclBuilder m_aBuilder;
38 OUString m_sLabel;
39 bool m_bIsHeader;
40 VclPtr<PopupMenu> m_pPopupMenu;
41 VclPtr<vcl::Window> m_pLine;
42 bool m_bIsAppearing;
43 int m_nFadeRate;
44 Timer m_aFadeTimer;
46 public:
47 SwHeaderFooterWin( SwEditWin *pEditWin, const SwFrame *pFrame, bool bHeader );
48 virtual ~SwHeaderFooterWin( ) override;
49 virtual void dispose() override;
51 void SetOffset( Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd );
53 virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
54 virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
55 virtual void Select( ) override;
57 virtual void ShowAll( bool bShow ) override;
58 virtual bool Contains( const Point &rDocPt ) const override;
60 bool IsHeader() const { return m_bIsHeader; };
61 bool IsEmptyHeaderFooter( ) const;
63 void ExecuteCommand(const OString &rIdent);
65 void SetReadonly( bool bReadonly ) override;
67 private:
68 DECL_LINK( FadeHandler, Timer *, void );
71 #endif
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */