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_SHELL_INC_INTERNAL_CONTENTREADER_HXX
21 #define INCLUDED_SHELL_INC_INTERNAL_CONTENTREADER_HXX
23 #include "basereader.hxx"
25 #include "filepath.hxx"
28 class StreamInterface
;
30 class CContentReader
: public CBaseReader
33 virtual ~CContentReader() override
;
35 CContentReader( const Filepath_t
& DocumentName
, LocaleSet_t
const & DocumentLocale
);
37 CContentReader( StreamInterface
* stream
, LocaleSet_t
const & DocumentLocale
);
40 /** Get the chunkbuffer.
43 the chunkbuffer of the document.
45 ChunkBuffer_t
const & getChunkBuffer( ) const{ return m_ChunkBuffer
; };
47 protected: // protected because its only an implementation relevant class
49 /** start_element occurs when a tag is start.
54 local name of the tag.
58 virtual void start_element(
59 const string_t
& raw_name
,
60 const string_t
& local_name
,
61 const xml_tag_attribute_container_t
& attributes
) override
;
63 /** end_element occurs when a tag is closed
68 local name of the tag.
70 virtual void end_element(
71 const string_t
& raw_name
, const string_t
& local_name
) override
;
73 /** characters occurs when receiving characters
76 content of the information received.
78 virtual void characters(const string_t
& character
) override
;
81 /** choose an appropriate tag reader to handle the tag.
86 attribute structure of the tag to save in.
88 ITag
* chooseTagReader(
89 const std::wstring
& tag_name
, const XmlTagAttributes_t
& XmlAttributes
);
91 /** Get the list of style locale pair.
96 StyleLocaleMap_t
const & getStyleMap( ) const{ return m_StyleMap
; };
98 /** get style of the current content.
100 @return style of the current content.
102 ::std::wstring
getCurrentContentStyle();
104 /** add chunk into Chunk Buffer.
106 void addChunk( LocaleSet_t
const & Locale
, Content_t
const & Content
);
108 /** get a style's locale field.
110 LocaleSet_t
const & getLocale( const StyleName_t
& Style
);
113 std::stack
<ITag
*> m_TagBuilderStack
;
115 ChunkBuffer_t m_ChunkBuffer
;
116 StyleLocaleMap_t m_StyleMap
;
117 LocaleSet_t m_DefaultLocale
;
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */