LibreOffice Module svx (master)  1
fmview.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SVX_FMVIEW_HXX
21 #define INCLUDED_SVX_FMVIEW_HXX
22 
23 #include <svx/view3d.hxx>
24 #include <svx/svxdllapi.h>
25 
26 namespace com { namespace sun { namespace star {
27  namespace beans {
28  class XPropertySet;
29  }
30  namespace util {
31  class XNumberFormats;
32  }
33 }}}
34 
35 class OutputDevice;
36 class FmFormObj;
37 class FmFormPage;
38 class FmFormShell;
39 class FmXFormView;
40 
41 namespace svx {
42  class ODataAccessDescriptor;
43  struct OXFormsDescriptor;
44 }
45 
46 class SdrUnoObj;
47 namespace com { namespace sun { namespace star { namespace form {
48  class XForm;
49  namespace runtime {
50  class XFormController;
51  }
52 } } } }
53 
55 {
58 
59  void Init();
60 
61 public:
62  FmFormView(
63  SdrModel& rSdrModel,
64  OutputDevice* pOut);
65 
66  virtual ~FmFormView() override;
67 
74  SdrObjectUniquePtr CreateFieldControl(const OUString& rFieldDesc) const;
75 
78  SdrObjectUniquePtr CreateFieldControl( const svx::ODataAccessDescriptor& _rColumnDescriptor );
79 
82  SdrObjectUniquePtr CreateXFormsControl( const svx::OXFormsDescriptor &_rDesc );
83 
84  virtual void MarkListHasChanged() override;
85  virtual void AddWindowToPaintView(OutputDevice* pNewWin, vcl::Window* pWindow) override;
86  virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin) override;
87 
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,
97 
98  // tdf#118963 Need a SdrModel for SdrObject creation. To make the
99  // demand clear, hand over a SdrMldel&
100  SdrModel& _rModel,
101 
102  std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel,
103  std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl
104  );
105 
106  virtual SdrPageView* ShowSdrPage(SdrPage* pPage) override;
107  virtual void HideSdrPage() override;
108 
109  virtual bool MouseButtonDown( const MouseEvent& _rMEvt, OutputDevice* _pWin ) override;
110 
113  SVX_DLLPRIVATE void GrabFirstControlFocus();
114 
117  SVX_DLLPRIVATE css::uno::Reference< css::form::runtime::XFormController >
118  GetFormController( const css::uno::Reference< css::form::XForm >& _rxForm, const OutputDevice& _rDevice ) const;
119 
120  // SdrView
121  bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) override;
122 
124  FmFormPage* GetCurPage();
125 
126  SVX_DLLPRIVATE void ActivateControls(SdrPageView const *);
127  SVX_DLLPRIVATE void DeactivateControls(SdrPageView const *);
128 
129  SVX_DLLPRIVATE void ChangeDesignMode(bool bDesign);
130 
131  SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl.get(); }
132  SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return pFormShell; }
133 
134  struct FormShellAccess { friend class FmFormShell; private: FormShellAccess() { } };
135  void SetFormShell( FmFormShell* pShell, FormShellAccess ) { pFormShell = pShell; }
136 
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);
141 
142  virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut) override;
143  virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) override;
144 
146  SVX_DLLPRIVATE bool checkUnMarkAll(const css::uno::Reference< css::uno::XInterface >& _xSource);
147 
148 private:
149  SVX_DLLPRIVATE FmFormObj* getMarkedGrid() const;
150  protected:
152 };
153 
154 #endif // _FML_FMVIEW_HXX
155 
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void DeleteWindowFromPaintView(OutputDevice *pOldWin) override
Definition: svdedxv.cxx:2319
void Init()
virtual bool MouseButtonDown(const MouseEvent &rMEvt, OutputDevice *pWin) override
Definition: svdview.cxx:203
SVX_DLLPRIVATE const OutputDevice * GetActualOutDev() const
Definition: fmview.hxx:145
FmFormShell * pFormShell
Definition: fmview.hxx:57
void HideSdrPage() override
Definition: svdedxv.cxx:206
SVX_DLLPRIVATE FmFormShell * GetFormShell() const
Definition: fmview.hxx:132
SdrInventor
Definition: svdobj.hxx:152
virtual SdrPaintWindow * BeginCompleteRedraw(OutputDevice *pOut)
Definition: svdpntv.cxx:596
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
virtual void MarkListHasChanged() override
Definition: svdedxv.cxx:2479
SdrPageView * ShowSdrPage(SdrPage *pPage) override
Definition: svdedxv.cxx:138
void SetMoveOutside(bool bOn)
Definition: svdmrkv.cxx:2456
class SAL_NO_VTABLE XPropertySet
Definition: xmlexchg.hxx:31
void SetMoveOutside(bool _bMoveOutside, ImplAccess)
Definition: fmview.hxx:138
rtl::Reference< FmXFormView > pImpl
Definition: fmview.hxx:56
class encapsulating the css::sdb::DataAccessDescriptor service.
Derived class of SdrView to edit 3D objects.
Definition: view3d.hxx:41
SVX_DLLPRIVATE FmXFormView * GetImpl() const
Definition: fmview.hxx:131
bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin) override
Definition: svdview.cxx:166
virtual void AddWindowToPaintView(OutputDevice *pNewWin, vcl::Window *pWindow) override
Definition: svdedxv.cxx:2308
std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr
Definition: svdobj.hxx:114
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:366
#define SVX_DLLPRIVATE
Definition: svxdllapi.h:30
VclPtr< OutputDevice > mpActualOutDev
Definition: svdpntv.hxx:133
virtual void EndCompleteRedraw(SdrPaintWindow &rPaintWindow, bool bPaintFormLayer)
Definition: svdpntv.cxx:628
void SetFormShell(FmFormShell *pShell, FormShellAccess)
Definition: fmview.hxx:135