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