1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <comphelper/uno3.hxx>
25 #include <svx/svxdllapi.h>
27 namespace com
{ namespace sun
{ namespace star
{
44 class ODataAccessDescriptor
;
45 struct OXFormsDescriptor
;
49 namespace com
{ namespace sun
{ namespace star
{ namespace form
{
52 class XFormController
;
56 class SVX_DLLPUBLIC FmFormView
: public E3dView
58 rtl::Reference
<FmXFormView
> pImpl
;
59 FmFormShell
* pFormShell
;
65 FmFormView(FmFormModel
* pModel
, OutputDevice
* pOut
);
66 virtual ~FmFormView() override
;
68 /** create a control pair (label/bound control) for the database field description given.
70 description of the field. see clipboard format SBA-FIELDFORMAT
72 This method is deprecated. Use the version with a ODataAccessDescriptor instead.
74 SdrObject
* CreateFieldControl(const OUString
& rFieldDesc
) const;
76 /** create a control pair (label/bound control) for the database field description given.
78 SdrObject
* CreateFieldControl( const svx::ODataAccessDescriptor
& _rColumnDescriptor
);
80 /** create a control pair (label/bound control) for the xforms description given.
82 SdrObject
* 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
* _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 const OUString
& _rFieldPostfix
,
96 SdrInventor _nInventor
,
97 sal_uInt16 _nLabelObjectID
,
99 SdrPage
* _pControlPage
,
101 SdrUnoObj
*& _rpLabel
,
102 SdrUnoObj
*& _rpControl
105 virtual SdrPageView
* ShowSdrPage(SdrPage
* pPage
) override
;
106 virtual void HideSdrPage() override
;
108 virtual bool MouseButtonDown( const MouseEvent
& _rMEvt
, vcl::Window
* _pWin
) override
;
110 /** grab the focus to the first form control on the view
112 SVX_DLLPRIVATE
void GrabFirstControlFocus();
114 /** returns the form controller for a given form and a given device
116 SVX_DLLPRIVATE
css::uno::Reference
< css::form::runtime::XFormController
>
117 GetFormController( const css::uno::Reference
< css::form::XForm
>& _rxForm
, const OutputDevice
& _rDevice
) const;
120 bool KeyInput(const KeyEvent
& rKEvt
, vcl::Window
* pWin
) override
;
122 /// shortcut to "GetSdrPageView() ? PTR_CAST( FmFormPage, GetSdrPageView() ) : NULL"
123 FmFormPage
* GetCurPage();
125 SVX_DLLPRIVATE
void ActivateControls(SdrPageView
*);
126 SVX_DLLPRIVATE
void DeactivateControls(SdrPageView
*);
128 SVX_DLLPRIVATE
void ChangeDesignMode(bool bDesign
);
130 SVX_DLLPRIVATE FmXFormView
* GetImpl() const { return pImpl
.get(); }
131 SVX_DLLPRIVATE FmFormShell
* GetFormShell() const { return pFormShell
; }
133 struct FormShellAccess
{ friend class FmFormShell
; private: FormShellAccess() { } };
134 void SetFormShell( FmFormShell
* pShell
, FormShellAccess
) { pFormShell
= pShell
; }
136 struct ImplAccess
{ friend class FmXFormView
; private: ImplAccess() { } };
137 void SetMoveOutside( bool _bMoveOutside
, ImplAccess
) { E3dView::SetMoveOutside( _bMoveOutside
); }
138 void InsertControlContainer(const css::uno::Reference
< css::awt::XControlContainer
>& xCC
);
139 void RemoveControlContainer(const css::uno::Reference
< css::awt::XControlContainer
>& xCC
);
141 virtual SdrPaintWindow
* BeginCompleteRedraw(OutputDevice
* pOut
) override
;
142 virtual void EndCompleteRedraw(SdrPaintWindow
& rPaintWindow
, bool bPaintFormLayer
) override
;
144 SVX_DLLPRIVATE
const OutputDevice
* GetActualOutDev() const {return mpActualOutDev
;}
145 SVX_DLLPRIVATE
bool checkUnMarkAll(const css::uno::Reference
< css::uno::XInterface
>& _xSource
);
148 SVX_DLLPRIVATE FmFormObj
* getMarkedGrid() const;
150 using E3dView::SetMoveOutside
;
153 #endif // _FML_FMVIEW_HXX
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */