xref: /trunk/main/sw/inc/unofootnote.hxx (revision 1d2dbeb0)
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_UNOFOOTNOTE_HXX
25 #define SW_UNOFOOTNOTE_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/XEnumerationAccess.hpp>
31 #include <com/sun/star/text/XTextContent.hpp>
32 #include <com/sun/star/text/XFootnote.hpp>
33 
34 #include <cppuhelper/implbase5.hxx>
35 
36 #include <unotext.hxx>
37 
38 
39 class SwDoc;
40 class SwModify;
41 class SwFmtFtn;
42 
43 
44 /*-----------------12.02.98 08:01-------------------
45 
46 --------------------------------------------------*/
47 typedef ::cppu::WeakImplHelper5
48 <   ::com::sun::star::lang::XUnoTunnel
49 ,   ::com::sun::star::lang::XServiceInfo
50 ,   ::com::sun::star::beans::XPropertySet
51 ,   ::com::sun::star::container::XEnumerationAccess
52 ,   ::com::sun::star::text::XFootnote
53 > SwXFootnote_Base;
54 
55 class SwXFootnote
56     : public SwXFootnote_Base
57     , public SwXText
58 {
59 
60 private:
61 
62     friend class SwXFootnotes;
63 
64     class Impl;
65     ::sw::UnoImplPtr<Impl> m_pImpl;
66 
67 
68 protected:
69 
70     virtual const SwStartNode *GetStartNode() const;
71 
72     virtual ::com::sun::star::uno::Reference<
73                 ::com::sun::star::text::XTextCursor >
74         CreateCursor()
75         throw (::com::sun::star::uno::RuntimeException);
76 
77     virtual ~SwXFootnote();
78 
79     SwXFootnote(SwDoc & rDoc, const SwFmtFtn & rFmt);
80 
81 public:
82 
83     SwXFootnote(const bool bEndnote);
84 
85     static SwXFootnote *
86         CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt);
87     /// may return 0
88     static SwXFootnote *
89         GetXFootnote(SwModify const& rUnoCB, SwFmtFtn const& rFootnoteFmt);
90 
91     // XInterface
92     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
93             const ::com::sun::star::uno::Type& rType)
94         throw (::com::sun::star::uno::RuntimeException);
acquire()95     virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
release()96     virtual void SAL_CALL release() throw() { OWeakObject::release(); }
97 
98     // XTypeProvider
99     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
100         SAL_CALL getTypes()
101         throw (::com::sun::star::uno::RuntimeException);
102     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
103         getImplementationId()
104         throw (::com::sun::star::uno::RuntimeException);
105 
106     static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
107 
108     // XUnoTunnel
109     virtual sal_Int64 SAL_CALL getSomething(
110             const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
111         throw (::com::sun::star::uno::RuntimeException);
112 
113     // XServiceInfo
114     virtual ::rtl::OUString SAL_CALL getImplementationName()
115         throw (::com::sun::star::uno::RuntimeException);
116     virtual sal_Bool SAL_CALL supportsService(
117             const ::rtl::OUString& rServiceName)
118         throw (::com::sun::star::uno::RuntimeException);
119     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
120         getSupportedServiceNames()
121         throw (::com::sun::star::uno::RuntimeException);
122 
123     // XComponent
124     virtual void SAL_CALL dispose()
125         throw (::com::sun::star::uno::RuntimeException);
126     virtual void SAL_CALL addEventListener(
127             const ::com::sun::star::uno::Reference<
128                 ::com::sun::star::lang::XEventListener > & xListener)
129         throw (::com::sun::star::uno::RuntimeException);
130     virtual void SAL_CALL removeEventListener(
131             const ::com::sun::star::uno::Reference<
132                 ::com::sun::star::lang::XEventListener > & xListener)
133         throw (::com::sun::star::uno::RuntimeException);
134 
135     // XPropertySet
136     virtual ::com::sun::star::uno::Reference<
137                 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
138         getPropertySetInfo()
139         throw (::com::sun::star::uno::RuntimeException);
140     virtual void SAL_CALL setPropertyValue(
141             const ::rtl::OUString& rPropertyName,
142             const ::com::sun::star::uno::Any& rValue)
143         throw (::com::sun::star::beans::UnknownPropertyException,
144                 ::com::sun::star::beans::PropertyVetoException,
145                 ::com::sun::star::lang::IllegalArgumentException,
146                 ::com::sun::star::lang::WrappedTargetException,
147                 ::com::sun::star::uno::RuntimeException);
148     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
149             const ::rtl::OUString& rPropertyName)
150         throw (::com::sun::star::beans::UnknownPropertyException,
151                 ::com::sun::star::lang::WrappedTargetException,
152                 ::com::sun::star::uno::RuntimeException);
153     virtual void SAL_CALL addPropertyChangeListener(
154             const ::rtl::OUString& rPropertyName,
155             const ::com::sun::star::uno::Reference<
156                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
157         throw (::com::sun::star::beans::UnknownPropertyException,
158                 ::com::sun::star::lang::WrappedTargetException,
159                 ::com::sun::star::uno::RuntimeException);
160     virtual void SAL_CALL removePropertyChangeListener(
161             const ::rtl::OUString& rPropertyName,
162             const ::com::sun::star::uno::Reference<
163                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
164         throw (::com::sun::star::beans::UnknownPropertyException,
165                 ::com::sun::star::lang::WrappedTargetException,
166                 ::com::sun::star::uno::RuntimeException);
167     virtual void SAL_CALL addVetoableChangeListener(
168             const ::rtl::OUString& rPropertyName,
169             const ::com::sun::star::uno::Reference<
170                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
171         throw (::com::sun::star::beans::UnknownPropertyException,
172                 ::com::sun::star::lang::WrappedTargetException,
173                 ::com::sun::star::uno::RuntimeException);
174     virtual void SAL_CALL removeVetoableChangeListener(
175             const ::rtl::OUString& rPropertyName,
176             const ::com::sun::star::uno::Reference<
177                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
178         throw (::com::sun::star::beans::UnknownPropertyException,
179                 ::com::sun::star::lang::WrappedTargetException,
180                 ::com::sun::star::uno::RuntimeException);
181 
182     // XElementAccess
183     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
184         throw (::com::sun::star::uno::RuntimeException);
185     virtual sal_Bool SAL_CALL hasElements()
186         throw (::com::sun::star::uno::RuntimeException);
187 
188     // XEnumerationAccess
189     virtual ::com::sun::star::uno::Reference<
190             ::com::sun::star::container::XEnumeration >  SAL_CALL
191         createEnumeration()
192         throw (::com::sun::star::uno::RuntimeException);
193 
194     // XTextContent
195     virtual void SAL_CALL attach(
196             const ::com::sun::star::uno::Reference<
197                 ::com::sun::star::text::XTextRange > & xTextRange)
198         throw (::com::sun::star::lang::IllegalArgumentException,
199                 ::com::sun::star::uno::RuntimeException);
200     virtual ::com::sun::star::uno::Reference<
201                 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor()
202         throw (::com::sun::star::uno::RuntimeException);
203 
204     // XFootnote
205     virtual ::rtl::OUString SAL_CALL getLabel()
206         throw (::com::sun::star::uno::RuntimeException);
207     virtual void SAL_CALL setLabel(const ::rtl::OUString& rLabel)
208         throw (::com::sun::star::uno::RuntimeException);
209 
210     // XSimpleText
211     virtual ::com::sun::star::uno::Reference<
212                 ::com::sun::star::text::XTextCursor >  SAL_CALL
213         createTextCursor()
214         throw (::com::sun::star::uno::RuntimeException);
215     virtual ::com::sun::star::uno::Reference<
216                 ::com::sun::star::text::XTextCursor >  SAL_CALL
217         createTextCursorByRange(
218             const ::com::sun::star::uno::Reference<
219                 ::com::sun::star::text::XTextRange > & xTextPosition)
220         throw (::com::sun::star::uno::RuntimeException);
221 
222 };
223 
224 #endif // SW_UNOFOOTNOTE_HXX
225 
226