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
59 FmFormShell
* pFormShell
;
66 FmFormView(FmFormModel
* pModel
, OutputDevice
* pOut
= 0L);
67 virtual ~FmFormView();
69 /** create a control pair (label/bound control) for the database field description given.
71 description of the field. see clipboard format SBA-FIELDFORMAT
73 This method is deprecated. Use the version with a ODataAccessDescriptor instead.
75 SdrObject
* CreateFieldControl(const OUString
& rFieldDesc
) const;
77 /** create a control pair (label/bound control) for the database field description given.
79 SdrObject
* CreateFieldControl( const svx::ODataAccessDescriptor
& _rColumnDescriptor
);
81 /** create a control pair (label/bound control) for the xforms description given.
83 SdrObject
* CreateXFormsControl( const svx::OXFormsDescriptor
&_rDesc
);
85 virtual void MarkListHasChanged() SAL_OVERRIDE
;
86 virtual void AddWindowToPaintView(OutputDevice
* pNewWin
, vcl::Window
* pWindow
) SAL_OVERRIDE
;
87 virtual void DeleteWindowFromPaintView(OutputDevice
* pOldWin
) SAL_OVERRIDE
;
89 static void createControlLabelPair(
90 OutputDevice
* _pOutDev
,
91 sal_Int32 _nXOffsetMM
,
92 sal_Int32 _nYOffsetMM
,
93 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxField
,
94 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormats
>& _rxNumberFormats
,
95 sal_uInt16 _nControlObjectID
,
96 const OUString
& _rFieldPostfix
,
97 sal_uInt32 _nInventor
,
98 sal_uInt16 _nLabelObjectID
,
100 SdrPage
* _pControlPage
,
102 SdrUnoObj
*& _rpLabel
,
103 SdrUnoObj
*& _rpControl
106 virtual SdrPageView
* ShowSdrPage(SdrPage
* pPage
) SAL_OVERRIDE
;
107 virtual void HideSdrPage() SAL_OVERRIDE
;
109 // for copying complete form structures, not only control models
110 virtual SdrModel
* GetMarkedObjModel() const SAL_OVERRIDE
;
112 virtual bool MouseButtonDown( const MouseEvent
& _rMEvt
, vcl::Window
* _pWin
) SAL_OVERRIDE
;
114 /** grab the focus to the first form control on the view
116 <TRUE/> if the handling should be done synchronously.
118 SVX_DLLPRIVATE
void GrabFirstControlFocus( bool _bForceSync
= false );
120 /** returns the form controller for a given form and a given device
122 SVX_DLLPRIVATE ::com::sun::star::uno::Reference
< ::com::sun::star::form::runtime::XFormController
>
123 GetFormController( const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
>& _rxForm
, const OutputDevice
& _rDevice
) const;
126 bool KeyInput(const KeyEvent
& rKEvt
, vcl::Window
* pWin
) SAL_OVERRIDE
;
128 /// shortcut to "GetSdrPageView() ? PTR_CAST( FmFormPage, GetSdrPageView() ) : NULL"
129 FmFormPage
* GetCurPage();
131 SVX_DLLPRIVATE
void ActivateControls(SdrPageView
*);
132 SVX_DLLPRIVATE
void DeactivateControls(SdrPageView
*);
134 SVX_DLLPRIVATE
void ChangeDesignMode(bool bDesign
);
136 SVX_DLLPRIVATE FmXFormView
* GetImpl() const { return pImpl
; }
137 SVX_DLLPRIVATE FmFormShell
* GetFormShell() const { return pFormShell
; }
139 struct FormShellAccess
{ friend class FmFormShell
; private: FormShellAccess() { } };
140 void SetFormShell( FmFormShell
* pShell
, FormShellAccess
) { pFormShell
= pShell
; }
142 struct ImplAccess
{ friend class FmXFormView
; private: ImplAccess() { } };
143 void SetMoveOutside( bool _bMoveOutside
, ImplAccess
) { E3dView::SetMoveOutside( _bMoveOutside
); }
144 void InsertControlContainer(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>& xCC
);
145 void RemoveControlContainer(const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XControlContainer
>& xCC
);
147 virtual SdrPaintWindow
* BeginCompleteRedraw(OutputDevice
* pOut
) SAL_OVERRIDE
;
148 virtual void EndCompleteRedraw(SdrPaintWindow
& rPaintWindow
, bool bPaintFormLayer
) SAL_OVERRIDE
;
150 SVX_DLLPRIVATE
const OutputDevice
* GetActualOutDev() const {return pActualOutDev
;}
151 SVX_DLLPRIVATE
bool checkUnMarkAll(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _xSource
);
154 SVX_DLLPRIVATE
void AdjustMarks(const SdrMarkList
& rMarkList
);
155 SVX_DLLPRIVATE FmFormObj
* getMarkedGrid() const;
157 using E3dView::SetMoveOutside
;
160 #endif // _FML_FMVIEW_HXX
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */