Update git submodules
[LibreOffice.git] / sw / source / core / inc / unofootnote.hxx
blob03acbc6cacc1218bea2f8dcede331e6d84b79212
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <swdllapi.h>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/container/XEnumerationAccess.hpp>
26 #include <com/sun/star/text/XFootnote.hpp>
28 #include <cppuhelper/implbase.hxx>
30 #include <unotext.hxx>
32 class SwDoc;
33 class SwFormatFootnote;
34 class SwUnoInternalPaM;
36 typedef ::cppu::WeakImplHelper
37 < css::lang::XServiceInfo
38 , css::beans::XPropertySet
39 , css::container::XEnumerationAccess
40 , css::text::XFootnote
41 > SwXFootnote_Base;
43 class SW_DLLPUBLIC SwXFootnote final
44 : public SwXFootnote_Base
45 , public SwXText
47 friend class SwXFootnotes;
49 class Impl;
50 ::sw::UnoImplPtr<Impl> m_pImpl;
52 virtual const SwStartNode *GetStartNode() const override;
54 virtual ~SwXFootnote() override;
56 SwXFootnote(SwDoc & rDoc, SwFormatFootnote & rFormat);
57 SwXFootnote(const bool bEndnote);
59 public:
61 static rtl::Reference<SwXFootnote>
62 CreateXFootnote(SwDoc & rDoc, SwFormatFootnote * pFootnoteFormat,
63 bool isEndnote = false);
65 // XInterface
66 virtual css::uno::Any SAL_CALL queryInterface(
67 const css::uno::Type& rType) override;
68 virtual void SAL_CALL acquire() noexcept override { OWeakObject::acquire(); }
69 virtual void SAL_CALL release() noexcept override { OWeakObject::release(); }
71 // XTypeProvider
72 virtual css::uno::Sequence< css::uno::Type >
73 SAL_CALL getTypes() override;
74 virtual css::uno::Sequence< sal_Int8 > SAL_CALL
75 getImplementationId() override;
77 // XServiceInfo
78 virtual OUString SAL_CALL getImplementationName() override;
79 virtual sal_Bool SAL_CALL supportsService(
80 const OUString& rServiceName) override;
81 virtual css::uno::Sequence< OUString > SAL_CALL
82 getSupportedServiceNames() override;
84 // XComponent
85 virtual void SAL_CALL dispose() override;
86 virtual void SAL_CALL addEventListener(
87 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
88 virtual void SAL_CALL removeEventListener(
89 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
91 // XPropertySet
92 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
93 getPropertySetInfo() override;
94 virtual void SAL_CALL setPropertyValue(
95 const OUString& rPropertyName,
96 const css::uno::Any& rValue) override;
97 virtual css::uno::Any SAL_CALL getPropertyValue(
98 const OUString& rPropertyName) override;
99 virtual void SAL_CALL addPropertyChangeListener(
100 const OUString& rPropertyName,
101 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
102 virtual void SAL_CALL removePropertyChangeListener(
103 const OUString& rPropertyName,
104 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
105 virtual void SAL_CALL addVetoableChangeListener(
106 const OUString& rPropertyName,
107 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
108 virtual void SAL_CALL removeVetoableChangeListener(
109 const OUString& rPropertyName,
110 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
112 // XElementAccess
113 virtual css::uno::Type SAL_CALL getElementType() override;
114 virtual sal_Bool SAL_CALL hasElements() override;
116 // XEnumerationAccess
117 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
118 createEnumeration() override;
120 // XTextContent
121 virtual void SAL_CALL attach(
122 const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
123 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override;
125 // XFootnote
126 virtual OUString SAL_CALL getLabel() override;
127 virtual void SAL_CALL setLabel(const OUString& rLabel) override;
129 // XSimpleText
130 virtual rtl::Reference< SwXTextCursor > createXTextCursor() override;
131 virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(
132 const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) override;
134 void OnFormatFootnoteDeleted();
136 private:
137 rtl::Reference< SwXTextCursor > createXTextCursorByRangeImpl(SwUnoInternalPaM& rPam);
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */