tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / tphfedit.hxx
blob4247f2ad9807b25c88b4b1c801d3da5681ae4fa2
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 #pragma once
22 #include <scdllapi.h>
23 #include <editutil.hxx>
24 #include <svx/weldeditview.hxx>
25 #include <editeng/svxenum.hxx>
26 #include <unotools/weakref.hxx>
28 #include <functional>
30 namespace com::sun::star::accessibility { class XAccessible; }
32 class ScPatternAttr;
33 class EditView;
34 class EditTextObject;
35 class SvxFieldItem;
36 class ScAccessibleEditObject;
38 enum ScEditWindowLocation
40 Left,
41 Center,
42 Right
45 class SC_DLLPUBLIC ScEditWindow : public WeldEditView
47 public:
48 ScEditWindow(ScEditWindowLocation eLoc, weld::Window* pParent);
49 virtual void SetDrawingArea(weld::DrawingArea* pArea) override;
50 virtual ~ScEditWindow() override;
52 void SetFont( const ScPatternAttr& rPattern );
53 void SetText( const EditTextObject& rTextObject );
54 std::unique_ptr<EditTextObject> CreateTextObject();
55 void SetCharAttributes();
57 void InsertField( const SvxFieldItem& rFld );
59 void SetNumType(SvxNumType eNumType);
61 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
63 ScHeaderEditEngine* GetEditEngine() const override;
64 void SetObjectSelectHdl( const Link<ScEditWindow&,void>& aLink) { aObjectSelectLink = aLink; }
65 void SetGetFocusHdl(const std::function<void (ScEditWindow&)>& rLink) { m_GetFocusLink = rLink; }
67 protected:
68 virtual void makeEditEngine() override;
69 virtual bool KeyInput( const KeyEvent& rKEvt ) override;
70 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
71 virtual void GetFocus() override;
72 virtual void LoseFocus() override;
74 private:
75 ScEditWindowLocation eLocation;
76 bool mbRTL;
77 weld::Window* mpDialog;
79 unotools::WeakReference<ScAccessibleEditObject> mxAcc;
81 Link<ScEditWindow&,void> aObjectSelectLink;
82 std::function<void (ScEditWindow&)> m_GetFocusLink;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */