fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / shell / inc / internal / contentreader.hxx
blobc64e868941d2f467839876a2f564554115b850ca
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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"
24 #include <stack>
26 class ITag;
27 class StreamInterface;
29 class CContentReader : public CBaseReader
31 public:
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.
41 @return
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.
50 @param raw_name
51 raw name of the tag.
52 @param local_name
53 local name of the tag.
54 @param attributes
55 attribute structure.
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
64 @param raw_name
65 raw name of the tag.
66 @param local_name
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
74 @param character
75 content of the information received.
77 virtual void characters(const std::wstring& character);
79 protected:
80 /** choose an appropriate tag reader to handle the tag.
82 @param tag_name
83 the name of the tag.
84 @param XmlAttributes
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.
92 @return
93 the Style-Locale map
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 );
111 private:
112 std::stack<ITag*> m_TagBuilderStack;
114 ChunkBuffer_t m_ChunkBuffer;
115 StyleLocaleMap_t m_StyleMap;
116 LocaleSet_t m_DefaultLocale;
119 #endif
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */