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 .
19 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOIDX_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_UNOIDX_HXX
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>
30 #include <cppuhelper/implbase.hxx>
32 #include <sfx2/Metadatable.hxx>
35 #include <unobaseclass.hxx>
38 class SwTOXBaseSection
;
42 typedef ::cppu::ImplInheritanceHelper
43 < ::sfx2::MetadatableMixin
44 , css::lang::XUnoTunnel
45 , css::lang::XServiceInfo
46 , css::beans::XPropertySet
47 , css::container::XNamed
48 , css::util::XRefreshable
49 , css::text::XDocumentIndex
50 > SwXDocumentIndex_Base
;
52 class SwXDocumentIndex
53 : public SwXDocumentIndex_Base
58 class StyleAccess_Impl
;
59 class TokenAccess_Impl
;
62 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
64 virtual ~SwXDocumentIndex() override
;
66 SwXDocumentIndex(SwTOXBaseSection
&, SwDoc
&);
69 SwXDocumentIndex(const TOXTypes eToxType
, SwDoc
& rDoc
);
73 static css::uno::Reference
< css::text::XDocumentIndex
>
74 CreateXDocumentIndex(SwDoc
& rDoc
, SwTOXBaseSection
* pSection
,
75 TOXTypes eTypes
= TOX_INDEX
);
78 virtual ::sfx2::Metadatable
* GetCoreObject() override
;
79 virtual css::uno::Reference
< css::frame::XModel
>
82 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
85 virtual sal_Int64 SAL_CALL
getSomething(
86 const css::uno::Sequence
< sal_Int8
>& rIdentifier
) override
;
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
;
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
;
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
;
124 virtual OUString SAL_CALL
getName() override
;
125 virtual void SAL_CALL
setName(const OUString
& rName
) override
;
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
;
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
;
140 virtual OUString SAL_CALL
getServiceName() override
;
141 virtual void SAL_CALL
update() override
;
145 typedef ::cppu::WeakImplHelper
146 < css::lang::XUnoTunnel
147 , css::lang::XServiceInfo
148 , css::beans::XPropertySet
149 , css::text::XDocumentIndexMark
150 > SwXDocumentIndexMark_Base
;
152 class SwXDocumentIndexMark
153 : public SwXDocumentIndexMark_Base
159 ::sw::UnoImplPtr
<Impl
> m_pImpl
;
161 virtual ~SwXDocumentIndexMark() override
;
163 SwXDocumentIndexMark(SwDoc
& rDoc
,
164 SwTOXType
& rType
, SwTOXMark
& rMark
);
167 SwXDocumentIndexMark(const TOXTypes eToxType
);
171 static css::uno::Reference
< css::text::XDocumentIndexMark
>
172 CreateXDocumentIndexMark(SwDoc
& rDoc
,
173 SwTOXMark
* pMark
, TOXTypes eType
= TOX_INDEX
);
175 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
178 virtual sal_Int64 SAL_CALL
getSomething(
179 const css::uno::Sequence
< sal_Int8
>& rIdentifier
) override
;
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
;
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
;
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
;
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
;
221 // XDocumentIndexMark
222 virtual OUString SAL_CALL
getMarkEntry() override
;
223 virtual void SAL_CALL
setMarkEntry(const OUString
& rIndexEntry
) override
;
229 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */