Update ooo320-m1
[ooovba.git] / svx / source / inc / fmobj.hxx
blob3dd15fc1cdfd554d15c89f70e08bf6cb9df0bc7c
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: fmobj.hxx,v $
10 * $Revision: 1.11 $
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 ************************************************************************/
30 #ifndef _SVX_FMOBJ_HXX
31 #define _SVX_FMOBJ_HXX
33 #include <svx/svdouno.hxx>
34 #include <com/sun/star/script/ScriptEventDescriptor.hpp>
35 #include <com/sun/star/container/XIndexContainer.hpp>
37 class FmFormView;
39 //==================================================================
40 // FmFormObj
41 //==================================================================
42 class FmXForms;
43 class FmFormObj: public SdrUnoObj
45 ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor > aEvts; // events des Objects
46 ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor> m_aEventsHistory;
47 // valid if and only if m_pEnvironmentHistory != NULL, this are the events which we're set when
48 // m_pEnvironmentHistory was created
50 FmFormView* m_pControlCreationView;
51 ULONG m_nControlCreationEvent;
53 // Informationen fuer die Controlumgebung
54 // werden nur vorgehalten, wenn ein Object sich nicht in einer Objectliste befindet
55 ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer> m_xParent;
56 ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > m_xEnvironmentHistory;
57 sal_Int32 m_nPos;
58 sal_Int32 m_nType;
60 OutputDevice* m_pLastKnownRefDevice;
61 // the last ref device we know, as set at the model
62 // only to be used for comparison with the current ref device!
64 public:
65 SVX_DLLPUBLIC FmFormObj(const ::rtl::OUString& rModelName,sal_Int32 _nType);
66 SVX_DLLPUBLIC FmFormObj(sal_Int32 _nType);
68 TYPEINFO();
70 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>&
71 GetOriginalParent() const { return m_xParent; }
72 const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >&
73 GetOriginalEvents() const { return aEvts; }
74 sal_Int32
75 GetOriginalIndex() const { return m_nPos; }
77 void SetObjEnv(
78 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xForm,
79 const sal_Int32 nIdx,
80 const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& rEvts );
81 void ClearObjEnv();
83 public:
84 virtual ~FmFormObj();
85 virtual void SetPage(SdrPage* pNewPage);
87 virtual sal_uInt32 GetObjInventor() const;
88 virtual sal_uInt16 GetObjIdentifier() const;
89 virtual void ReformatText();
91 virtual SdrObject* Clone() const;
92 // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const;
93 virtual void operator= (const SdrObject& rObj);
95 virtual void clonedFrom(const FmFormObj* _pSource);
97 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> ensureModelEnv(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rSourceContainer, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer> _rTopLevelDestContainer);
99 /** returns the FmFormObj behind the given SdrObject
101 In case the SdrObject *is* an FmFormObject, this is a simple cast. In case the SdrObject
102 is a virtual object whose referenced object is an FmFormObj, then this referenced
103 object is returned. In all other cases, NULL is returned.
105 static FmFormObj* GetFormObject( SdrObject* _pSdrObject );
106 static const FmFormObj* GetFormObject( const SdrObject* _pSdrObject );
108 /** returns the type of this form object. See fmglob.hxx
110 sal_Int32 getType() const;
112 virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& _rxModel );
114 protected:
115 virtual FASTBOOL EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd );
116 virtual void BrkCreate( SdrDragStat& rStat );
118 // #i70852# overload Layer interface to force to FormColtrol layer
119 virtual SdrLayerID GetLayer() const;
120 virtual void NbcSetLayer(SdrLayerID nLayer);
122 private:
123 /** isolates the control model from its form component hierarchy, i.e. removes it from
124 its parent.
126 void impl_isolateControlModel_nothrow();
130 #endif // _FM_FMOBJ_HXX