xref: /aoo4110/main/sc/source/ui/vba/vbapagebreak.hxx (revision b1cdbd2c)
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_PAGEBREAK_HXX
24 #define SC_VBA_PAGEBREAK_HXX
25 
26 #include <cppuhelper/implbase1.hxx>
27 #include <ooo/vba/excel/XPageBreak.hpp>
28 #include <ooo/vba/excel/XHPageBreak.hpp>
29 #include <ooo/vba/excel/XVPageBreak.hpp>
30 #include <ooo/vba/excel/XRange.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <com/sun/star/script/BasicErrorException.hpp>
33 #include <com/sun/star/sheet/TablePageBreakData.hpp>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <vbahelper/vbahelperinterface.hxx>
36 
37 template< typename Ifc1 >
38 class ScVbaPageBreak : public InheritedHelperInterfaceImpl1< Ifc1 >
39 {
40 typedef InheritedHelperInterfaceImpl1< Ifc1 > ScVbaPageBreak_BASE;
41 protected:
42 	css::uno::Reference< css::beans::XPropertySet > mxRowColPropertySet;
43     css::sheet::TablePageBreakData maTablePageBreakData;
44 public:
45 	ScVbaPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent,
46                     const css::uno::Reference< css::uno::XComponentContext >& xContext,
47             		css::uno::Reference< css::beans::XPropertySet >& xProps,
48                     css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException);
~ScVbaPageBreak()49 	virtual ~ScVbaPageBreak(){}
50 
51 	virtual sal_Int32 SAL_CALL getType( ) throw (css::uno::RuntimeException);
52     virtual void SAL_CALL setType(sal_Int32 type) throw (css::uno::RuntimeException);
53 
54     virtual void SAL_CALL Delete() throw ( css::script::BasicErrorException, css::uno::RuntimeException);
55     virtual css::uno::Reference< ov::excel::XRange> SAL_CALL Location() throw ( css::script::BasicErrorException, css::uno::RuntimeException);
56 
57 	// XHelperInterface
58 	virtual rtl::OUString& getServiceImplName();
59 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
60 };
61 
62 
63 typedef ScVbaPageBreak < ov::excel::XHPageBreak > ScVbaHPageBreak_BASE;
64 
65 class ScVbaHPageBreak :  public ScVbaHPageBreak_BASE
66 {
67 public:
ScVbaHPageBreak(const css::uno::Reference<ov::XHelperInterface> & xParent,const css::uno::Reference<css::uno::XComponentContext> & xContext,css::uno::Reference<css::beans::XPropertySet> & xProps,css::sheet::TablePageBreakData aTablePageBreakData)68 	ScVbaHPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent,
69                     const css::uno::Reference< css::uno::XComponentContext >& xContext,
70             		css::uno::Reference< css::beans::XPropertySet >& xProps,
71                     css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException):
72               ScVbaHPageBreak_BASE( xParent,xContext,xProps,aTablePageBreakData ){}
73 
~ScVbaHPageBreak()74 	virtual ~ScVbaHPageBreak(){}
75 
76 	// XHelperInterface
77 	virtual rtl::OUString& getServiceImplName();
78 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
79 };
80 
81 //VPageBreak
82 typedef ScVbaPageBreak < ov::excel::XVPageBreak > ScVbaVPageBreak_BASE;
83 
84 class ScVbaVPageBreak :  public ScVbaVPageBreak_BASE
85 {
86 public:
87 	ScVbaVPageBreak( const css::uno::Reference< ov::XHelperInterface >& xParent,
88 					 const css::uno::Reference< css::uno::XComponentContext >& xContext,
89 					 css::uno::Reference< css::beans::XPropertySet >& xProps,
90 					 css::sheet::TablePageBreakData aTablePageBreakData) throw (css::uno::RuntimeException);
91 
92 	virtual ~ScVbaVPageBreak();
93 
94 	// XHelperInterface
95 	virtual rtl::OUString& getServiceImplName();
96 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
97 };
98 
99 #endif
100