LibreOffice Module svx (master)  1
svdouno.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 
20 #ifndef INCLUDED_SVX_SVDOUNO_HXX
21 #define INCLUDED_SVX_SVDOUNO_HXX
22 
23 #include <com/sun/star/awt/XControlModel.hpp>
24 #include <com/sun/star/awt/XControl.hpp>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/awt/XControlContainer.hpp>
27 #include <svx/svxdllapi.h>
28 #include <svx/svdorect.hxx>
29 #include <memory>
30 
31 
32 // Forward declaration
33 class SdrView;
34 class SdrPageWindow;
36 
37 namespace sdr { namespace contact {
38  class ViewContactOfUnoControl;
39 }}
40 
41 
42 // SdrUnoObj
43 struct SdrUnoObjDataHolder;
45 {
46  friend class SdrPageView;
48 
49  std::unique_ptr<SdrUnoObjDataHolder> m_pImpl;
50 
53 
54 protected:
55  css::uno::Reference< css::awt::XControlModel > xUnoControlModel; // Can also be set from outside
56 
57 private:
58  SVX_DLLPRIVATE void CreateUnoControlModel(const OUString& rModelName);
59  SVX_DLLPRIVATE void CreateUnoControlModel(const OUString& rModelName,
60  const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac );
61 
62 protected:
63  // protected destructor
64  virtual ~SdrUnoObj() override;
65 
66 public:
67  explicit SdrUnoObj(
68  SdrModel& rSdrModel,
69  const OUString& rModelName);
70  SdrUnoObj(
71  SdrModel& rSdrModel,
72  const OUString& rModelName,
73  const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac);
74 
75  virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
76  virtual sal_uInt16 GetObjIdentifier() const override;
77 
78  virtual SdrUnoObj* CloneSdrObject(SdrModel& rTargetModel) const override;
79  SdrUnoObj& operator= (const SdrUnoObj& rObj);
80  virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
81  virtual void NbcSetLayer(SdrLayerID nLayer) override;
82 
83  // SpecialDrag support
84  virtual bool hasSpecialDrag() const override;
85 
86  virtual OUString TakeObjNameSingul() const override;
87  virtual OUString TakeObjNamePlural() const override;
88 
89  virtual void SetContextWritingMode( const sal_Int16 _nContextWritingMode ) override;
90 
91  const css::uno::Reference< css::awt::XControlModel >& GetUnoControlModel() const {return xUnoControlModel;}
92  css::uno::Reference< css::awt::XControl > GetUnoControl(const SdrView& _rView, const OutputDevice& _rOut) const;
93 
118  css::uno::Reference< css::awt::XControl >
119  GetTemporaryControlForWindow(
120  const vcl::Window& _rWindow,
121  css::uno::Reference< css::awt::XControlContainer >& _inout_ControlContainer
122  ) const;
123 
124  const OUString& GetUnoControlTypeName() const { return aUnoControlTypeName; }
125 
126  virtual void SetUnoControlModel( const css::uno::Reference< css::awt::XControlModel >& xModel );
127 
128 protected:
129  // SdrObject overridables
130  virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
131 
132 private:
141  SVX_DLLPRIVATE bool impl_getViewContact( sdr::contact::ViewContactOfUnoControl*& _out_rpContact ) const;
142 };
143 
144 #endif // INCLUDED_SVX_SVDOUNO_HXX
145 
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString TakeObjNameSingul() const override
Definition: svdorect.cxx:204
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
Provides information about various ZObject properties.
Definition: svdobj.hxx:248
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdorect.cxx:368
OUString aUnoControlTypeName
Definition: svdouno.hxx:52
const OUString & GetUnoControlTypeName() const
Definition: svdouno.hxx:124
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdorect.cxx:150
virtual SdrRectObj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdorect.cxx:258
SdrRectObj & operator=(const SdrRectObj &rCopy)
Definition: svdorect.cxx:263
std::unique_ptr< SdrUnoObjDataHolder > m_pImpl
Definition: svdouno.hxx:49
virtual sal_uInt16 GetObjIdentifier() const override
Definition: svdorect.cxx:176
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdorect.cxx:59
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdorect.cxx:479
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
Definition: svdouno.hxx:91
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode)
Definition: svdobj.cxx:2999
css::uno::Reference< css::awt::XControlModel > xUnoControlModel
Definition: svdouno.hxx:55
#define SVX_DLLPRIVATE
Definition: svxdllapi.h:30
OUString aUnoControlModelTypeName
Definition: svdouno.hxx:51
virtual OUString TakeObjNamePlural() const override
Definition: svdorect.cxx:237
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:621