Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _SVX_FMOBJ_HXX
20 : #define _SVX_FMOBJ_HXX
21 :
22 : #include <svx/svdouno.hxx>
23 : #include <com/sun/star/script/ScriptEventDescriptor.hpp>
24 : #include <com/sun/star/container/XIndexContainer.hpp>
25 :
26 : //==================================================================
27 : // FmFormObj
28 : //==================================================================
29 : class FmFormObj: public SdrUnoObj
30 : {
31 : ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor > aEvts; // events des Objects
32 : ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor> m_aEventsHistory;
33 : // valid if and only if m_pEnvironmentHistory != NULL, this are the events which we're set when
34 : // m_pEnvironmentHistory was created
35 :
36 : // Informationen fuer die Controlumgebung
37 : // werden nur vorgehalten, wenn ein Object sich nicht in einer Objectliste befindet
38 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer> m_xParent;
39 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > m_xEnvironmentHistory;
40 : sal_Int32 m_nPos;
41 :
42 : OutputDevice* m_pLastKnownRefDevice;
43 : // the last ref device we know, as set at the model
44 : // only to be used for comparison with the current ref device!
45 :
46 : public:
47 : SVX_DLLPUBLIC FmFormObj(const ::rtl::OUString& rModelName);
48 : SVX_DLLPUBLIC FmFormObj();
49 :
50 : TYPEINFO();
51 :
52 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>&
53 0 : GetOriginalParent() const { return m_xParent; }
54 : const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >&
55 0 : GetOriginalEvents() const { return aEvts; }
56 : sal_Int32
57 0 : GetOriginalIndex() const { return m_nPos; }
58 :
59 : void SetObjEnv(
60 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xForm,
61 : const sal_Int32 nIdx,
62 : const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& rEvts );
63 : void ClearObjEnv();
64 :
65 : public:
66 : virtual ~FmFormObj();
67 : virtual void SetPage(SdrPage* pNewPage);
68 :
69 : virtual sal_uInt32 GetObjInventor() const;
70 : virtual sal_uInt16 GetObjIdentifier() const;
71 : virtual void NbcReformatText();
72 :
73 : virtual FmFormObj* Clone() const;
74 : // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const;
75 : FmFormObj& operator= (const FmFormObj& rObj);
76 :
77 : virtual void SetModel(SdrModel* pNewModel);
78 :
79 : virtual void clonedFrom(const FmFormObj* _pSource);
80 :
81 : 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);
82 :
83 : /** returns the FmFormObj behind the given SdrObject
84 :
85 : In case the SdrObject *is* an FmFormObject, this is a simple cast. In case the SdrObject
86 : is a virtual object whose referenced object is an FmFormObj, then this referenced
87 : object is returned. In all other cases, NULL is returned.
88 : */
89 : static FmFormObj* GetFormObject( SdrObject* _pSdrObject );
90 : static const FmFormObj* GetFormObject( const SdrObject* _pSdrObject );
91 :
92 : virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& _rxModel );
93 :
94 : protected:
95 : virtual bool EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd );
96 : virtual void BrkCreate( SdrDragStat& rStat );
97 :
98 : // #i70852# overload Layer interface to force to FormColtrol layer
99 : virtual SdrLayerID GetLayer() const;
100 : virtual void NbcSetLayer(SdrLayerID nLayer);
101 :
102 : private:
103 : /** isolates the control model from its form component hierarchy, i.e. removes it from
104 : its parent.
105 : */
106 : void impl_isolateControlModel_nothrow();
107 :
108 : /** forwards the reference device of our SdrModel to the control model
109 : */
110 : void impl_checkRefDevice_nothrow( bool _force = false );
111 : };
112 :
113 :
114 : #endif // _FM_FMOBJ_HXX
115 :
116 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|