xref: /aoo4110/main/sw/inc/unosection.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_UNOSECTION_HXX
25 #define SW_UNOSECTION_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/beans/XPropertyState.hpp>
31 #include <com/sun/star/beans/XMultiPropertySet.hpp>
32 #include <com/sun/star/container/XNamed.hpp>
33 #include <com/sun/star/text/XTextContent.hpp>
34 #include <com/sun/star/text/XTextSection.hpp>
35 
36 #include <cppuhelper/implbase7.hxx>
37 
38 #include <sfx2/Metadatable.hxx>
39 
40 #include <unobaseclass.hxx>
41 
42 
43 class SwSectionFmt;
44 
45 
46 /*-----------------09.03.98 13:57-------------------
47 
48 --------------------------------------------------*/
49 
50 
51 struct SwTextSectionProperties_Impl;
52 
53 typedef ::cppu::ImplInheritanceHelper7
54 <   ::sfx2::MetadatableMixin
55 ,   ::com::sun::star::lang::XUnoTunnel
56 ,   ::com::sun::star::lang::XServiceInfo
57 ,   ::com::sun::star::beans::XPropertySet
58 ,   ::com::sun::star::beans::XPropertyState
59 ,   ::com::sun::star::beans::XMultiPropertySet
60 ,   ::com::sun::star::container::XNamed
61 ,   ::com::sun::star::text::XTextSection
62 > SwXTextSection_Base;
63 
64 class SwXTextSection
65     : public SwXTextSection_Base
66 {
67 
68 private:
69 
70     class Impl;
71     ::sw::UnoImplPtr<Impl> m_pImpl;
72 
73     SwXTextSection(SwSectionFmt *const pFmt, const bool bIndexHeader = false);
74 
75     virtual ~SwXTextSection();
76 
77 public:
78 
79     SwSectionFmt*   GetFmt() const;
80 
81     static ::com::sun::star::uno::Reference<
82             ::com::sun::star::text::XTextSection >
83         CreateXTextSection(SwSectionFmt *const pFmt = 0,
84                 const bool bIndexHeader = false);
85 
86     // MetadatableMixin
87     virtual ::sfx2::Metadatable* GetCoreObject();
88     virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
89         GetModel();
90 
91     static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
92 
93     // XUnoTunnel
94     virtual sal_Int64 SAL_CALL getSomething(
95             const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier)
96         throw (::com::sun::star::uno::RuntimeException);
97 
98     // XServiceInfo
99     virtual ::rtl::OUString SAL_CALL getImplementationName()
100         throw (::com::sun::star::uno::RuntimeException);
101     virtual sal_Bool SAL_CALL supportsService(
102             const ::rtl::OUString& rServiceName)
103         throw (::com::sun::star::uno::RuntimeException);
104     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
105         getSupportedServiceNames()
106         throw (::com::sun::star::uno::RuntimeException);
107 
108     // XComponent
109     virtual void SAL_CALL dispose()
110         throw (::com::sun::star::uno::RuntimeException);
111     virtual void SAL_CALL addEventListener(
112             const ::com::sun::star::uno::Reference<
113                 ::com::sun::star::lang::XEventListener > & xListener)
114         throw (::com::sun::star::uno::RuntimeException);
115     virtual void SAL_CALL removeEventListener(
116             const ::com::sun::star::uno::Reference<
117                 ::com::sun::star::lang::XEventListener > & xListener)
118         throw (::com::sun::star::uno::RuntimeException);
119 
120     // XPropertySet
121     virtual ::com::sun::star::uno::Reference<
122                 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
123         getPropertySetInfo()
124         throw (::com::sun::star::uno::RuntimeException);
125     virtual void SAL_CALL setPropertyValue(
126             const ::rtl::OUString& rPropertyName,
127             const ::com::sun::star::uno::Any& rValue)
128         throw (::com::sun::star::beans::UnknownPropertyException,
129                 ::com::sun::star::beans::PropertyVetoException,
130                 ::com::sun::star::lang::IllegalArgumentException,
131                 ::com::sun::star::lang::WrappedTargetException,
132                 ::com::sun::star::uno::RuntimeException);
133     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
134             const ::rtl::OUString& rPropertyName)
135         throw (::com::sun::star::beans::UnknownPropertyException,
136                 ::com::sun::star::lang::WrappedTargetException,
137                 ::com::sun::star::uno::RuntimeException);
138     virtual void SAL_CALL addPropertyChangeListener(
139             const ::rtl::OUString& rPropertyName,
140             const ::com::sun::star::uno::Reference<
141                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
142         throw (::com::sun::star::beans::UnknownPropertyException,
143                 ::com::sun::star::lang::WrappedTargetException,
144                 ::com::sun::star::uno::RuntimeException);
145     virtual void SAL_CALL removePropertyChangeListener(
146             const ::rtl::OUString& rPropertyName,
147             const ::com::sun::star::uno::Reference<
148                 ::com::sun::star::beans::XPropertyChangeListener >& xListener)
149         throw (::com::sun::star::beans::UnknownPropertyException,
150                 ::com::sun::star::lang::WrappedTargetException,
151                 ::com::sun::star::uno::RuntimeException);
152     virtual void SAL_CALL addVetoableChangeListener(
153             const ::rtl::OUString& rPropertyName,
154             const ::com::sun::star::uno::Reference<
155                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
156         throw (::com::sun::star::beans::UnknownPropertyException,
157                 ::com::sun::star::lang::WrappedTargetException,
158                 ::com::sun::star::uno::RuntimeException);
159     virtual void SAL_CALL removeVetoableChangeListener(
160             const ::rtl::OUString& rPropertyName,
161             const ::com::sun::star::uno::Reference<
162                 ::com::sun::star::beans::XVetoableChangeListener >& xListener)
163         throw (::com::sun::star::beans::UnknownPropertyException,
164                 ::com::sun::star::lang::WrappedTargetException,
165                 ::com::sun::star::uno::RuntimeException);
166 
167     // XPropertyState
168     virtual ::com::sun::star::beans::PropertyState SAL_CALL
169         getPropertyState(const ::rtl::OUString& rPropertyName)
170         throw (::com::sun::star::beans::UnknownPropertyException,
171                 ::com::sun::star::uno::RuntimeException);
172     virtual ::com::sun::star::uno::Sequence<
173             ::com::sun::star::beans::PropertyState > SAL_CALL
174         getPropertyStates(
175             const ::com::sun::star::uno::Sequence<
176                 ::rtl::OUString >& rPropertyNames)
177         throw (::com::sun::star::beans::UnknownPropertyException,
178                 ::com::sun::star::uno::RuntimeException);
179     virtual void SAL_CALL setPropertyToDefault(
180             const ::rtl::OUString& rPropertyName)
181         throw (::com::sun::star::beans::UnknownPropertyException,
182                 ::com::sun::star::uno::RuntimeException);
183     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
184             const ::rtl::OUString& rPropertyName)
185         throw (::com::sun::star::beans::UnknownPropertyException,
186                 ::com::sun::star::lang::WrappedTargetException,
187                 ::com::sun::star::uno::RuntimeException);
188 
189     // XMultiPropertySet
190     virtual void SAL_CALL setPropertyValues(
191             const ::com::sun::star::uno::Sequence< ::rtl::OUString >&
192                 rPropertyNames,
193             const ::com::sun::star::uno::Sequence<
194                 ::com::sun::star::uno::Any >& rValues)
195         throw (::com::sun::star::beans::PropertyVetoException,
196                 ::com::sun::star::lang::IllegalArgumentException,
197                 ::com::sun::star::lang::WrappedTargetException,
198                 ::com::sun::star::uno::RuntimeException);
199     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
200         SAL_CALL getPropertyValues(
201             const ::com::sun::star::uno::Sequence< ::rtl::OUString >&
202                 rPropertyNames)
203         throw (::com::sun::star::uno::RuntimeException);
204     virtual void SAL_CALL addPropertiesChangeListener(
205             const ::com::sun::star::uno::Sequence< ::rtl::OUString >&
206                 rPropertyNames,
207             const ::com::sun::star::uno::Reference<
208                 ::com::sun::star::beans::XPropertiesChangeListener >& xListener)
209         throw (::com::sun::star::uno::RuntimeException);
210     virtual void SAL_CALL removePropertiesChangeListener(
211             const ::com::sun::star::uno::Reference<
212                 ::com::sun::star::beans::XPropertiesChangeListener >& xListener)
213         throw (::com::sun::star::uno::RuntimeException);
214     virtual void SAL_CALL firePropertiesChangeEvent(
215             const ::com::sun::star::uno::Sequence< ::rtl::OUString >&
216                 rPropertyNames,
217             const ::com::sun::star::uno::Reference<
218                 ::com::sun::star::beans::XPropertiesChangeListener >& xListener)
219         throw (::com::sun::star::uno::RuntimeException);
220 
221     // XNamed
222     virtual ::rtl::OUString SAL_CALL getName()
223         throw (::com::sun::star::uno::RuntimeException);
224     virtual void SAL_CALL setName(const ::rtl::OUString& rName)
225         throw (::com::sun::star::uno::RuntimeException);
226 
227     // XTextContent
228     virtual void SAL_CALL attach(
229             const ::com::sun::star::uno::Reference<
230                 ::com::sun::star::text::XTextRange > & xTextRange)
231         throw (::com::sun::star::lang::IllegalArgumentException,
232                 ::com::sun::star::uno::RuntimeException);
233     virtual ::com::sun::star::uno::Reference<
234                 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor()
235         throw (::com::sun::star::uno::RuntimeException);
236 
237     // XTextSection
238     virtual ::com::sun::star::uno::Reference<
239                 ::com::sun::star::text::XTextSection > SAL_CALL
240         getParentSection()
241         throw (::com::sun::star::uno::RuntimeException);
242     virtual ::com::sun::star::uno::Sequence<
243                 ::com::sun::star::uno::Reference<
244                     ::com::sun::star::text::XTextSection >  > SAL_CALL
245         getChildSections()
246         throw (::com::sun::star::uno::RuntimeException);
247 
248 };
249 
250 #endif // SW_UNOSECTION_HXX
251 
252