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