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_SC_SOURCE_FILTER_XML_XMLDETECTIVECONTEXT_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLDETECTIVECONTEXT_HXX
23 #include <xmloff/xmlimp.hxx>
24 #include <com/sun/star/table/CellRangeAddress.hpp>
25 #include "detfunc.hxx"
26 #include "detdata.hxx"
27 #include "xmlimprt.hxx"
31 struct ScMyImpDetectiveObj
34 ScDetectiveObjType eObjType
;
37 ScMyImpDetectiveObj();
40 typedef ::std::vector
< ScMyImpDetectiveObj
> ScMyImpDetectiveObjVec
;
42 struct ScMyImpDetectiveOp
49 : eOpType(SCDETOP_ADDSUCC
)
54 bool operator<(const ScMyImpDetectiveOp
& rDetOp
) const;
57 typedef ::std::list
< ScMyImpDetectiveOp
> ScMyImpDetectiveOpList
;
59 class ScMyImpDetectiveOpArray
62 ScMyImpDetectiveOpList aDetectiveOpList
;
65 inline ScMyImpDetectiveOpArray() :
68 inline void AddDetectiveOp( const ScMyImpDetectiveOp
& rDetOp
)
69 { aDetectiveOpList
.push_back( rDetOp
); }
72 bool GetFirstOp( ScMyImpDetectiveOp
& rDetOp
);
75 class ScXMLDetectiveContext
: public SvXMLImportContext
78 ScMyImpDetectiveObjVec
* pDetectiveObjVec
;
80 const ScXMLImport
& GetScImport() const { return static_cast<const ScXMLImport
&>(GetImport()); }
81 ScXMLImport
& GetScImport() { return static_cast<ScXMLImport
&>(GetImport()); }
84 ScXMLDetectiveContext(
87 const OUString
& rLName
,
88 ScMyImpDetectiveObjVec
* pNewDetectiveObjVec
90 virtual ~ScXMLDetectiveContext();
92 virtual SvXMLImportContext
* CreateChildContext(
94 const OUString
& rLocalName
,
95 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
97 virtual void EndElement() SAL_OVERRIDE
;
100 class ScXMLDetectiveHighlightedContext
: public SvXMLImportContext
103 ScMyImpDetectiveObjVec
* pDetectiveObjVec
;
104 ScMyImpDetectiveObj aDetectiveObj
;
107 const ScXMLImport
& GetScImport() const { return static_cast<const ScXMLImport
&>(GetImport()); }
108 ScXMLImport
& GetScImport() { return static_cast<ScXMLImport
&>(GetImport()); }
111 ScXMLDetectiveHighlightedContext(
112 ScXMLImport
& rImport
,
114 const OUString
& rLName
,
115 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
116 ScMyImpDetectiveObjVec
* pNewDetectiveObjVec
118 virtual ~ScXMLDetectiveHighlightedContext();
120 virtual SvXMLImportContext
* CreateChildContext(
122 const OUString
& rLocalName
,
123 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
125 virtual void EndElement() SAL_OVERRIDE
;
128 class ScXMLDetectiveOperationContext
: public SvXMLImportContext
131 ScMyImpDetectiveOp aDetectiveOp
;
134 const ScXMLImport
& GetScImport() const { return static_cast<const ScXMLImport
&>(GetImport()); }
135 ScXMLImport
& GetScImport() { return static_cast<ScXMLImport
&>(GetImport()); }
138 ScXMLDetectiveOperationContext(
139 ScXMLImport
& rImport
,
141 const OUString
& rLName
,
142 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
144 virtual ~ScXMLDetectiveOperationContext();
146 virtual SvXMLImportContext
* CreateChildContext(
148 const OUString
& rLocalName
,
149 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
151 virtual void EndElement() SAL_OVERRIDE
;
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */