xref: /aoo4110/main/sc/source/ui/vba/vbanames.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_NAMES_HXX
24 #define SC_VBA_NAMES_HXX
25 
26 #include <ooo/vba/excel/XNames.hpp>
27 #include <ooo/vba/XCollection.hpp>
28 #include <com/sun/star/container/XEnumerationAccess.hpp>
29 #include <com/sun/star/sheet/XNamedRanges.hpp>
30 #include <vbahelper/vbacollectionimpl.hxx>
31 
32 class ScDocument;
33 class ScDocShell;
34 
35 typedef CollTestImplHelper< ov::excel::XNames > ScVbaNames_BASE;
36 
37 class ScVbaNames : public ScVbaNames_BASE
38 {
39 	css::uno::Reference< css::frame::XModel > mxModel;
40 	css::uno::Reference< css::sheet::XNamedRanges > mxNames;
41 
42 protected:
getModel()43 	virtual css::uno::Reference< css::frame::XModel >  getModel() { return mxModel; }
44 
45 public:
46 	ScVbaNames( const css::uno::Reference< ov::XHelperInterface >& xParent,  const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRanges >& xNames , const css::uno::Reference< css::frame::XModel >& xModel );
47 
48 	ScDocument* getScDocument();
49 	ScDocShell* getScDocShell();
50 
51 	virtual ~ScVbaNames();
52 
53 	// XEnumerationAccess
54 	virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException);
55 	virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException);
56 
57 	// Methods
58 	virtual css::uno::Any SAL_CALL Add( const css::uno::Any& aName ,
59 					const css::uno::Any& aRefersTo,
60 					const css::uno::Any& aVisible,
61 					const css::uno::Any& aMacroType,
62 					const css::uno::Any& aShoutcutKey,
63 					const css::uno::Any& aCategory,
64 					const css::uno::Any& aNameLocal,
65 					const css::uno::Any& aRefersToLocal,
66 					const css::uno::Any& aCategoryLocal,
67 					const css::uno::Any& aRefersToR1C1,
68 					const css::uno::Any& aRefersToR1C1Local ) throw (css::uno::RuntimeException);
69 
70 	virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
71 
72 	// ScVbaNames_BASE
73 	virtual rtl::OUString& getServiceImplName();
74 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
75 
76 };
77 #endif /* SC_VBA_NAMES_HXX */
78 
79