xref: /AOO41X/main/sw/source/filter/xml/xmltexti.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _XMLTEXTI_HXX
24 #define _XMLTEXTI_HXX
25 
26 #ifndef _XMLOFF_TXTIMP_HXX
27 #include <xmloff/txtimp.hxx>
28 #endif
29 #include <xmloff/functional.hxx>
30 
31 class XMLRedlineImportHelper;
32 class SvXMLImport;
33 
34 class SwXMLTextImportHelper : public XMLTextImportHelper
35 {
36     XMLRedlineImportHelper *pRedlineHelper;
37 
38 protected:
39     virtual SvXMLImportContext *CreateTableChildContext(
40                 SvXMLImport& rImport,
41                 sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName,
42                 const ::com::sun::star::uno::Reference<
43                     ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
44 
45 public:
46     SwXMLTextImportHelper(
47             const ::com::sun::star::uno::Reference <
48                 ::com::sun::star::frame::XModel>& rModel,
49             SvXMLImport& rImport,
50             const ::com::sun::star::uno::Reference <
51                 ::com::sun::star::beans::XPropertySet>& rInfoSet,
52             sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bProgress,
53             sal_Bool bBlockM, sal_Bool bOrganizerM,
54             sal_Bool bPreserveRedlineMode );
55     ~SwXMLTextImportHelper();
56 
57     virtual ::com::sun::star::uno::Reference<
58         ::com::sun::star::beans::XPropertySet>
59             createAndInsertOLEObject( SvXMLImport& rImport,
60                                       const ::rtl::OUString& rHRef,
61                                       const ::rtl::OUString& rStyleName,
62                                       const ::rtl::OUString& rTblName,
63                                       sal_Int32 nWidth, sal_Int32 nHeight );
64     virtual ::com::sun::star::uno::Reference<
65         ::com::sun::star::beans::XPropertySet>
66             createAndInsertOOoLink( SvXMLImport& rImport,
67                                       const ::rtl::OUString& rHRef,
68                                       const ::rtl::OUString& rStyleName,
69                                       const ::rtl::OUString& rTblName,
70                                       sal_Int32 nWidth, sal_Int32 nHeight );
71     virtual ::com::sun::star::uno::Reference<
72         ::com::sun::star::beans::XPropertySet>
73         createAndInsertApplet(
74             const ::rtl::OUString &rName,
75             const ::rtl::OUString &rCode,
76             sal_Bool bMayScript,
77             const ::rtl::OUString& rHRef,
78             sal_Int32 nWidth, sal_Int32 nHeight );
79 
80     virtual ::com::sun::star::uno::Reference<
81         ::com::sun::star::beans::XPropertySet>
82         createAndInsertPlugin(
83             const ::rtl::OUString &rMimeType,
84             const ::rtl::OUString& rHRef,
85             sal_Int32 nWidth, sal_Int32 nHeight );
86 
87     virtual ::com::sun::star::uno::Reference<
88         ::com::sun::star::beans::XPropertySet>
89         createAndInsertFloatingFrame(
90             const ::rtl::OUString &rName,
91             const ::rtl::OUString &rHRef,
92             const ::rtl::OUString &rStyleName,
93             sal_Int32 nWidth, sal_Int32 nHeight );
94 
95     virtual void endAppletOrPlugin(
96         const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > &rPropSet,
97         ::std::map < const ::rtl::OUString, ::rtl::OUString, ::comphelper::UStringLess> &rParamMap);
98 
99     virtual sal_Bool IsInHeaderFooter() const;
100 
101     // redlining helper methods
102     // (here is the real implementation)
103     virtual void RedlineAdd(
104         const ::rtl::OUString& rType,       /// redline type (insert, del,... )
105         const ::rtl::OUString& rId,         /// use to identify this redline
106         const ::rtl::OUString& rAuthor,     /// name of the author
107         const ::rtl::OUString& rComment,    /// redline comment
108         const ::com::sun::star::util::DateTime& rDateTime,  /// date+time
109         sal_Bool bMergeLastPara);           /// merge last paragraph
110     virtual ::com::sun::star::uno::Reference<
111         ::com::sun::star::text::XTextCursor> RedlineCreateText(
112             ::com::sun::star::uno::Reference<   /// needed to get the document
113                     ::com::sun::star::text::XTextCursor> & rOldCursor,
114             const ::rtl::OUString& rId);    /// ID used to RedlineAdd() call
115     virtual void RedlineSetCursor(
116         const ::rtl::OUString& rId,         /// ID used to RedlineAdd() call
117         sal_Bool bStart,                    /// start or end Cursor
118         sal_Bool bIsOutsideOfParagraph);
119     virtual void RedlineAdjustStartNodeCursor(
120         sal_Bool bStart);
121     virtual void SetShowChanges( sal_Bool bShowChanges );
122     virtual void SetRecordChanges( sal_Bool bRecordChanges );
123     virtual void SetChangesProtectionKey(
124         const ::com::sun::star::uno::Sequence<sal_Int8> & rKey );
125 };
126 
127 #endif  //  _XMLTEXTI_HXX
128 
129