bump product version to 4.1.6.2
[LibreOffice.git] / shell / inc / internal / metainforeader.hxx
blob16dcfce6ca0c9ea3b50588480e302f618c8f89d6
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 METAINFOREADER_HXX_INCLUDED
21 #define METAINFOREADER_HXX_INCLUDED
23 #include "internal/basereader.hxx"
24 #include "internal/types.hxx"
26 class ITag;
27 class CKeywordsTag;
28 class CSimpleTag;
29 class CDummyTag;
31 class CMetaInfoReader : public CBaseReader
33 public:
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.
42 @param TagName
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.
50 @param TagName
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.
57 @param TagName
58 the name of the tag.
59 @param AttributeName
60 the name of the attribute.
62 bool hasTagAttribute( const std::wstring TagName, std::wstring AttributeName);
64 /** Get a specific attribute content.
66 @param TagName
67 the name of the tag.
68 @param AttributeName
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.
81 @param raw_name
82 raw name of the tag.
83 @param local_name
84 local name of the tag.
85 @param attributes
86 attribute structure.
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
95 @param raw_name
96 raw name of the tag.
97 @param local_name
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
105 @param character
106 content of the information received.
108 virtual void characters(const std::wstring& character);
110 protected:
111 /** choose an appropriate tag reader to handle the tag.
113 @param tag_name
114 the name of the tag.
115 @param XmlAttributes
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.
123 @param tag_name
124 the name of the tag.
126 void saveTagContent( const std::wstring& tag_name );
128 private:
129 XmlTags_t m_AllMetaInfo;
131 private:
132 std::stack<ITag*> m_TagBuilderStack;
134 private:
135 CKeywordsTag* m_pKeywords_Builder;
136 CDummyTag* m_pDummy_Builder;
137 CSimpleTag* m_pSimple_Builder;
140 #endif
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */