Update ooo320-m1
[ooovba.git] / sc / source / filter / xml / xmlannoi.hxx
blob41b206bd43803dd03f297d6a9b8c5a6b99fc5a6f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlannoi.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef SC_XMLANNOI_HXX
31 #define SC_XMLANNOI_HXX
33 #include <memory>
34 #include <xmloff/xmlictxt.hxx>
35 #include <xmloff/xmlimp.hxx>
36 #include <rtl/ustrbuf.hxx>
37 #include <svx/editdata.hxx>
38 #include <com/sun/star/drawing/XShape.hpp>
39 #include <com/sun/star/drawing/XShapes.hpp>
41 class ScXMLImport;
42 class ScXMLTableRowCellContext;
44 struct ScXMLAnnotationStyleEntry
46 sal_uInt16 mnFamily;
47 rtl::OUString maName;
48 ESelection maSelection;
50 ScXMLAnnotationStyleEntry( sal_uInt16 nFam, const rtl::OUString& rNam, const ESelection& rSel ) :
51 mnFamily( nFam ),
52 maName( rNam ),
53 maSelection( rSel )
58 struct ScXMLAnnotationData
60 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
61 mxShape;
62 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
63 mxShapes;
64 ::rtl::OUString maAuthor;
65 ::rtl::OUString maCreateDate;
66 ::rtl::OUString maSimpleText;
67 ::rtl::OUString maStyleName;
68 ::rtl::OUString maTextStyle;
69 bool mbUseShapePos;
70 bool mbShown;
71 std::vector<ScXMLAnnotationStyleEntry> maContentStyles;
73 explicit ScXMLAnnotationData();
74 ~ScXMLAnnotationData();
77 class ScXMLAnnotationContext : public SvXMLImportContext
79 public:
81 ScXMLAnnotationContext( ScXMLImport& rImport, USHORT nPrfx,
82 const ::rtl::OUString& rLName,
83 const ::com::sun::star::uno::Reference<
84 ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
85 ScXMLAnnotationData& rAnnotationData,
86 ScXMLTableRowCellContext* pCellContext);
88 virtual ~ScXMLAnnotationContext();
90 virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix,
91 const ::rtl::OUString& rLocalName,
92 const ::com::sun::star::uno::Reference<
93 ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
95 virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
97 virtual void Characters( const ::rtl::OUString& rChars );
99 virtual void EndElement();
101 void SetShape(
102 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
103 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
104 const ::rtl::OUString& rStyleName, const ::rtl::OUString& rTextStyle );
106 void AddContentStyle( sal_uInt16 nFamily, const rtl::OUString& rName, const ESelection& rSelection );
108 private:
109 ScXMLAnnotationData& mrAnnotationData;
110 rtl::OUStringBuffer maTextBuffer;
111 rtl::OUStringBuffer maAuthorBuffer;
112 rtl::OUStringBuffer maCreateDateBuffer;
113 rtl::OUStringBuffer maCreateDateStringBuffer;
114 sal_Int32 nParagraphCount;
115 sal_Bool bHasTextP;
116 ScXMLTableRowCellContext* pCellContext;
117 SvXMLImportContext* pShapeContext;
119 const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
120 ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
124 #endif