1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: contentreader.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef CONTENTREADER_HXX_INCLUDED
32 #define CONTENTREADER_HXX_INCLUDED
34 #include "internal/basereader.hxx"
38 class CContentReader
: public CBaseReader
41 virtual ~CContentReader();
43 //CContentReader( const std::string& DocumentName );
44 CContentReader( const std::string
& DocumentName
, LocaleSet_t
const & DocumentLocale
);
46 CContentReader( void* stream
, LocaleSet_t
const & DocumentLocale
, zlib_filefunc_def
* fa
);
49 /** Get the chunkbuffer.
52 the chunkbuffer of the document.
54 inline ChunkBuffer_t
const & getChunkBuffer( ) const{ return m_ChunkBuffer
; };
56 protected: // protected because its only an implementation relevant class
58 /** start_element occurs when a tag is start.
63 local name of the tag.
67 virtual void start_element(
68 const std::wstring
& raw_name
,
69 const std::wstring
& local_name
,
70 const XmlTagAttributes_t
& attributes
);
72 /** end_element occurs when a tag is closed
77 local name of the tag.
79 virtual void end_element(
80 const std::wstring
& raw_name
, const std::wstring
& local_name
);
82 /** characters occurs when receiving characters
85 content of the information received.
87 virtual void characters(const std::wstring
& character
);
90 /** choose an appropriate tag reader to handle the tag.
95 attribute structure of the tag to save in.
97 ITag
* chooseTagReader(
98 const std::wstring
& tag_name
, const XmlTagAttributes_t
& XmlAttributes
);
100 /** Get the list of style locale pair.
105 inline StyleLocaleMap_t
const & getStyleMap( ) const{ return m_StyleMap
; };
107 /** get style of the current content.
109 @return style of the current content.
111 ::std::wstring
getCurrentContentStyle( void );
113 /** add chunk into Chunk Buffer.
115 void addChunk( LocaleSet_t
const & Locale
, Content_t
const & Content
);
117 /** get a style's locale field.
119 LocaleSet_t
const & getLocale( const StyleName_t Style
);
122 std::stack
<ITag
*> m_TagBuilderStack
;
124 ChunkBuffer_t m_ChunkBuffer
;
125 StyleLocaleMap_t m_StyleMap
;
126 LocaleSet_t m_DefaultLocale
;