Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_FMOBJ_HXX
29 : : #define _SVX_FMOBJ_HXX
30 : :
31 : : #include <svx/svdouno.hxx>
32 : : #include <com/sun/star/script/ScriptEventDescriptor.hpp>
33 : : #include <com/sun/star/container/XIndexContainer.hpp>
34 : :
35 : : //==================================================================
36 : : // FmFormObj
37 : : //==================================================================
38 : : class FmFormObj: public SdrUnoObj
39 : : {
40 : : ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor > aEvts; // events des Objects
41 : : ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor> m_aEventsHistory;
42 : : // valid if and only if m_pEnvironmentHistory != NULL, this are the events which we're set when
43 : : // m_pEnvironmentHistory was created
44 : :
45 : : // Informationen fuer die Controlumgebung
46 : : // werden nur vorgehalten, wenn ein Object sich nicht in einer Objectliste befindet
47 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer> m_xParent;
48 : : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > m_xEnvironmentHistory;
49 : : sal_Int32 m_nPos;
50 : :
51 : : OutputDevice* m_pLastKnownRefDevice;
52 : : // the last ref device we know, as set at the model
53 : : // only to be used for comparison with the current ref device!
54 : :
55 : : public:
56 : : SVX_DLLPUBLIC FmFormObj(const ::rtl::OUString& rModelName);
57 : : SVX_DLLPUBLIC FmFormObj();
58 : :
59 : : TYPEINFO();
60 : :
61 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>&
62 : 468 : GetOriginalParent() const { return m_xParent; }
63 : : const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >&
64 : 468 : GetOriginalEvents() const { return aEvts; }
65 : : sal_Int32
66 : 8 : GetOriginalIndex() const { return m_nPos; }
67 : :
68 : : void SetObjEnv(
69 : : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xForm,
70 : : const sal_Int32 nIdx,
71 : : const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& rEvts );
72 : : void ClearObjEnv();
73 : :
74 : : public:
75 : : virtual ~FmFormObj();
76 : : virtual void SetPage(SdrPage* pNewPage);
77 : :
78 : : virtual sal_uInt32 GetObjInventor() const;
79 : : virtual sal_uInt16 GetObjIdentifier() const;
80 : : virtual void NbcReformatText();
81 : :
82 : : virtual FmFormObj* Clone() const;
83 : : // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const;
84 : : FmFormObj& operator= (const FmFormObj& rObj);
85 : :
86 : : virtual void SetModel(SdrModel* pNewModel);
87 : :
88 : : virtual void clonedFrom(const FmFormObj* _pSource);
89 : :
90 : : 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);
91 : :
92 : : /** returns the FmFormObj behind the given SdrObject
93 : :
94 : : In case the SdrObject *is* an FmFormObject, this is a simple cast. In case the SdrObject
95 : : is a virtual object whose referenced object is an FmFormObj, then this referenced
96 : : object is returned. In all other cases, NULL is returned.
97 : : */
98 : : static FmFormObj* GetFormObject( SdrObject* _pSdrObject );
99 : : static const FmFormObj* GetFormObject( const SdrObject* _pSdrObject );
100 : :
101 : : virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& _rxModel );
102 : :
103 : : protected:
104 : : virtual bool EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd );
105 : : virtual void BrkCreate( SdrDragStat& rStat );
106 : :
107 : : // #i70852# overload Layer interface to force to FormColtrol layer
108 : : virtual SdrLayerID GetLayer() const;
109 : : virtual void NbcSetLayer(SdrLayerID nLayer);
110 : :
111 : : private:
112 : : /** isolates the control model from its form component hierarchy, i.e. removes it from
113 : : its parent.
114 : : */
115 : : void impl_isolateControlModel_nothrow();
116 : :
117 : : /** forwards the reference device of our SdrModel to the control model
118 : : */
119 : : void impl_checkRefDevice_nothrow( bool _force = false );
120 : : };
121 : :
122 : :
123 : : #endif // _FM_FMOBJ_HXX
124 : :
125 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|