LibreOffice Module sw (master)  1
unofootnote.hxx
Go to the documentation of this file.
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 
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOFOOTNOTE_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNOFOOTNOTE_HXX
22 
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>
28 
29 #include <cppuhelper/implbase.hxx>
30 
31 #include <unotext.hxx>
32 
33 class SwDoc;
35 
36 typedef ::cppu::WeakImplHelper
37 < css::lang::XUnoTunnel
38 , css::lang::XServiceInfo
39 , css::beans::XPropertySet
40 , css::container::XEnumerationAccess
41 , css::text::XFootnote
43 
44 class SwXFootnote final
45  : public SwXFootnote_Base
46  , public SwXText
47 {
48  friend class SwXFootnotes;
49 
50  class Impl;
52 
53  virtual const SwStartNode *GetStartNode() const override;
54 
55  virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override;
56 
57  virtual ~SwXFootnote() override;
58 
59  SwXFootnote(SwDoc & rDoc, SwFormatFootnote & rFormat);
60  SwXFootnote(const bool bEndnote);
61 
62 public:
63 
64  static css::uno::Reference<css::text::XFootnote>
65  CreateXFootnote(SwDoc & rDoc, SwFormatFootnote * pFootnoteFormat,
66  bool isEndnote = false);
67 
68  // XInterface
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(); }
73 
74  // XTypeProvider
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;
79 
80  static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
81 
82  // XUnoTunnel
83  virtual sal_Int64 SAL_CALL getSomething(
84  const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
85 
86  // XServiceInfo
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;
92 
93  // XComponent
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;
99 
100  // XPropertySet
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;
120 
121  // XElementAccess
122  virtual css::uno::Type SAL_CALL getElementType() override;
123  virtual sal_Bool SAL_CALL hasElements() override;
124 
125  // XEnumerationAccess
126  virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
127  createEnumeration() override;
128 
129  // XTextContent
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;
133 
134  // XFootnote
135  virtual OUString SAL_CALL getLabel() override;
136  virtual void SAL_CALL setLabel(const OUString& rLabel) override;
137 
138  // XSimpleText
139  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
140  createTextCursor() override;
141  virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL
143  const css::uno::Reference< css::text::XTextRange > & xTextPosition) override;
144 
145 };
146 
147 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNOFOOTNOTE_HXX
148 
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unoftn.cxx:498
Starts a section of nodes in the document model.
Definition: node.hxx:303
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoftn.cxx:477
virtual OUString SAL_CALL getLabel() override
Definition: unoftn.cxx:230
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unoftn.cxx:282
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoftn.cxx:199
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Definition: unoftn.cxx:169
virtual void SAL_CALL setLabel(const OUString &rLabel) override
Definition: unoftn.cxx:252
virtual OUString SAL_CALL getImplementationName() override
Definition: unoftn.cxx:176
::cppu::WeakImplHelper< css::lang::XUnoTunnel, css::lang::XServiceInfo, css::beans::XPropertySet, css::container::XEnumerationAccess, css::text::XFootnote > SwXFootnote_Base
Definition: unofootnote.hxx:34
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoftn.cxx:208
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &xTextPosition) override
Definition: unoftn.cxx:434
Definition: doc.hxx:185
virtual const SwStartNode * GetStartNode() const override
Definition: unoftn.cxx:395
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unoftn.cxx:350
virtual void SAL_CALL acquire() override
Definition: unofootnote.hxx:71
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unoftn.cxx:222
virtual void SAL_CALL dispose() override
Definition: unoftn.cxx:365
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unoftn.cxx:505
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoftn.cxx:216
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unofootnote.hxx:50
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoftn.cxx:482
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoftn.cxx:380
virtual ~SwXFootnote() override
Definition: unoftn.cxx:128
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoftn.cxx:558
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoftn.cxx:566
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoftn.cxx:488
unsigned char sal_Bool
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override
Definition: unoftn.cxx:410
virtual void SAL_CALL release() override
Definition: unofootnote.hxx:72
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoftn.cxx:388
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unoftn.cxx:416
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoftn.cxx:542
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoftn.cxx:163
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unoftn.cxx:464
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoftn.cxx:550
static css::uno::Reference< css::text::XFootnote > CreateXFootnote(SwDoc &rDoc, SwFormatFootnote *pFootnoteFormat, bool isEndnote=false)
Definition: unoftn.cxx:133
SwXFootnote(SwDoc &rDoc, SwFormatFootnote &rFormat)
Definition: unoftn.cxx:122
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unoftn.cxx:193