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 METAINFOREADER_HXX_INCLUDED
21 #define METAINFOREADER_HXX_INCLUDED
23 #include "internal/basereader.hxx"
24 #include "internal/types.hxx"
31 class CMetaInfoReader
: public CBaseReader
34 virtual ~CMetaInfoReader();
36 CMetaInfoReader( const std::string
& DocumentName
);
38 CMetaInfoReader( StreamInterface
* stream
);
40 /** check if the Tag is in the target meta.xml file.
43 the name of the tag that will be retrive.
45 bool hasTag(std::wstring TagName
) const;
48 /** Get a specific tag content, compound tags will be returned as comma separated list.
51 the name of the tag that will be retrive.
53 std::wstring
getTagData( const std::wstring
& TagName
);
55 /** check if the a tag has the specific attribute.
60 the name of the attribute.
62 bool hasTagAttribute( const std::wstring TagName
, std::wstring AttributeName
);
64 /** Get a specific attribute content.
69 the name of the attribute.
71 std::wstring
getTagAttribute( const std::wstring TagName
, std::wstring AttributeName
);
73 /** Get the default language of the whole document.
75 LocaleSet_t
getDefaultLocale( );
77 protected: // protected because its only an implementation relevant class
79 /** start_element occurs when a tag is start.
84 local name of the tag.
88 virtual void start_element(
89 const std::wstring
& raw_name
,
90 const std::wstring
& local_name
,
91 const XmlTagAttributes_t
& attributes
);
93 /** end_element occurs when a tag is closed
98 local name of the tag.
100 virtual void end_element(
101 const std::wstring
& raw_name
, const std::wstring
& local_name
);
103 /** characters occurs when receiving characters
106 content of the information received.
108 virtual void characters(const std::wstring
& character
);
111 /** choose an appropriate tag reader to handle the tag.
116 attribute structure of the tag to save in.
118 ITag
* chooseTagReader(
119 const std::wstring
& tag_name
, const XmlTagAttributes_t
& XmlAttributes
);
121 /** save the received content into structure.
126 void saveTagContent( const std::wstring
& tag_name
);
129 XmlTags_t m_AllMetaInfo
;
132 std::stack
<ITag
*> m_TagBuilderStack
;
135 CKeywordsTag
* m_pKeywords_Builder
;
136 CDummyTag
* m_pDummy_Builder
;
137 CSimpleTag
* m_pSimple_Builder
;
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */