fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / filter / xml / XMLDetectiveContext.hxx
blob38f22eaab5289dfb4c8458d030d40f7c613820bb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
29 #include <list>
31 struct ScMyImpDetectiveObj
33 ScRange aSourceRange;
34 ScDetectiveObjType eObjType;
35 bool bHasError;
37 ScMyImpDetectiveObj();
40 typedef ::std::vector< ScMyImpDetectiveObj > ScMyImpDetectiveObjVec;
42 struct ScMyImpDetectiveOp
44 ScAddress aPosition;
45 ScDetOpType eOpType;
46 sal_Int32 nIndex;
48 ScMyImpDetectiveOp()
49 : eOpType(SCDETOP_ADDSUCC)
50 , nIndex(-1)
54 bool operator<(const ScMyImpDetectiveOp& rDetOp) const;
57 typedef ::std::list< ScMyImpDetectiveOp > ScMyImpDetectiveOpList;
59 class ScMyImpDetectiveOpArray
61 private:
62 ScMyImpDetectiveOpList aDetectiveOpList;
64 public:
65 inline ScMyImpDetectiveOpArray() :
66 aDetectiveOpList() {}
68 inline void AddDetectiveOp( const ScMyImpDetectiveOp& rDetOp )
69 { aDetectiveOpList.push_back( rDetOp ); }
71 void Sort();
72 bool GetFirstOp( ScMyImpDetectiveOp& rDetOp );
75 class ScXMLDetectiveContext : public SvXMLImportContext
77 private:
78 ScMyImpDetectiveObjVec* pDetectiveObjVec;
80 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
81 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
83 public:
84 ScXMLDetectiveContext(
85 ScXMLImport& rImport,
86 sal_uInt16 nPrfx,
87 const OUString& rLName,
88 ScMyImpDetectiveObjVec* pNewDetectiveObjVec
90 virtual ~ScXMLDetectiveContext();
92 virtual SvXMLImportContext* CreateChildContext(
93 sal_uInt16 nPrefix,
94 const OUString& rLocalName,
95 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList
96 ) SAL_OVERRIDE;
97 virtual void EndElement() SAL_OVERRIDE;
100 class ScXMLDetectiveHighlightedContext : public SvXMLImportContext
102 private:
103 ScMyImpDetectiveObjVec* pDetectiveObjVec;
104 ScMyImpDetectiveObj aDetectiveObj;
105 bool bValid;
107 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
108 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
110 public:
111 ScXMLDetectiveHighlightedContext(
112 ScXMLImport& rImport,
113 sal_uInt16 nPrfx,
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(
121 sal_uInt16 nPrefix,
122 const OUString& rLocalName,
123 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList
124 ) SAL_OVERRIDE;
125 virtual void EndElement() SAL_OVERRIDE;
128 class ScXMLDetectiveOperationContext : public SvXMLImportContext
130 private:
131 ScMyImpDetectiveOp aDetectiveOp;
132 bool bHasType;
134 const ScXMLImport& GetScImport() const { return static_cast<const ScXMLImport&>(GetImport()); }
135 ScXMLImport& GetScImport() { return static_cast<ScXMLImport&>(GetImport()); }
137 public:
138 ScXMLDetectiveOperationContext(
139 ScXMLImport& rImport,
140 sal_uInt16 nPrfx,
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(
147 sal_uInt16 nPrefix,
148 const OUString& rLocalName,
149 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList
150 ) SAL_OVERRIDE;
151 virtual void EndElement() SAL_OVERRIDE;
154 #endif
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */