xref: /trunk/main/sw/inc/unofootnote.hxx (revision 9d37da743abb7db0a497688391f6e55a19f27c44)
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 
76     virtual ~SwXFootnote();
77 
78     SwXFootnote(SwDoc & rDoc, const SwFmtFtn & rFmt);
79 
80 public:
81 
82     SwXFootnote(const bool bEndnote);
83 
84     static SwXFootnote *
85         CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt);
86     /// may return 0
87     static SwXFootnote *
88         GetXFootnote(SwModify const& rUnoCB, SwFmtFtn const& rFootnoteFmt);
89 
90     // XInterface
91     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
92             const ::com::sun::star::uno::Type& rType);
93     virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
94     virtual void SAL_CALL release() throw() { OWeakObject::release(); }
95 
96     // XTypeProvider
97     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
98         SAL_CALL getTypes();
99     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
100         getImplementationId();
101 
102     static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
103 
104     // XUnoTunnel
105     virtual sal_Int64 SAL_CALL getSomething(
106             const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier);
107 
108     // XServiceInfo
109     virtual ::rtl::OUString SAL_CALL getImplementationName();
110     virtual sal_Bool SAL_CALL supportsService(
111             const ::rtl::OUString& rServiceName);
112     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
113         getSupportedServiceNames();
114 
115     // XComponent
116     virtual void SAL_CALL dispose();
117     virtual void SAL_CALL addEventListener(
118             const ::com::sun::star::uno::Reference<
119                 ::com::sun::star::lang::XEventListener > & xListener);
120     virtual void SAL_CALL removeEventListener(
121             const ::com::sun::star::uno::Reference<
122                 ::com::sun::star::lang::XEventListener > & xListener);
123 
124     // XPropertySet
125     virtual ::com::sun::star::uno::Reference<
126                 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
127         getPropertySetInfo();
128     virtual void SAL_CALL setPropertyValue(
129             const ::rtl::OUString& rPropertyName,
130             const ::com::sun::star::uno::Any& rValue);
131     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
132             const ::rtl::OUString& rPropertyName);
133     virtual void SAL_CALL addPropertyChangeListener(
134             const ::rtl::OUString& rPropertyName,
135             const ::com::sun::star::uno::Reference<
136                 ::com::sun::star::beans::XPropertyChangeListener >& xListener);
137     virtual void SAL_CALL removePropertyChangeListener(
138             const ::rtl::OUString& rPropertyName,
139             const ::com::sun::star::uno::Reference<
140                 ::com::sun::star::beans::XPropertyChangeListener >& xListener);
141     virtual void SAL_CALL addVetoableChangeListener(
142             const ::rtl::OUString& rPropertyName,
143             const ::com::sun::star::uno::Reference<
144                 ::com::sun::star::beans::XVetoableChangeListener >& xListener);
145     virtual void SAL_CALL removeVetoableChangeListener(
146             const ::rtl::OUString& rPropertyName,
147             const ::com::sun::star::uno::Reference<
148                 ::com::sun::star::beans::XVetoableChangeListener >& xListener);
149 
150     // XElementAccess
151     virtual ::com::sun::star::uno::Type SAL_CALL getElementType();
152     virtual sal_Bool SAL_CALL hasElements();
153 
154     // XEnumerationAccess
155     virtual ::com::sun::star::uno::Reference<
156             ::com::sun::star::container::XEnumeration >  SAL_CALL
157         createEnumeration();
158 
159     // XTextContent
160     virtual void SAL_CALL attach(
161             const ::com::sun::star::uno::Reference<
162                 ::com::sun::star::text::XTextRange > & xTextRange);
163     virtual ::com::sun::star::uno::Reference<
164                 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor();
165 
166     // XFootnote
167     virtual ::rtl::OUString SAL_CALL getLabel();
168     virtual void SAL_CALL setLabel(const ::rtl::OUString& rLabel);
169 
170     // XSimpleText
171     virtual ::com::sun::star::uno::Reference<
172                 ::com::sun::star::text::XTextCursor >  SAL_CALL
173         createTextCursor();
174     virtual ::com::sun::star::uno::Reference<
175                 ::com::sun::star::text::XTextCursor >  SAL_CALL
176         createTextCursorByRange(
177             const ::com::sun::star::uno::Reference<
178                 ::com::sun::star::text::XTextRange > & xTextPosition);
179 
180 };
181 
182 #endif // SW_UNOFOOTNOTE_HXX
183