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 CONTENTREADER_HXX_INCLUDED
21 #define CONTENTREADER_HXX_INCLUDED
23 #include "internal/basereader.hxx"
26 class StreamInterface
;
28 class CContentReader
: public CBaseReader
31 virtual ~CContentReader();
33 CContentReader( const std::string
& DocumentName
, LocaleSet_t
const & DocumentLocale
);
35 CContentReader( StreamInterface
* stream
, LocaleSet_t
const & DocumentLocale
);
38 /** Get the chunkbuffer.
41 the chunkbuffer of the document.
43 inline ChunkBuffer_t
const & getChunkBuffer( ) const{ return m_ChunkBuffer
; };
45 protected: // protected because its only an implementation relevant class
47 /** start_element occurs when a tag is start.
52 local name of the tag.
56 virtual void start_element(
57 const std::wstring
& raw_name
,
58 const std::wstring
& local_name
,
59 const XmlTagAttributes_t
& attributes
);
61 /** end_element occurs when a tag is closed
66 local name of the tag.
68 virtual void end_element(
69 const std::wstring
& raw_name
, const std::wstring
& local_name
);
71 /** characters occurs when receiving characters
74 content of the information received.
76 virtual void characters(const std::wstring
& character
);
79 /** choose an appropriate tag reader to handle the tag.
84 attribute structure of the tag to save in.
86 ITag
* chooseTagReader(
87 const std::wstring
& tag_name
, const XmlTagAttributes_t
& XmlAttributes
);
89 /** Get the list of style locale pair.
94 inline StyleLocaleMap_t
const & getStyleMap( ) const{ return m_StyleMap
; };
96 /** get style of the current content.
98 @return style of the current content.
100 ::std::wstring
getCurrentContentStyle( void );
102 /** add chunk into Chunk Buffer.
104 void addChunk( LocaleSet_t
const & Locale
, Content_t
const & Content
);
106 /** get a style's locale field.
108 LocaleSet_t
const & getLocale( const StyleName_t Style
);
111 std::stack
<ITag
*> m_TagBuilderStack
;
113 ChunkBuffer_t m_ChunkBuffer
;
114 StyleLocaleMap_t m_StyleMap
;
115 LocaleSet_t m_DefaultLocale
;
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */