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