LibreOffice Module sw (master)  1
unoidx.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 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOIDX_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_UNOIDX_HXX
21 
22 #include <com/sun/star/lang/XServiceInfo.hpp>
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/container/XNamed.hpp>
26 #include <com/sun/star/util/XRefreshable.hpp>
27 #include <com/sun/star/text/XDocumentIndexMark.hpp>
28 #include <com/sun/star/text/XDocumentIndex.hpp>
29 
30 #include <cppuhelper/implbase.hxx>
31 
32 #include <sfx2/Metadatable.hxx>
33 
34 #include <toxe.hxx>
35 #include <unobaseclass.hxx>
36 
37 class SwDoc;
38 class SwTOXBaseSection;
39 class SwTOXMark;
40 class SwTOXType;
41 
42 typedef ::cppu::ImplInheritanceHelper
44 , css::lang::XUnoTunnel
45 , css::lang::XServiceInfo
46 , css::beans::XPropertySet
47 , css::container::XNamed
48 , css::util::XRefreshable
49 , css::text::XDocumentIndex
51 
53  : public SwXDocumentIndex_Base
54 {
55 
56 private:
57 
58  class StyleAccess_Impl;
59  class TokenAccess_Impl;
60 
61  class Impl;
63 
64  virtual ~SwXDocumentIndex() override;
65 
67 
69  SwXDocumentIndex(const TOXTypes eToxType, SwDoc& rDoc);
70 
71 public:
72 
73  static css::uno::Reference< css::text::XDocumentIndex>
74  CreateXDocumentIndex(SwDoc & rDoc, SwTOXBaseSection * pSection,
75  TOXTypes eTypes = TOX_INDEX);
76 
77  // MetadatableMixin
78  virtual ::sfx2::Metadatable* GetCoreObject() override;
79  virtual css::uno::Reference< css::frame::XModel >
80  GetModel() override;
81 
82  static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
83 
84  // XUnoTunnel
85  virtual sal_Int64 SAL_CALL getSomething(
86  const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
87 
88  // XServiceInfo
89  virtual OUString SAL_CALL getImplementationName() override;
90  virtual sal_Bool SAL_CALL supportsService(
91  const OUString& rServiceName) override;
92  virtual css::uno::Sequence< OUString > SAL_CALL
93  getSupportedServiceNames() override;
94 
95  // XComponent
96  virtual void SAL_CALL dispose() override;
97  virtual void SAL_CALL addEventListener(
98  const css::uno::Reference< css::lang::XEventListener > & xListener) override;
99  virtual void SAL_CALL removeEventListener(
100  const css::uno::Reference< css::lang::XEventListener > & xListener) override;
101 
102  // XPropertySet
103  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
104  getPropertySetInfo() override;
105  virtual void SAL_CALL setPropertyValue(
106  const OUString& rPropertyName,
107  const css::uno::Any& rValue) override;
108  virtual css::uno::Any SAL_CALL getPropertyValue(
109  const OUString& rPropertyName) override;
110  virtual void SAL_CALL addPropertyChangeListener(
111  const OUString& rPropertyName,
112  const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
113  virtual void SAL_CALL removePropertyChangeListener(
114  const OUString& rPropertyName,
115  const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
116  virtual void SAL_CALL addVetoableChangeListener(
117  const OUString& rPropertyName,
118  const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
119  virtual void SAL_CALL removeVetoableChangeListener(
120  const OUString& rPropertyName,
121  const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
122 
123  // XNamed
124  virtual OUString SAL_CALL getName() override;
125  virtual void SAL_CALL setName(const OUString& rName) override;
126 
127  // XRefreshable
128  virtual void SAL_CALL refresh() override;
129  virtual void SAL_CALL addRefreshListener(
130  const css::uno::Reference< css::util::XRefreshListener>& xListener) override;
131  virtual void SAL_CALL removeRefreshListener(
132  const css::uno::Reference< css::util::XRefreshListener>& xListener) override;
133 
134  // XTextContent
135  virtual void SAL_CALL attach(
136  const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
137  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override;
138 
139  // XDocumentIndex
140  virtual OUString SAL_CALL getServiceName() override;
141  virtual void SAL_CALL update() override;
142 
143 };
144 
145 typedef ::cppu::WeakImplHelper
146 < css::lang::XUnoTunnel
147 , css::lang::XServiceInfo
148 , css::beans::XPropertySet
149 , css::text::XDocumentIndexMark
151 
154 {
155 
156 private:
157 
158  class Impl;
160 
161  virtual ~SwXDocumentIndexMark() override;
162 
164  SwTOXType & rType, SwTOXMark & rMark);
165 
167  SwXDocumentIndexMark(const TOXTypes eToxType);
168 
169 public:
170 
171  static css::uno::Reference< css::text::XDocumentIndexMark>
173  SwTOXMark * pMark, TOXTypes eType = TOX_INDEX);
174 
175  static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
176 
177  // XUnoTunnel
178  virtual sal_Int64 SAL_CALL getSomething(
179  const css::uno::Sequence< sal_Int8 >& rIdentifier) override;
180 
181  // XServiceInfo
182  virtual OUString SAL_CALL getImplementationName() override;
183  virtual sal_Bool SAL_CALL supportsService(
184  const OUString& rServiceName) override;
185  virtual css::uno::Sequence< OUString > SAL_CALL
186  getSupportedServiceNames() override;
187 
188  // XComponent
189  virtual void SAL_CALL dispose() override;
190  virtual void SAL_CALL addEventListener(
191  const css::uno::Reference< css::lang::XEventListener > & xListener) override;
192  virtual void SAL_CALL removeEventListener(
193  const css::uno::Reference< css::lang::XEventListener > & xListener) override;
194 
195  // XPropertySet
196  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
197  getPropertySetInfo() override;
198  virtual void SAL_CALL setPropertyValue(
199  const OUString& rPropertyName,
200  const css::uno::Any& rValue) override;
201  virtual css::uno::Any SAL_CALL getPropertyValue(
202  const OUString& rPropertyName) override;
203  virtual void SAL_CALL addPropertyChangeListener(
204  const OUString& rPropertyName,
205  const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
206  virtual void SAL_CALL removePropertyChangeListener(
207  const OUString& rPropertyName,
208  const css::uno::Reference<css::beans::XPropertyChangeListener >& xListener) override;
209  virtual void SAL_CALL addVetoableChangeListener(
210  const OUString& rPropertyName,
211  const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
212  virtual void SAL_CALL removeVetoableChangeListener(
213  const OUString& rPropertyName,
214  const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
215 
216  // XTextContent
217  virtual void SAL_CALL attach(
218  const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
219  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override;
220 
221  // XDocumentIndexMark
222  virtual OUString SAL_CALL getMarkEntry() override;
223  virtual void SAL_CALL setMarkEntry(const OUString& rIndexEntry) override;
224 
225 };
226 
227 #endif
228 
229 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unoidx.cxx:1321
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoidx.cxx:2322
TOXTypes
Definition: toxe.hxx:39
virtual void SAL_CALL setMarkEntry(const OUString &rIndexEntry) override
Definition: unoidx.cxx:1755
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoidx.cxx:1243
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
Definition: unoidx.cxx:1312
virtual css::uno::Reference< css::frame::XModel > GetModel() override
Definition: unoidx.cxx:1490
::cppu::WeakImplHelper< css::lang::XUnoTunnel, css::lang::XServiceInfo, css::beans::XPropertySet, css::text::XDocumentIndexMark > SwXDocumentIndexMark_Base
Definition: unoidx.hxx:150
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoidx.cxx:1235
Definition: doc.hxx:185
virtual void SAL_CALL update() override
Definition: unoidx.cxx:539
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoidx.cxx:2338
virtual void SAL_CALL refresh() override
Definition: unoidx.cxx:1271
virtual OUString SAL_CALL getImplementationName() override
Definition: unoidx.cxx:468
virtual OUString SAL_CALL getMarkEntry() override
Definition: unoidx.cxx:1736
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unoidx.cxx:1379
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unoidx.cxx:1701
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unoidx.cxx:1788
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoidx.cxx:480
virtual void SAL_CALL setName(const OUString &rName) override
Definition: unoidx.cxx:1454
virtual ::sfx2::Metadatable * GetCoreObject() override
Definition: unoidx.cxx:1484
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoidx.cxx:1427
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
virtual void SAL_CALL dispose() override
Definition: unoidx.cxx:2007
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unoidx.cxx:888
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoidx.cxx:1707
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Definition: unoidx.cxx:1690
virtual OUString SAL_CALL getServiceName() override
Definition: unoidx.cxx:514
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoidx.cxx:545
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoidx.cxx:1219
unsigned char sal_Bool
static css::uno::Reference< css::text::XDocumentIndexMark > CreateXDocumentIndexMark(SwDoc &rDoc, SwTOXMark *pMark, TOXTypes eType=TOX_INDEX)
Definition: unoidx.cxx:1651
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
Definition: unoidx.cxx:1304
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoidx.cxx:1684
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoidx.cxx:2035
static css::uno::Reference< css::text::XDocumentIndex > CreateXDocumentIndex(SwDoc &rDoc, SwTOXBaseSection *pSection, TOXTypes eTypes=TOX_INDEX)
Definition: unoidx.cxx:424
::cppu::ImplInheritanceHelper< ::sfx2::MetadatableMixin, css::lang::XUnoTunnel, css::lang::XServiceInfo, css::beans::XPropertySet, css::container::XNamed, css::util::XRefreshable, css::text::XDocumentIndex > SwXDocumentIndex_Base
Definition: unoidx.hxx:40
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unoidx.cxx:2064
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unoidx.cxx:555
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Definition: unoidx.cxx:462
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoidx.cxx:1227
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unoidx.hxx:158
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unoidx.cxx:1973
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoidx.cxx:2027
virtual OUString SAL_CALL getName() override
Definition: unoidx.cxx:1435
SwXDocumentIndexMark(SwDoc &rDoc, SwTOXType &rType, SwTOXMark &rMark)
Definition: unoidx.cxx:1639
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unoidx.cxx:2330
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unoidx.cxx:2201
virtual void SAL_CALL dispose() override
Definition: unoidx.cxx:1404
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoidx.cxx:456
SwXDocumentIndex(SwTOXBaseSection &, SwDoc &)
Definition: unoidx.cxx:407
virtual ~SwXDocumentIndexMark() override
Definition: unoidx.cxx:1646
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unoidx.hxx:61
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unoidx.cxx:474
virtual ~SwXDocumentIndex() override
Definition: unoidx.cxx:419
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoidx.cxx:1418
virtual OUString SAL_CALL getImplementationName() override
Definition: unoidx.cxx:1696
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoidx.cxx:2314
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoidx.cxx:2019