xref: /aoo41x/main/sc/source/ui/vba/vbahyperlink.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_VBA_HYPERLINK_HXX
29 #define SC_VBA_HYPERLINK_HXX
30 
31 #include <ooo/vba/excel/XHyperlink.hpp>
32 #include <com/sun/star/table/XCell.hpp>
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 #include <ooo/vba/excel/XRange.hpp>
35 
36 #include <vbahelper/vbahelperinterface.hxx>
37 
38 typedef InheritedHelperInterfaceImpl1< ov::excel::XHyperlink > HyperlinkImpl_BASE;
39 
40 class ScVbaHyperlink : public HyperlinkImpl_BASE
41 {
42 public:
43     ScVbaHyperlink(
44         const css::uno::Sequence< css::uno::Any >& rArgs,
45         const css::uno::Reference< css::uno::XComponentContext >& rxContext ) throw (css::lang::IllegalArgumentException);
46 
47     ScVbaHyperlink(
48         const css::uno::Reference< ov::XHelperInterface >& rxAnchor,
49         const css::uno::Reference< css::uno::XComponentContext >& rxContext,
50         const css::uno::Any& rAddress, const css::uno::Any& rSubAddress,
51         const css::uno::Any& rScreenTip, const css::uno::Any& rTextToDisplay ) throw (css::uno::RuntimeException);
52 
53     virtual ~ScVbaHyperlink();
54 
55     // Attributes
56     virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
57     virtual void SAL_CALL setName( const ::rtl::OUString& rName ) throw (css::uno::RuntimeException);
58     virtual ::rtl::OUString SAL_CALL getAddress() throw (css::uno::RuntimeException);
59     virtual void SAL_CALL setAddress( const ::rtl::OUString& rAddress ) throw (css::uno::RuntimeException);
60     virtual ::rtl::OUString SAL_CALL getSubAddress() throw (css::uno::RuntimeException);
61     virtual void SAL_CALL setSubAddress( const ::rtl::OUString& rSubAddress ) throw (css::uno::RuntimeException);
62     virtual ::rtl::OUString SAL_CALL getScreenTip() throw (css::uno::RuntimeException);
63     virtual void SAL_CALL setScreenTip( const ::rtl::OUString& rScreenTip ) throw (css::uno::RuntimeException);
64     virtual ::rtl::OUString SAL_CALL getTextToDisplay() throw (css::uno::RuntimeException);
65     virtual void SAL_CALL setTextToDisplay( const ::rtl::OUString& rTextToDisplay ) throw (css::uno::RuntimeException);
66     virtual sal_Int32 SAL_CALL getType() throw (css::uno::RuntimeException);
67     virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getRange() throw (css::uno::RuntimeException);
68     virtual css::uno::Reference< ov::msforms::XShape > SAL_CALL getShape() throw (css::uno::RuntimeException);
69 
70     // XHelperInterface
71     VBAHELPER_DECL_XHELPERINTERFACE
72 
73 private:
74     typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > UrlComponents;
75 
76     void ensureTextField() throw (css::uno::RuntimeException);
77     UrlComponents getUrlComponents() throw (css::uno::RuntimeException);
78     void setUrlComponents( const UrlComponents& rUrlComp ) throw (css::uno::RuntimeException);
79 
80 private:
81     css::uno::Reference< css::table::XCell > mxCell;
82     css::uno::Reference< css::beans::XPropertySet > mxTextField;
83     ::rtl::OUString maScreenTip;
84     long mnType;
85 };
86 
87 #endif /* SC_VBA_HYPERLINK_HXX */
88 
89