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: XMLDetectiveContext.hxx,v $
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 ************************************************************************/
31 #ifndef SC_XMLDETECTIVECONTEXT_HXX
32 #define SC_XMLDETECTIVECONTEXT_HXX
34 #include <xmloff/xmlimp.hxx>
35 #include <com/sun/star/table/CellRangeAddress.hpp>
36 #include "detfunc.hxx"
37 #include "detdata.hxx"
44 //___________________________________________________________________
46 struct ScMyImpDetectiveObj
49 ScDetectiveObjType eObjType
;
52 ScMyImpDetectiveObj();
55 typedef ::std::vector
< ScMyImpDetectiveObj
> ScMyImpDetectiveObjVec
;
58 //___________________________________________________________________
60 struct ScMyImpDetectiveOp
66 inline ScMyImpDetectiveOp() : nIndex( -1 ) {}
67 sal_Bool
operator<(const ScMyImpDetectiveOp
& rDetOp
) const;
70 typedef ::std::list
< ScMyImpDetectiveOp
> ScMyImpDetectiveOpList
;
72 class ScMyImpDetectiveOpArray
75 ScMyImpDetectiveOpList aDetectiveOpList
;
78 inline ScMyImpDetectiveOpArray() :
81 inline void AddDetectiveOp( const ScMyImpDetectiveOp
& rDetOp
)
82 { aDetectiveOpList
.push_back( rDetOp
); }
85 sal_Bool
GetFirstOp( ScMyImpDetectiveOp
& rDetOp
);
89 //___________________________________________________________________
91 class ScXMLDetectiveContext
: public SvXMLImportContext
94 ScMyImpDetectiveObjVec
* pDetectiveObjVec
;
96 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
97 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
100 ScXMLDetectiveContext(
101 ScXMLImport
& rImport
,
103 const ::rtl::OUString
& rLName
,
104 ScMyImpDetectiveObjVec
* pNewDetectiveObjVec
106 virtual ~ScXMLDetectiveContext();
108 virtual SvXMLImportContext
* CreateChildContext(
110 const ::rtl::OUString
& rLocalName
,
111 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
113 virtual void EndElement();
117 //___________________________________________________________________
119 class ScXMLDetectiveHighlightedContext
: public SvXMLImportContext
122 ScMyImpDetectiveObjVec
* pDetectiveObjVec
;
123 ScMyImpDetectiveObj aDetectiveObj
;
126 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
127 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
130 ScXMLDetectiveHighlightedContext(
131 ScXMLImport
& rImport
,
133 const ::rtl::OUString
& rLName
,
134 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
135 ScMyImpDetectiveObjVec
* pNewDetectiveObjVec
137 virtual ~ScXMLDetectiveHighlightedContext();
139 virtual SvXMLImportContext
* CreateChildContext(
141 const ::rtl::OUString
& rLocalName
,
142 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
144 virtual void EndElement();
148 //___________________________________________________________________
150 class ScXMLDetectiveOperationContext
: public SvXMLImportContext
153 ScMyImpDetectiveOp aDetectiveOp
;
156 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
157 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
160 ScXMLDetectiveOperationContext(
161 ScXMLImport
& rImport
,
163 const ::rtl::OUString
& rLName
,
164 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
166 virtual ~ScXMLDetectiveOperationContext();
168 virtual SvXMLImportContext
* CreateChildContext(
170 const ::rtl::OUString
& rLocalName
,
171 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
173 virtual void EndElement();