1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _SVX_FMOBJ_HXX
29 #define _SVX_FMOBJ_HXX
31 #include <svx/svdouno.hxx>
32 #include <com/sun/star/script/ScriptEventDescriptor.hpp>
33 #include <com/sun/star/container/XIndexContainer.hpp>
37 //==================================================================
39 //==================================================================
41 class FmFormObj
: public SdrUnoObj
43 ::com::sun::star::uno::Sequence
< ::com::sun::star::script::ScriptEventDescriptor
> aEvts
; // events des Objects
44 ::com::sun::star::uno::Sequence
< ::com::sun::star::script::ScriptEventDescriptor
> m_aEventsHistory
;
45 // valid if and only if m_pEnvironmentHistory != NULL, this are the events which we're set when
46 // m_pEnvironmentHistory was created
48 FmFormView
* m_pControlCreationView
;
49 sal_uLong m_nControlCreationEvent
;
51 // Informationen fuer die Controlumgebung
52 // werden nur vorgehalten, wenn ein Object sich nicht in einer Objectliste befindet
53 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
> m_xParent
;
54 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
> m_xEnvironmentHistory
;
57 OutputDevice
* m_pLastKnownRefDevice
;
58 // the last ref device we know, as set at the model
59 // only to be used for comparison with the current ref device!
62 SVX_DLLPUBLIC
FmFormObj(const ::rtl::OUString
& rModelName
);
63 SVX_DLLPUBLIC
FmFormObj();
67 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
>&
68 GetOriginalParent() const { return m_xParent
; }
69 const ::com::sun::star::uno::Sequence
< ::com::sun::star::script::ScriptEventDescriptor
>&
70 GetOriginalEvents() const { return aEvts
; }
72 GetOriginalIndex() const { return m_nPos
; }
75 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexContainer
>& xForm
,
77 const ::com::sun::star::uno::Sequence
< ::com::sun::star::script::ScriptEventDescriptor
>& rEvts
);
82 virtual void SetPage(SdrPage
* pNewPage
);
84 virtual sal_uInt32
GetObjInventor() const;
85 virtual sal_uInt16
GetObjIdentifier() const;
86 virtual void NbcReformatText();
88 virtual FmFormObj
* Clone() const;
89 // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const;
90 FmFormObj
& operator= (const FmFormObj
& rObj
);
92 virtual void SetModel(SdrModel
* pNewModel
);
94 virtual void clonedFrom(const FmFormObj
* _pSource
);
96 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
);
98 /** returns the FmFormObj behind the given SdrObject
100 In case the SdrObject *is* an FmFormObject, this is a simple cast. In case the SdrObject
101 is a virtual object whose referenced object is an FmFormObj, then this referenced
102 object is returned. In all other cases, NULL is returned.
104 static FmFormObj
* GetFormObject( SdrObject
* _pSdrObject
);
105 static const FmFormObj
* GetFormObject( const SdrObject
* _pSdrObject
);
107 virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference
< com::sun::star::awt::XControlModel
>& _rxModel
);
110 virtual bool EndCreate( SdrDragStat
& rStat
, SdrCreateCmd eCmd
);
111 virtual void BrkCreate( SdrDragStat
& rStat
);
113 // #i70852# overload Layer interface to force to FormColtrol layer
114 virtual SdrLayerID
GetLayer() const;
115 virtual void NbcSetLayer(SdrLayerID nLayer
);
118 /** isolates the control model from its form component hierarchy, i.e. removes it from
121 void impl_isolateControlModel_nothrow();
123 /** forwards the reference device of our SdrModel to the control model
125 void impl_checkRefDevice_nothrow( bool _force
= false );
129 #endif // _FM_FMOBJ_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */