xref: /trunk/main/sc/source/ui/vba/vbaname.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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_NAME_HXX
24 #define SC_VBA_NAME_HXX
25 
26 #include <ooo/vba/excel/XName.hpp>
27 #include <com/sun/star/sheet/XNamedRange.hpp>
28 #include <com/sun/star/sheet/XNamedRanges.hpp>
29 
30 #include <vbahelper/vbahelperinterface.hxx>
31 
32 class ScDocument;
33 
34 typedef InheritedHelperInterfaceImpl1< ov::excel::XName > NameImpl_BASE;
35 
36 class ScVbaName : public NameImpl_BASE
37 {
38     css::uno::Reference< css::frame::XModel > mxModel;
39     css::uno::Reference< css::sheet::XNamedRange > mxNamedRange;
40     css::uno::Reference< css::sheet::XNamedRanges > mxNames;
41 
42     ScDocument * m_pDoc;
43 
44 protected:
getModel()45     virtual css::uno::Reference< css::frame::XModel >  getModel() { return mxModel; }
46     virtual css::uno::Reference< ov::excel::XWorksheet > getWorkSheet();
47 
48 public:
49     ScVbaName( const css::uno::Reference< ov::XHelperInterface >& xParent,  const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRange >& xName , const css::uno::Reference< css::sheet::XNamedRanges >& xNames , const css::uno::Reference< css::frame::XModel >& xModel );
50     virtual ~ScVbaName();
51 
52     // Attributes
53     virtual ::rtl::OUString SAL_CALL getName();
54     virtual void SAL_CALL setName( const ::rtl::OUString &rName );
55     virtual ::rtl::OUString SAL_CALL getNameLocal();
56     virtual void SAL_CALL setNameLocal( const ::rtl::OUString &rName );
57     virtual sal_Bool SAL_CALL getVisible();
58     virtual void SAL_CALL setVisible( sal_Bool bVisible );
59     virtual ::rtl::OUString SAL_CALL getValue();
60     virtual void SAL_CALL setValue( const ::rtl::OUString &rValue );
61     virtual ::rtl::OUString SAL_CALL getRefersTo();
62     virtual void SAL_CALL setRefersTo( const ::rtl::OUString &rRefersTo );
63     virtual ::rtl::OUString SAL_CALL getRefersToLocal();
64     virtual void SAL_CALL setRefersToLocal( const ::rtl::OUString &rRefersTo );
65     virtual ::rtl::OUString SAL_CALL getRefersToR1C1();
66     virtual void SAL_CALL setRefersToR1C1( const ::rtl::OUString &rRefersTo );
67     virtual ::rtl::OUString SAL_CALL getRefersToR1C1Local();
68     virtual void SAL_CALL setRefersToR1C1Local( const ::rtl::OUString &rRefersTo );
69     virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getRefersToRange();
70     virtual void SAL_CALL setRefersToRange( const css::uno::Reference< ov::excel::XRange > xRange );
71 
72     // Methods
73     virtual void SAL_CALL Delete();
74 
75     // XHelperInterface
76     virtual rtl::OUString& getServiceImplName();
77     virtual css::uno::Sequence<rtl::OUString> getServiceNames();
78 };
79 #endif /* SC_VBA_NAME_HXX */
80