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#pragma once
21
22#include <com/sun/star/awt/XControlModel.hpp>
23#include <com/sun/star/awt/XControl.hpp>
24#include <com/sun/star/lang/XMultiServiceFactory.hpp>
25#include <com/sun/star/awt/XControlContainer.hpp>
26#include <svx/svxdllapi.h>
27#include <svx/svdorect.hxx>
28#include <memory>
29
30
31// Forward declaration
32class SdrView;
33class SdrPageWindow;
35
36namespace sdr::contact {
37 class ViewContactOfUnoControl;
38}
39
40
41// SdrUnoObj
44{
45 friend class SdrPageView;
47
48 std::unique_ptr<SdrUnoObjDataHolder> m_pImpl;
49
52
53protected:
54 css::uno::Reference< css::awt::XControlModel > xUnoControlModel; // Can also be set from outside
55
56private:
57 SVX_DLLPRIVATE void CreateUnoControlModel(const OUString& rModelName);
58 SVX_DLLPRIVATE void CreateUnoControlModel(const OUString& rModelName,
59 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac );
60
61public:
62 explicit SdrUnoObj(
63 SdrModel& rSdrModel,
64 const OUString& rModelName);
65 // Copy constructor
66 SdrUnoObj(SdrModel& rSdrModel, SdrUnoObj const & rSource);
68 SdrModel& rSdrModel,
69 const OUString& rModelName,
70 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac);
71 virtual ~SdrUnoObj() override;
72
73 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
74 virtual SdrObjKind GetObjIdentifier() const override;
75
76 virtual rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override;
77 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
78 virtual void NbcSetLayer(SdrLayerID nLayer) override;
79
80 // SpecialDrag support
81 virtual bool hasSpecialDrag() const override;
82
83 virtual OUString TakeObjNameSingul() const override;
84 virtual OUString TakeObjNamePlural() const override;
85
86 virtual void SetContextWritingMode( const sal_Int16 _nContextWritingMode ) override;
87
88 const css::uno::Reference< css::awt::XControlModel >& GetUnoControlModel() const {return xUnoControlModel;}
89 css::uno::Reference< css::awt::XControl > GetUnoControl(const SdrView& _rView, const OutputDevice& _rOut) const;
90
115 css::uno::Reference< css::awt::XControl >
116 GetTemporaryControlForWindow(
117 const vcl::Window& _rWindow,
118 css::uno::Reference< css::awt::XControlContainer >& _inout_ControlContainer
119 ) const;
120
121 const OUString& GetUnoControlTypeName() const { return aUnoControlTypeName; }
122 const OUString& getUnoControlModelTypeName() const { return aUnoControlModelTypeName; }
123
124 virtual void SetUnoControlModel( const css::uno::Reference< css::awt::XControlModel >& xModel );
125
126protected:
127 // SdrObject overridables
128 virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override;
129
130private:
139 SVX_DLLPRIVATE bool impl_getViewContact( sdr::contact::ViewContactOfUnoControl*& _out_rpContact ) const;
140};
141
142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provides information about various ZObject properties.
Definition: svdobj.hxx:197
virtual void NbcSetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:662
virtual void SetContextWritingMode(const sal_Int16 _nContextWritingMode)
Definition: svdobj.cxx:3076
Rectangle objects (rectangle, circle, ...)
Definition: svdorect.hxx:39
virtual bool hasSpecialDrag() const override
The standard transformations (Move,Resize,Rotate,Mirror,Shear) are taken over by the View (TakeXorPol...
Definition: svdorect.cxx:342
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: svdorect.cxx:451
virtual SdrObjKind GetObjIdentifier() const override
Definition: svdorect.cxx:171
virtual OUString TakeObjNamePlural() const override
Definition: svdorect.cxx:226
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const override
Definition: svdorect.cxx:247
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const override
Definition: svdorect.cxx:145
virtual OUString TakeObjNameSingul() const override
Definition: svdorect.cxx:200
virtual std::unique_ptr< sdr::contact::ViewContact > CreateObjectSpecificViewContact() override
Definition: svdorect.cxx:47
SVX_DLLPRIVATE void CreateUnoControlModel(const OUString &rModelName, const css::uno::Reference< css::lang::XMultiServiceFactory > &rxSFac)
css::uno::Reference< css::awt::XControlModel > xUnoControlModel
Definition: svdouno.hxx:54
OUString aUnoControlTypeName
Definition: svdouno.hxx:51
OUString aUnoControlModelTypeName
Definition: svdouno.hxx:50
const OUString & GetUnoControlTypeName() const
Definition: svdouno.hxx:121
std::unique_ptr< SdrUnoObjDataHolder > m_pImpl
Definition: svdouno.hxx:48
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
Definition: svdouno.hxx:88
const OUString & getUnoControlModelTypeName() const
Definition: svdouno.hxx:122
SdrUnoObj(SdrModel &rSdrModel, const OUString &rModelName, const css::uno::Reference< css::lang::XMultiServiceFactory > &rxSFac)
SdrObjKind
Definition: svdobjkind.hxx:25
#define SVX_DLLPRIVATE
Definition: svxdllapi.h:30
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35