/src/libreoffice/sw/inc/unocoll.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | #ifndef INCLUDED_SW_INC_UNOCOLL_HXX |
20 | | #define INCLUDED_SW_INC_UNOCOLL_HXX |
21 | | #include <limits.h> |
22 | | #include "flyenum.hxx" |
23 | | #include <com/sun/star/lang/XServiceInfo.hpp> |
24 | | #include <com/sun/star/container/XEnumerationAccess.hpp> |
25 | | #include <com/sun/star/container/XNameAccess.hpp> |
26 | | #include <com/sun/star/container/XIndexAccess.hpp> |
27 | | #include <cppuhelper/implbase.hxx> |
28 | | #include <rtl/ref.hxx> |
29 | | #include "swdllapi.h" |
30 | | |
31 | | class SwDoc; |
32 | | class SwFrameFormat; |
33 | | namespace com::sun::star::text |
34 | | { |
35 | | class XTextTable; |
36 | | class XTextSection; |
37 | | class XFootnote; |
38 | | } |
39 | | class SwFormatFootnote; |
40 | | class SwSectionFormat; |
41 | | struct SvEventDescription; |
42 | | class SwXFootnote; |
43 | | class SwXTextSection; |
44 | | class SwXTextTable; |
45 | | class SwXBookmark; |
46 | | |
47 | | const SvEventDescription* sw_GetSupportedMacroItems(); |
48 | | |
49 | | class SwUnoCollection |
50 | | { |
51 | | SwDoc* m_pDoc; |
52 | | |
53 | | public: |
54 | | SwUnoCollection(SwDoc* p) : |
55 | 123k | m_pDoc(p){} |
56 | | |
57 | 123k | virtual ~SwUnoCollection() {} |
58 | | |
59 | | virtual void Invalidate(); |
60 | | |
61 | | protected: |
62 | 604k | bool IsValid() const { return m_pDoc; } |
63 | | |
64 | | SwDoc& GetDoc() const; |
65 | | }; |
66 | | |
67 | | /** entries in this enum are mapped in an array in unocoll.cxx */ |
68 | | enum class SwServiceType { |
69 | | TypeTextTable = 0, |
70 | | TypeTextFrame = 1, |
71 | | TypeGraphic = 2, |
72 | | TypeOLE = 3, |
73 | | TypeBookmark = 4, |
74 | | TypeFootnote = 5, |
75 | | TypeEndnote = 6, |
76 | | TypeIndexMark = 7, |
77 | | TypeIndex = 8, |
78 | | ReferenceMark = 9, |
79 | | StyleCharacter = 10, |
80 | | StyleParagraph = 11, |
81 | | StyleFrame = 12, |
82 | | StylePage = 13, |
83 | | StyleNumbering = 14, |
84 | | ContentIndexMark = 15, |
85 | | ContentIndex = 16, |
86 | | UserIndexMark = 17, |
87 | | UserIndex = 18, |
88 | | TextSection = 19, |
89 | | FieldTypeDateTime = 20, |
90 | | FieldTypeUser = 21, |
91 | | FieldTypeSetExp = 22, |
92 | | FieldTypeGetExp = 23, |
93 | | FieldTypeFileName = 24, |
94 | | FieldTypePageNum = 25, |
95 | | FieldTypeAuthor = 26, |
96 | | FieldTypeChapter = 27, |
97 | | FieldTypeDummy0 = 28, |
98 | | FieldTypeGetReference = 29, |
99 | | FieldTypeConditionedText = 30, |
100 | | FieldTypeAnnotation = 31, |
101 | | FieldTypeInput = 32, |
102 | | FieldTypeMacro = 33, |
103 | | FieldTypeDDE = 34, |
104 | | FieldTypeHiddenPara = 35, |
105 | | FieldTypeDocInfo = 36, |
106 | | FieldTypeTemplateName = 37, |
107 | | FieldTypeUserExt = 38, |
108 | | FieldTypeRefPageSet = 39, |
109 | | FieldTypeRefPageGet = 40, |
110 | | FieldTypeJumpEdit = 41, |
111 | | FieldTypeScript = 42, |
112 | | FieldTypeDatabaseNextSet = 43, |
113 | | FieldTypeDatabaseNumSet = 44, |
114 | | FieldTypeDatabaseSetNum = 45, |
115 | | FieldTypeDatabase = 46, |
116 | | FieldTypeDatabaseName = 47, |
117 | | FieldTypeTableFormula = 48, |
118 | | FieldTypePageCount = 49, |
119 | | FieldTypeParagraphCount = 50, |
120 | | FieldTypeWordCount = 51, |
121 | | FieldTypeCharacterCount = 52, |
122 | | FieldTypeTableCount = 53, |
123 | | FieldTypeGraphicObjectCount = 54, |
124 | | FieldTypeEmbeddedObjectCount = 55, |
125 | | FieldTypeDocInfoChangeAuthor = 56, |
126 | | FieldTypeDocInfoChangeDateTime = 57, |
127 | | FieldTypeDocInfoEditTime = 58, |
128 | | FieldTypeDocInfoDescription = 59, |
129 | | FieldTypeDocInfoCreateAuthor = 60, |
130 | | FieldTypeDocInfoCreateDateTime = 61, |
131 | | FieldTypePageCountRange = 62, |
132 | | FieldTypeDummy1 = 63, |
133 | | FieldTypeDummy2 = 64, |
134 | | FieldTypeDummy3 = 65, |
135 | | FieldTypeDocInfoCustom = 66, |
136 | | FieldTypeDocInfoPrintAuthor = 67, |
137 | | FieldTypeDocInfoPrintDateTime = 68, |
138 | | FieldTypeDocInfoKeywords = 69, |
139 | | FieldTypeDocInfoSubject = 70, |
140 | | FieldTypeDocInfoTitle = 71, |
141 | | FieldTypeDocInfoRevision = 72, |
142 | | FieldTypeBibliography = 73, |
143 | | FieldTypeCombinedCharacters = 74, |
144 | | FieldTypeDropdown = 75, |
145 | | FieldTypeMetafield = 76, |
146 | | FieldTypeDummy4 = 77, |
147 | | FieldTypeDummy5 = 78, |
148 | | FieldTypeDummy6 = 79, |
149 | | FieldTypeDummy7 = 80, |
150 | | FieldMasterUser = 81, |
151 | | FieldMasterDDE = 82, |
152 | | FieldMasterSetExp = 83, |
153 | | FieldMasterDatabase = 84, |
154 | | FieldMasterBibliography = 85, |
155 | | FieldMasterDummy2 = 86, |
156 | | FieldMasterDummy3 = 87, |
157 | | FieldMasterDummy4 = 88, |
158 | | FieldMasterDummy5 = 89, |
159 | | IndexIllustrations = 90, |
160 | | IndexObjects = 91, |
161 | | IndexTables = 92, |
162 | | IndexBibliography = 93, |
163 | | Paragraph = 94, |
164 | | FieldTypeInputUser = 95, |
165 | | FieldTypeHiddenText = 96, |
166 | | StyleConditionalParagraph = 97, |
167 | | NumberingRules = 98, |
168 | | TextColumns = 99, |
169 | | IndexHeaderSection = 100, |
170 | | Defaults = 101, |
171 | | IMapRectangle = 102, |
172 | | IMapCircle = 103, |
173 | | IMapPolygon = 104, |
174 | | TypeTextGraphic = 105, |
175 | | Chart2DataProvider = 106, |
176 | | TypeFieldMark = 107, |
177 | | TypeFormFieldMark = 108, |
178 | | TypeMeta = 109, |
179 | | VbaObjectProvider = 110, |
180 | | VbaCodeNameProvider = 111, |
181 | | VbaProjectNameProvider = 112, |
182 | | VbaGlobals = 113, |
183 | | StyleTable = 114, |
184 | | StyleCell = 115, |
185 | | LineBreak = 116, |
186 | | ContentControl = 117, |
187 | | |
188 | | Invalid = USHRT_MAX |
189 | | }; |
190 | | |
191 | | // case-corrected versions of service-names (see #i67811) |
192 | | |
193 | | #define CSS_TEXT_TEXTFIELD_DATE_TIME "com.sun.star.text.textfield.DateTime" |
194 | | #define CSS_TEXT_TEXTFIELD_USER "com.sun.star.text.textfield.User" |
195 | | #define CSS_TEXT_TEXTFIELD_SET_EXPRESSION "com.sun.star.text.textfield.SetExpression" |
196 | | #define CSS_TEXT_TEXTFIELD_GET_EXPRESSION "com.sun.star.text.textfield.GetExpression" |
197 | | #define CSS_TEXT_TEXTFIELD_FILE_NAME "com.sun.star.text.textfield.FileName" |
198 | | #define CSS_TEXT_TEXTFIELD_PAGE_NUMBER "com.sun.star.text.textfield.PageNumber" |
199 | | #define CSS_TEXT_TEXTFIELD_AUTHOR "com.sun.star.text.textfield.Author" |
200 | | #define CSS_TEXT_TEXTFIELD_CHAPTER "com.sun.star.text.textfield.Chapter" |
201 | | #define CSS_TEXT_TEXTFIELD_GET_REFERENCE "com.sun.star.text.textfield.GetReference" |
202 | | #define CSS_TEXT_TEXTFIELD_CONDITIONAL_TEXT "com.sun.star.text.textfield.ConditionalText" |
203 | | #define CSS_TEXT_TEXTFIELD_ANNOTATION "com.sun.star.text.textfield.Annotation" |
204 | | #define CSS_TEXT_TEXTFIELD_INPUT "com.sun.star.text.textfield.Input" |
205 | | #define CSS_TEXT_TEXTFIELD_MACRO "com.sun.star.text.textfield.Macro" |
206 | | #define CSS_TEXT_TEXTFIELD_DDE "com.sun.star.text.textfield.DDE" |
207 | | #define CSS_TEXT_TEXTFIELD_HIDDEN_PARAGRAPH "com.sun.star.text.textfield.HiddenParagraph" |
208 | | #define CSS_TEXT_TEXTFIELD_TEMPLATE_NAME "com.sun.star.text.textfield.TemplateName" |
209 | | #define CSS_TEXT_TEXTFIELD_EXTENDED_USER "com.sun.star.text.textfield.ExtendedUser" |
210 | | #define CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_SET "com.sun.star.text.textfield.ReferencePageSet" |
211 | | #define CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_GET "com.sun.star.text.textfield.ReferencePageGet" |
212 | | #define CSS_TEXT_TEXTFIELD_JUMP_EDIT "com.sun.star.text.textfield.JumpEdit" |
213 | | #define CSS_TEXT_TEXTFIELD_SCRIPT "com.sun.star.text.textfield.Script" |
214 | | #define CSS_TEXT_TEXTFIELD_DATABASE_NEXT_SET "com.sun.star.text.textfield.DatabaseNextSet" |
215 | | #define CSS_TEXT_TEXTFIELD_DATABASE_NUMBER_OF_SET "com.sun.star.text.textfield.DatabaseNumberOfSet" |
216 | | #define CSS_TEXT_TEXTFIELD_DATABASE_SET_NUMBER "com.sun.star.text.textfield.DatabaseSetNumber" |
217 | | #define CSS_TEXT_TEXTFIELD_DATABASE "com.sun.star.text.textfield.Database" |
218 | | #define CSS_TEXT_TEXTFIELD_DATABASE_NAME "com.sun.star.text.textfield.DatabaseName" |
219 | | #define CSS_TEXT_TEXTFIELD_TABLE_FORMULA "com.sun.star.text.textfield.TableFormula" |
220 | | #define CSS_TEXT_TEXTFIELD_PAGE_COUNT "com.sun.star.text.textfield.PageCount" |
221 | | #define CSS_TEXT_TEXTFIELD_PAGE_COUNT_RANGE "com.sun.star.text.textfield.PageCountRange" |
222 | | #define CSS_TEXT_TEXTFIELD_PARAGRAPH_COUNT "com.sun.star.text.textfield.ParagraphCount" |
223 | | #define CSS_TEXT_TEXTFIELD_WORD_COUNT "com.sun.star.text.textfield.WordCount" |
224 | | #define CSS_TEXT_TEXTFIELD_CHARACTER_COUNT "com.sun.star.text.textfield.CharacterCount" |
225 | | #define CSS_TEXT_TEXTFIELD_TABLE_COUNT "com.sun.star.text.textfield.TableCount" |
226 | | #define CSS_TEXT_TEXTFIELD_GRAPHIC_OBJECT_COUNT "com.sun.star.text.textfield.GraphicObjectCount" |
227 | | #define CSS_TEXT_TEXTFIELD_EMBEDDED_OBJECT_COUNT "com.sun.star.text.textfield.EmbeddedObjectCount" |
228 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_AUTHOR "com.sun.star.text.textfield.docinfo.ChangeAuthor" |
229 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_DATE_TIME "com.sun.star.text.textfield.docinfo.ChangeDateTime" |
230 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_EDIT_TIME "com.sun.star.text.textfield.docinfo.EditTime" |
231 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_DESCRIPTION "com.sun.star.text.textfield.docinfo.Description" |
232 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_AUTHOR "com.sun.star.text.textfield.docinfo.CreateAuthor" |
233 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_DATE_TIME "com.sun.star.text.textfield.docinfo.CreateDateTime" |
234 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_AUTHOR "com.sun.star.text.textfield.docinfo.PrintAuthor" |
235 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_DATE_TIME "com.sun.star.text.textfield.docinfo.PrintDateTime" |
236 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_KEY_WORDS "com.sun.star.text.textfield.docinfo.KeyWords" |
237 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_SUBJECT "com.sun.star.text.textfield.docinfo.Subject" |
238 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_TITLE "com.sun.star.text.textfield.docinfo.Title" |
239 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_REVISION "com.sun.star.text.textfield.docinfo.Revision" |
240 | | #define CSS_TEXT_TEXTFIELD_DOCINFO_CUSTOM "com.sun.star.text.textfield.docinfo.Custom" |
241 | | #define CSS_TEXT_TEXTFIELD_BIBLIOGRAPHY "com.sun.star.text.textfield.Bibliography" |
242 | | #define CSS_TEXT_TEXTFIELD_COMBINED_CHARACTERS "com.sun.star.text.textfield.CombinedCharacters" |
243 | | #define CSS_TEXT_TEXTFIELD_DROP_DOWN "com.sun.star.text.textfield.DropDown" |
244 | | #define CSS_TEXT_TEXTFIELD_INPUT_USER "com.sun.star.text.textfield.InputUser" |
245 | | #define CSS_TEXT_TEXTFIELD_HIDDEN_TEXT "com.sun.star.text.textfield.HiddenText" |
246 | | #define CSS_TEXT_FIELDMASTER_USER "com.sun.star.text.fieldmaster.User" |
247 | | #define CSS_TEXT_FIELDMASTER_DDE "com.sun.star.text.fieldmaster.DDE" |
248 | | #define CSS_TEXT_FIELDMASTER_SET_EXPRESSION "com.sun.star.text.fieldmaster.SetExpression" |
249 | | #define CSS_TEXT_FIELDMASTER_DATABASE "com.sun.star.text.fieldmaster.Database" |
250 | | #define CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY "com.sun.star.text.fieldmaster.Bibliography" |
251 | | |
252 | | class SwXServiceProvider |
253 | | { |
254 | | public: |
255 | | static OUString GetProviderName(SwServiceType nObjectType); |
256 | | static SwServiceType GetProviderType(std::u16string_view rServiceName); |
257 | | static css::uno::Reference< css::uno::XInterface > MakeInstance(SwServiceType nObjectType, SwDoc & rDoc); |
258 | | static css::uno::Sequence<OUString> GetAllServiceNames(); |
259 | | |
260 | | }; |
261 | | |
262 | | typedef |
263 | | cppu::WeakImplHelper |
264 | | < |
265 | | css::container::XNameAccess, |
266 | | css::container::XIndexAccess, |
267 | | css::lang::XServiceInfo |
268 | | > |
269 | | SwCollectionBaseClass; |
270 | | class SW_DLLPUBLIC SwXTextTables final : public SwCollectionBaseClass, |
271 | | public SwUnoCollection |
272 | | { |
273 | | virtual ~SwXTextTables() override; |
274 | | public: |
275 | | SwXTextTables(SwDoc* pDoc); |
276 | | |
277 | | //XIndexAccess |
278 | | virtual sal_Int32 SAL_CALL getCount( ) override; |
279 | | virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; |
280 | | |
281 | | //XNameAccess |
282 | | virtual css::uno::Any SAL_CALL getByName(const OUString& Name) override; |
283 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
284 | | virtual sal_Bool SAL_CALL hasByName(const OUString& Name) override; |
285 | | |
286 | | //XElementAccess |
287 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
288 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
289 | | |
290 | | //XServiceInfo |
291 | | virtual OUString SAL_CALL getImplementationName() override; |
292 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
293 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
294 | | |
295 | | rtl::Reference<SwXTextTable> getTextTableByName(std::u16string_view Name); |
296 | | rtl::Reference<SwXTextTable> getTextTableByIndex(sal_Int32 nIndex); |
297 | | }; |
298 | | |
299 | | typedef |
300 | | cppu::WeakImplHelper |
301 | | < |
302 | | css::container::XEnumerationAccess, |
303 | | css::container::XNameAccess, |
304 | | css::container::XIndexAccess, |
305 | | css::lang::XServiceInfo |
306 | | > SwXFramesBaseClass; |
307 | | |
308 | | class SAL_DLLPUBLIC_RTTI SwXFrames : public SwXFramesBaseClass, |
309 | | public SwUnoCollection |
310 | | { |
311 | | const FlyCntType m_eType; |
312 | | protected: |
313 | | virtual ~SwXFrames() override; |
314 | | public: |
315 | | SwXFrames(SwDoc* pDoc, FlyCntType eSet); |
316 | | |
317 | | //XEnumerationAccess |
318 | | virtual SW_DLLPUBLIC css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override; |
319 | | |
320 | | //XIndexAccess |
321 | | virtual sal_Int32 SAL_CALL getCount() override; |
322 | | virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; |
323 | | |
324 | | //XNameAccess |
325 | | virtual css::uno::Any SAL_CALL getByName(const OUString& Name) override; |
326 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
327 | | virtual sal_Bool SAL_CALL hasByName(const OUString& Name) override; |
328 | | |
329 | | //XElementAccess |
330 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
331 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
332 | | |
333 | | //XServiceInfo |
334 | | virtual OUString SAL_CALL getImplementationName() override; |
335 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
336 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
337 | | }; |
338 | | |
339 | | class SwXTextFrames final : public SwXFrames |
340 | | { |
341 | | virtual ~SwXTextFrames() override; |
342 | | public: |
343 | | SwXTextFrames(SwDoc* pDoc); |
344 | | |
345 | | //XServiceInfo |
346 | | virtual OUString SAL_CALL getImplementationName() override; |
347 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
348 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
349 | | |
350 | | }; |
351 | | |
352 | | class SwXTextGraphicObjects final : public SwXFrames |
353 | | { |
354 | | virtual ~SwXTextGraphicObjects() override; |
355 | | public: |
356 | | SwXTextGraphicObjects(SwDoc* pDoc); |
357 | | |
358 | | //XServiceInfo |
359 | | virtual OUString SAL_CALL getImplementationName() override; |
360 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
361 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
362 | | |
363 | | }; |
364 | | |
365 | | class SwXTextEmbeddedObjects final : public SwXFrames |
366 | | { |
367 | | virtual ~SwXTextEmbeddedObjects() override; |
368 | | public: |
369 | | SwXTextEmbeddedObjects(SwDoc* pDoc); |
370 | | |
371 | | //XServiceInfo |
372 | | virtual OUString SAL_CALL getImplementationName() override; |
373 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
374 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
375 | | |
376 | | }; |
377 | | |
378 | | class SAL_DLLPUBLIC_RTTI SwXTextSections final : public SwCollectionBaseClass, |
379 | | public SwUnoCollection |
380 | | { |
381 | | virtual ~SwXTextSections() override; |
382 | | public: |
383 | | SwXTextSections(SwDoc* pDoc); |
384 | | |
385 | | //XIndexAccess |
386 | | virtual sal_Int32 SAL_CALL getCount() override; |
387 | | virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; |
388 | | |
389 | | //XNameAccess |
390 | | virtual css::uno::Any SAL_CALL getByName(const OUString& Name) override; |
391 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
392 | | virtual sal_Bool SAL_CALL hasByName(const OUString& Name) override; |
393 | | |
394 | | //XElementAccess |
395 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
396 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
397 | | |
398 | | //XServiceInfo |
399 | | virtual OUString SAL_CALL getImplementationName() override; |
400 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
401 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
402 | | |
403 | | SW_DLLPUBLIC rtl::Reference<SwXTextSection> getSwTextSectionByName(const OUString& Name); |
404 | | rtl::Reference<SwXTextSection> getSwTextSectionByIndex(sal_Int32 nIndex); |
405 | | }; |
406 | | |
407 | | class SwXBookmarks final : public SwCollectionBaseClass, |
408 | | public SwUnoCollection |
409 | | { |
410 | | virtual ~SwXBookmarks() override; |
411 | | public: |
412 | | SwXBookmarks(SwDoc* pDoc); |
413 | | |
414 | | //XIndexAccess |
415 | | virtual sal_Int32 SAL_CALL getCount() override; |
416 | | virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; |
417 | | |
418 | | //XNameAccess |
419 | | virtual css::uno::Any SAL_CALL getByName(const OUString& Name) override; |
420 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
421 | | virtual sal_Bool SAL_CALL hasByName(const OUString& Name) override; |
422 | | |
423 | | //XElementAccess |
424 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
425 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
426 | | |
427 | | //XServiceInfo |
428 | | virtual OUString SAL_CALL getImplementationName() override; |
429 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
430 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
431 | | |
432 | | rtl::Reference<SwXBookmark> getBookmarkByIndex(sal_Int32 nIndex); |
433 | | }; |
434 | | |
435 | | class SwXNumberingRulesCollection final : public cppu::WeakImplHelper |
436 | | < |
437 | | css::container::XIndexAccess |
438 | | >, |
439 | | public SwUnoCollection |
440 | | { |
441 | | virtual ~SwXNumberingRulesCollection() override; |
442 | | |
443 | | public: |
444 | | SwXNumberingRulesCollection( SwDoc* pDoc ); |
445 | | |
446 | | //XIndexAccess |
447 | | virtual sal_Int32 SAL_CALL getCount() override; |
448 | | virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; |
449 | | |
450 | | //XElementAccess |
451 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
452 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
453 | | }; |
454 | | |
455 | | typedef |
456 | | cppu::WeakImplHelper |
457 | | < |
458 | | css::container::XIndexAccess, |
459 | | css::lang::XServiceInfo |
460 | | > |
461 | | SwSimpleIndexAccessBaseClass; |
462 | | |
463 | | class SW_DLLPUBLIC SwXFootnotes final : public SwSimpleIndexAccessBaseClass, |
464 | | public SwUnoCollection |
465 | | { |
466 | | const bool m_bEndnote; |
467 | | |
468 | | virtual ~SwXFootnotes() override; |
469 | | public: |
470 | | SwXFootnotes(bool bEnd, SwDoc* pDoc); |
471 | | |
472 | | //XIndexAccess |
473 | | virtual sal_Int32 SAL_CALL getCount() override; |
474 | | virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; |
475 | | |
476 | | //XElementAccess |
477 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
478 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
479 | | |
480 | | //XServiceInfo |
481 | | virtual OUString SAL_CALL getImplementationName() override; |
482 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
483 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
484 | | |
485 | | rtl::Reference<SwXFootnote> getFootnoteByIndex(sal_Int32 nIndex) ; |
486 | | }; |
487 | | |
488 | | class SwXReferenceMarks final : public SwCollectionBaseClass, |
489 | | public SwUnoCollection |
490 | | { |
491 | | virtual ~SwXReferenceMarks() override; |
492 | | public: |
493 | | SwXReferenceMarks(SwDoc* pDoc); |
494 | | |
495 | | //XIndexAccess |
496 | | virtual sal_Int32 SAL_CALL getCount() override; |
497 | | virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override; |
498 | | |
499 | | //XNameAccess |
500 | | virtual css::uno::Any SAL_CALL getByName(const OUString& Name) override; |
501 | | virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override; |
502 | | virtual sal_Bool SAL_CALL hasByName(const OUString& Name) override; |
503 | | |
504 | | //XElementAccess |
505 | | virtual css::uno::Type SAL_CALL getElementType( ) override; |
506 | | virtual sal_Bool SAL_CALL hasElements( ) override; |
507 | | |
508 | | //XServiceInfo |
509 | | virtual OUString SAL_CALL getImplementationName() override; |
510 | | virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; |
511 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; |
512 | | |
513 | | }; |
514 | | |
515 | | #endif |
516 | | |
517 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |