LibreOffice Module svx (master)  1
fmobj.hxx
Go to the documentation of this file.
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 
31 {
32  FmFormObj( const FmFormObj& ) = delete;
33 
34  css::uno::Sequence< css::script::ScriptEventDescriptor > aEvts; // events of the object
35  css::uno::Sequence< css::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  // information for the control environment is only maintained if an object is not in an
40  // object list
41  css::uno::Reference< css::container::XIndexContainer> m_xParent;
42  css::uno::Reference< css::form::XForms > m_xEnvironmentHistory;
43  sal_Int32 m_nPos;
44 
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 protected:
50  // protected destructor
51  SAL_DLLPRIVATE virtual ~FmFormObj() override;
52 
53 public:
54  FmFormObj(
55  SdrModel& rSdrModel,
56  const OUString& rModelName);
57  FmFormObj(SdrModel& rSdrModel);
58 
59  SAL_DLLPRIVATE const css::uno::Reference< css::container::XIndexContainer>&
60  GetOriginalParent() const { return m_xParent; }
61  SAL_DLLPRIVATE const css::uno::Sequence< css::script::ScriptEventDescriptor >&
62  GetOriginalEvents() const { return aEvts; }
63  SAL_DLLPRIVATE sal_Int32
64  GetOriginalIndex() const { return m_nPos; }
65 
66  SAL_DLLPRIVATE void SetObjEnv(
67  const css::uno::Reference< css::container::XIndexContainer>& xForm,
68  const sal_Int32 nIdx,
69  const css::uno::Sequence< css::script::ScriptEventDescriptor >& rEvts );
70  SAL_DLLPRIVATE void ClearObjEnv();
71 
72 public:
73  // react on page change
74  virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override;
75 
76  SAL_DLLPRIVATE virtual SdrInventor GetObjInventor() const override;
77  SAL_DLLPRIVATE virtual sal_uInt16 GetObjIdentifier() const override;
78  SAL_DLLPRIVATE virtual void NbcReformatText() override;
79 
80  SAL_DLLPRIVATE virtual FmFormObj* CloneSdrObject(SdrModel& rTargetModel) const override;
81  SAL_DLLPRIVATE FmFormObj& operator= (const FmFormObj& rObj);
82 
83  SAL_DLLPRIVATE void clonedFrom(const FmFormObj* _pSource);
84 
85  SAL_DLLPRIVATE static css::uno::Reference< css::uno::XInterface> ensureModelEnv(
86  const css::uno::Reference< css::uno::XInterface>& _rSourceContainer,
87  const css::uno::Reference< css::form::XForms>& _rTopLevelDestContainer);
88 
95  SAL_DLLPRIVATE static FmFormObj* GetFormObject( SdrObject* _pSdrObject );
96  SAL_DLLPRIVATE static const FmFormObj* GetFormObject( const SdrObject* _pSdrObject );
97 
98  SAL_DLLPRIVATE virtual void SetUnoControlModel( const css::uno::Reference< css::awt::XControlModel >& _rxModel ) override;
99 
100 protected:
101  SAL_DLLPRIVATE virtual bool EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd ) override;
102  SAL_DLLPRIVATE virtual void BrkCreate( SdrDragStat& rStat ) override;
103 
104 private:
108  SAL_DLLPRIVATE void impl_isolateControlModel_nothrow();
109 
112  SAL_DLLPRIVATE void impl_checkRefDevice_nothrow( bool _force = false );
113 };
114 
115 
116 #endif // _FM_FMOBJ_HXX
117 
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPRIVATE const css::uno::Sequence< css::script::ScriptEventDescriptor > & GetOriginalEvents() const
Definition: fmobj.hxx:62
css::uno::Reference< css::form::XForms > m_xEnvironmentHistory
Definition: fmobj.hxx:42
SdrUnoObj & operator=(const SdrUnoObj &rObj)
Definition: svdouno.cxx:264
SdrInventor
Definition: svdobj.hxx:152
sal_Int32 m_nPos
Definition: fmobj.hxx:43
virtual void NbcReformatText() override
Definition: svdotext.cxx:1417
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
SAL_DLLPRIVATE const css::uno::Reference< css::container::XIndexContainer > & GetOriginalParent() const
Definition: fmobj.hxx:60
virtual void handlePageChange(SdrPage *pOldPage, SdrPage *pNewPage) override
Definition: svdotext.cxx:459
css::uno::Sequence< css::script::ScriptEventDescriptor > m_aEventsHistory
Definition: fmobj.hxx:35
virtual void BrkCreate(SdrDragStat &rStat) override
Definition: svdotxdr.cxx:221
virtual void SetUnoControlModel(const css::uno::Reference< css::awt::XControlModel > &xModel)
Definition: svdouno.cxx:438
size_t const m_nPos
Definition: filtnav.cxx:193
Abstract DrawObject.
Definition: svdobj.hxx:312
virtual SdrInventor GetObjInventor() const
Definition: svdobj.cxx:580
virtual sal_uInt16 GetObjIdentifier() const override
Definition: svdouno.cxx:220
VclPtr< OutputDevice > m_pLastKnownRefDevice
Definition: fmobj.hxx:45
SAL_DLLPRIVATE sal_Int32 GetOriginalIndex() const
Definition: fmobj.hxx:64
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: svdotxdr.cxx:207
css::uno::Sequence< css::script::ScriptEventDescriptor > aEvts
Definition: fmobj.hxx:34
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:366
SdrCreateCmd
Definition: svdtypes.hxx:27
virtual SdrUnoObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdouno.cxx:259
css::uno::Reference< css::container::XIndexContainer > m_xParent
Definition: fmobj.hxx:41