Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / unotextbodyhf.hxx
blob6f46a3905734ece73053b668a059852465efab00
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_INC_UNOTEXTBODYHF_HXX
21 #define INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/container/XEnumerationAccess.hpp>
27 #include <cppuhelper/implbase.hxx>
28 #include <cppuhelper/implbase2.hxx>
30 #include <unotext.hxx>
32 class SwDoc;
33 class SwFrameFormat;
34 class SwXTextCursor;
36 typedef ::cppu::WeakAggImplHelper2
37 < ::com::sun::star::lang::XServiceInfo
38 , ::com::sun::star::container::XEnumerationAccess
39 > SwXBodyText_Base;
41 class SwXBodyText
42 : public SwXBodyText_Base
43 , public SwXText
46 protected:
48 virtual ~SwXBodyText();
50 public:
52 SwXBodyText(SwDoc *const pDoc);
54 SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false);
56 // XInterface
57 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
58 const ::com::sun::star::uno::Type& rType)
59 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
60 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE { OWeakObject::acquire(); }
61 virtual void SAL_CALL release() throw() SAL_OVERRIDE { OWeakObject::release(); }
63 // XAggregation
64 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(
65 const ::com::sun::star::uno::Type& rType)
66 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 // XTypeProvider
69 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
70 SAL_CALL getTypes()
71 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
73 getImplementationId()
74 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 // XServiceInfo
77 virtual OUString SAL_CALL getImplementationName()
78 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 virtual sal_Bool SAL_CALL supportsService(
80 const OUString& rServiceName)
81 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
83 getSupportedServiceNames()
84 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 // XElementAccess
87 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
88 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 virtual sal_Bool SAL_CALL hasElements()
90 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 // XEnumerationAccess
93 virtual ::com::sun::star::uno::Reference<
94 ::com::sun::star::container::XEnumeration > SAL_CALL
95 createEnumeration()
96 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 // XSimpleText
99 virtual ::com::sun::star::uno::Reference<
100 ::com::sun::star::text::XTextCursor > SAL_CALL
101 createTextCursor()
102 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 virtual ::com::sun::star::uno::Reference<
104 ::com::sun::star::text::XTextCursor > SAL_CALL
105 createTextCursorByRange(
106 const ::com::sun::star::uno::Reference<
107 ::com::sun::star::text::XTextRange > & xTextPosition)
108 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 typedef ::cppu::WeakImplHelper
113 < ::com::sun::star::lang::XServiceInfo
114 , ::com::sun::star::container::XEnumerationAccess
115 > SwXHeadFootText_Base;
117 class SwXHeadFootText
118 : public SwXHeadFootText_Base
119 , public SwXText
122 private:
124 class Impl;
125 ::sw::UnoImplPtr<Impl> m_pImpl;
127 protected:
129 virtual const SwStartNode *GetStartNode() const SAL_OVERRIDE;
130 virtual ::com::sun::star::uno::Reference<
131 ::com::sun::star::text::XTextCursor >
132 CreateCursor()
133 throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
135 virtual ~SwXHeadFootText();
137 SwXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
139 public:
141 static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >
142 CreateXHeadFootText(SwFrameFormat & rHeadFootFormat, const bool bIsHeader);
143 static bool IsXHeadFootText(SwClient *const pClient);
145 // XInterface
146 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
147 const ::com::sun::star::uno::Type& rType)
148 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
149 virtual void SAL_CALL acquire() throw() SAL_OVERRIDE { OWeakObject::acquire(); }
150 virtual void SAL_CALL release() throw() SAL_OVERRIDE { OWeakObject::release(); }
152 // XTypeProvider
153 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
154 SAL_CALL getTypes()
155 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
156 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
157 getImplementationId()
158 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
160 // XServiceInfo
161 virtual OUString SAL_CALL getImplementationName()
162 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 virtual sal_Bool SAL_CALL supportsService(
164 const OUString& rServiceName)
165 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
166 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
167 getSupportedServiceNames()
168 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
170 // XElementAccess
171 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
172 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
173 virtual sal_Bool SAL_CALL hasElements()
174 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
176 // XEnumerationAccess
177 virtual ::com::sun::star::uno::Reference<
178 ::com::sun::star::container::XEnumeration > SAL_CALL
179 createEnumeration()
180 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
182 // XSimpleText
183 virtual ::com::sun::star::uno::Reference<
184 ::com::sun::star::text::XTextCursor > SAL_CALL
185 createTextCursor()
186 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
187 virtual ::com::sun::star::uno::Reference<
188 ::com::sun::star::text::XTextCursor > SAL_CALL
189 createTextCursorByRange(
190 const ::com::sun::star::uno::Reference<
191 ::com::sun::star::text::XTextRange > & xTextPosition)
192 throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
196 #endif // INCLUDED_SW_INC_UNOTEXTBODYHF_HXX
198 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */