Bump version to 6.4-15
[LibreOffice.git] / include / svx / fmview.hxx
blob508b3380eb9103dfe29922779c4314764594aca5
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_SVX_FMVIEW_HXX
21 #define INCLUDED_SVX_FMVIEW_HXX
23 #include <svx/view3d.hxx>
24 #include <svx/svxdllapi.h>
26 namespace com { namespace sun { namespace star {
27 namespace beans {
28 class XPropertySet;
30 namespace util {
31 class XNumberFormats;
33 }}}
35 class OutputDevice;
36 class FmFormObj;
37 class FmFormPage;
38 class FmFormShell;
39 class FmXFormView;
41 namespace svx {
42 class ODataAccessDescriptor;
43 struct OXFormsDescriptor;
46 class SdrUnoObj;
47 namespace com { namespace sun { namespace star { namespace form {
48 class XForm;
49 namespace runtime {
50 class XFormController;
52 } } } }
54 class SVX_DLLPUBLIC FmFormView : public E3dView
56 rtl::Reference<FmXFormView> pImpl;
57 FmFormShell* pFormShell;
59 void Init();
61 public:
62 FmFormView(
63 SdrModel& rSdrModel,
64 OutputDevice* pOut);
66 virtual ~FmFormView() override;
68 /** create a control pair (label/bound control) for the database field description given.
69 @param rFieldDesc
70 description of the field. see clipboard format SBA-FIELDFORMAT
71 @deprecated
72 This method is deprecated. Use the version with an ODataAccessDescriptor instead.
74 SdrObjectUniquePtr CreateFieldControl(const OUString& rFieldDesc) const;
76 /** create a control pair (label/bound control) for the database field description given.
78 SdrObjectUniquePtr CreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor );
80 /** create a control pair (label/bound control) for the xforms description given.
82 SdrObjectUniquePtr CreateXFormsControl( const svx::OXFormsDescriptor &_rDesc );
84 virtual void MarkListHasChanged() override;
85 virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow) override;
86 virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin) override;
88 static void createControlLabelPair(
89 OutputDevice const * _pOutDev,
90 sal_Int32 _nXOffsetMM,
91 sal_Int32 _nYOffsetMM,
92 const css::uno::Reference< css::beans::XPropertySet >& _rxField,
93 const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats,
94 sal_uInt16 _nControlObjectID,
95 SdrInventor _nInventor,
96 sal_uInt16 _nLabelObjectID,
98 // tdf#118963 Need a SdrModel for SdrObject creation. To make the
99 // demand clear, hand over a SdrMldel&
100 SdrModel& _rModel,
102 std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel,
103 std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl
106 virtual SdrPageView* ShowSdrPage(SdrPage* pPage) override;
107 virtual void HideSdrPage() override;
109 virtual bool MouseButtonDown( const MouseEvent& _rMEvt, OutputDevice* _pWin ) override;
111 /** grab the focus to the first form control on the view
113 SVX_DLLPRIVATE void GrabFirstControlFocus();
115 /** returns the form controller for a given form and a given device
117 SVX_DLLPRIVATE css::uno::Reference< css::form::runtime::XFormController >
118 GetFormController( const css::uno::Reference< css::form::XForm >& _rxForm, const OutputDevice& _rDevice ) const;
120 // SdrView
121 bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override;
123 /// shortcut to "GetSdrPageView() ? PTR_CAST( FmFormPage, GetSdrPageView() ) : NULL"
124 FmFormPage* GetCurPage();
126 SVX_DLLPRIVATE void ActivateControls(SdrPageView const *);
127 SVX_DLLPRIVATE void DeactivateControls(SdrPageView const *);
129 SVX_DLLPRIVATE void ChangeDesignMode(bool bDesign);
131 SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl.get(); }
132 SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return pFormShell; }
134 struct FormShellAccess { friend class FmFormShell; private: FormShellAccess() { } };
135 void SetFormShell( FmFormShell* pShell, FormShellAccess ) { pFormShell = pShell; }
137 struct ImplAccess { friend class FmXFormView; private: ImplAccess() { } };
138 void SetMoveOutside( bool _bMoveOutside, ImplAccess ) { E3dView::SetMoveOutside( _bMoveOutside ); }
139 void InsertControlContainer(const css::uno::Reference< css::awt::XControlContainer >& xCC);
140 void RemoveControlContainer(const css::uno::Reference< css::awt::XControlContainer >& xCC);
142 virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut) override;
143 virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) override;
145 SVX_DLLPRIVATE const OutputDevice* GetActualOutDev() const {return mpActualOutDev;}
146 SVX_DLLPRIVATE bool checkUnMarkAll(const css::uno::Reference< css::uno::XInterface >& _xSource);
148 private:
149 SVX_DLLPRIVATE FmFormObj* getMarkedGrid() const;
150 protected:
151 using E3dView::SetMoveOutside;
154 #endif // _FML_FMVIEW_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */