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 INCLUDED_SVX_SOURCE_INC_FMOBJ_HXX
20 : #define INCLUDED_SVX_SOURCE_INC_FMOBJ_HXX
21 :
22 : #include <svx/svdouno.hxx>
23 : #include <com/sun/star/container/XIndexContainer.hpp>
24 : #include <com/sun/star/form/XForms.hpp>
25 : #include <com/sun/star/script/ScriptEventDescriptor.hpp>
26 :
27 :
28 : // FmFormObj
29 :
30 : class SVX_DLLPUBLIC FmFormObj: public SdrUnoObj
31 : {
32 : ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor > aEvts; // events des Objects
33 : ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor> m_aEventsHistory;
34 : // valid if and only if m_pEnvironmentHistory != NULL, this are the events which we're set when
35 : // m_pEnvironmentHistory was created
36 :
37 : // Informationen fuer die Controlumgebung
38 : // werden nur vorgehalten, wenn ein Object sich nicht in einer Objectliste befindet
39 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer> m_xParent;
40 : ::com::sun::star::uno::Reference< ::com::sun::star::form::XForms > m_xEnvironmentHistory;
41 : sal_Int32 m_nPos;
42 :
43 : OutputDevice* m_pLastKnownRefDevice;
44 : // the last ref device we know, as set at the model
45 : // only to be used for comparison with the current ref device!
46 :
47 : public:
48 : FmFormObj(const OUString& rModelName);
49 : FmFormObj();
50 :
51 : TYPEINFO_VISIBILITY_OVERRIDE(SAL_DLLPRIVATE);
52 :
53 : SAL_DLLPRIVATE const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>&
54 600 : GetOriginalParent() const { return m_xParent; }
55 : SAL_DLLPRIVATE const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >&
56 464 : GetOriginalEvents() const { return aEvts; }
57 : SAL_DLLPRIVATE sal_Int32
58 8 : GetOriginalIndex() const { return m_nPos; }
59 :
60 : SAL_DLLPRIVATE void SetObjEnv(
61 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xForm,
62 : const sal_Int32 nIdx,
63 : const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& rEvts );
64 : SAL_DLLPRIVATE void ClearObjEnv();
65 :
66 : public:
67 : SAL_DLLPRIVATE virtual ~FmFormObj();
68 : SAL_DLLPRIVATE virtual void SetPage(SdrPage* pNewPage) SAL_OVERRIDE;
69 :
70 : SAL_DLLPRIVATE virtual sal_uInt32 GetObjInventor() const SAL_OVERRIDE;
71 : SAL_DLLPRIVATE virtual sal_uInt16 GetObjIdentifier() const SAL_OVERRIDE;
72 : SAL_DLLPRIVATE virtual void NbcReformatText() SAL_OVERRIDE;
73 :
74 : SAL_DLLPRIVATE virtual FmFormObj* Clone() const SAL_OVERRIDE;
75 : // #116235# virtual SdrObject* Clone(SdrPage* pPage, SdrModel* pModel) const;
76 : SAL_DLLPRIVATE FmFormObj& operator= (const FmFormObj& rObj);
77 :
78 : SAL_DLLPRIVATE virtual void SetModel(SdrModel* pNewModel) SAL_OVERRIDE;
79 :
80 : SAL_DLLPRIVATE virtual void clonedFrom(const FmFormObj* _pSource);
81 :
82 : SAL_DLLPRIVATE static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> ensureModelEnv(
83 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rSourceContainer,
84 : const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForms>& _rTopLevelDestContainer);
85 :
86 : /** returns the FmFormObj behind the given SdrObject
87 :
88 : In case the SdrObject *is* an FmFormObject, this is a simple cast. In case the SdrObject
89 : is a virtual object whose referenced object is an FmFormObj, then this referenced
90 : object is returned. In all other cases, NULL is returned.
91 : */
92 : SAL_DLLPRIVATE static FmFormObj* GetFormObject( SdrObject* _pSdrObject );
93 : SAL_DLLPRIVATE static const FmFormObj* GetFormObject( const SdrObject* _pSdrObject );
94 :
95 : SAL_DLLPRIVATE virtual void SetUnoControlModel( const ::com::sun::star::uno::Reference< com::sun::star::awt::XControlModel >& _rxModel ) SAL_OVERRIDE;
96 :
97 : protected:
98 : SAL_DLLPRIVATE virtual bool EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd ) SAL_OVERRIDE;
99 : SAL_DLLPRIVATE virtual void BrkCreate( SdrDragStat& rStat ) SAL_OVERRIDE;
100 :
101 : // #i70852# overload Layer interface to force to FormColtrol layer
102 : SAL_DLLPRIVATE virtual SdrLayerID GetLayer() const SAL_OVERRIDE;
103 : SAL_DLLPRIVATE virtual void NbcSetLayer(SdrLayerID nLayer) SAL_OVERRIDE;
104 :
105 : private:
106 : /** isolates the control model from its form component hierarchy, i.e. removes it from
107 : its parent.
108 : */
109 : SAL_DLLPRIVATE void impl_isolateControlModel_nothrow();
110 :
111 : /** forwards the reference device of our SdrModel to the control model
112 : */
113 : SAL_DLLPRIVATE void impl_checkRefDevice_nothrow( bool _force = false );
114 : };
115 :
116 :
117 : #endif // _FM_FMOBJ_HXX
118 :
119 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|