1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/.
12 #include <vcl/ctrl.hxx>
13 #include <vcl/weld.hxx>
17 class SwContentControl
;
19 /// This button is shown when the cursor is inside a content control with drop-down capability.
20 class SwContentControlButton
: public Control
23 SwContentControlButton(SwEditWin
* pEditWin
, std::shared_ptr
<SwContentControl
> pContentControl
);
24 virtual ~SwContentControlButton() override
;
25 virtual void dispose() override
;
27 void CalcPosAndSize(const SwRect
& rPortionPaintArea
);
28 void SetRTL(bool bRTL
) { m_bRTL
= bRTL
; }
30 virtual void MouseButtonDown(const MouseEvent
& rMEvt
) override
;
31 DECL_LINK(PopupModeEndHdl
, weld::Popover
&, void);
32 /// Shared MouseButtonDown() and KeyInput() code.
35 virtual void Paint(vcl::RenderContext
& rRenderContext
, const tools::Rectangle
& rRect
) override
;
36 virtual WindowHitTest
ImplHitTest(const Point
& rFramePos
) override
;
38 virtual void LaunchPopup();
39 virtual void DestroyPopup();
41 const std::shared_ptr
<SwContentControl
>& GetContentControl() const { return m_pContentControl
; }
44 tools::Rectangle m_aFramePixel
;
47 std::shared_ptr
<SwContentControl
> m_pContentControl
;
48 std::unique_ptr
<weld::Builder
> m_xPopupBuilder
;
49 std::unique_ptr
<weld::Popover
> m_xPopup
;
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */