Update ooo320-m1
[ooovba.git] / svx / inc / svx / fmview.hxx
blobc580abae5a75183d4bff6296270257ba83052cd0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmview.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_FMVIEW_HXX
32 #define _SVX_FMVIEW_HXX
34 #include <svx/view3d.hxx>
35 #include <comphelper/uno3.hxx>
36 #include "svx/svxdllapi.h"
38 FORWARD_DECLARE_INTERFACE(util,XNumberFormats)
39 FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
41 class OutputDevice;
42 class FmFormModel;
43 class FmPageViewWinRec;
44 class FmFormObj;
45 class FmFormPage;
46 class FmFormShell;
47 class FmXFormView;
49 namespace svx {
50 class ODataAccessDescriptor;
51 struct OXFormsDescriptor;
54 class SdrUnoObj;
55 namespace com { namespace sun { namespace star { namespace form {
56 class XForm;
57 class XFormController;
58 } } } }
60 class SVX_DLLPUBLIC FmFormView : public E3dView
62 FmXFormView* pImpl;
63 FmFormShell* pFormShell;
65 void Init();
67 public:
68 TYPEINFO();
70 FmFormView(FmFormModel* pModel, OutputDevice* pOut = 0L);
71 virtual ~FmFormView();
73 /** create a control pair (label/bound control) for the database field description given.
74 @param rFieldDesc
75 description of the field. see clipboard format SBA-FIELDFORMAT
76 @deprecated
77 This method is deprecated. Use the version with a ODataAccessDescriptor instead.
79 SdrObject* CreateFieldControl(const UniString& rFieldDesc) const;
81 /** create a control pair (label/bound control) for the database field description given.
83 SdrObject* CreateFieldControl( const ::svx::ODataAccessDescriptor& _rColumnDescriptor );
85 /** create a control pair (label/bound control) for the xforms description given.
87 SdrObject* CreateXFormsControl( const ::svx::OXFormsDescriptor &_rDesc );
89 virtual void MarkListHasChanged();
90 virtual void AddWindowToPaintView(OutputDevice* pNewWin);
91 virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
93 static void createControlLabelPair(
94 OutputDevice* _pOutDev,
95 sal_Int32 _nXOffsetMM,
96 sal_Int32 _nYOffsetMM,
97 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField,
98 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats >& _rxNumberFormats,
99 sal_uInt16 _nControlObjectID,
100 const ::rtl::OUString& _rFieldPostfix,
101 UINT32 _nInventor,
102 UINT16 _nLabelObjectID,
103 SdrPage* _pLabelPage,
104 SdrPage* _pControlPage,
105 SdrModel* _pModel,
106 SdrUnoObj*& _rpLabel,
107 SdrUnoObj*& _rpControl
110 virtual SdrPageView* ShowSdrPage(SdrPage* pPage);
111 virtual void HideSdrPage();
113 // for copying complete form structures, not only control models
114 virtual SdrModel* GetMarkedObjModel() const;
115 using E3dView::Paste;
116 virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0);
118 virtual BOOL MouseButtonDown( const MouseEvent& _rMEvt, Window* _pWin );
120 /** grab the focus to the first form control on the view
121 @param _bForceSync
122 <TRUE/> if the handling should be done synchronously.
124 SVX_DLLPRIVATE void GrabFirstControlFocus( sal_Bool _bForceSync = sal_False );
126 /** returns the form controller for a given form and a given device
128 SVX_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormController >
129 GetFormController( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm >& _rxForm, const OutputDevice& _rDevice ) const;
131 // SdrView
132 BOOL KeyInput(const KeyEvent& rKEvt, Window* pWin);
134 /// shortcut to "GetSdrPageView() ? PTR_CAST( FmFormPage, GetSdrPageView() ) : NULL"
135 FmFormPage* GetCurPage();
137 SVX_DLLPRIVATE void ActivateControls(SdrPageView*);
138 SVX_DLLPRIVATE void DeactivateControls(SdrPageView*);
140 SVX_DLLPRIVATE void ChangeDesignMode(sal_Bool bDesign);
142 SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl; }
143 SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return pFormShell; }
145 struct FormShellAccess { friend class FmFormShell; private: FormShellAccess() { } };
146 void SetFormShell( FmFormShell* pShell, FormShellAccess ) { pFormShell = pShell; }
148 struct ImplAccess { friend class FmXFormView; private: ImplAccess() { } };
149 void SetMoveOutside( bool _bMoveOutside, ImplAccess ) { E3dView::SetMoveOutside( _bMoveOutside ); }
150 virtual void InsertControlContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& xCC);
151 virtual void RemoveControlContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& xCC);
153 virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut);
154 virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer);
156 SVX_DLLPRIVATE const OutputDevice* GetActualOutDev() const {return pActualOutDev;}
157 SVX_DLLPRIVATE sal_Bool checkUnMarkAll(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xSource);
159 private:
160 SVX_DLLPRIVATE void AdjustMarks(const SdrMarkList& rMarkList);
161 SVX_DLLPRIVATE FmFormObj* getMarkedGrid() const;
162 protected:
163 using E3dView::SetMoveOutside;
166 #endif // _FML_FMVIEW_HXX