LibreOffice Module reportdesign (master) 1
ImageControl.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_REPORTDESIGN_SOURCE_CORE_INC_IMAGECONTROL_HXX
20#define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_IMAGECONTROL_HXX
21
22#include <comphelper/uno3.hxx>
24#include <com/sun/star/report/XImageControl.hpp>
28#include <com/sun/star/lang/XServiceInfo.hpp>
30
31namespace reportdesign
32{
33 typedef ::cppu::PropertySetMixin< css::report::XImageControl > ImageControlPropertySet;
34 typedef ::cppu::WeakComponentImplHelper< css::report::XImageControl
35 ,css::lang::XServiceInfo > ImageControlBase;
36
42 public ImageControlBase,
44 {
45 friend class OShapeHelper;
47 OUString m_aImageURL;
48 sal_Int16 m_nScaleMode;
50 private:
51 OImageControl(const OImageControl&) = delete;
53
54 template <typename T> void set( const OUString& _sProperty
55 ,const T& Value
56 ,T& _member)
57 {
58 BoundListeners l;
59 {
60 ::osl::MutexGuard aGuard(m_aMutex);
61 prepareSet(_sProperty, css::uno::Any(_member), css::uno::Any(Value), &l);
62 _member = Value;
63 }
64 l.notify();
65 }
66 void set( const OUString& _sProperty
67 ,bool Value
68 ,bool& _member)
69 {
70 BoundListeners l;
71 {
72 ::osl::MutexGuard aGuard(m_aMutex);
73 prepareSet(_sProperty, css::uno::Any(_member), css::uno::Any(Value), &l);
74 _member = Value;
75 }
76 l.notify();
77 }
78 protected:
79 virtual ~OImageControl() override;
80 public:
81 explicit OImageControl(css::uno::Reference< css::uno::XComponentContext > const & _xContext);
82 explicit OImageControl(css::uno::Reference< css::uno::XComponentContext > const & _xContext
83 ,const css::uno::Reference< css::lang::XMultiServiceFactory > & _xFactory
84 ,css::uno::Reference< css::drawing::XShape >& _xShape);
85
87 // css::lang::XServiceInfo
88 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
89 virtual OUString SAL_CALL getImplementationName( ) override;
90 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
91
93 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
95 static OUString getImplementationName_Static();
96 static css::uno::Reference< css::uno::XInterface >
97 create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
98 // css::beans::XPropertySet
99 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
100 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
101 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
102 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
103 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
104 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
105 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
106
107 // XReportComponent
109 // XShape
111
112 // XShapeDescriptor
113 virtual OUString SAL_CALL getShapeType( ) override;
114
115 // XReportControlModel
117
118 // XReportControlFormat
120
121 // XCloneable
122 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
123
124 // XImageControl
125 virtual OUString SAL_CALL getImageURL() override;
126 virtual void SAL_CALL setImageURL( const OUString& _imageurl ) override;
127 virtual sal_Bool SAL_CALL getPreserveIRI() override;
128 virtual void SAL_CALL setPreserveIRI( sal_Bool _preserveiri ) override;
129 virtual ::sal_Int16 SAL_CALL getScaleMode() override;
130 virtual void SAL_CALL setScaleMode( ::sal_Int16 _scalemode ) override;
131
132 // XImageProducerSupplier
133 virtual css::uno::Reference< css::awt::XImageProducer > SAL_CALL getImageProducer( ) override;
134
135 // XComponent
136 virtual void SAL_CALL dispose() override;
137 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
138 {
139 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
140 }
141 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
142 {
143 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
144 }
145
146 // XChild
147 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
148 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
149 // XContainer
150 virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
151 virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
152
153 // XElementAccess
154 virtual css::uno::Type SAL_CALL getElementType( ) override;
155 virtual sal_Bool SAL_CALL hasElements( ) override;
156
157 // XIndexReplace
158 virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
159
160 // XIndexContainer
161 virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const css::uno::Any& Element ) override;
162 virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) override;
163
164 // XIndexAccess
165 virtual ::sal_Int32 SAL_CALL getCount( ) override;
166 virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) override;
167 };
168}
169#endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_IMAGECONTROL_HXX
170
171/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
#define REPORTCONTROLMODEL_HEADER()
#define SHAPE_HEADER()
#define REPORTCONTROLFORMAT_HEADER()
#define REPORTCOMPONENT_HEADER()
mutable::osl::Mutex m_aMutex
void prepareSet(rtl::OUString const &propertyName, css::uno::Any const &oldValue, css::uno::Any const &newValue, BoundListeners *boundListeners)
implementation of a
virtual void SAL_CALL replaceByIndex(::sal_Int32 Index, const css::uno::Any &Element) override
virtual OUString SAL_CALL getShapeType() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
OImageControl(const OImageControl &)=delete
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
static OUString getImplementationName_Static()
virtual void SAL_CALL removeByIndex(::sal_Int32 Index) override
virtual ~OImageControl() override
virtual css::uno::Reference< css::awt::XImageProducer > SAL_CALL getImageProducer() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
OReportControlModel m_aProps
OImageControl & operator=(const OImageControl &)=delete
virtual sal_Bool SAL_CALL getPreserveIRI() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
virtual ::sal_Int16 SAL_CALL getScaleMode() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL setScaleMode(::sal_Int16 _scalemode) override
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual void SAL_CALL insertByIndex(::sal_Int32 Index, const css::uno::Any &Element) override
virtual sal_Bool SAL_CALL hasElements() override
virtual void SAL_CALL setImageURL(const OUString &_imageurl) override
virtual OUString SAL_CALL getImageURL() override
void set(const OUString &_sProperty, const T &Value, T &_member)
OImageControl(css::uno::Reference< css::uno::XComponentContext > const &_xContext)
virtual ::sal_Int32 SAL_CALL getCount() override
OImageControl(css::uno::Reference< css::uno::XComponentContext > const &_xContext, const css::uno::Reference< css::lang::XMultiServiceFactory > &_xFactory, css::uno::Reference< css::drawing::XShape > &_xShape)
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
virtual void SAL_CALL setPreserveIRI(sal_Bool _preserveiri) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
static css::uno::Reference< css::uno::XInterface > create(css::uno::Reference< css::uno::XComponentContext > const &xContext)
virtual css::uno::Any SAL_CALL getByIndex(::sal_Int32 Index) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
void set(const OUString &_sProperty, bool Value, bool &_member)
virtual void SAL_CALL dispose() override
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
Value
::cppu::PropertySetMixin< css::report::XImageControl > ImageControlPropertySet
::cppu::WeakComponentImplHelper< css::report::XImageControl,css::lang::XServiceInfo > ImageControlBase
unsigned char sal_Bool
#define DECLARE_XINTERFACE()