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_METAINFOREADER_HXX
21 #define INCLUDED_SHELL_INC_INTERNAL_METAINFOREADER_HXX
23 #include "basereader.hxx"
26 #include "filepath.hxx"
33 class CMetaInfoReader
: public CBaseReader
36 virtual ~CMetaInfoReader() override
;
38 CMetaInfoReader(const Filepath_t
& DocumentName
);
40 CMetaInfoReader(StreamInterface
* stream
);
42 /** check if the Tag is in the target meta.xml file.
45 the name of the tag that will be retrieved.
47 bool hasTag(const std::wstring
& TagName
) const;
49 /** Get a specific tag content, compound tags will be returned as comma separated list.
52 the name of the tag that will be retrieved.
54 std::wstring
getTagData(const std::wstring
& TagName
);
56 /** check if the a tag has the specific attribute.
61 the name of the attribute.
63 bool hasTagAttribute(const std::wstring
& TagName
, const std::wstring
& AttributeName
);
65 /** Get a specific attribute content.
70 the name of the attribute.
72 std::wstring
getTagAttribute(const std::wstring
& TagName
, const std::wstring
& AttributeName
);
74 /** Get the default language of the whole document.
76 LocaleSet_t
getDefaultLocale();
78 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(const string_t
& raw_name
, const string_t
& local_name
,
89 const xml_tag_attribute_container_t
& attributes
) override
;
91 /** end_element occurs when a tag is closed
96 local name of the tag.
98 virtual void end_element(const string_t
& raw_name
, const string_t
& local_name
) override
;
100 /** characters occurs when receiving characters
103 content of the information received.
105 virtual void characters(const string_t
& character
) override
;
108 /** choose an appropriate tag reader to handle the tag.
113 attribute structure of the tag to save in.
115 ITag
* chooseTagReader(const std::wstring
& tag_name
, const XmlTagAttributes_t
& XmlAttributes
);
117 /** save the received content into structure.
122 void saveTagContent(const std::wstring
& tag_name
);
125 XmlTags_t m_AllMetaInfo
;
128 std::stack
<ITag
*> m_TagBuilderStack
;
131 CKeywordsTag
* m_pKeywords_Builder
;
132 CDummyTag
* m_pDummy_Builder
;
133 CSimpleTag
* m_pSimple_Builder
;
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */