LibreOffice Module sc (master)  1
vbaformatconditions.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 
20 #pragma once
21 
22 #include <ooo/vba/excel/XFormatConditions.hpp>
24 
25 namespace com::sun::star::beans { class XPropertySet; }
26 namespace com::sun::star::sheet { class XSheetConditionalEntries; }
27 namespace ooo::vba::excel { class XRange; }
28 namespace ooo::vba::excel { class XStyle; }
29 namespace ooo::vba::excel { class XStyles; }
30 
31 // This class is used only as a target for casting, it seems,
32 // and no objects of this type are created as such, I think.
33 
34 class ScVbaFormatConditions: public CollTestImplHelper< ov::excel::XFormatConditions >
35 {
36  css::uno::Reference< css::sheet::XSheetConditionalEntries > mxSheetConditionalEntries;
37  css::uno::Reference< ov::excel::XStyles > mxStyles;
38  css::uno::Reference< ov::excel::XRange > mxRangeParent;
39  css::uno::Reference< css::beans::XPropertySet > mxParentRangePropertySet;
40 public:
42  void notifyRange();
45  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  static OUString getA1Formula(const css::uno::Any& _aFormula);
48  OUString getStyleName();
50  void removeFormatCondition( const OUString& _sStyleName, bool _bRemoveStyle);
51  const css::uno::Reference< css::sheet::XSheetConditionalEntries >& getSheetConditionalEntries() const { return mxSheetConditionalEntries; }
52  // XFormatConditions
53  virtual void SAL_CALL Delete( ) override;
54  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;
55  // XEnumerationAccess
56  virtual css::uno::Type SAL_CALL getElementType() override;
57  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
58  virtual css::uno::Any createCollectionObject(const css::uno::Any&) override;
59  // XHelperInterface
60  virtual OUString getServiceImplName() override;
61  virtual css::uno::Sequence<OUString> getServiceNames() override;
62 
63  ScVbaFormatConditions() = delete;
64 };
65 
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Type
css::uno::Reference< css::beans::XPropertySet > mxParentRangePropertySet
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)
virtual OUString getServiceImplName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
void removeFormatCondition(const OUString &_sStyleName, bool _bRemoveStyle)
ScVbaFormatConditions()=delete
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
css::uno::Reference< ov::excel::XRange > mxRangeParent
virtual css::uno::Any createCollectionObject(const css::uno::Any &) override
virtual css::uno::Type SAL_CALL getElementType() override
class SAL_NO_VTABLE XPropertySet
virtual void SAL_CALL Delete() override
css::uno::Reference< ov::excel::XStyles > mxStyles
css::uno::Reference< css::sheet::XSheetConditionalEntries > mxSheetConditionalEntries
const css::uno::Reference< css::sheet::XSheetConditionalEntries > & getSheetConditionalEntries() const
static OUString getA1Formula(const css::uno::Any &_aFormula)