nss: upgrade to release 3.73
[LibreOffice.git] / sc / source / ui / inc / tphfedit.hxx
blob85b8984c821d95d77e96c3a0a7e1924e18ec3679
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_SC_SOURCE_UI_INC_TPHFEDIT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_TPHFEDIT_HXX
23 #include <scdllapi.h>
24 #include <cppuhelper/weakref.hxx>
25 #include <tools/wintypes.hxx>
26 #include <svx/weldeditview.hxx>
27 #include <editeng/svxenum.hxx>
28 #include <vcl/customweld.hxx>
30 #include <functional>
32 namespace com::sun::star::accessibility { class XAccessible; }
34 class ScHeaderEditEngine;
35 class ScPatternAttr;
36 class EditView;
37 class EditTextObject;
38 class SvxFieldItem;
39 class ScAccessibleEditObject;
40 namespace vcl { class Window; }
42 enum ScEditWindowLocation
44 Left,
45 Center,
46 Right
49 class SC_DLLPUBLIC ScEditWindow : public WeldEditView
51 public:
52 ScEditWindow(ScEditWindowLocation eLoc, weld::Window* pParent);
53 virtual void SetDrawingArea(weld::DrawingArea* pArea) override;
54 virtual ~ScEditWindow() override;
56 void SetFont( const ScPatternAttr& rPattern );
57 void SetText( const EditTextObject& rTextObject );
58 std::unique_ptr<EditTextObject> CreateTextObject();
59 void SetCharAttributes();
61 void InsertField( const SvxFieldItem& rFld );
63 void SetNumType(SvxNumType eNumType);
65 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
67 ScHeaderEditEngine* GetEditEngine() const;
68 void SetObjectSelectHdl( const Link<ScEditWindow&,void>& aLink) { aObjectSelectLink = aLink; }
69 void SetGetFocusHdl(const std::function<void (ScEditWindow&)>& rLink) { m_GetFocusLink = rLink; }
71 protected:
72 virtual void makeEditEngine() override;
73 virtual bool KeyInput( const KeyEvent& rKEvt ) override;
74 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
75 virtual void GetFocus() override;
76 virtual void LoseFocus() override;
78 private:
79 ScEditWindowLocation eLocation;
80 bool mbRTL;
81 weld::Window* mpDialog;
83 css::uno::WeakReference< css::accessibility::XAccessible > xAcc;
84 ScAccessibleEditObject* pAcc;
86 Link<ScEditWindow&,void> aObjectSelectLink;
87 std::function<void (ScEditWindow&)> m_GetFocusLink;
91 #endif // INCLUDED_SC_SOURCE_UI_INC_TPHFEDIT_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */