LibreOffice Module sw (master) 1
contentcontrolbutton.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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
10#pragma once
11
12#include <vcl/ctrl.hxx>
13#include <vcl/weld.hxx>
14#include <swrect.hxx>
15
16class SwEditWin;
18
21{
22public:
24 const std::shared_ptr<SwContentControl>& pContentControl);
25 virtual ~SwContentControlButton() override;
26 virtual void dispose() override;
27
28 void CalcPosAndSize(const SwRect& rPortionPaintArea);
29
30 virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
31 DECL_LINK(PopupModeEndHdl, weld::Popover&, void);
33 void StartPopup();
34
35 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
36 virtual WindowHitTest ImplHitTest(const Point& rFramePos) override;
37
38 virtual void LaunchPopup();
39 virtual void DestroyPopup();
40
41 const std::shared_ptr<SwContentControl>& GetContentControl() const { return m_pContentControl; }
42
43private:
45
46protected:
47 std::shared_ptr<SwContentControl> m_pContentControl;
48 std::unique_ptr<weld::Builder> m_xPopupBuilder;
49 std::unique_ptr<weld::Popover> m_xPopup;
50};
51
52/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This button is shown when the cursor is inside a content control with drop-down capability.
virtual void dispose() override
DECL_LINK(PopupModeEndHdl, weld::Popover &, void)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual WindowHitTest ImplHitTest(const Point &rFramePos) override
std::shared_ptr< SwContentControl > m_pContentControl
void CalcPosAndSize(const SwRect &rPortionPaintArea)
SwContentControlButton(SwEditWin *pEditWin, const std::shared_ptr< SwContentControl > &pContentControl)
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
virtual ~SwContentControlButton() override
void StartPopup()
Shared MouseButtonDown() and KeyInput() code.
std::unique_ptr< weld::Builder > m_xPopupBuilder
const std::shared_ptr< SwContentControl > & GetContentControl() const
std::unique_ptr< weld::Popover > m_xPopup
Stores the properties of a content control.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
WindowHitTest