xref: /trunk/main/xmloff/source/text/XMLTextFrameContext.hxx (revision 016b0c61eebf003f0b526d089dcc575e4fe2c2e8)
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 
24 #ifndef _XMLTEXTFRAMECONTEXT_HXX
25 #define _XMLTEXTFRAMECONTEXT_HXX
26 
27 #ifndef _COM_SUN_STAR_TEXT_TEXTCONTENTANCHORTYPE_HPP
28 #include <com/sun/star/text/TextContentAnchorType.hpp>
29 #endif
30 #include <xmloff/xmlictxt.hxx>
31 
32 namespace com { namespace sun { namespace star {
33     namespace text { class XTextCursor; class XTextContent; }
34 } } }
35 
36 class SvXMLAttributeList;
37 class XMLTextFrameContextHyperlink_Impl;
38 
39 class XMLTextFrameContext : public SvXMLImportContext
40 {
41     ::com::sun::star::uno::Reference<
42         ::com::sun::star::xml::sax::XAttributeList > m_xAttrList;
43 
44     SvXMLImportContextRef m_xImplContext;
45     SvXMLImportContextRef m_xReplImplContext;
46     SvXMLAttributeList *m_pAttrList;
47 
48     XMLTextFrameContextHyperlink_Impl   *m_pHyperlink;
49     // --> OD 2009-07-22 #i73249#
50     ::rtl::OUString m_sTitle;
51     // <--
52     ::rtl::OUString m_sDesc;
53 
54     ::com::sun::star::text::TextContentAnchorType   m_eDefaultAnchorType;
55 
56     // --> OD 2006-03-10 #i51726#
57     // The <draw:name> can longer be used to distinguish Writer graphic/text box
58     // objects and Draw graphic/text box objects.
59     // The new distinguish attribute is the parent style of the automatic style
60     // of the object. All Draw objects have an automatic style without a parent style.
61     sal_Bool m_HasAutomaticStyleWithoutParentStyle;
62     // <--
63     sal_Bool m_bSupportsReplacement;
64 
65     sal_Bool CreateIfNotThere();
66     sal_Bool CreateIfNotThere( ::com::sun::star::uno::Reference <
67         ::com::sun::star::beans::XPropertySet >& rPropSet );
68 
69 public:
70 
71     TYPEINFO();
72 
73     XMLTextFrameContext( SvXMLImport& rImport,
74             sal_uInt16 nPrfx,
75             const ::rtl::OUString& rLName,
76             const ::com::sun::star::uno::Reference<
77                 ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
78             ::com::sun::star::text::TextContentAnchorType eDfltAnchorType );
79     virtual ~XMLTextFrameContext();
80 
81     virtual void EndElement();
82 
83     SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
84                 const ::rtl::OUString& rLocalName,
85                 const ::com::sun::star::uno::Reference<
86                     ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
87 
88     void SetHyperlink( const ::rtl::OUString& rHRef,
89                        const ::rtl::OUString& rName,
90                        const ::rtl::OUString& rTargetFrameName,
91                        sal_Bool bMap );
92 
93     ::com::sun::star::text::TextContentAnchorType GetAnchorType() const;
94 
95     ::com::sun::star::uno::Reference <
96         ::com::sun::star::text::XTextContent > GetTextContent() const;
97     // --> OD 2004-08-24 #i33242#
98     ::com::sun::star::uno::Reference <
99         ::com::sun::star::drawing::XShape > GetShape() const;
100     // <--
101 };
102 
103 
104 #endif
105