Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / unosection.hxx
blob7527a2f110889fe4a26f8d2efe0f12b3328ad008
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 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNOSECTION_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNOSECTION_HXX
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/beans/XPropertyState.hpp>
26 #include <com/sun/star/beans/XMultiPropertySet.hpp>
27 #include <com/sun/star/container/XNamed.hpp>
28 #include <com/sun/star/text/XTextSection.hpp>
30 #include <cppuhelper/implbase.hxx>
32 #include <sfx2/Metadatable.hxx>
34 #include <unobaseclass.hxx>
36 class SwSectionFormat;
38 typedef ::cppu::ImplInheritanceHelper
39 < ::sfx2::MetadatableMixin
40 , css::lang::XServiceInfo
41 , css::beans::XPropertySet
42 , css::beans::XPropertyState
43 , css::beans::XMultiPropertySet
44 , css::container::XNamed
45 , css::text::XTextSection
46 > SwXTextSection_Base;
48 class SwXTextSection final
49 : public SwXTextSection_Base
52 private:
54 class Impl;
55 ::sw::UnoImplPtr<Impl> m_pImpl;
57 SwXTextSection(SwSectionFormat *const pFormat, const bool bIndexHeader);
59 virtual ~SwXTextSection() override;
61 public:
63 SwSectionFormat* GetFormat() const;
65 static rtl::Reference< SwXTextSection >
66 CreateXTextSection(SwSectionFormat *const pFormat,
67 const bool bIndexHeader = false);
69 // MetadatableMixin
70 virtual ::sfx2::Metadatable* GetCoreObject() override;
71 virtual css::uno::Reference< css::frame::XModel >
72 GetModel() override;
74 // XServiceInfo
75 virtual OUString SAL_CALL getImplementationName() override;
76 virtual sal_Bool SAL_CALL supportsService(
77 const OUString& rServiceName) override;
78 virtual css::uno::Sequence< OUString > SAL_CALL
79 getSupportedServiceNames() override;
81 // XComponent
82 virtual void SAL_CALL dispose() override;
83 virtual void SAL_CALL addEventListener(
84 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
85 virtual void SAL_CALL removeEventListener(
86 const css::uno::Reference< css::lang::XEventListener > & xListener) override;
88 // XPropertySet
89 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
90 getPropertySetInfo() override;
91 virtual void SAL_CALL setPropertyValue(
92 const OUString& rPropertyName,
93 const css::uno::Any& rValue) override;
94 virtual css::uno::Any SAL_CALL getPropertyValue(
95 const OUString& rPropertyName) override;
96 virtual void SAL_CALL addPropertyChangeListener(
97 const OUString& rPropertyName,
98 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
99 virtual void SAL_CALL removePropertyChangeListener(
100 const OUString& rPropertyName,
101 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener) override;
102 virtual void SAL_CALL addVetoableChangeListener(
103 const OUString& rPropertyName,
104 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
105 virtual void SAL_CALL removeVetoableChangeListener(
106 const OUString& rPropertyName,
107 const css::uno::Reference< css::beans::XVetoableChangeListener >& xListener) override;
109 // XPropertyState
110 virtual css::beans::PropertyState SAL_CALL
111 getPropertyState(const OUString& rPropertyName) override;
112 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL
113 getPropertyStates(
114 const css::uno::Sequence< OUString >& rPropertyNames) override;
115 virtual void SAL_CALL setPropertyToDefault(
116 const OUString& rPropertyName) override;
117 virtual css::uno::Any SAL_CALL getPropertyDefault(
118 const OUString& rPropertyName) override;
120 // XMultiPropertySet
121 virtual void SAL_CALL setPropertyValues(
122 const css::uno::Sequence< OUString >& rPropertyNames,
123 const css::uno::Sequence< css::uno::Any >& rValues) override;
124 virtual css::uno::Sequence< css::uno::Any >
125 SAL_CALL getPropertyValues(
126 const css::uno::Sequence< OUString >& rPropertyNames) override;
127 virtual void SAL_CALL addPropertiesChangeListener(
128 const css::uno::Sequence< OUString >& rPropertyNames,
129 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
130 virtual void SAL_CALL removePropertiesChangeListener(
131 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
132 virtual void SAL_CALL firePropertiesChangeEvent(
133 const css::uno::Sequence< OUString >& rPropertyNames,
134 const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener) override;
136 // XNamed
137 virtual OUString SAL_CALL getName() override;
138 virtual void SAL_CALL setName(const OUString& rName) override;
140 // XTextContent
141 virtual void SAL_CALL attach(
142 const css::uno::Reference< css::text::XTextRange > & xTextRange) override;
143 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override;
145 // XTextSection
146 virtual css::uno::Reference< css::text::XTextSection > SAL_CALL
147 getParentSection() override;
148 virtual css::uno::Sequence< css::uno::Reference< css::text::XTextSection > > SAL_CALL
149 getChildSections() override;
153 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNOSECTION_HXX
155 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */