Line data Source code
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 _UNOREDLINE_HXX
20 : #define _UNOREDLINE_HXX
21 :
22 : #include <unoport.hxx>
23 : #include <unotext.hxx>
24 :
25 :
26 : class SwRedline;
27 :
28 : /**
29 : * SwXRedlineText provides an XText which may be used to write
30 : * directly into a redline node. It got implemented to enable XML
31 : * import of redlines and should not be used directly via the API.
32 : */
33 0 : class SwXRedlineText :
34 : public SwXText,
35 : public cppu::OWeakObject,
36 : public ::com::sun::star::container::XEnumerationAccess
37 : {
38 : SwNodeIndex aNodeIndex;
39 : virtual const SwStartNode *GetStartNode() const;
40 :
41 : public:
42 : SwXRedlineText(SwDoc* pDoc, SwNodeIndex aNodeIndex);
43 :
44 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
45 0 : virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();}
46 0 : virtual void SAL_CALL release( ) throw(){OWeakObject::release();}
47 :
48 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
49 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
50 :
51 : //XText
52 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
53 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException );
54 :
55 : //XEnumerationAccess
56 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
57 :
58 : //XElementAccess (via XEnumerationAccess)
59 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
60 : virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
61 : };
62 :
63 : class SwXRedlinePortion : public SwXTextPortion
64 : {
65 : const SwRedline* pRedline;
66 :
67 : void Validate() throw( ::com::sun::star::uno::RuntimeException );
68 :
69 : using SwXTextPortion::GetPropertyValue;
70 :
71 : public:
72 : SwXRedlinePortion( const SwRedline* pRed,
73 : const SwUnoCrsr* pPortionCrsr,
74 : ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent,
75 : sal_Bool bIsStart);
76 :
77 : ~SwXRedlinePortion();
78 :
79 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
80 :
81 : //XPropertySet
82 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
83 :
84 : static ::com::sun::star::uno::Any GetPropertyValue( const ::rtl::OUString& PropertyName, const SwRedline& rRedline ) throw();
85 : static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > CreateRedlineProperties( const SwRedline& rRedline, sal_Bool bIsStart ) throw();
86 :
87 : };
88 :
89 : typedef
90 : cppu::WeakImplHelper1
91 : <
92 : ::com::sun::star::container::XEnumerationAccess
93 : >
94 : SwXRedlineBaseClass;
95 : class SwXRedline :
96 : public SwXRedlineBaseClass,
97 : public SwXText,
98 : public SwClient
99 : {
100 : SwDoc* pDoc;
101 : SwRedline* pRedline;
102 : public:
103 : SwXRedline(SwRedline& rRedline, SwDoc& rDoc);
104 : ~SwXRedline();
105 :
106 : TYPEINFO();
107 :
108 : virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
109 0 : virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();}
110 0 : virtual void SAL_CALL release( ) throw(){OWeakObject::release();}
111 :
112 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
113 : virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
114 :
115 : //XText
116 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException );
117 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException );
118 :
119 : //XPropertySet
120 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
121 : virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
122 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
123 : virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
124 : virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
125 : virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
126 : virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
127 :
128 : //XEnumerationAccess
129 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
130 :
131 : //XElementAccess
132 : virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
133 : virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
134 :
135 0 : const SwRedline* GetRedline() const {return pRedline;}
136 : protected:
137 : //SwClient
138 : virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
139 : };
140 : #endif
141 :
142 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|