tdf#132752: docx import: improvements for first line indent in lists
[LibreOffice.git] / include / sfx2 / charwin.hxx
blobf4118d44ceb6ce3e8063ca99085da1f837794aea
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SFX2_INC_CHARWIN_HXX
21 #define INCLUDED_SFX2_INC_CHARWIN_HXX
23 #include <sfx2/dllapi.h>
24 #include <vcl/customweld.hxx>
25 #include <vcl/virdev.hxx>
26 #include <vcl/weld.hxx>
28 class SFX2_DLLPUBLIC SvxCharView final : public weld::CustomWidgetController
30 private:
31 VclPtr<VirtualDevice> mxVirDev;
32 tools::Long mnY;
33 Point maPosition;
34 vcl::Font maFont;
35 bool maHasInsert;
36 OUString m_sText;
38 Link<SvxCharView*, void> maMouseClickHdl;
39 Link<SvxCharView*, void> maClearClickHdl;
40 Link<SvxCharView*, void> maClearAllClickHdl;
42 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
43 virtual void Resize() override;
44 virtual bool MouseButtonDown(const MouseEvent&) override;
45 virtual void GetFocus() override;
46 virtual void LoseFocus() override;
47 virtual bool KeyInput(const KeyEvent&) override;
48 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
49 public:
50 SvxCharView(const VclPtr<VirtualDevice>& rVirDev);
52 void SetFont( const vcl::Font& rFont );
53 vcl::Font const & GetFont() const { return maFont; }
54 void SetText( const OUString& rText );
55 OUString const & GetText() const { return m_sText; }
56 void SetHasInsert( bool bInsert );
57 void InsertCharToDoc();
59 void createContextMenu();
61 Size get_preferred_size() const { return GetDrawingArea()->get_preferred_size(); }
63 void setMouseClickHdl(const Link<SvxCharView*,void> &rLink);
64 void setClearClickHdl(const Link<SvxCharView*,void> &rLink);
65 void setClearAllClickHdl(const Link<SvxCharView*,void> &rLink);
67 void ContextMenuSelect(std::string_view rIdent);
70 #endif
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */