1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTFRAMECONTEXT_HXX
21 #define INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTFRAMECONTEXT_HXX
23 #include <com/sun/star/text/TextContentAnchorType.hpp>
24 #include <xmloff/xmlictxt.hxx>
25 #include <xmloff/xmlmultiimagehelper.hxx>
27 namespace com
{ namespace sun
{ namespace star
{
28 namespace text
{ class XTextCursor
; class XTextContent
; }
31 class XMLTextFrameContextHyperlink_Impl
;
33 class XMLTextFrameContext
: public SvXMLImportContext
, public MultiImageImportHelper
35 ::com::sun::star::uno::Reference
<
36 ::com::sun::star::xml::sax::XAttributeList
> m_xAttrList
;
38 SvXMLImportContextRef m_xImplContext
;
39 SvXMLImportContextRef m_xReplImplContext
;
41 XMLTextFrameContextHyperlink_Impl
*m_pHyperlink
;
42 // Implement Title/Description Elements UI (#i73249#)
46 ::com::sun::star::text::TextContentAnchorType m_eDefaultAnchorType
;
48 /* The <draw:name> can longer be used to distinguish Writer graphic/text box
49 objects and Draw graphic/text box objects.
50 The new distinguish attribute is the parent style of the automatic style
51 of the object. All Draw objects have an automatic style without a parent style.
54 bool m_HasAutomaticStyleWithoutParentStyle
;
55 bool m_bSupportsReplacement
;
57 bool CreateIfNotThere( ::com::sun::star::uno::Reference
<
58 ::com::sun::star::beans::XPropertySet
>& rPropSet
);
61 /// helper to get the created xShape instance, needs to be overridden
62 virtual OUString
getGraphicURLFromImportContext(const SvXMLImportContext
& rContext
) const SAL_OVERRIDE
;
63 virtual void removeGraphicFromImportContext(const SvXMLImportContext
& rContext
) const SAL_OVERRIDE
;
69 XMLTextFrameContext( SvXMLImport
& rImport
,
71 const OUString
& rLName
,
72 const ::com::sun::star::uno::Reference
<
73 ::com::sun::star::xml::sax::XAttributeList
> & xAttrList
,
74 ::com::sun::star::text::TextContentAnchorType eDfltAnchorType
);
75 virtual ~XMLTextFrameContext();
77 virtual void EndElement() SAL_OVERRIDE
;
79 SvXMLImportContext
*CreateChildContext( sal_uInt16 nPrefix
,
80 const OUString
& rLocalName
,
81 const ::com::sun::star::uno::Reference
<
82 ::com::sun::star::xml::sax::XAttributeList
> & xAttrList
) SAL_OVERRIDE
;
84 void SetHyperlink( const OUString
& rHRef
,
85 const OUString
& rName
,
86 const OUString
& rTargetFrameName
,
89 ::com::sun::star::text::TextContentAnchorType
GetAnchorType() const;
91 ::com::sun::star::uno::Reference
<
92 ::com::sun::star::text::XTextContent
> GetTextContent() const;
94 // Frame "to character": anchor moves from first to last char after saving (#i33242#)
95 ::com::sun::star::uno::Reference
<
96 ::com::sun::star::drawing::XShape
> GetShape() const;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */