LibreOffice Module sd (master) 1
unopback.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#pragma once
20
21#include <sal/config.h>
22
23#include <memory>
24
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/beans/XPropertyState.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
28
29#include <svl/lstner.hxx>
31
33#include <editeng/unoipset.hxx>
34
35class SdDrawDocument;
36class SdrModel;
37class SfxItemSet;
40
42
43class SdUnoPageBackground final : public ::cppu::WeakImplHelper<
44 css::beans::XPropertySet,
45 css::lang::XServiceInfo,
46 css::beans::XPropertyState>,
47 public SfxListener
48{
51 std::unique_ptr<SfxItemSet> mpSet;
53
54 const SfxItemPropertyMapEntry* getPropertyMapEntry( std::u16string_view rPropertyName ) const noexcept;
55public:
56 SdUnoPageBackground( SdDrawDocument* pDoc = nullptr, const SfxItemSet* pSet = nullptr);
57 virtual ~SdUnoPageBackground() noexcept override;
58
59 // internal
60 void fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet );
61 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
62
63 // XServiceInfo
64 virtual OUString SAL_CALL getImplementationName() override;
65 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
66 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
67
68 // XPropertySet
69 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
70 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
71 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
72 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
73 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
74 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
75 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
76
77 // XPropertyState
78 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
79 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
80 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
81 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
82};
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: unopback.cxx:340
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unopback.cxx:290
virtual ~SdUnoPageBackground() noexcept override
Definition: unopback.cxx:64
SvxItemPropertySetUsrAnys maUsrAnys
Definition: unopback.hxx:50
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unopback.cxx:185
SdUnoPageBackground(SdDrawDocument *pDoc=nullptr, const SfxItemSet *pSet=nullptr)
Definition: unopback.cxx:48
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unopback.cxx:295
const SvxItemPropertySet * mpPropSet
Definition: unopback.hxx:49
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unopback.cxx:289
SdrModel * mpDoc
Definition: unopback.hxx:52
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unopback.cxx:354
const SfxItemPropertyMapEntry * getPropertyMapEntry(std::u16string_view rPropertyName) const noexcept
this is used because our property map is not sorted yet
Definition: unopback.cxx:402
std::unique_ptr< SfxItemSet > mpSet
Definition: unopback.hxx:51
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unopback.cxx:291
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unopback.cxx:174
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unopback.cxx:292
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unopback.cxx:239
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unopback.cxx:180
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unopback.cxx:169
void fillItemSet(SdDrawDocument *pDoc, SfxItemSet &rSet)
Definition: unopback.cxx:87
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unopback.cxx:377
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: unopback.cxx:72
virtual OUString SAL_CALL getImplementationName() override
Definition: unopback.cxx:164
unsigned char sal_Bool
const SvxItemPropertySet * ImplGetPageBackgroundPropertySet()
Definition: unopback.cxx:37