Update ooo320-m1
[ooovba.git] / shell / inc / internal / metainforeader.hxx
blob3a494cd34bdde4193319a47cc7a0375baae57613
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: metainforeader.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef METAINFOREADER_HXX_INCLUDED
32 #define METAINFOREADER_HXX_INCLUDED
34 #include "internal/basereader.hxx"
35 #include "internal/types.hxx"
37 class ITag;
38 class CKeywordsTag;
39 class CSimpleTag;
40 class CDummyTag;
42 class CMetaInfoReader : public CBaseReader
44 public:
45 virtual ~CMetaInfoReader();
47 CMetaInfoReader( const std::string& DocumentName );
49 CMetaInfoReader( void* stream, zlib_filefunc_def* fa);
51 /** check if the Tag is in the target meta.xml file.
53 @param TagName
54 the name of the tag that will be retrive.
56 bool hasTag(std::wstring TagName) const;
59 /** Get a specific tag content, compound tags will be returned as comma separated list.
61 @param TagName
62 the name of the tag that will be retrive.
64 std::wstring getTagData( const std::wstring& TagName);
66 /** check if the a tag has the specific attribute.
68 @param TagName
69 the name of the tag.
70 @param AttributeName
71 the name of the attribute.
73 bool hasTagAttribute( const std::wstring TagName, std::wstring AttributeName);
75 /** Get a specific attribute content.
77 @param TagName
78 the name of the tag.
79 @param AttributeName
80 the name of the attribute.
82 std::wstring getTagAttribute( const std::wstring TagName, std::wstring AttributeName);
84 /** Get the default language of the whole document.
86 LocaleSet_t getDefaultLocale( );
88 protected: // protected because its only an implementation relevant class
90 /** start_element occurs when a tag is start.
92 @param raw_name
93 raw name of the tag.
94 @param local_name
95 local name of the tag.
96 @param attributes
97 attribute structure.
99 virtual void start_element(
100 const std::wstring& raw_name,
101 const std::wstring& local_name,
102 const XmlTagAttributes_t& attributes);
104 /** end_element occurs when a tag is closed
106 @param raw_name
107 raw name of the tag.
108 @param local_name
109 local name of the tag.
111 virtual void end_element(
112 const std::wstring& raw_name, const std::wstring& local_name);
114 /** characters occurs when receiving characters
116 @param character
117 content of the information received.
119 virtual void characters(const std::wstring& character);
121 protected:
122 /** choose an appropriate tag reader to handle the tag.
124 @param tag_name
125 the name of the tag.
126 @param XmlAttributes
127 attribute structure of the tag to save in.
129 ITag* chooseTagReader(
130 const std::wstring& tag_name, const XmlTagAttributes_t& XmlAttributes );
132 /** save the received content into structure.
134 @param tag_name
135 the name of the tag.
137 void saveTagContent( const std::wstring& tag_name );
139 private:
140 XmlTags_t m_AllMetaInfo;
142 private:
143 std::stack<ITag*> m_TagBuilderStack;
145 private:
146 CKeywordsTag* m_pKeywords_Builder;
147 CDummyTag* m_pDummy_Builder;
148 CSimpleTag* m_pSimple_Builder;
151 #endif