bump product version to 5.0.4.1
[LibreOffice.git] / shell / inc / internal / metainforeader.hxx
blob047bf77683c0d4d5fce591791534a0bec33180ed
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_METAINFOREADER_HXX
21 #define INCLUDED_SHELL_INC_INTERNAL_METAINFOREADER_HXX
23 #include "internal/basereader.hxx"
24 #include "internal/types.hxx"
25 #include <stack>
27 class ITag;
28 class CKeywordsTag;
29 class CSimpleTag;
30 class CDummyTag;
32 class CMetaInfoReader : public CBaseReader
34 public:
35 virtual ~CMetaInfoReader();
37 CMetaInfoReader( const std::string& DocumentName );
39 CMetaInfoReader( StreamInterface* stream );
41 /** check if the Tag is in the target meta.xml file.
43 @param TagName
44 the name of the tag that will be retrieved.
46 bool hasTag(const std::wstring& TagName) const;
49 /** Get a specific tag content, compound tags will be returned as comma separated list.
51 @param TagName
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.
58 @param TagName
59 the name of the tag.
60 @param AttributeName
61 the name of the attribute.
63 bool hasTagAttribute(const std::wstring& TagName, const std::wstring& AttributeName);
65 /** Get a specific attribute content.
67 @param TagName
68 the name of the tag.
69 @param AttributeName
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
80 /** start_element occurs when a tag is start.
82 @param raw_name
83 raw name of the tag.
84 @param local_name
85 local name of the tag.
86 @param attributes
87 attribute structure.
89 virtual void start_element(
90 const std::wstring& raw_name,
91 const std::wstring& local_name,
92 const XmlTagAttributes_t& attributes);
94 /** end_element occurs when a tag is closed
96 @param raw_name
97 raw name of the tag.
98 @param local_name
99 local name of the tag.
101 virtual void end_element(
102 const std::wstring& raw_name, const std::wstring& local_name);
104 /** characters occurs when receiving characters
106 @param character
107 content of the information received.
109 virtual void characters(const std::wstring& character);
111 protected:
112 /** choose an appropriate tag reader to handle the tag.
114 @param tag_name
115 the name of the tag.
116 @param XmlAttributes
117 attribute structure of the tag to save in.
119 ITag* chooseTagReader(
120 const std::wstring& tag_name, const XmlTagAttributes_t& XmlAttributes );
122 /** save the received content into structure.
124 @param tag_name
125 the name of the tag.
127 void saveTagContent( const std::wstring& tag_name );
129 private:
130 XmlTags_t m_AllMetaInfo;
132 private:
133 std::stack<ITag*> m_TagBuilderStack;
135 private:
136 CKeywordsTag* m_pKeywords_Builder;
137 CDummyTag* m_pDummy_Builder;
138 CSimpleTag* m_pSimple_Builder;
141 #endif
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */