1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOFOOTNOTE_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNOFOOTNOTE_HXX
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/container/XEnumerationAccess.hpp>
27 #include <com/sun/star/text/XFootnote.hpp>
29 #include <cppuhelper/implbase.hxx>
31 #include <unotext.hxx>
34 class SwFormatFootnote
;
36 typedef ::cppu::WeakImplHelper
37 < css::lang::XUnoTunnel
38 , css::lang::XServiceInfo
39 , css::beans::XPropertySet
40 , css::container::XEnumerationAccess
41 , css::text::XFootnote
44 class SwXFootnote final
45 : public SwXFootnote_Base
48 friend class SwXFootnotes
;
51 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
53 virtual const SwStartNode
*GetStartNode() const override
;
55 virtual css::uno::Reference
< css::text::XTextCursor
> CreateCursor() override
;
57 virtual ~SwXFootnote() override
;
59 SwXFootnote(SwDoc
& rDoc
, SwFormatFootnote
& rFormat
);
60 SwXFootnote(const bool bEndnote
);
64 static css::uno::Reference
<css::text::XFootnote
>
65 CreateXFootnote(SwDoc
& rDoc
, SwFormatFootnote
* pFootnoteFormat
,
66 bool isEndnote
= false);
69 virtual css::uno::Any SAL_CALL
queryInterface(
70 const css::uno::Type
& rType
) override
;
71 virtual void SAL_CALL
acquire() throw() override
{ OWeakObject::acquire(); }
72 virtual void SAL_CALL
release() throw() override
{ OWeakObject::release(); }
75 virtual css::uno::Sequence
< css::uno::Type
>
76 SAL_CALL
getTypes() override
;
77 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
78 getImplementationId() override
;
80 static const css::uno::Sequence
< sal_Int8
>& getUnoTunnelId();
83 virtual sal_Int64 SAL_CALL
getSomething(
84 const css::uno::Sequence
< sal_Int8
>& rIdentifier
) override
;
87 virtual OUString SAL_CALL
getImplementationName() override
;
88 virtual sal_Bool SAL_CALL
supportsService(
89 const OUString
& rServiceName
) override
;
90 virtual css::uno::Sequence
< OUString
> SAL_CALL
91 getSupportedServiceNames() override
;
94 virtual void SAL_CALL
dispose() override
;
95 virtual void SAL_CALL
addEventListener(
96 const css::uno::Reference
< css::lang::XEventListener
> & xListener
) override
;
97 virtual void SAL_CALL
removeEventListener(
98 const css::uno::Reference
< css::lang::XEventListener
> & xListener
) override
;
101 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
102 getPropertySetInfo() override
;
103 virtual void SAL_CALL
setPropertyValue(
104 const OUString
& rPropertyName
,
105 const css::uno::Any
& rValue
) override
;
106 virtual css::uno::Any SAL_CALL
getPropertyValue(
107 const OUString
& rPropertyName
) override
;
108 virtual void SAL_CALL
addPropertyChangeListener(
109 const OUString
& rPropertyName
,
110 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
111 virtual void SAL_CALL
removePropertyChangeListener(
112 const OUString
& rPropertyName
,
113 const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) override
;
114 virtual void SAL_CALL
addVetoableChangeListener(
115 const OUString
& rPropertyName
,
116 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& xListener
) override
;
117 virtual void SAL_CALL
removeVetoableChangeListener(
118 const OUString
& rPropertyName
,
119 const css::uno::Reference
< css::beans::XVetoableChangeListener
>& xListener
) override
;
122 virtual css::uno::Type SAL_CALL
getElementType() override
;
123 virtual sal_Bool SAL_CALL
hasElements() override
;
125 // XEnumerationAccess
126 virtual css::uno::Reference
< css::container::XEnumeration
> SAL_CALL
127 createEnumeration() override
;
130 virtual void SAL_CALL
attach(
131 const css::uno::Reference
< css::text::XTextRange
> & xTextRange
) override
;
132 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getAnchor() override
;
135 virtual OUString SAL_CALL
getLabel() override
;
136 virtual void SAL_CALL
setLabel(const OUString
& rLabel
) override
;
139 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
140 createTextCursor() override
;
141 virtual css::uno::Reference
< css::text::XTextCursor
> SAL_CALL
142 createTextCursorByRange(
143 const css::uno::Reference
< css::text::XTextRange
> & xTextPosition
) override
;
147 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNOFOOTNOTE_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */