1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_SOURCE_UI_VBA_VBAFORMATCONDITIONS_HXX
21 #define INCLUDED_SC_SOURCE_UI_VBA_VBAFORMATCONDITIONS_HXX
23 #include <ooo/vba/excel/XFormatConditions.hpp>
24 #include <vbahelper/vbacollectionimpl.hxx>
26 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{ class XPropertySet
; } } } }
27 namespace com
{ namespace sun
{ namespace star
{ namespace sheet
{ class XSheetConditionalEntries
; } } } }
28 namespace ooo
{ namespace vba
{ namespace excel
{ class XRange
; } } }
29 namespace ooo
{ namespace vba
{ namespace excel
{ class XStyle
; } } }
30 namespace ooo
{ namespace vba
{ namespace excel
{ class XStyles
; } } }
32 // This class is used only as a target for casting, it seems,
33 // and no objects of this type are created as such, I think.
35 class ScVbaFormatConditions
: public CollTestImplHelper
< ov::excel::XFormatConditions
>
37 css::uno::Reference
< css::sheet::XSheetConditionalEntries
> mxSheetConditionalEntries
;
38 css::uno::Reference
< ov::excel::XStyles
> mxStyles
;
39 css::uno::Reference
< ov::excel::XRange
> mxRangeParent
;
40 css::uno::Reference
< css::beans::XPropertySet
> mxParentRangePropertySet
;
42 /// @throws css::script::BasicErrorException
44 /// @throws css::script::BasicErrorException
45 /// @throws css::uno::RuntimeException
46 css::uno::Reference
< ov::excel::XFormatCondition
> Add( ::sal_Int32 Type
, const css::uno::Any
& Operator
, const css::uno::Any
& Formula1
, const css::uno::Any
& Formula2
, const css::uno::Reference
< ov::excel::XStyle
>& _xCalcStyle
);
47 /// @throws css::script::BasicErrorException
48 static OUString
getA1Formula(const css::uno::Any
& _aFormula
);
49 OUString
getStyleName();
50 /// @throws css::script::BasicErrorException
51 void removeFormatCondition( const OUString
& _sStyleName
, bool _bRemoveStyle
);
52 const css::uno::Reference
< css::sheet::XSheetConditionalEntries
>& getSheetConditionalEntries() const { return mxSheetConditionalEntries
; }
54 virtual void SAL_CALL
Delete( ) override
;
55 virtual css::uno::Reference
< ov::excel::XFormatCondition
> SAL_CALL
Add( ::sal_Int32 Type
, const css::uno::Any
& Operator
, const css::uno::Any
& Formula1
, const css::uno::Any
& Formula2
) override
;
57 virtual css::uno::Type SAL_CALL
getElementType() override
;
58 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
createEnumeration() override
;
59 virtual css::uno::Any
createCollectionObject(const css::uno::Any
&) override
;
61 virtual OUString
getServiceImplName() override
;
62 virtual css::uno::Sequence
<OUString
> getServiceNames() override
;
64 ScVbaFormatConditions() = delete;
67 #endif // INCLUDED_SC_SOURCE_UI_VBA_VBAFORMATCONDITIONS_HXX
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */