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 "internal/basereader.hxx"
27 class StreamInterface
;
29 class CContentReader
: public CBaseReader
32 virtual ~CContentReader();
34 CContentReader( const std::string
& DocumentName
, LocaleSet_t
const & DocumentLocale
);
36 CContentReader( StreamInterface
* stream
, LocaleSet_t
const & DocumentLocale
);
39 /** Get the chunkbuffer.
42 the chunkbuffer of the document.
44 inline ChunkBuffer_t
const & getChunkBuffer( ) const{ return m_ChunkBuffer
; };
46 protected: // protected because its only an implementation relevant class
48 /** start_element occurs when a tag is start.
53 local name of the tag.
57 virtual void start_element(
58 const std::wstring
& raw_name
,
59 const std::wstring
& local_name
,
60 const XmlTagAttributes_t
& attributes
);
62 /** end_element occurs when a tag is closed
67 local name of the tag.
69 virtual void end_element(
70 const std::wstring
& raw_name
, const std::wstring
& local_name
);
72 /** characters occurs when receiving characters
75 content of the information received.
77 virtual void characters(const std::wstring
& character
);
80 /** choose an appropriate tag reader to handle the tag.
85 attribute structure of the tag to save in.
87 ITag
* chooseTagReader(
88 const std::wstring
& tag_name
, const XmlTagAttributes_t
& XmlAttributes
);
90 /** Get the list of style locale pair.
95 inline StyleLocaleMap_t
const & getStyleMap( ) const{ return m_StyleMap
; };
97 /** get style of the current content.
99 @return style of the current content.
101 ::std::wstring
getCurrentContentStyle();
103 /** add chunk into Chunk Buffer.
105 void addChunk( LocaleSet_t
const & Locale
, Content_t
const & Content
);
107 /** get a style's locale field.
109 LocaleSet_t
const & getLocale( const StyleName_t
& Style
);
112 std::stack
<ITag
*> m_TagBuilderStack
;
114 ChunkBuffer_t m_ChunkBuffer
;
115 StyleLocaleMap_t m_StyleMap
;
116 LocaleSet_t m_DefaultLocale
;
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */