xref: /aoo42x/main/sc/source/ui/vba/vbahyperlink.hxx (revision 38d50f7b)
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 
24 #ifndef SC_VBA_HYPERLINK_HXX
25 #define SC_VBA_HYPERLINK_HXX
26 
27 #include <ooo/vba/excel/XHyperlink.hpp>
28 #include <com/sun/star/table/XCell.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <ooo/vba/excel/XRange.hpp>
31 
32 #include <vbahelper/vbahelperinterface.hxx>
33 
34 typedef InheritedHelperInterfaceImpl1< ov::excel::XHyperlink > HyperlinkImpl_BASE;
35 
36 class ScVbaHyperlink : public HyperlinkImpl_BASE
37 {
38 public:
39     ScVbaHyperlink(
40         const css::uno::Sequence< css::uno::Any >& rArgs,
41         const css::uno::Reference< css::uno::XComponentContext >& rxContext ) throw (css::lang::IllegalArgumentException);
42 
43     ScVbaHyperlink(
44         const css::uno::Reference< ov::XHelperInterface >& rxAnchor,
45         const css::uno::Reference< css::uno::XComponentContext >& rxContext,
46         const css::uno::Any& rAddress, const css::uno::Any& rSubAddress,
47         const css::uno::Any& rScreenTip, const css::uno::Any& rTextToDisplay ) throw (css::uno::RuntimeException);
48 
49     virtual ~ScVbaHyperlink();
50 
51     // Attributes
52     virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
53     virtual void SAL_CALL setName( const ::rtl::OUString& rName ) throw (css::uno::RuntimeException);
54     virtual ::rtl::OUString SAL_CALL getAddress() throw (css::uno::RuntimeException);
55     virtual void SAL_CALL setAddress( const ::rtl::OUString& rAddress ) throw (css::uno::RuntimeException);
56     virtual ::rtl::OUString SAL_CALL getSubAddress() throw (css::uno::RuntimeException);
57     virtual void SAL_CALL setSubAddress( const ::rtl::OUString& rSubAddress ) throw (css::uno::RuntimeException);
58     virtual ::rtl::OUString SAL_CALL getScreenTip() throw (css::uno::RuntimeException);
59     virtual void SAL_CALL setScreenTip( const ::rtl::OUString& rScreenTip ) throw (css::uno::RuntimeException);
60     virtual ::rtl::OUString SAL_CALL getTextToDisplay() throw (css::uno::RuntimeException);
61     virtual void SAL_CALL setTextToDisplay( const ::rtl::OUString& rTextToDisplay ) throw (css::uno::RuntimeException);
62     virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException);
63     virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getRange() throw (css::uno::RuntimeException);
64     virtual css::uno::Reference< ov::msforms::XShape > SAL_CALL getShape() throw (css::uno::RuntimeException);
65 
66     // XHelperInterface
67     VBAHELPER_DECL_XHELPERINTERFACE
68 
69 private:
70     typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > UrlComponents;
71 
72     void ensureTextField() throw (css::uno::RuntimeException);
73     UrlComponents getUrlComponents() throw (css::uno::RuntimeException);
74     void setUrlComponents( const UrlComponents& rUrlComp ) throw (css::uno::RuntimeException);
75 
76 private:
77     css::uno::Reference< css::table::XCell > mxCell;
78     css::uno::Reference< css::beans::XPropertySet > mxTextField;
79     ::rtl::OUString maScreenTip;
80     long mnType;
81 };
82 
83 #endif /* SC_VBA_HYPERLINK_HXX */
84 
85