1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SC_VBA_FORMATCONDITION_HXX
24 #define SC_VBA_FORMATCONDITION_HXX
25 #include <ooo/vba/excel/XFormatCondition.hpp>
26 #include <ooo/vba/excel/XFormatConditions.hpp>
27 #include <ooo/vba/excel/XStyle.hpp>
28 #include <com/sun/star/frame/XModel.hpp>
29 #include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
30 #include <com/sun/star/sheet/XSheetConditionalEntry.hpp>
31 #include <com/sun/star/sheet/XSheetCondition.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include "vbacondition.hxx"
34 
35 typedef ScVbaCondition< ov::excel::XFormatCondition >  ScVbaFormatCondition_BASE;
36 class ScVbaFormatCondition : public ScVbaFormatCondition_BASE
37 {
38 protected:
39 	rtl::OUString msStyleName;
40 	css::uno::Reference< css::sheet::XSheetConditionalEntry > mxSheetConditionalEntry;
41 	css::uno::Reference< css::sheet::XSheetConditionalEntries > mxSheetConditionalEntries;
42 	css::uno::Reference< ov::excel::XFormatConditions> moFormatConditions;
43 	css::uno::Reference< ov::excel::XStyle > mxStyle;
44 	css::uno::Reference< css::beans::XPropertySet > mxParentRangePropertySet;
45 public:
46 	ScVbaFormatCondition(  const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::sheet::XSheetConditionalEntry >& _xSheetConditionalEntry, const css::uno::Reference< ov::excel::XStyle >&,  const css::uno::Reference< ov::excel::XFormatConditions >& _xFormatConditions, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet ) throw ( css::uno::RuntimeException );
47 
48 	void notifyRange() throw ( css::script::BasicErrorException );
49 	static css::sheet::ConditionOperator retrieveAPIType(sal_Int32 _nVBAType, const css::uno::Reference< css::sheet::XSheetCondition >& _xSheetCondition ) throw( css::script::BasicErrorException );
50 
51 	//Methods
52 	virtual void SAL_CALL Delete(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
53 	virtual void SAL_CALL Modify( ::sal_Int32 Type, const css::uno::Any& Operator, const css::uno::Any& Formula1, const css::uno::Any& Formula2 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
54 	virtual ::sal_Int32 SAL_CALL Type(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
55 	virtual ::sal_Int32 Operator( sal_Bool  ) throw (css::script::BasicErrorException);
56 	virtual ::sal_Int32 SAL_CALL Operator(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
57 	virtual void setFormula1( const css::uno::Any& _aFormula1) throw ( css::script::BasicErrorException );
58 	virtual void setFormula2( const css::uno::Any& _aFormula2) throw ( css::script::BasicErrorException );
59 	virtual css::uno::Reference< ::ooo::vba::excel::XInterior > SAL_CALL Interior(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
60 	virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
61 	virtual css::uno::Reference< ::ooo::vba::excel::XFont > SAL_CALL Font(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
62 	// XHelperInterface
63 	virtual rtl::OUString& getServiceImplName();
64 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
65 };
66 #endif
67