Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / FormFieldButton.hxx
blob22a9b3e8c7b00a8920ff2682176940f872d89cfa
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.
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 */
10 #pragma once
12 #include <vcl/ctrl.hxx>
13 #include <vcl/weld.hxx>
14 #include <swrect.hxx>
16 class SwEditWin;
17 namespace sw::mark
19 class Fieldmark;
22 /**
23 * This button is shown when the cursor is on a form field with drop-down capability.
25 class FormFieldButton : public Control
27 public:
28 FormFieldButton(SwEditWin* pEditWin, sw::mark::Fieldmark& rFieldMark);
29 virtual ~FormFieldButton() override;
30 virtual void dispose() override;
32 void CalcPosAndSize(const SwRect& rPortionPaintArea);
34 virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
35 DECL_LINK(FieldPopupModeEndHdl, weld::Popover&, void);
37 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
38 virtual WindowHitTest ImplHitTest(const Point& rFramePos) override;
40 virtual void LaunchPopup();
41 virtual void DestroyPopup();
43 private:
44 tools::Rectangle m_aFieldFramePixel;
46 protected:
47 sw::mark::Fieldmark& m_rFieldmark;
48 std::unique_ptr<weld::Builder> m_xFieldPopupBuilder;
49 std::unique_ptr<weld::Popover> m_xFieldPopup;
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */