LibreOffice Module sw (master) 1
unoredline.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_INC_UNOREDLINE_HXX
20#define INCLUDED_SW_INC_UNOREDLINE_HXX
21
22#include <svl/listener.hxx>
23#include <com/sun/star/container/XEnumerationAccess.hpp>
24#include "unotext.hxx"
25#include "ndindex.hxx"
26
27class SwRangeRedline;
28
34class SwXRedlineText final :
35 public SwXText,
36 public cppu::OWeakObject,
37 public css::container::XEnumerationAccess
38{
40 virtual const SwStartNode *GetStartNode() const override;
41
42public:
43 SwXRedlineText(SwDoc* pDoc, const SwNodeIndex& aNodeIndex);
44
45 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
46 virtual void SAL_CALL acquire( ) noexcept override {OWeakObject::acquire();}
47 virtual void SAL_CALL release( ) noexcept override {OWeakObject::release();}
48
49 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
50 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
51
52 //XText
55 const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) override;
56
57 //XEnumerationAccess
58 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
59
60 //XElementAccess (via XEnumerationAccess)
61 virtual css::uno::Type SAL_CALL getElementType( ) override;
62 virtual sal_Bool SAL_CALL hasElements( ) override;
63};
64
65typedef cppu::WeakImplHelper<css::container::XEnumerationAccess> SwXRedlineBaseClass;
66
67class SwXRedline final
68 : public SwXRedlineBaseClass
69 , public SwXText
70 , public SvtListener
71{
74public:
75 SwXRedline(SwRangeRedline& rRedline, SwDoc& rDoc);
76 virtual ~SwXRedline() override;
77
78
79 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
80 virtual void SAL_CALL acquire( ) noexcept override {OWeakObject::acquire();}
81 virtual void SAL_CALL release( ) noexcept override {OWeakObject::release();}
82
83 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
84 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
85
86 //XText
89 const ::css::uno::Reference< ::css::text::XTextRange >& aTextPosition ) override;
90
91 //XPropertySet
92 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
93 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
94 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
95 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
96 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
97 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
98 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
99
100 //XEnumerationAccess
101 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
102
103 //XElementAccess
104 virtual css::uno::Type SAL_CALL getElementType( ) override;
105 virtual sal_Bool SAL_CALL hasElements( ) override;
106
107 const SwRangeRedline* GetRedline() const {return m_pRedline;}
108 virtual void Notify( const SfxHint& ) override;
109};
110
111namespace sw
112{
114 {
117 FindRedlineHint(const SwRangeRedline& rRedline, SwXRedline** ppXRedline) : m_rRedline(rRedline), m_ppXRedline(ppXRedline) {}
118 };
119}
120
121#endif
122
123/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:197
Marks a node in the document model.
Definition: ndindex.hxx:31
Starts a section of nodes in the document model.
Definition: node.hxx:348
SwXRedlineText provides an XText which may be used to write directly into a redline node.
Definition: unoredline.hxx:38
virtual void SAL_CALL release() noexcept override
Definition: unoredline.hxx:47
virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition) override
Definition: unoredline.cxx:132
SwXRedlineText(SwDoc *pDoc, const SwNodeIndex &aNodeIndex)
Definition: unoredline.cxx:47
virtual const SwStartNode * GetStartNode() const override
Definition: unoredline.cxx:53
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoredline.cxx:88
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoredline.cxx:80
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unoredline.cxx:58
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unoredline.cxx:141
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoredline.cxx:155
SwNodeIndex m_aNodeIndex
Definition: unoredline.hxx:39
virtual void SAL_CALL acquire() noexcept override
Definition: unoredline.hxx:46
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoredline.cxx:150
virtual rtl::Reference< SwXTextCursor > createXTextCursor() override
Definition: unoredline.cxx:93
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoredline.cxx:516
virtual ~SwXRedline() override
Definition: unoredline.cxx:344
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unoredline.cxx:469
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unoredline.cxx:558
SwXRedline(SwRangeRedline &rRedline, SwDoc &rDoc)
Definition: unoredline.cxx:336
virtual rtl::Reference< SwXTextCursor > createXTextCursorByRange(const ::css::uno::Reference< ::css::text::XTextRange > &aTextPosition) override
Definition: unoredline.cxx:552
SwRangeRedline * m_pRedline
Definition: unoredline.hxx:73
const SwRangeRedline * GetRedline() const
Definition: unoredline.hxx:107
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoredline.cxx:568
virtual void SAL_CALL acquire() noexcept override
Definition: unoredline.hxx:80
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoredline.cxx:576
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoredline.cxx:355
virtual rtl::Reference< SwXTextCursor > createXTextCursor() override
Definition: unoredline.cxx:523
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoredline.cxx:479
virtual void SAL_CALL release() noexcept override
Definition: unoredline.hxx:81
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unoredline.cxx:496
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoredline.cxx:463
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoredline.cxx:348
virtual void Notify(const SfxHint &) override
Definition: unoredline.cxx:484
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoredline.cxx:511
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoredline.cxx:394
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoredline.cxx:474
SwDoc * m_pDoc
Definition: unoredline.hxx:72
Dialog to specify the properties of date form field.
SwXRedline ** m_ppXRedline
Definition: unoredline.hxx:116
FindRedlineHint(const SwRangeRedline &rRedline, SwXRedline **ppXRedline)
Definition: unoredline.hxx:117
const SwRangeRedline & m_rRedline
Definition: unoredline.hxx:115
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_Bool
cppu::WeakImplHelper< css::container::XEnumerationAccess > SwXRedlineBaseClass
Definition: unoredline.hxx:65