1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmobj.hxx,v $
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>
39 //==================================================================
41 //==================================================================
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
;
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!
65 SVX_DLLPUBLIC
FmFormObj(const ::rtl::OUString
& rModelName
,sal_Int32 _nType
);
66 SVX_DLLPUBLIC
FmFormObj(sal_Int32 _nType
);
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
; }
75 GetOriginalIndex() const { return m_nPos
; }
78 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
>& xForm
,
80 const ::com::sun::star::uno::Sequence
< ::com::sun::star::script::ScriptEventDescriptor
>& rEvts
);
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
);
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
);
123 /** isolates the control model from its form component hierarchy, i.e. removes it from
126 void impl_isolateControlModel_nothrow();
130 #endif // _FM_FMOBJ_HXX