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 #ifndef _UNOCOLL_HXX 28 #define _UNOCOLL_HXX 29 #include <tools/solar.h> 30 #include <flyenum.hxx> 31 #include <vcl/timer.hxx> 32 #include <com/sun/star/lang/XServiceInfo.hpp> 33 #include <com/sun/star/container/XEnumerationAccess.hpp> 34 #include <com/sun/star/container/XNameAccess.hpp> 35 #include <com/sun/star/container/XIndexAccess.hpp> 36 #include <tools/string.hxx> 37 #include <cppuhelper/implbase1.hxx> // helper for implementations 38 #include <cppuhelper/implbase2.hxx> // helper for implementations 39 #include <cppuhelper/implbase3.hxx> // helper for implementations 40 #include <cppuhelper/implbase4.hxx> // helper for implementations 41 #include <IMark.hxx> 42 #include <unobaseclass.hxx> 43 #include "swdllapi.h" 44 /*************************************************** 45 *************************************************** 46 * 47 ***************************************************/ 48 class SwDoc; 49 class SwFrmFmt; 50 namespace com{namespace sun {namespace star {namespace text 51 { 52 class XTextTable; 53 class XTextSection; 54 class XFootnote; 55 }}}} 56 class SwXFrame; 57 class SwFrmFmt; 58 class SwFmtFtn; 59 class XBookmark; 60 class SwXReferenceMark; 61 class SwSectionFmt; 62 class SwFmtRefMark; 63 class SwXReferenceMark; 64 class SwXBookmark; 65 /*-----------------11.03.98 11:19------------------- 66 67 --------------------------------------------------*/ 68 class SwUnoCollection 69 { 70 SwDoc* pDoc; 71 sal_Bool bObjectValid; 72 73 public: 74 SwUnoCollection(SwDoc* p) : 75 pDoc(p), 76 bObjectValid(sal_True){} 77 78 virtual void Invalidate(); 79 sal_Bool IsValid() const {return bObjectValid;} 80 81 82 SwDoc* GetDoc() const {return pDoc;} 83 }; 84 85 /****************************************************************************** 86 * 87 ******************************************************************************/ 88 #define SW_SERVICE_TYPE_TEXTTABLE 0 89 #define SW_SERVICE_TYPE_TEXTFRAME 1 90 #define SW_SERVICE_TYPE_GRAPHIC 2 91 #define SW_SERVICE_TYPE_OLE 3 92 #define SW_SERVICE_TYPE_BOOKMARK 4 93 #define SW_SERVICE_TYPE_FOOTNOTE 5 94 #define SW_SERVICE_TYPE_ENDNOTE 6 95 #define SW_SERVICE_TYPE_INDEXMARK 7 96 #define SW_SERVICE_TYPE_INDEX 8 97 #define SW_SERVICE_REFERENCE_MARK 9 98 #define SW_SERVICE_STYLE_CHARACTER_STYLE 10 99 #define SW_SERVICE_STYLE_PARAGRAPH_STYLE 11 100 #define SW_SERVICE_STYLE_FRAME_STYLE 12 101 #define SW_SERVICE_STYLE_PAGE_STYLE 13 102 #define SW_SERVICE_STYLE_NUMBERING_STYLE 14 103 #define SW_SERVICE_CONTENT_INDEX_MARK 15 104 #define SW_SERVICE_CONTENT_INDEX 16 105 #define SW_SERVICE_USER_INDEX_MARK 17 106 #define SW_SERVICE_USER_INDEX 18 107 #define SW_SERVICE_TEXT_SECTION 19 108 #define SW_SERVICE_FIELDTYPE_DATETIME 20 109 #define SW_SERVICE_FIELDTYPE_USER 21 110 #define SW_SERVICE_FIELDTYPE_SET_EXP 22 111 #define SW_SERVICE_FIELDTYPE_GET_EXP 23 112 #define SW_SERVICE_FIELDTYPE_FILE_NAME 24 113 #define SW_SERVICE_FIELDTYPE_PAGE_NUM 25 114 #define SW_SERVICE_FIELDTYPE_AUTHOR 26 115 #define SW_SERVICE_FIELDTYPE_CHAPTER 27 116 #define SW_SERVICE_FIELDTYPE_DUMMY_0 28 117 #define SW_SERVICE_FIELDTYPE_GET_REFERENCE 29 118 #define SW_SERVICE_FIELDTYPE_CONDITIONED_TEXT 30 119 #define SW_SERVICE_FIELDTYPE_ANNOTATION 31 120 #define SW_SERVICE_FIELDTYPE_INPUT 32 121 #define SW_SERVICE_FIELDTYPE_MACRO 33 122 #define SW_SERVICE_FIELDTYPE_DDE 34 123 #define SW_SERVICE_FIELDTYPE_HIDDEN_PARA 35 124 #define SW_SERVICE_FIELDTYPE_DOC_INFO 36 125 #define SW_SERVICE_FIELDTYPE_TEMPLATE_NAME 37 126 #define SW_SERVICE_FIELDTYPE_USER_EXT 38 127 #define SW_SERVICE_FIELDTYPE_REF_PAGE_SET 39 128 #define SW_SERVICE_FIELDTYPE_REF_PAGE_GET 40 129 #define SW_SERVICE_FIELDTYPE_JUMP_EDIT 41 130 #define SW_SERVICE_FIELDTYPE_SCRIPT 42 131 #define SW_SERVICE_FIELDTYPE_DATABASE_NEXT_SET 43 132 #define SW_SERVICE_FIELDTYPE_DATABASE_NUM_SET 44 133 #define SW_SERVICE_FIELDTYPE_DATABASE_SET_NUM 45 134 #define SW_SERVICE_FIELDTYPE_DATABASE 46 135 #define SW_SERVICE_FIELDTYPE_DATABASE_NAME 47 136 #define SW_SERVICE_FIELDTYPE_TABLE_FORMULA 48 137 #define SW_SERVICE_FIELDTYPE_PAGE_COUNT 49 138 #define SW_SERVICE_FIELDTYPE_PARAGRAPH_COUNT 50 139 #define SW_SERVICE_FIELDTYPE_WORD_COUNT 51 140 #define SW_SERVICE_FIELDTYPE_CHARACTER_COUNT 52 141 #define SW_SERVICE_FIELDTYPE_TABLE_COUNT 53 142 #define SW_SERVICE_FIELDTYPE_GRAPHIC_OBJECT_COUNT 54 143 #define SW_SERVICE_FIELDTYPE_EMBEDDED_OBJECT_COUNT 55 144 #define SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_AUTHOR 56 145 #define SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_DATE_TIME 57 146 #define SW_SERVICE_FIELDTYPE_DOCINFO_EDIT_TIME 58 147 #define SW_SERVICE_FIELDTYPE_DOCINFO_DESCRIPTION 59 148 #define SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_AUTHOR 60 149 #define SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_DATE_TIME 61 150 #define SW_SERVICE_FIELDTYPE_DUMMY_O 62 151 #define SW_SERVICE_FIELDTYPE_DUMMY_1 63 152 #define SW_SERVICE_FIELDTYPE_DUMMY_2 64 153 #define SW_SERVICE_FIELDTYPE_DUMMY_3 65 154 #define SW_SERVICE_FIELDTYPE_DOCINFO_CUSTOM 66 155 #define SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_AUTHOR 67 156 #define SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_DATE_TIME 68 157 #define SW_SERVICE_FIELDTYPE_DOCINFO_KEY_WORDS 69 158 #define SW_SERVICE_FIELDTYPE_DOCINFO_SUBJECT 70 159 #define SW_SERVICE_FIELDTYPE_DOCINFO_TITLE 71 160 #define SW_SERVICE_FIELDTYPE_DOCINFO_REVISION 72 161 #define SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY 73 162 #define SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS 74 163 #define SW_SERVICE_FIELDTYPE_DROPDOWN 75 164 #define SW_SERVICE_FIELDTYPE_METAFIELD 76 165 #define SW_SERVICE_FIELDTYPE_DUMMY_4 77 166 #define SW_SERVICE_FIELDTYPE_DUMMY_5 78 167 #define SW_SERVICE_FIELDTYPE_DUMMY_6 79 168 #define SW_SERVICE_FIELDTYPE_DUMMY_7 80 169 #define SW_SERVICE_FIELDMASTER_USER 81 170 #define SW_SERVICE_FIELDMASTER_DDE 82 171 #define SW_SERVICE_FIELDMASTER_SET_EXP 83 172 #define SW_SERVICE_FIELDMASTER_DATABASE 84 173 #define SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY 85 174 #define SW_SERVICE_FIELDMASTER_DUMMY2 86 175 #define SW_SERVICE_FIELDMASTER_DUMMY3 87 176 #define SW_SERVICE_FIELDMASTER_DUMMY4 88 177 #define SW_SERVICE_FIELDMASTER_DUMMY5 89 178 #define SW_SERVICE_INDEX_ILLUSTRATIONS 90 179 #define SW_SERVICE_INDEX_OBJECTS 91 180 #define SW_SERVICE_INDEX_TABLES 92 181 #define SW_SERVICE_INDEX_BIBLIOGRAPHY 93 182 #define SW_SERVICE_PARAGRAPH 94 183 #define SW_SERVICE_FIELDTYPE_INPUT_USER 95 184 #define SW_SERVICE_FIELDTYPE_HIDDEN_TEXT 96 185 #define SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE 97 186 #define SW_SERVICE_NUMBERING_RULES 98 187 #define SW_SERVICE_TEXT_COLUMNS 99 188 #define SW_SERVICE_INDEX_HEADER_SECTION 100 189 #define SW_SERVICE_DEFAULTS 101 190 #define SW_SERVICE_IMAP_RECTANGLE 102 191 #define SW_SERVICE_IMAP_CIRCLE 103 192 #define SW_SERVICE_IMAP_POLYGON 104 193 #define SW_SERVICE_TYPE_TEXT_GRAPHIC 105 194 #define SW_SERVICE_CHART2_DATA_PROVIDER 106 195 #define SW_SERVICE_TYPE_FIELDMARK 107 196 #define SW_SERVICE_TYPE_FORMFIELDMARK 108 197 #define SW_SERVICE_TYPE_META 109 198 199 #define SW_SERVICE_LAST SW_SERVICE_TYPE_META 200 201 #define SW_SERVICE_INVALID USHRT_MAX 202 203 // 204 // case-corrected versions of service-names (see #i67811) 205 // 206 #define CSS_TEXT_TEXTFIELD_DATE_TIME "com.sun.star.text.textfield.DateTime" 207 #define CSS_TEXT_TEXTFIELD_USER "com.sun.star.text.textfield.User" 208 #define CSS_TEXT_TEXTFIELD_SET_EXPRESSION "com.sun.star.text.textfield.SetExpression" 209 #define CSS_TEXT_TEXTFIELD_GET_EXPRESSION "com.sun.star.text.textfield.GetExpression" 210 #define CSS_TEXT_TEXTFIELD_FILE_NAME "com.sun.star.text.textfield.FileName" 211 #define CSS_TEXT_TEXTFIELD_PAGE_NUMBER "com.sun.star.text.textfield.PageNumber" 212 #define CSS_TEXT_TEXTFIELD_AUTHOR "com.sun.star.text.textfield.Author" 213 #define CSS_TEXT_TEXTFIELD_CHAPTER "com.sun.star.text.textfield.Chapter" 214 #define CSS_TEXT_TEXTFIELD_GET_REFERENCE "com.sun.star.text.textfield.GetReference" 215 #define CSS_TEXT_TEXTFIELD_CONDITIONAL_TEXT "com.sun.star.text.textfield.ConditionalText" 216 #define CSS_TEXT_TEXTFIELD_ANNOTATION "com.sun.star.text.textfield.Annotation" 217 #define CSS_TEXT_TEXTFIELD_INPUT "com.sun.star.text.textfield.Input" 218 #define CSS_TEXT_TEXTFIELD_MACRO "com.sun.star.text.textfield.Macro" 219 #define CSS_TEXT_TEXTFIELD_DDE "com.sun.star.text.textfield.DDE" 220 #define CSS_TEXT_TEXTFIELD_HIDDEN_PARAGRAPH "com.sun.star.text.textfield.HiddenParagraph" 221 #define CSS_TEXT_TEXTFIELD_TEMPLATE_NAME "com.sun.star.text.textfield.TemplateName" 222 #define CSS_TEXT_TEXTFIELD_EXTENDED_USER "com.sun.star.text.textfield.ExtendedUser" 223 #define CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_SET "com.sun.star.text.textfield.ReferencePageSet" 224 #define CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_GET "com.sun.star.text.textfield.ReferencePageGet" 225 #define CSS_TEXT_TEXTFIELD_JUMP_EDIT "com.sun.star.text.textfield.JumpEdit" 226 #define CSS_TEXT_TEXTFIELD_SCRIPT "com.sun.star.text.textfield.Script" 227 #define CSS_TEXT_TEXTFIELD_DATABASE_NEXT_SET "com.sun.star.text.textfield.DatabaseNextSet" 228 #define CSS_TEXT_TEXTFIELD_DATABASE_NUMBER_OF_SET "com.sun.star.text.textfield.DatabaseNumberOfSet" 229 #define CSS_TEXT_TEXTFIELD_DATABASE_SET_NUMBER "com.sun.star.text.textfield.DatabaseSetNumber" 230 #define CSS_TEXT_TEXTFIELD_DATABASE "com.sun.star.text.textfield.Database" 231 #define CSS_TEXT_TEXTFIELD_DATABASE_NAME "com.sun.star.text.textfield.DatabaseName" 232 #define CSS_TEXT_TEXTFIELD_TABLE_FORMULA "com.sun.star.text.textfield.TableFormula" 233 #define CSS_TEXT_TEXTFIELD_PAGE_COUNT "com.sun.star.text.textfield.PageCount" 234 #define CSS_TEXT_TEXTFIELD_PARAGRAPH_COUNT "com.sun.star.text.textfield.ParagraphCount" 235 #define CSS_TEXT_TEXTFIELD_WORD_COUNT "com.sun.star.text.textfield.WordCount" 236 #define CSS_TEXT_TEXTFIELD_CHARACTER_COUNT "com.sun.star.text.textfield.CharacterCount" 237 #define CSS_TEXT_TEXTFIELD_TABLE_COUNT "com.sun.star.text.textfield.TableCount" 238 #define CSS_TEXT_TEXTFIELD_GRAPHIC_OBJECT_COUNT "com.sun.star.text.textfield.GraphicObjectCount" 239 #define CSS_TEXT_TEXTFIELD_EMBEDDED_OBJECT_COUNT "com.sun.star.text.textfield.EmbeddedObjectCount" 240 #define CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_AUTHOR "com.sun.star.text.textfield.docinfo.ChangeAuthor" 241 #define CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_DATE_TIME "com.sun.star.text.textfield.docinfo.ChangeDateTime" 242 #define CSS_TEXT_TEXTFIELD_DOCINFO_EDIT_TIME "com.sun.star.text.textfield.docinfo.EditTime" 243 #define CSS_TEXT_TEXTFIELD_DOCINFO_DESCRIPTION "com.sun.star.text.textfield.docinfo.Description" 244 #define CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_AUTHOR "com.sun.star.text.textfield.docinfo.CreateAuthor" 245 #define CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_DATE_TIME "com.sun.star.text.textfield.docinfo.CreateDateTime" 246 #define CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_AUTHOR "com.sun.star.text.textfield.docinfo.PrintAuthor" 247 #define CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_DATE_TIME "com.sun.star.text.textfield.docinfo.PrintDateTime" 248 #define CSS_TEXT_TEXTFIELD_DOCINFO_KEY_WORDS "com.sun.star.text.textfield.docinfo.KeyWords" 249 #define CSS_TEXT_TEXTFIELD_DOCINFO_SUBJECT "com.sun.star.text.textfield.docinfo.Subject" 250 #define CSS_TEXT_TEXTFIELD_DOCINFO_TITLE "com.sun.star.text.textfield.docinfo.Title" 251 #define CSS_TEXT_TEXTFIELD_DOCINFO_REVISION "com.sun.star.text.textfield.docinfo.Revision" 252 #define CSS_TEXT_TEXTFIELD_DOCINFO_CUSTOM "com.sun.star.text.textfield.docinfo.Custom" 253 #define CSS_TEXT_TEXTFIELD_BIBLIOGRAPHY "com.sun.star.text.textfield.Bibliography" 254 #define CSS_TEXT_TEXTFIELD_COMBINED_CHARACTERS "com.sun.star.text.textfield.CombinedCharacters" 255 #define CSS_TEXT_TEXTFIELD_DROP_DOWN "com.sun.star.text.textfield.DropDown" 256 #define CSS_TEXT_TEXTFIELD_INPUT_USER "com.sun.star.text.textfield.InputUser" 257 #define CSS_TEXT_TEXTFIELD_HIDDEN_TEXT "com.sun.star.text.textfield.HiddenText" 258 #define CSS_TEXT_FIELDMASTER_USER "com.sun.star.text.fieldmaster.User" 259 #define CSS_TEXT_FIELDMASTER_DDE "com.sun.star.text.fieldmaster.DDE" 260 #define CSS_TEXT_FIELDMASTER_SET_EXPRESSION "com.sun.star.text.fieldmaster.SetExpression" 261 #define CSS_TEXT_FIELDMASTER_DATABASE "com.sun.star.text.fieldmaster.Database" 262 #define CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY "com.sun.star.text.fieldmaster.Bibliography" 263 264 265 class SwXServiceProvider 266 { 267 public: 268 static rtl::OUString GetProviderName(sal_uInt16 nObjectType); 269 static sal_uInt16 GetProviderType(const rtl::OUString& rServiceName); 270 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > MakeInstance(sal_uInt16 nObjectType, SwDoc* pDoc); 271 static ::com::sun::star::uno::Sequence<rtl::OUString> GetAllServiceNames(); 272 273 }; 274 /*-----------------11.12.97 09:38------------------- 275 276 --------------------------------------------------*/ 277 typedef 278 cppu::WeakImplHelper3 279 < 280 ::com::sun::star::container::XNameAccess, 281 ::com::sun::star::container::XIndexAccess, 282 ::com::sun::star::lang::XServiceInfo 283 > 284 SwCollectionBaseClass; 285 class SW_DLLPUBLIC SwXTextTables : public SwCollectionBaseClass, 286 public SwUnoCollection 287 { 288 protected: 289 virtual ~SwXTextTables(); 290 public: 291 SwXTextTables(SwDoc* pDoc); 292 293 294 //XIndexAccess 295 virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException); 296 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 297 298 //XNameAccess 299 virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 300 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 301 virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 302 303 //XElementAccess 304 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 305 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 306 307 //XServiceInfo 308 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 309 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 310 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 311 312 static ::com::sun::star::text::XTextTable* GetObject( SwFrmFmt& rFmt ); 313 }; 314 315 typedef 316 cppu::WeakImplHelper4 317 < 318 ::com::sun::star::container::XEnumerationAccess, 319 ::com::sun::star::container::XNameAccess, 320 ::com::sun::star::container::XIndexAccess, 321 ::com::sun::star::lang::XServiceInfo 322 > SwXFramesBaseClass; 323 324 class SwXFrames : public SwXFramesBaseClass, 325 public SwUnoCollection 326 { 327 const FlyCntType eType; 328 protected: 329 virtual ~SwXFrames(); 330 public: 331 SwXFrames(SwDoc* pDoc, FlyCntType eSet); 332 333 //XEnumerationAccess 334 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); 335 336 //XIndexAccess 337 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); 338 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 339 340 //XNameAccess 341 virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 342 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 343 virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 344 345 //XElementAccess 346 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 347 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 348 349 //XServiceInfo 350 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 351 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 352 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 353 354 FlyCntType GetType()const{return eType;} 355 static SwXFrame* GetObject( SwFrmFmt& rFmt, FlyCntType eType ); 356 357 }; 358 359 /*-----------------20.02.98 10:51------------------- 360 361 --------------------------------------------------*/ 362 class SwXTextFrames : public SwXFrames 363 { 364 protected: 365 virtual ~SwXTextFrames(); 366 public: 367 SwXTextFrames(SwDoc* pDoc); 368 369 370 // SMART_UNO_DECLARATION( SwXTextFrames, UsrObject ); 371 372 //XServiceInfo 373 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 374 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 375 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 376 377 }; 378 379 /*-----------------20.02.98 10:55------------------- 380 381 --------------------------------------------------*/ 382 class SwXTextGraphicObjects : public SwXFrames 383 { 384 protected: 385 virtual ~SwXTextGraphicObjects(); 386 public: 387 SwXTextGraphicObjects(SwDoc* pDoc); 388 389 390 // SMART_UNO_DECLARATION( SwXTextGraphicObjects, UsrObject ); 391 392 //XServiceInfo 393 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 394 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 395 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 396 397 }; 398 399 /*-----------------20.02.98 10:57------------------- 400 401 --------------------------------------------------*/ 402 class SwXTextEmbeddedObjects : public SwXFrames 403 { 404 protected: 405 virtual ~SwXTextEmbeddedObjects(); 406 public: 407 SwXTextEmbeddedObjects(SwDoc* pDoc); 408 409 410 // SMART_UNO_DECLARATION( SwXTextEmbeddedObjects, UsrObject ); 411 412 //XServiceInfo 413 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 414 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 415 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 416 417 }; 418 419 /*-----------------12.02.98 07:58------------------- 420 421 --------------------------------------------------*/ 422 class SwXTextSections : public SwCollectionBaseClass, 423 public SwUnoCollection 424 { 425 protected: 426 virtual ~SwXTextSections(); 427 public: 428 SwXTextSections(SwDoc* pDoc); 429 430 431 //XIndexAccess 432 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); 433 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 434 435 //XNameAccess 436 virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 437 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 438 virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 439 440 //XElementAccess 441 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 442 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 443 444 //XServiceInfo 445 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 446 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 447 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 448 449 static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection> GetObject( SwSectionFmt& rFmt ); 450 }; 451 /*-----------------12.02.98 07:51------------------- 452 453 --------------------------------------------------*/ 454 class SwXBookmarks : public SwCollectionBaseClass, 455 public SwUnoCollection 456 { 457 protected: 458 virtual ~SwXBookmarks(); 459 public: 460 SwXBookmarks(SwDoc* pDoc); 461 462 463 //XIndexAccess 464 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); 465 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 466 467 //XNameAccess 468 virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 469 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 470 virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 471 472 //XElementAccess 473 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 474 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 475 476 //XServiceInfo 477 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 478 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 479 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 480 481 }; 482 483 class SwXNumberingRulesCollection : public cppu::WeakImplHelper1 484 < 485 ::com::sun::star::container::XIndexAccess 486 >, 487 public SwUnoCollection 488 { 489 protected: 490 virtual ~SwXNumberingRulesCollection(); 491 492 public: 493 SwXNumberingRulesCollection( SwDoc* pDoc ); 494 495 //XIndexAccess 496 virtual sal_Int32 SAL_CALL SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); 497 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 498 499 //XElementAccess 500 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 501 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 502 }; 503 504 /*-----------------12.02.98 08:01------------------- 505 506 --------------------------------------------------*/ 507 508 typedef 509 cppu::WeakImplHelper2 510 < 511 ::com::sun::star::container::XIndexAccess, 512 ::com::sun::star::lang::XServiceInfo 513 > 514 SwSimpleIndexAccessBaseClass; 515 516 class SwXFootnotes : public SwSimpleIndexAccessBaseClass, 517 public SwUnoCollection 518 { 519 const bool m_bEndnote; 520 521 protected: 522 virtual ~SwXFootnotes(); 523 public: 524 SwXFootnotes(sal_Bool bEnd, SwDoc* pDoc); 525 526 //XIndexAccess 527 virtual sal_Int32 SAL_CALL SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); 528 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 529 530 //XElementAccess 531 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 532 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 533 534 //XServiceInfo 535 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 536 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 537 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 538 539 static ::com::sun::star::uno::Reference< ::com::sun::star::text::XFootnote> GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt ); 540 }; 541 542 /* -----------------27.08.98 13:10------------------- 543 * 544 * --------------------------------------------------*/ 545 class SwXReferenceMarks : public SwCollectionBaseClass, 546 public SwUnoCollection 547 { 548 protected: 549 virtual ~SwXReferenceMarks(); 550 public: 551 SwXReferenceMarks(SwDoc* pDoc); 552 553 554 //XIndexAccess 555 virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); 556 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 557 558 //XNameAccess 559 virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); 560 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); 561 virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); 562 563 //XElementAccess 564 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); 565 virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); 566 567 //XServiceInfo 568 virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 569 virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 570 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 571 572 static SwXReferenceMark* GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark ); 573 }; 574 575 #endif 576 577 578 579 580 581 582