xref: /aoo4110/main/sw/inc/unorefmark.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 
24 #ifndef SW_UNOREFMARK_HXX
25 #define SW_UNOREFMARK_HXX
26 
27 #include <com/sun/star/lang/XUnoTunnel.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/container/XNamed.hpp>
31 #include <com/sun/star/text/XTextContent.hpp>
32 
33 #include <cppuhelper/implbase5.hxx>
34 
35 #include <unobaseclass.hxx>
36 
37 
38 class SwDoc;
39 class SwModify;
40 class SwFmtRefMark;
41 
42 
43 /* -----------------27.08.98 15:11-------------------
44  *
45  * --------------------------------------------------*/
46 typedef ::cppu::WeakImplHelper5
47 <   ::com::sun::star::lang::XUnoTunnel
48 ,   ::com::sun::star::lang::XServiceInfo
49 ,   ::com::sun::star::beans::XPropertySet
50 ,   ::com::sun::star::container::XNamed
51 ,   ::com::sun::star::text::XTextContent
52 > SwXReferenceMark_Base;
53 
54 class SwXReferenceMark
55     : public SwXReferenceMark_Base
56 {
57 
58 private:
59 
60     class Impl;
61     ::sw::UnoImplPtr<Impl> m_pImpl;
62 
63     virtual ~SwXReferenceMark();
64 
65 public:
66 
67     SwXReferenceMark(SwDoc *const pDoc, const SwFmtRefMark *const pMark);
68 
69     static SwXReferenceMark *
70         CreateXReferenceMark(SwDoc & rDoc, SwFmtRefMark const& rMarkFmt);
71     /// may return 0
72     static SwXReferenceMark *
73         GetReferenceMark(SwModify const& rUnoCB, SwFmtRefMark const& rMarkFmt);
74 
75     static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
76 
77     // XUnoTunnel
78     virtual sal_Int64 SAL_CALL getSomething(
79             const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
80         throw (::com::sun::star::uno::RuntimeException);
81 
82     // XServiceInfo
83     virtual ::rtl::OUString SAL_CALL getImplementationName()
84         throw (::com::sun::star::uno::RuntimeException);
85     virtual sal_Bool SAL_CALL supportsService(
86             const ::rtl::OUString& rServiceName)
87         throw (::com::sun::star::uno::RuntimeException);
88     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
89         getSupportedServiceNames()
90         throw (::com::sun::star::uno::RuntimeException);
91 
92     // XComponent
93     virtual void SAL_CALL dispose()
94         throw (::com::sun::star::uno::RuntimeException);
95     virtual void SAL_CALL addEventListener(
96             const ::com::sun::star::uno::Reference<
97                 ::com::sun::star::lang::XEventListener > & xListener)
98         throw (::com::sun::star::uno::RuntimeException);
99     virtual void SAL_CALL removeEventListener(
100             const ::com::sun::star::uno::Reference<
101                 ::com::sun::star::lang::XEventListener > & xListener)
102         throw (::com::sun::star::uno::RuntimeException);
103 
104     // XPropertySet
105     virtual ::com::sun::star::uno::Reference<
106                 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
107         getPropertySetInfo()
108         throw (::com::sun::star::uno::RuntimeException);
109     virtual void SAL_CALL setPropertyValue(
110             const ::rtl::OUString& rPropertyName,
111             const ::com::sun::star::uno::Any& rValue)
112         throw (::com::sun::star::beans::UnknownPropertyException,
113                 ::com::sun::star::beans::PropertyVetoException,
114                 ::com::sun::star::lang::IllegalArgumentException,
115                 ::com::sun::star::lang::WrappedTargetException,
116                 ::com::sun::star::uno::RuntimeException);
117     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
118             const ::rtl::OUString& rPropertyName)
119         throw (::com::sun::star::beans::UnknownPropertyException,
120                 ::com::sun::star::lang::WrappedTargetException,
121                 ::com::sun::star::uno::RuntimeException);
122     virtual void SAL_CALL addPropertyChangeListener(
123             const ::rtl::OUString& rPropertyName,
124             const ::com::sun::star::uno::Reference<
125                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
126         throw (::com::sun::star::beans::UnknownPropertyException,
127                 ::com::sun::star::lang::WrappedTargetException,
128                 ::com::sun::star::uno::RuntimeException);
129     virtual void SAL_CALL removePropertyChangeListener(
130             const ::rtl::OUString& rPropertyName,
131             const ::com::sun::star::uno::Reference<
132                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
133         throw (::com::sun::star::beans::UnknownPropertyException,
134                 ::com::sun::star::lang::WrappedTargetException,
135                 ::com::sun::star::uno::RuntimeException);
136     virtual void SAL_CALL addVetoableChangeListener(
137             const ::rtl::OUString& rPropertyName,
138             const ::com::sun::star::uno::Reference<
139                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
140         throw (::com::sun::star::beans::UnknownPropertyException,
141                 ::com::sun::star::lang::WrappedTargetException,
142                 ::com::sun::star::uno::RuntimeException);
143     virtual void SAL_CALL removeVetoableChangeListener(
144             const ::rtl::OUString& rPropertyName,
145             const ::com::sun::star::uno::Reference<
146                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
147         throw (::com::sun::star::beans::UnknownPropertyException,
148                 ::com::sun::star::lang::WrappedTargetException,
149                 ::com::sun::star::uno::RuntimeException);
150 
151     // XNamed
152     virtual ::rtl::OUString SAL_CALL getName()
153         throw (::com::sun::star::uno::RuntimeException);
154     virtual void SAL_CALL setName(const ::rtl::OUString& rName)
155         throw (::com::sun::star::uno::RuntimeException);
156 
157     // XTextContent
158     virtual void SAL_CALL attach(
159             const ::com::sun::star::uno::Reference<
160                 ::com::sun::star::text::XTextRange > & xTextRange)
161         throw (::com::sun::star::lang::IllegalArgumentException,
162                 ::com::sun::star::uno::RuntimeException);
163     virtual ::com::sun::star::uno::Reference<
164                 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor()
165         throw (::com::sun::star::uno::RuntimeException);
166 
167 };
168 
169 #endif // SW_UNOREFMARK_HXX
170 
171