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
42 virtual css::uno::Reference< css::text::XTextCursor >
43 CreateCursor() override;
44
45public:
46 SwXRedlineText(SwDoc* pDoc, const SwNodeIndex& aNodeIndex);
47
48 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
49 virtual void SAL_CALL acquire( ) noexcept override {OWeakObject::acquire();}
50 virtual void SAL_CALL release( ) noexcept override {OWeakObject::release();}
51
52 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
53 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
54
55 //XText
56 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override;
57 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > & aTextPosition) override;
58
59 //XEnumerationAccess
60 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
61
62 //XElementAccess (via XEnumerationAccess)
63 virtual css::uno::Type SAL_CALL getElementType( ) override;
64 virtual sal_Bool SAL_CALL hasElements( ) override;
65};
66
67typedef cppu::WeakImplHelper<css::container::XEnumerationAccess> SwXRedlineBaseClass;
68
69class SwXRedline final
70 : public SwXRedlineBaseClass
71 , public SwXText
72 , public SvtListener
73{
76public:
77 SwXRedline(SwRangeRedline& rRedline, SwDoc& rDoc);
78 virtual ~SwXRedline() override;
79
80
81 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
82 virtual void SAL_CALL acquire( ) noexcept override {OWeakObject::acquire();}
83 virtual void SAL_CALL release( ) noexcept override {OWeakObject::release();}
84
85 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
86 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
87
88 //XText
89 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override;
90 virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > & aTextPosition) override;
91
92 //XPropertySet
93 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
94 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
95 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
96 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
97 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
98 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
99 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
100
101 //XEnumerationAccess
102 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override;
103
104 //XElementAccess
105 virtual css::uno::Type SAL_CALL getElementType( ) override;
106 virtual sal_Bool SAL_CALL hasElements( ) override;
107
108 const SwRangeRedline* GetRedline() const {return m_pRedline;}
109 virtual void Notify( const SfxHint& ) override;
110};
111
112namespace sw
113{
115 {
118 FindRedlineHint(const SwRangeRedline& rRedline, SwXRedline** ppXRedline) : m_rRedline(rRedline), m_ppXRedline(ppXRedline) {}
119 };
120}
121
122#endif
123
124/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:194
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:50
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override
Definition: unoredline.cxx:93
SwXRedlineText(SwDoc *pDoc, const SwNodeIndex &aNodeIndex)
Definition: unoredline.cxx:47
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unoredline.cxx:98
virtual const SwStartNode * GetStartNode() const override
Definition: unoredline.cxx:53
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: unoredline.cxx:137
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:146
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoredline.cxx:160
SwNodeIndex m_aNodeIndex
Definition: unoredline.hxx:39
virtual void SAL_CALL acquire() noexcept override
Definition: unoredline.hxx:49
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoredline.cxx:155
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoredline.cxx:521
virtual ~SwXRedline() override
Definition: unoredline.cxx:349
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unoredline.cxx:474
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unoredline.cxx:564
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: unoredline.cxx:558
SwXRedline(SwRangeRedline &rRedline, SwDoc &rDoc)
Definition: unoredline.cxx:341
SwRangeRedline * m_pRedline
Definition: unoredline.hxx:75
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unoredline.cxx:528
const SwRangeRedline * GetRedline() const
Definition: unoredline.hxx:108
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoredline.cxx:574
virtual void SAL_CALL acquire() noexcept override
Definition: unoredline.hxx:82
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoredline.cxx:582
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoredline.cxx:360
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoredline.cxx:484
virtual void SAL_CALL release() noexcept override
Definition: unoredline.hxx:83
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unoredline.cxx:501
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoredline.cxx:468
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoredline.cxx:353
virtual void Notify(const SfxHint &) override
Definition: unoredline.cxx:489
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoredline.cxx:516
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoredline.cxx:399
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoredline.cxx:479
SwDoc * m_pDoc
Definition: unoredline.hxx:74
Dialog to specify the properties of date form field.
SwXRedline ** m_ppXRedline
Definition: unoredline.hxx:117
FindRedlineHint(const SwRangeRedline &rRedline, SwXRedline **ppXRedline)
Definition: unoredline.hxx:118
const SwRangeRedline & m_rRedline
Definition: unoredline.hxx:116
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_Bool
cppu::WeakImplHelper< css::container::XEnumerationAccess > SwXRedlineBaseClass
Definition: unoredline.hxx:67