/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include class ScDocShell; class ScConditionalFormatList; class ScConditionalFormat; class ScIconSetFormat; class ScDataBarFormat; class ScColorScaleFormat; class ScCondFormatEntry; class ScColorScaleEntry; class ScCondDateFormatEntry; using namespace com::sun::star; namespace com::sun::star::sheet { class XSheetCellRanges; } class ScCondFormatsObj : public cppu::WeakImplHelper, public SfxListener { public: ScCondFormatsObj(ScDocShell* pDocShell, SCTAB nTab); virtual ~ScCondFormatsObj() override; virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; // XConditionalFormats virtual sal_Int32 SAL_CALL createByRange(const uno::Reference& xRanges) override; virtual void SAL_CALL removeByID( const sal_Int32 nID ) override; virtual uno::Sequence< uno::Reference< sheet::XConditionalFormat > > SAL_CALL getConditionalFormats() override; virtual sal_Int32 SAL_CALL getLength() override; ScConditionalFormatList* getCoreObject(); private: SCTAB mnTab; ScDocShell* mpDocShell; }; class ScCondFormatObj : public cppu::WeakImplHelper { public: ScCondFormatObj(ScDocShell* pDocShell, rtl::Reference xCondFormats, sal_Int32 nKey); virtual ~ScCondFormatObj() override; ScDocShell* getDocShell(); // XConditionalFormat virtual void SAL_CALL createEntry(const sal_Int32 nType, const sal_Int32 nPos) override; virtual void SAL_CALL removeByIndex(const sal_Int32 nIndex) override; // XIndexAccess virtual uno::Type SAL_CALL getElementType() override; virtual sal_Bool SAL_CALL hasElements() override; virtual sal_Int32 SAL_CALL getCount() override; virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; ScConditionalFormat* getCoreObject(); private: rtl::Reference mxCondFormatList; ScDocShell* mpDocShell; SfxItemPropertySet maPropSet; sal_Int32 mnKey; }; class ScConditionEntryObj : public cppu::WeakImplHelper { public: ScConditionEntryObj(rtl::Reference const & xParent, const ScCondFormatEntry* pFormat); virtual ~ScConditionEntryObj() override; ScCondFormatEntry* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; private: ScDocShell* mpDocShell; rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScCondFormatEntry* mpFormat; }; class ScColorScaleFormatObj : public cppu::WeakImplHelper { public: ScColorScaleFormatObj(rtl::Reference xParent, const ScColorScaleFormat* pFormat); virtual ~ScColorScaleFormatObj() override; // XConditionEntry virtual sal_Int32 SAL_CALL getType() override; ScColorScaleFormat* getCoreObject(); // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScColorScaleFormat* mpFormat; }; class ScColorScaleEntryObj : public cppu::WeakImplHelper { public: ScColorScaleEntryObj(rtl::Reference xParent, size_t nPos); virtual ~ScColorScaleEntryObj() override; virtual sal_Int32 SAL_CALL getColor() override; virtual void SAL_CALL setColor(sal_Int32 aColor) override; virtual sal_Int32 SAL_CALL getType() override; virtual void SAL_CALL setType(sal_Int32 nType) override; virtual OUString SAL_CALL getFormula() override; virtual void SAL_CALL setFormula(const OUString& rString) override; private: ScColorScaleEntry* getCoreObject(); rtl::Reference mxParent; size_t mnPos; }; class ScDataBarFormatObj : public cppu::WeakImplHelper { public: ScDataBarFormatObj(rtl::Reference xParent, const ScDataBarFormat* pFormat); virtual ~ScDataBarFormatObj() override; ScDataBarFormat* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScDataBarFormat* mpFormat; }; class ScDataBarEntryObj : public cppu::WeakImplHelper { public: ScDataBarEntryObj(rtl::Reference xParent, size_t nPos); virtual ~ScDataBarEntryObj() override; virtual sal_Int32 SAL_CALL getType() override; virtual void SAL_CALL setType(sal_Int32 nType) override; virtual OUString SAL_CALL getFormula() override; virtual void SAL_CALL setFormula(const OUString& rString) override; private: ScColorScaleEntry* getCoreObject(); rtl::Reference mxParent; size_t mnPos; }; class ScIconSetFormatObj : public cppu::WeakImplHelper { public: ScIconSetFormatObj(rtl::Reference xParent, const ScIconSetFormat* pFormat); virtual ~ScIconSetFormatObj() override; ScIconSetFormat* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScIconSetFormat* mpFormat; }; class ScIconSetEntryObj : public cppu::WeakImplHelper { public: ScIconSetEntryObj(rtl::Reference xParent, size_t nPos); virtual ~ScIconSetEntryObj() override; virtual sal_Int32 SAL_CALL getType() override; virtual void SAL_CALL setType(sal_Int32 nType) override; virtual OUString SAL_CALL getFormula() override; virtual void SAL_CALL setFormula(const OUString& rString) override; private: ScColorScaleEntry* getCoreObject(); rtl::Reference mxParent; size_t mnPos; }; class ScCondDateFormatObj : public cppu::WeakImplHelper { public: ScCondDateFormatObj(rtl::Reference xParent, const ScCondDateFormatEntry* pFormat); virtual ~ScCondDateFormatObj() override; ScCondDateFormatEntry* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScCondDateFormatEntry* mpFormat; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */