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 .
19 #ifndef INCLUDE_OOXML_PARSER_STATE_HXX
20 #define INCLUDE_OOXML_PARSER_STATE_HXX
23 #include <ooxml/OOXMLDocument.hxx>
24 #include "OOXMLPropertySetImpl.hxx"
26 #if OSL_DEBUG_LEVEL > 1
27 #include <resourcemodel/TagLogger.hxx>
28 #include <resourcemodel/XPathLogger.hxx>
31 namespace writerfilter
{
37 class OOXMLParserState
39 bool mbInSectionGroup
;
40 bool mbInParagraphGroup
;
41 bool mbInCharacterGroup
;
42 bool mbLastParagraphInSection
;
44 unsigned int mnContexts
;
45 unsigned int mnHandle
;
46 OOXMLDocument
* mpDocument
;
48 OOXMLPropertySet::Pointer_t mpCharacterProps
;
49 stack
<OOXMLPropertySet::Pointer_t
> mCellProps
;
50 stack
<OOXMLPropertySet::Pointer_t
> mRowProps
;
51 stack
<OOXMLPropertySet::Pointer_t
> mTableProps
;
53 // these 4 save when inTxbxContent
54 bool savedInParagraphGroup
;
55 bool savedInCharacterGroup
;
56 bool savedLastParagraphInSection
;
57 #if OSL_DEBUG_LEVEL > 1
58 XPathLogger m_xPathLogger
;
62 typedef boost::shared_ptr
<OOXMLParserState
> Pointer_t
;
65 virtual ~OOXMLParserState();
67 bool isInSectionGroup() const;
68 void setInSectionGroup(bool bInSectionGroup
);
70 void setLastParagraphInSection(bool bLastParagraphInSection
);
71 bool isLastParagraphInSection() const;
73 bool isInParagraphGroup() const;
74 void setInParagraphGroup(bool bInParagraphGroup
);
76 bool isInCharacterGroup() const;
77 void setInCharacterGroup(bool bInCharacterGroup
);
79 void setForwardEvents(bool bForwardEvents
);
80 bool isForwardEvents() const;
82 const string
getHandle() const;
85 void setDocument(OOXMLDocument
* pDocument
);
86 OOXMLDocument
* getDocument() const;
88 void setXNoteId(const sal_Int32 rId
);
89 sal_Int32
getXNoteId() const;
91 const OUString
& getTarget() const;
93 void resolveCharacterProperties(Stream
& rStream
);
94 void setCharacterProperties(OOXMLPropertySet::Pointer_t pProps
);
95 void resolveCellProperties(Stream
& rStream
);
96 void setCellProperties(OOXMLPropertySet::Pointer_t pProps
);
97 void resolveRowProperties(Stream
& rStream
);
98 void setRowProperties(OOXMLPropertySet::Pointer_t pProps
);
99 void resolveTableProperties(Stream
& rStream
);
100 void setTableProperties(OOXMLPropertySet::Pointer_t pProps
);
105 void incContextCount();
107 void startTxbxContent();
108 void endTxbxContent();
110 #if OSL_DEBUG_LEVEL > 1
112 void dumpXml( const TagLogger::Pointer_t
& pLogger
);
113 XPathLogger
& getXPathLogger();
120 #endif // INCLUDE_OOXML_PARSER_STATE_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */