LibreOffice Module xmloff (master)  1
XMLTextFrameContext.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 
20 #ifndef INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTFRAMECONTEXT_HXX
21 #define INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTFRAMECONTEXT_HXX
22 
23 #include <memory>
24 
25 #include <com/sun/star/text/TextContentAnchorType.hpp>
26 #include <xmloff/xmlictxt.hxx>
27 #include <xmlmultiimagehelper.hxx>
28 
29 namespace com::sun::star {
30  namespace text { class XTextCursor; class XTextContent; }
31 }
32 
34 
36 {
37  css::uno::Reference< css::xml::sax::XAttributeList > m_xAttrList;
38 
41 
42  std::unique_ptr<XMLTextFrameContextHyperlink_Impl> m_pHyperlink;
43  // Implement Title/Description Elements UI (#i73249#)
44  OUString m_sTitle;
45  OUString m_sDesc;
46 
47  css::text::TextContentAnchorType m_eDefaultAnchorType;
48 
49  /* The <draw:name> can longer be used to distinguish Writer graphic/text box
50  objects and Draw graphic/text box objects.
51  The new distinguish attribute is the parent style of the automatic style
52  of the object. All Draw objects have an automatic style without a parent style.
53  (#i51726#)
54  */
57 
58  bool CreateIfNotThere( css::uno::Reference < css::beans::XPropertySet >& rPropSet );
59 
60 protected:
62  void removeGraphicFromImportContext(const SvXMLImportContext& rContext) override;
63  OUString getGraphicPackageURLFromImportContext(const SvXMLImportContext& rContext) const override;
64  css::uno::Reference<css::graphic::XGraphic> getGraphicFromImportContext(const SvXMLImportContext& rContext) const override;
65 
66 public:
67 
68 
70  sal_uInt16 nPrfx,
71  const OUString& rLName,
72  const css::uno::Reference<
73  css::xml::sax::XAttributeList > & xAttrList,
74  css::text::TextContentAnchorType eDfltAnchorType );
75 
76  virtual void EndElement() override;
77 
78  SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
79  const OUString& rLocalName,
80  const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override;
81 
82  void SetHyperlink( const OUString& rHRef,
83  const OUString& rName,
84  const OUString& rTargetFrameName,
85  bool bMap );
86 
87  css::text::TextContentAnchorType GetAnchorType() const;
88 
89  css::uno::Reference < css::text::XTextContent > GetTextContent() const;
90 
91  // Frame "to character": anchor moves from first to last char after saving (#i33242#)
92  css::uno::Reference < css::drawing::XShape > GetShape() const;
93 };
94 
95 
96 #endif
97 
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool CreateIfNotThere(css::uno::Reference< css::beans::XPropertySet > &rPropSet)
SvXMLImportContextRef m_xReplImplContext
XMLTextFrameContext(SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList, css::text::TextContentAnchorType eDfltAnchorType)
std::unique_ptr< XMLTextFrameContextHyperlink_Impl > m_pHyperlink
void SetHyperlink(const OUString &rHRef, const OUString &rName, const OUString &rTargetFrameName, bool bMap)
OUString getGraphicPackageURLFromImportContext(const SvXMLImportContext &rContext) const override
css::text::TextContentAnchorType GetAnchorType() const
exports com.sun.star. text
virtual void EndElement() override
EndElement is called before a context will be destructed, but after an elements context has been pars...
css::uno::Reference< css::text::XTextContent > GetTextContent() const
css::uno::Reference< css::xml::sax::XAttributeList > m_xAttrList
css::uno::Reference< css::graphic::XGraphic > getGraphicFromImportContext(const SvXMLImportContext &rContext) const override
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
void removeGraphicFromImportContext(const SvXMLImportContext &rContext) override
helper to get the created xShape instance, needs to be overridden
css::text::TextContentAnchorType m_eDefaultAnchorType
css::uno::Reference< css::drawing::XShape > GetShape() const
SvXMLImportContextRef CreateChildContext(sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
Create a children element context.
SvXMLImportContextRef m_xImplContext