/* -*- 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/. */ #ifndef INCLUDED_SC_SOURCE_UI_INC_CONDFORMATUNO_HXX #define INCLUDED_SC_SOURCE_UI_INC_CONDFORMATUNO_HXX #include "address.hxx" #include #include #include #include #include #include #include #include #include #include #include class ScDocument; 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 { namespace sun { namespace star { namespace sheet { class XSheetCellRanges; } } } } class ScCondFormatsObj : public cppu::WeakImplHelper, public SfxListener { public: ScCondFormatsObj(ScDocShell* pDocShell, SCTAB nTab); virtual ~ScCondFormatsObj(); virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; // XConditionalFormats virtual sal_Int32 SAL_CALL createByRange(const uno::Reference& xRanges) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeByID( const sal_Int32 nID ) throw(css::uno::RuntimeException, std::exception) override; virtual uno::Sequence< uno::Reference< sheet::XConditionalFormat > > SAL_CALL getConditionalFormats() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Int32 SAL_CALL getLength() throw(css::uno::RuntimeException, std::exception) override; ScConditionalFormatList* getCoreObject(); private: SCTAB mnTab; ScDocShell* mpDocShell; }; class ScCondFormatObj : public cppu::WeakImplHelper { public: ScCondFormatObj(ScDocShell* pDocShell, rtl::Reference const & xCondFormats, sal_Int32 nKey); virtual ~ScCondFormatObj(); ScDocShell* getDocShell(); // XConditionalFormat virtual void SAL_CALL createEntry(const sal_Int32 nType, const sal_Int32 nPos) throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeByIndex(const sal_Int32 nIndex) throw(css::uno::RuntimeException, std::exception) override; // XIndexAccess virtual uno::Type SAL_CALL getElementType() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException, std::exception) override; virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException, std::exception) override; virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 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(); ScCondFormatEntry* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; private: ScDocShell* mpDocShell; rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScCondFormatEntry* mpFormat; }; class ScColorScaleFormatObj : public cppu::WeakImplHelper { public: ScColorScaleFormatObj(rtl::Reference const & xParent, const ScColorScaleFormat* pFormat); virtual ~ScColorScaleFormatObj(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; ScColorScaleFormat* getCoreObject(); // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScColorScaleFormat* mpFormat; }; class ScColorScaleEntryObj : public cppu::WeakImplHelper { public: ScColorScaleEntryObj(rtl::Reference const & xParent, size_t nPos); virtual ~ScColorScaleEntryObj(); virtual css::util::Color SAL_CALL getColor() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setColor(css::util::Color aColor) throw(css::uno::RuntimeException, std::exception) override; virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setType(sal_Int32 nType) throw(css::uno::RuntimeException, std::exception) override; virtual OUString SAL_CALL getFormula() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setFormula(const OUString& rString) throw(css::uno::RuntimeException, std::exception) override; private: ScColorScaleEntry* getCoreObject(); rtl::Reference mxParent; size_t mnPos; }; class ScDataBarFormatObj : public cppu::WeakImplHelper { public: ScDataBarFormatObj(rtl::Reference const & xParent, const ScDataBarFormat* pFormat); virtual ~ScDataBarFormatObj(); ScDataBarFormat* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScDataBarFormat* mpFormat; }; class ScDataBarEntryObj : public cppu::WeakImplHelper { public: ScDataBarEntryObj(rtl::Reference const & xParent, size_t nPos); virtual ~ScDataBarEntryObj(); virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setType(sal_Int32 nType) throw(css::uno::RuntimeException, std::exception) override; virtual OUString SAL_CALL getFormula() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setFormula(const OUString& rString) throw(css::uno::RuntimeException, std::exception) override; private: ScColorScaleEntry* getCoreObject(); rtl::Reference mxParent; size_t mnPos; }; class ScIconSetFormatObj : public cppu::WeakImplHelper { public: ScIconSetFormatObj(rtl::Reference const & xParent, const ScIconSetFormat* pFormat); virtual ~ScIconSetFormatObj(); ScIconSetFormat* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScIconSetFormat* mpFormat; }; class ScIconSetEntryObj : public cppu::WeakImplHelper { public: ScIconSetEntryObj(rtl::Reference const & xParent, size_t nPos); virtual ~ScIconSetEntryObj(); virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setType(sal_Int32 nType) throw(css::uno::RuntimeException, std::exception) override; virtual OUString SAL_CALL getFormula() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setFormula(const OUString& rString) throw(css::uno::RuntimeException, std::exception) override; private: ScColorScaleEntry* getCoreObject(); rtl::Reference mxParent; size_t mnPos; }; class ScCondDateFormatObj : public cppu::WeakImplHelper { public: ScCondDateFormatObj(rtl::Reference const & xParent, const ScCondDateFormatEntry* pFormat); virtual ~ScCondDateFormatObj(); ScCondDateFormatEntry* getCoreObject(); // XConditionEntry virtual sal_Int32 SAL_CALL getType() throw(css::uno::RuntimeException, std::exception) override; // XPropertySet virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) throw(css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; private: rtl::Reference mxParent; SfxItemPropertySet maPropSet; const ScCondDateFormatEntry* mpFormat; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */