19#ifndef INCLUDED_XMLOFF_TXTIMP_HXX
20#define INCLUDED_XMLOFF_TXTIMP_HXX
25#include <rtl/ustring.hxx>
26#include <com/sun/star/uno/Reference.h>
27#include <com/sun/star/uno/Sequence.hxx>
47 struct ParsedRDFaAttributes;
58namespace frame {
class XModel; }
59namespace container {
class XNameContainer;
class XIndexReplace; }
61namespace xml::sax {
class XAttributeList; }
62namespace xml::sax {
class XFastAttributeList; }
66namespace rtl {
template <
class reference_type>
class Reference; }
91#define XML_TEXT_RENAME_TYPE_FRAME 10
92#define XML_TEXT_RENAME_TYPE_TABLE 20
105 static std::shared_ptr<BackpatcherImpl> MakeBackpatcherImpl();
109 SvXMLImport& rImport,
111 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList );
122 css::uno::Reference< css::frame::XModel >
const& rModel,
123 SvXMLImport& rImport,
124 bool const bInsertMode =
false,
bool const bStylesOnlyMode =
false,
125 bool const bProgress =
false,
bool const bBlockMode =
false,
126 bool const bOrganizerMode =
false);
133 const css::uno::Reference< css::text::XTextCursor >& rCursor );
139 SvXMLImport& rImport,
141 const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList,
144 css::uno::Reference< css::text::XText > & GetText();
145 css::uno::Reference< css::text::XTextCursor > & GetCursor();
146 css::uno::Reference< css::text::XTextRange > & GetCursorAsRange();
148 bool IsInsertMode()
const;
149 bool IsStylesOnlyMode()
const;
150 bool IsBlockMode()
const;
151 bool IsOrganizerMode()
const;
152 bool IsProgress()
const;
154 OUString ConvertStarFonts(
const OUString& rChars,
155 const OUString& rStyleName,
158 SvXMLImport& rImport )
const;
160 void InsertString(
const OUString& rChars );
162 void InsertString( std::u16string_view rChars,
163 bool& rIgnoreLeadingSpace );
165 void DeleteParagraph();
167 void InsertControlCharacter( sal_Int16 nControl );
168 void InsertTextContent( css::uno::Reference< css::text::XTextContent >
const & xContent);
172 OUString SetStyleAndAttrs(
173 SvXMLImport
const & rImport,
174 const css::uno::Reference< css::text::XTextCursor >& rCursor,
175 const OUString& rStyleName,
177 bool bOutlineLevelAttrFound =
false,
179 bool bSetListAttrs =
true,
180 bool bOutlineContentVisible =
true);
187 void FindOutlineStyleName( OUString& rStyleName,
191 void AddOutlineStyleCandidate(
const sal_Int8 nOutlineLevel,
192 const OUString& rStyleName );
194 void SetOutlineStyles(
bool bSetEmpty );
197 SvXMLImport
const & rImport,
198 const css::uno::Reference< css::text::XTextCursor >& rCursor,
199 const OUString& rHRef,
200 const OUString& rName,
201 const OUString& rTargetFrameName,
202 const OUString& rStyleName,
203 const OUString& rVisitedStyleName,
206 SvXMLImport
const & rImport,
207 const css::uno::Reference< css::text::XTextCursor >& rCursor,
208 const OUString& rStyleName,
209 const OUString& rTextStyleName,
210 const OUString& rText );
215 sal_Int32 GetDataStyleKey(
const OUString& sStyleName,
216 bool* pIsSystemLanguage =
nullptr );
219 const OUString& rName )
const;
221 const OUString& rName )
const;
223 const OUString& rName )
const;
225 const OUString& rName )
const;
230 const css::uno::Reference< css::container::XNameContainer> &
GetParaStyles()
const;
232 const css::uno::Reference< css::container::XNameContainer> & GetTextStyles()
const;
234 const css::uno::Reference< css::container::XNameContainer> &
235 GetNumberingStyles()
const;
237 const css::uno::Reference< css::container::XNameContainer> & GetFrameStyles()
const;
239 const css::uno::Reference< css::container::XNameContainer> & GetPageStyles()
const;
241 const css::uno::Reference< css::container::XNameContainer> & GetCellStyles()
const;
243 const css::uno::Reference< css::container::XIndexReplace > &
244 GetChapterNumbering()
const;
246 bool HasFrameByName(
const OUString& rName )
const;
248 bool IsDuplicateFrame(
const OUString& sName, sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight)
const;
249 void StoreLastImportedFrameName(
const OUString& rName);
250 void ClearLastImportedTextFrameName();
252 void ConnectFrameChains(
const OUString& rFrmName,
253 const OUString& rNextFrmName,
254 const css::uno::Reference< css::beans::XPropertySet >& rFrmPropSet );
257 GetParaImportPropertySetMapper()
const;
259 GetTextImportPropertySetMapper()
const;
261 GetSectionImportPropertySetMapper()
const;
263 GetRubyImportPropertySetMapper()
const;
276 void InsertBookmarkStartRange(
277 const OUString & sName,
278 const css::uno::Reference< css::text::XTextRange> & rRange,
279 OUString
const& i_rXmlId,
280 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > &
284 bool FindAndRemoveBookmarkStartRange(
285 const OUString & sName,
286 css::uno::Reference< css::text::XTextRange> & o_rRange,
288 std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes);
290 void pushFieldCtx(
const OUString& name,
const OUString& type );
291 css::uno::Reference<css::text::XFormField> popFieldCtx();
292 void addFieldParam(
const OUString& name,
const OUString& value );
293 void setCurrentFieldParamsTo(css::uno::Reference< css::text::XFormField>
const &xFormField);
294 ::std::pair<OUString, OUString> getCurrentFieldType()
const;
295 css::uno::Reference<css::text::XTextRange> getCurrentFieldStart()
const;
296 bool hasCurrentFieldSeparator()
const;
297 bool hasCurrentFieldCtx()
const;
303 void InsertFootnoteID(
const OUString& sXMLId, sal_Int16 nAPIId);
308 void ProcessFootnoteReference(
309 const OUString& sXMLId,
310 const css::uno::Reference< css::beans::XPropertySet> & xPropSet);
315 void InsertSequenceID(
const OUString& sXMLId,
316 const OUString& sName,
321 void ProcessSequenceReference(
322 const OUString& sXMLId,
323 const css::uno::Reference< css::beans::XPropertySet> & xPropSet);
325 bool IsInFrame()
const;
326 virtual bool IsInHeaderFooter()
const;
328 virtual css::uno::Reference< css::beans::XPropertySet>
329 createAndInsertOLEObject( SvXMLImport& rImport,
330 const OUString& rHRef,
331 const OUString &rStyleName,
332 const OUString &rTblName,
333 sal_Int32 nWidth, sal_Int32 nHeight );
335 virtual css::uno::Reference< css::beans::XPropertySet>
336 createAndInsertOOoLink( SvXMLImport& rImport,
337 const OUString& rHRef,
338 const OUString &rStyleName,
339 const OUString &rTblName,
340 sal_Int32 nWidth, sal_Int32 nHeight );
342 virtual css::uno::Reference< css::beans::XPropertySet>
343 createAndInsertApplet(
344 const OUString &rName,
345 const OUString &rCode,
347 const OUString& rHRef,
348 sal_Int32 nWidth, sal_Int32 nHeight );
350 virtual css::uno::Reference< css::beans::XPropertySet>
351 createAndInsertPlugin(
352 const OUString &rMimeType,
353 const OUString& rHRef,
354 sal_Int32 nWidth, sal_Int32 nHeight );
356 virtual css::uno::Reference< css::beans::XPropertySet>
357 createAndInsertFloatingFrame(
358 const OUString &rName,
359 const OUString &rHRef,
360 const OUString &rStyleName,
361 sal_Int32 nWidth, sal_Int32 nHeight );
363 virtual void endAppletOrPlugin(
364 const css::uno::Reference< css::beans::XPropertySet> &rPropSet,
365 ::std::map < const OUString, OUString > &rParamMap );
373 virtual void RedlineAdd(
375 const OUString& rType,
379 const OUString& rAuthor,
381 const OUString& rComment,
383 const css::util::DateTime& rDateTime,
385 bool bMergeLastParagraph);
387 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
389 css::uno::Reference< css::text::XTextCursor > & rOldCursor,
391 const OUString& rId);
393 virtual void RedlineSetCursor(
399 bool bIsOutsideOfParagraph);
401 virtual void RedlineAdjustStartNodeCursor();
402 virtual void SetShowChanges(
bool bShowChanges );
403 virtual void SetRecordChanges(
bool bRecordChanges );
404 virtual void SetChangesProtectionKey(
405 const css::uno::Sequence<sal_Int8> & rProtectionKey );
408 OUString
const & GetOpenRedlineId()
const;
410 void SetOpenRedlineId( OUString
const & rId);
412 void ResetOpenRedlineId();
416 void SetInsideDeleteContext(
bool const bNew);
419 bool IsInsideDeleteContext()
const;
421 SvXMLImport & GetXMLImport();
427 void PushListContext();
429 void PopListContext();
431 void SetCellParaStyleDefault(OUString
const& rNewValue);
432 OUString
const& GetCellParaStyleDefault()
const;
434 void AddCrossRefHeadingMapping(OUString
const& rFrom, OUString
const& rTo);
435 void MapCrossRefHeadingFieldsHorribly();
437 void setBookmarkAttributes(OUString
const& bookmark,
bool hidden, OUString
const& condition);
438 bool getBookmarkHidden(OUString
const& bookmark)
const;
439 const OUString& getBookmarkCondition(OUString
const& bookmark)
const;
This class deliberately does not support XWeak, to improve performance when loading large documents.
Import <script:events> element.
This class maintains an OUString->sal_Int16 mapping for cases in which an XPropertySet needs to be fi...
XMLTextImportHelper(css::uno::Reference< css::frame::XModel > const &rModel, SvXMLImport &rImport, bool const bInsertMode=false, bool const bStylesOnlyMode=false, bool const bProgress=false, bool const bBlockMode=false, bool const bOrganizerMode=false)
XMLTextImportHelper & operator=(const XMLTextImportHelper &)=delete
XMLTextImportHelper(const XMLTextImportHelper &)=delete
std::unique_ptr< Impl > m_xImpl
std::shared_ptr< BackpatcherImpl > m_xBackpatcherImpl
class SAL_NO_VTABLE XPropertySet
ww8::ParaStyles GetParaStyles(const SwDoc &rDoc)
rtl::Reference< XMLImportContext > CreateTextChildContext(XMLImport &rImport, std::u16string_view rName, bool bTopLevel=false)
VarType
variable type (for XMLSetVarFieldImportContext)